BusyBox Bug and Patch Tracking
BusyBox
  

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0000709 [BusyBox] Other minor always 02-09-06 11:36 02-13-06 23:30
Reporter scott View Status public  
Assigned To BusyBox
Priority normal Resolution fixed  
Status closed   Product Version svn
Summary 0000709: 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.
Additional Information The solution was to fix the makefile 'sed' expression to output the correct ENABLE value along with whatever was set in the config script. Here is the 1-liner patch I used to fix it:


bash> svn diff Makefile
Index: Makefile
===================================================================
--- Makefile (revision 13886)
+++ Makefile (working copy)
@@ -415,7 +415,7 @@
 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 ENABLE_\1/' \
                < $< >> $@
        @echo "#endif" >> $@
Attached Files

- Relationships

- Notes
(0001074)
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
 
(0001075)
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" >> $@
 
(0001088)
landley
02-13-06 23:30

svn 13955
 

- 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
02-13-06 23:30 landley Status assigned => closed
02-13-06 23:30 landley Note Added: 0001088
02-13-06 23:30 landley Resolution open => fixed
02-13-06 23:30 landley Fixed in Version  => svn


Copyright © 2000 - 2006 Mantis Group
Powered by Mantis Bugtracker