4 # Tests BusyBox-0.48 (at least) to see if each applet builds
5 # properly on its own. The most likely problems this will
6 # flush out are those involving preprocessor instructions in
9 $logfile = "multibuild.log";
11 # Support building from pristine source
12 $make_opt = "-f $ARGV[0]/Makefile BB_SRC_DIR=$ARGV[0]" if ($ARGV[0] ne "");
14 # Move the config file to a safe place
15 -e "Config.h.orig" || 0==system("mv -f Config.h Config.h.orig") || die;
17 # Clear previous log file, if any
20 # Parse the config file
21 open(C,"<Config.h.orig") || die;
26 $in_trailer=1 if /End of Applications List/;
27 if (/^\/*#define BB_([A-Z_]*)/) {
34 # Do the real work ...
36 # print "Testing build of applet $a ...\n";
37 open (O, ">Config.h") || die;
38 print O "#define BB_$a\n", $trailer;
40 system("echo -e '\n***\n$a\n***' >>$logfile");
41 # todo: figure out why the "rm -f *.o" is needed
42 $result{$a} = system("rm -f *.o; make $make_opt busybox >>$logfile 2>&1");
43 $flag = $result{$a} ? "FAIL" : "OK";
44 print "Applet $a: $flag\n";
48 system("mv -f Config.h.orig Config.h");
50 print "See $logfile for details.\n";