[BusyBox 0000709]: Makefile produces invalid include/bb_config.h file

bugs at busybox.net bugs at busybox.net
Thu Feb 9 22:33:41 UTC 2006


A NOTE has been added to this issue. 
====================================================================== 
http://busybox.net/bugs/view.php?id=709 
====================================================================== 
Reported By:                scott
Assigned To:                BusyBox
====================================================================== 
Project:                    BusyBox
Issue ID:                   709
Category:                   Other
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     assigned
====================================================================== 
Date Submitted:             02-09-2006 11:36 PST
Last Modified:              02-09-2006 14:33 PST
====================================================================== 
Summary:                    Makefile produces invalid  include/bb_config.h file
Description: 
After doing 'make menuconfig' I was getting a corrupt bb_config.h file with
lines catted together.  If the CONFIG flag was set (to 1) then the
bb_config.h was echoing the CONFIG value, with a mistaken newline of 'n'
instead of '\n' then the ENABLE flag.

====================================================================== 

---------------------------------------------------------------------- 
 scott - 02-09-06 14:17  
---------------------------------------------------------------------- 
Hold off on this change.  It fixes the compile, but breaks 'busybox.links'

It appears that CONFIG_XXX is the convention used in both the .config file
and also include/applets.h.  The busybox.mkll script merges these to figure
out how to make links.

However the C sources mostly(?) use ENABLE_XXX to decide when/how to
compile sources for the applets.

So, I guess we need to create both ENABLE_XXX and CONFIG_XXX definitions
in the makefile sed script.  Of course, it's probably simpler to settle on
one style and stick with it.

This appears to be problem with sed not passing '\n' as a new line char.
I have sed ver. 3.0.2 on yellowdog linux (powerpc)

bash> echo "111 x 222" | sed -e "s/x/z\n/"
111 zn 222 

---------------------------------------------------------------------- 
 scott - 02-09-06 14:33  
---------------------------------------------------------------------- 
OK, this fixes the 'sed' bug and should work on all platforms...
I'm using 'tr' to create the newline instead of using 'sed'.

bash> svn diff Makefile
Index: Makefile
===================================================================
--- Makefile    (revision 13889)
+++ Makefile    (working copy)
@@ -415,8 +415,8 @@
 include/bb_config.h: include/config.h
        @echo -e "#ifndef BB_CONFIG_H\n#define BB_CONFIG_H" > $@
        @sed -e 's/#undef CONFIG_\(.*\)/#define ENABLE_\1 0/' \
-           -e 's/#define CONFIG_\(.*\)/#define CONFIG_\1\n#define
ENABLE_\1/' \
-               < $< >> $@
+           -e "s/#define CONFIG_\(.*\)/#define CONFIG_\1~#define
ENABLE_\1/" \
+               < $< | tr "~" "\n" >> $@
        @echo "#endif" >> $@ 

Issue History 
Date Modified   Username       Field                    Change               
====================================================================== 
02-09-06 11:36  scott          New Issue                                    
02-09-06 11:36  scott          Status                   new => assigned     
02-09-06 11:36  scott          Assigned To               => BusyBox         
02-09-06 14:17  scott          Note Added: 0001074                          
02-09-06 14:33  scott          Note Added: 0001075                          
======================================================================




More information about the busybox-cvs mailing list