[BusyBox] multibuild.pl vs. busybox.REGRESS.sh, and libraries

Larry Doolittle ldoolitt at recycle.lbl.gov
Thu Jan 25 00:40:24 UTC 2001


Cute.  I see my multibuild.pl covered old ground.  I never looked
at busybox.REGRESS.sh.  That file seems somewhat defective, it doesn't
"find" as much to test as multibuild.pl, and I'm not sure why.
multibuild.pl checked BB_DPKG_DEB (but busybox.REGRESS.sh did not),
and found a problem, which this patch fixes.  The "cut" command for
finding the executable file size is broken on my machine, here is
the awk-ism that I believe is reliable.

In my spare time, I can pull the size summary features into
multibuild.pl, which looks (IMNSHO) more maintainable than the
shell implementation.  In the long run (not for 0.49!) we should
clearly get rid of one or the other.

A lot of the problems that these tools find would certainly go
away if we turned utility.c into a "real" library, where the
linker would take care of all those conditionals for us.
There are certainly plenty of advantages _and_ disadvantages
to making a _shared_ library, and the all-singing all-dancing
future BusyBox in the sky should support both shared and
non-shared.  The object code generated with the non-shared
version would be nominally identical to what we have now.

     - Larry

diff -ura /home/ldoolitt/cvs/busybox/tests/busybox.REGRESS.sh busybox-regress/tests/busybox.REGRESS.sh
--- /home/ldoolitt/cvs/busybox/tests/busybox.REGRESS.sh	Wed Jan 24 15:44:09 2001
+++ busybox-regress/tests/busybox.REGRESS.sh	Wed Jan 24 16:16:44 2001
@@ -122,7 +122,7 @@
 			echo "STATIC_SIZE=${STATIC_SIZE} (${SIZEDIFF})" >> ${RESULTSFILE}
 		fi
 
-		STORAGE_SIZE=`ls -la busybox | cut -c29-42 | tr -d " "`
+		STORAGE_SIZE=`ls -la busybox | awk '{print $5}'`
 		if [ "${i}" = "BB_NOOP" ]; then
 			NOOP_STORAGE_SIZE=${STORAGE_SIZE}
 			echo "STORAGE_SIZE=${STORAGE_SIZE}"
diff -ura /home/ldoolitt/cvs/busybox/utility.c busybox-regress/utility.c
--- /home/ldoolitt/cvs/busybox/utility.c	Wed Jan 24 16:07:35 2001
+++ busybox-regress/utility.c	Wed Jan 24 16:25:52 2001
@@ -1386,7 +1386,7 @@
 }
 #endif
 
-#if defined BB_NFSMOUNT || defined BB_LS || defined BB_SH || defined BB_WGET
+#if defined BB_NFSMOUNT || defined BB_LS || defined BB_SH || defined BB_WGET || defined BB_DPKG_DEB
 # ifndef DMALLOC
 extern char * xstrdup (const char *s) {
 	char *t;





More information about the busybox mailing list