applet_tables: do not include libbb.h, that header ir for target builds
authorDenys Vlasenko <vda.linux@googlemail.com>
Sun, 27 Mar 2011 23:23:38 +0000 (01:23 +0200)
committerDenys Vlasenko <vda.linux@googlemail.com>
Sun, 27 Mar 2011 23:23:38 +0000 (01:23 +0200)
...and applets/applet_tables.c is built on *host*.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
applets/applet_tables.c
include/applet_metadata.h [new file with mode: 0644]
include/busybox.h

index 32dcdb7..3859d73 100644 (file)
@@ -7,13 +7,19 @@
  *
  * Licensed under GPLv2, see file LICENSE in this source tree.
  */
-
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
 #include <stdlib.h>
 #include <string.h>
 #include <stdio.h>
+#include <unistd.h>
+
+#undef ARRAY_SIZE
+#define ARRAY_SIZE(x) ((unsigned)(sizeof(x) / sizeof((x)[0])))
 
 #include "../include/autoconf.h"
-#include "../include/busybox.h"
+#include "../include/applet_metadata.h"
 
 struct bb_applet {
        const char *name;
diff --git a/include/applet_metadata.h b/include/applet_metadata.h
new file mode 100644 (file)
index 0000000..566ef35
--- /dev/null
@@ -0,0 +1,30 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * Licensed under GPLv2 or later, see file LICENSE in this source tree.
+ */
+#ifndef APPLET_METADATA_H
+#define APPLET_METADATA_H 1
+
+/* Note: can be included by both host and target builds! */
+
+/* order matters: used as index into "install_dir[]" in appletlib.c */
+typedef enum bb_install_loc_t {
+       BB_DIR_ROOT = 0,
+       BB_DIR_BIN,
+       BB_DIR_SBIN,
+#if ENABLE_INSTALL_NO_USR
+       BB_DIR_USR_BIN  = BB_DIR_BIN,
+       BB_DIR_USR_SBIN = BB_DIR_SBIN,
+#else
+       BB_DIR_USR_BIN,
+       BB_DIR_USR_SBIN,
+#endif
+} bb_install_loc_t;
+
+typedef enum bb_suid_t {
+       BB_SUID_DROP = 0,
+       BB_SUID_MAYBE,
+       BB_SUID_REQUIRE
+} bb_suid_t;
+
+#endif
index be06817..315ef8f 100644 (file)
@@ -1,37 +1,16 @@
 /* vi: set sw=4 ts=4: */
 /*
- * Busybox main internal header file
- *
  * Licensed under GPLv2 or later, see file LICENSE in this source tree.
  */
 #ifndef BUSYBOX_H
 #define BUSYBOX_H 1
 
 #include "libbb.h"
+/* BB_DIR_foo and BB_SUID_bar constants: */
+#include "applet_metadata.h"
 
 PUSH_AND_SET_FUNCTION_VISIBILITY_TO_HIDDEN
 
-/* order matters: used as index into "install_dir[]" in appletlib.c */
-typedef enum bb_install_loc_t {
-       BB_DIR_ROOT = 0,
-       BB_DIR_BIN,
-       BB_DIR_SBIN,
-#if ENABLE_INSTALL_NO_USR
-       BB_DIR_USR_BIN  = BB_DIR_BIN,
-       BB_DIR_USR_SBIN = BB_DIR_SBIN,
-#else
-       BB_DIR_USR_BIN,
-       BB_DIR_USR_SBIN,
-#endif
-} bb_install_loc_t;
-
-typedef enum bb_suid_t {
-       BB_SUID_DROP = 0,
-       BB_SUID_MAYBE,
-       BB_SUID_REQUIRE
-} bb_suid_t;
-
-
 /* Defined in appletlib.c (by including generated applet_tables.h) */
 /* Keep in sync with applets/applet_tables.c! */
 extern const char applet_names[];