aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2000-12-02 00:44:48 +0000
committerEric Andersen <andersen@codepoet.org>2000-12-02 00:44:48 +0000
commit868c057d253c9f96b9646ef49f2f06e9c20181df (patch)
tree77ebde3b4f2581a272e235090349f380bd07d357
parente73fda83111ce7f043be3028b440e8ba96cbf639 (diff)
downloadbusybox-868c057d253c9f96b9646ef49f2f06e9c20181df.tar.gz
Patch from Larry Doolittle so it will build the newdocs right.
-rw-r--r--Makefile10
-rw-r--r--applets.h15
-rwxr-xr-xapplets/busybox.mkll33
-rwxr-xr-xbusybox.mkll33
-rw-r--r--include/applets.h15
5 files changed, 49 insertions, 57 deletions
diff --git a/Makefile b/Makefile
index 3b24002fc..345c3c35f 100644
--- a/Makefile
+++ b/Makefile
@@ -184,19 +184,19 @@ docs/busybox.txt: docs/busybox.sgml
@echo BusyBox Documentation
@echo
- mkdir -p docs
- (cd docs; sgmltools -b txt $(BB_SRC_DIR)/busybox.sgml)
+ (cd docs; sgmltools -b txt busybox.sgml)
docs/busybox.dvi: docs/busybox.sgml
- mkdir -p docs
- (cd docs; sgmltools -b dvi $(BB_SRC_DIR)/busybox.sgml)
+ (cd docs; sgmltools -b dvi busybox.sgml)
docs/busybox.ps: docs/busybox.sgml
- mkdir -p docs
- (cd docs; sgmltools -b ps $(BB_SRC_DIR)/busybox.sgml)
+ (cd docs; sgmltools -b ps busybox.sgml)
docs/busybox.pdf: docs/busybox.ps
- mkdir -p docs
- (cd docs; ps2pdf $(BB_SRC_DIR)/busybox.ps)
+ (cd docs; ps2pdf busybox.ps)
docs/busybox/busyboxdocumentation.html: docs/busybox.sgml
- mkdir -p docs
@@ -209,7 +209,7 @@ busybox: $(OBJECTS)
$(STRIP)
busybox.links: Config.h
- -$(BB_SRC_DIR)/busybox.mkll $(BB_SRC_DIR)/applets.h | sort >$@
+ - $(BB_SRC_DIR)/busybox.mkll $(CONFIG_H) $(BB_SRC_DIR)/applets.h >$@
nfsmount.o cmdedit.o: %.o: %.h
$(OBJECTS): %.o: %.c Config.h busybox.h Makefile
diff --git a/applets.h b/applets.h
index 254924a7a..fe8c59782 100644
--- a/applets.h
+++ b/applets.h
@@ -10,16 +10,19 @@
* file result in the listing remaining in ascii order. You have been warned.
*/
-#ifndef PROTOTYPES
-const struct BB_applet applets[] = {
-#define APPLET(a,b,c,d) {a,b,c,d},
-#define APPLET_NOUSAGE(a,b,c) {a,b,c,NULL},
-#else
+#if defined(PROTOTYPES)
#define APPLET(a,b,c,d) \
extern int b(int argc, char **argv); \
extern const char d[];
#define APPLET_NOUSAGE(a,b,c) \
extern int b(int argc, char **argv);
+#elif defined(MAKE_LINKS)
+#define APPLET(a,b,c,d) LINK c a
+#define APPLET_NOUSAGE(a,b,c) LINK c a
+#else
+const struct BB_applet applets[] = {
+#define APPLET(a,b,c,d) {a,b,c,d},
+#define APPLET_NOUSAGE(a,b,c) {a,b,c,NULL},
#endif
#ifdef BB_TEST
@@ -378,7 +381,7 @@ const struct BB_applet applets[] = {
APPLET("zcat", gunzip_main, _BB_DIR_BIN, gunzip_usage)
#endif
-#ifndef PROTOTYPES
+#if !defined(PROTOTYPES) && !defined(MAKE_LINKS)
{ 0,NULL,0,NULL}
};
diff --git a/applets/busybox.mkll b/applets/busybox.mkll
index 922dcdd81..12fa06f40 100755
--- a/applets/busybox.mkll
+++ b/applets/busybox.mkll
@@ -1,23 +1,16 @@
#!/bin/sh
# Make busybox links list file.
-DF="Config.h"
-
-MF=$1
-if [ "$MF" = "" ]; then
- MF="applets.h"
-fi
-
-LIST="$(gcc -E -dM $DF | sed -n -e '/^.*BB_FEATURE.*$/d;s/^#define.*\<BB_\(.*\)\>/BB_\1/gp;' | sort)"
-
-for def in ${LIST}; do
- i=`sed -n '/^#ifdef \<'$def'\>.*/,/^#endif/{ s/.*\"\(.*\)\".*\(_BB_DIR_[A-Z_]*\).*$/\2\/\1/gp; }' $MF`
- for j in $i; do
- if [ -z $j ] ; then
- continue;
- fi;
- echo $j | sed -e 's/_BB_DIR_ROOT//g;s/_BB_DIR_BIN/\/bin/g;' \
- -e 's/_BB_DIR_SBIN/\/sbin/g;s/_BB_DIR_USR_BIN/\/usr\/bin/g;' \
- -e 's/_BB_DIR_USR_SBIN/\/usr\/sbin/g;'
- done;
-done
+CONFIG_H=${1:-Config.h}
+APPLETS_H=${2:-applets.h}
+gcc -E -DMAKE_LINKS -include $CONFIG_H $APPLETS_H |
+ awk '/^[ \t]*LINK/{
+ match($2,"_BB_DIR[A-Z_]*")
+ dir=substr($2,RSTART+7,RLENGTH-7)
+ gsub("_","/",dir)
+ if(dir=="/ROOT") dir=""
+ file=$3
+ gsub("\"","",file)
+ if (file=="busybox") next
+ print tolower(dir) "/" file
+ }'
diff --git a/busybox.mkll b/busybox.mkll
index 922dcdd81..12fa06f40 100755
--- a/busybox.mkll
+++ b/busybox.mkll
@@ -1,23 +1,16 @@
#!/bin/sh
# Make busybox links list file.
-DF="Config.h"
-
-MF=$1
-if [ "$MF" = "" ]; then
- MF="applets.h"
-fi
-
-LIST="$(gcc -E -dM $DF | sed -n -e '/^.*BB_FEATURE.*$/d;s/^#define.*\<BB_\(.*\)\>/BB_\1/gp;' | sort)"
-
-for def in ${LIST}; do
- i=`sed -n '/^#ifdef \<'$def'\>.*/,/^#endif/{ s/.*\"\(.*\)\".*\(_BB_DIR_[A-Z_]*\).*$/\2\/\1/gp; }' $MF`
- for j in $i; do
- if [ -z $j ] ; then
- continue;
- fi;
- echo $j | sed -e 's/_BB_DIR_ROOT//g;s/_BB_DIR_BIN/\/bin/g;' \
- -e 's/_BB_DIR_SBIN/\/sbin/g;s/_BB_DIR_USR_BIN/\/usr\/bin/g;' \
- -e 's/_BB_DIR_USR_SBIN/\/usr\/sbin/g;'
- done;
-done
+CONFIG_H=${1:-Config.h}
+APPLETS_H=${2:-applets.h}
+gcc -E -DMAKE_LINKS -include $CONFIG_H $APPLETS_H |
+ awk '/^[ \t]*LINK/{
+ match($2,"_BB_DIR[A-Z_]*")
+ dir=substr($2,RSTART+7,RLENGTH-7)
+ gsub("_","/",dir)
+ if(dir=="/ROOT") dir=""
+ file=$3
+ gsub("\"","",file)
+ if (file=="busybox") next
+ print tolower(dir) "/" file
+ }'
diff --git a/include/applets.h b/include/applets.h
index 254924a7a..fe8c59782 100644
--- a/include/applets.h
+++ b/include/applets.h
@@ -10,16 +10,19 @@
* file result in the listing remaining in ascii order. You have been warned.
*/
-#ifndef PROTOTYPES
-const struct BB_applet applets[] = {
-#define APPLET(a,b,c,d) {a,b,c,d},
-#define APPLET_NOUSAGE(a,b,c) {a,b,c,NULL},
-#else
+#if defined(PROTOTYPES)
#define APPLET(a,b,c,d) \
extern int b(int argc, char **argv); \
extern const char d[];
#define APPLET_NOUSAGE(a,b,c) \
extern int b(int argc, char **argv);
+#elif defined(MAKE_LINKS)
+#define APPLET(a,b,c,d) LINK c a
+#define APPLET_NOUSAGE(a,b,c) LINK c a
+#else
+const struct BB_applet applets[] = {
+#define APPLET(a,b,c,d) {a,b,c,d},
+#define APPLET_NOUSAGE(a,b,c) {a,b,c,NULL},
#endif
#ifdef BB_TEST
@@ -378,7 +381,7 @@ const struct BB_applet applets[] = {
APPLET("zcat", gunzip_main, _BB_DIR_BIN, gunzip_usage)
#endif
-#ifndef PROTOTYPES
+#if !defined(PROTOTYPES) && !defined(MAKE_LINKS)
{ 0,NULL,0,NULL}
};