Changeset 2725 in MondoRescue for branches/2.2.9/mindi-busybox/scripts
- Timestamp:
- Feb 25, 2011, 9:26:54 PM (13 years ago)
- Location:
- branches/2.2.9/mindi-busybox/scripts
- Files:
-
- 18 added
- 35 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.2.9/mindi-busybox/scripts/Kbuild
r1765 r2725 1 # DO NOT EDIT. This file is generated from Kbuild.src 1 2 ### 2 3 # scripts contains sources for various helper programs used throughout -
branches/2.2.9/mindi-busybox/scripts/Makefile.IMA
r1765 r2725 1 1 # This is completely unsupported. 2 # 3 # Uasge: make -f scripts/Makefile.IMA 4 # 2 5 # Fix COMBINED_COMPILE upstream (in the Kbuild) and propagate 3 6 # the changes back … … 7 10 obj := $(objtree) 8 11 12 # Look for make include files relative to root of kernel src 13 MAKEFLAGS += --include-dir=$(srctree) 14 9 15 default: busybox 16 10 17 include .config 11 ifdef CONFIG_FEATURE_COMPRESS_USAGE 12 usage_stuff = include/usage_compressed.h 13 endif 14 15 # pull in the config stuff 16 lib-all-y := applets/applets.o 17 lib-y:= 18 include procps/Kbuild 19 lib-all-y += $(patsubst %,procps/%,$(sort $(lib-y))) 20 lib-y:= 21 include networking/Kbuild 22 lib-all-y += $(patsubst %,networking/%,$(sort $(lib-y))) 23 lib-y:= 24 include networking/udhcp/Kbuild 25 lib-all-y += $(patsubst %,networking/udhcp/%,$(sort $(lib-y))) 26 lib-y:= 27 include networking/libiproute/Kbuild 28 lib-all-y += $(patsubst %,networking/libiproute/%,$(sort $(lib-y))) 29 lib-y:= 30 include loginutils/Kbuild 31 lib-all-y += $(patsubst %,loginutils/%,$(sort $(lib-y))) 32 lib-y:= 33 include archival/Kbuild 34 lib-all-y += $(patsubst %,archival/%,$(sort $(lib-y))) 35 lib-y:= 36 include archival/libunarchive/Kbuild 37 lib-all-y += $(patsubst %,archival/libunarchive/%,$(sort $(lib-y))) 38 lib-y:= 39 include applets/Kbuild 40 lib-all-y += $(patsubst %,applets/%,$(sort $(lib-y))) 41 lib-y:= 42 include e2fsprogs/Kbuild 43 lib-all-y += $(patsubst %,e2fsprogs/%,$(sort $(lib-y))) 44 lib-y:= 45 #include e2fsprogs/old_e2fsprogs/Kbuild 46 #lib-all-y += $(patsubst %,e2fsprogs/old_e2fsprogs/%,$(sort $(lib-y))) 47 #lib-y:= 48 #include e2fsprogs/old_e2fsprogs/ext2fs/Kbuild 49 #lib-all-y += $(patsubst %,e2fsprogs/old_e2fsprogs/ext2fs/%,$(sort $(lib-y))) 50 #lib-y:= 51 #include e2fsprogs/old_e2fsprogs/blkid/Kbuild 52 #lib-all-y += $(patsubst %,e2fsprogs/old_e2fsprogs/blkid/%,$(sort $(lib-y))) 53 #lib-y:= 54 #include e2fsprogs/old_e2fsprogs/uuid/Kbuild 55 #lib-all-y += $(patsubst %,e2fsprogs/old_e2fsprogs/uuid/%,$(sort $(lib-y))) 56 #lib-y:= 57 #include e2fsprogs/old_e2fsprogs/e2p/Kbuild 58 #lib-all-y += $(patsubst %,e2fsprogs/old_e2fsprogs/e2p/%,$(sort $(lib-y))) 59 #lib-y:= 60 include debianutils/Kbuild 61 lib-all-y += $(patsubst %,debianutils/%,$(sort $(lib-y))) 62 lib-y:= 63 include runit/Kbuild 64 lib-all-y += $(patsubst %,runit/%,$(sort $(lib-y))) 65 lib-y:= 66 include modutils/Kbuild 67 lib-all-y += $(patsubst %,modutils/%,$(sort $(lib-y))) 68 lib-y:= 69 include miscutils/Kbuild 70 lib-all-y += $(patsubst %,miscutils/%,$(sort $(lib-y))) 71 lib-y:= 72 include coreutils/libcoreutils/Kbuild 73 lib-all-y += $(patsubst %,coreutils/libcoreutils/%,$(sort $(lib-y))) 74 lib-y:= 75 include coreutils/Kbuild 76 lib-all-y += $(patsubst %,coreutils/%,$(sort $(lib-y))) 77 lib-y:= 78 include sysklogd/Kbuild 79 lib-all-y += $(patsubst %,sysklogd/%,$(sort $(lib-y))) 80 lib-y:= 81 include shell/Kbuild 82 lib-all-y += $(patsubst %,shell/%,$(sort $(lib-y))) 83 lib-y:= 84 include console-tools/Kbuild 85 lib-all-y += $(patsubst %,console-tools/%,$(sort $(lib-y))) 86 lib-y:= 87 include findutils/Kbuild 88 lib-all-y += $(patsubst %,findutils/%,$(sort $(lib-y))) 89 lib-y:= 90 include util-linux/Kbuild 91 lib-all-y += $(patsubst %,util-linux/%,$(sort $(lib-y))) 92 lib-y:= 93 include init/Kbuild 94 lib-all-y += $(patsubst %,init/%,$(sort $(lib-y))) 95 lib-y:= 96 include libpwdgrp/Kbuild 97 lib-all-y += $(patsubst %,libpwdgrp/%,$(sort $(lib-y))) 98 lib-y:= 99 include editors/Kbuild 100 lib-all-y += $(patsubst %,editors/%,$(sort $(lib-y))) 101 lib-y:= 102 include selinux/Kbuild 103 lib-all-y += $(patsubst %,selinux/%,$(sort $(lib-y))) 104 lib-y:= 105 include scripts/Kbuild 106 lib-all-y += $(patsubst %,scripts/%,$(sort $(lib-y))) 107 lib-y:= 108 include libbb/Kbuild 109 lib-all-y += $(patsubst %,libbb/%,$(sort $(lib-y))) 110 lib-y:= 111 112 include Makefile.flags 113 ifndef BB_VER 114 BB_VER:="" 115 endif 116 117 CPPFLAGS+= -D"KBUILD_STR(s)=\#s" #-Q 118 119 HOSTCC = gcc 18 19 # Cross compiling and selecting different set of gcc/bin-utils 20 ifeq ($(CROSS_COMPILE),) 21 CROSS_COMPILE := $(subst ",,$(CONFIG_CROSS_COMPILER_PREFIX)) 22 endif 23 24 ifneq ($(CROSS_COMPILE),) 25 SUBARCH := $(shell echo $(CROSS_COMPILE) | cut -d- -f1) 26 else 27 SUBARCH := $(shell uname -m) 28 endif 29 SUBARCH := $(shell echo $(SUBARCH) | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ \ 30 -e s/arm.*/arm/ -e s/sa110/arm/ \ 31 -e s/s390x/s390/ -e s/parisc64/parisc/ \ 32 -e s/ppc.*/powerpc/ -e s/mips.*/mips/ ) 33 ARCH ?= $(SUBARCH) 34 35 ifndef HOSTCC 36 HOSTCC = cc 37 endif 120 38 AS = $(CROSS_COMPILE)as 121 39 CC = $(CROSS_COMPILE)gcc … … 128 46 OBJDUMP = $(CROSS_COMPILE)objdump 129 47 48 CFLAGS := $(CFLAGS) 49 CPPFLAGS += -D"KBUILD_STR(s)=\#s" #-Q 50 51 # We need some generic definitions 52 include $(srctree)/scripts/Kbuild.include 53 54 include Makefile.flags 55 56 -include $(srctree)/arch/$(ARCH)/Makefile 57 ifdef CONFIG_FEATURE_COMPRESS_USAGE 58 usage_stuff = include/usage_compressed.h 59 endif 60 61 ifndef BB_VER 62 BB_VER:="" 63 endif 64 130 65 WHOLE_PROGRAM:=$(call cc-option,-fwhole-program,) 131 busybox: $(usage_stuff) 132 $(CC) $(CPPFLAGS) $(CFLAGS) $(EXTRA_CFLAGS) --combine $(WHOLE_PROGRAM) \ 66 67 # pull in the config stuff 68 lib-all-y := applets/applets.o 69 lib-y:= 70 include procps/Kbuild 71 lib-all-y += $(patsubst %,procps/%,$(sort $(lib-y))) 72 lib-y:= 73 include networking/Kbuild 74 lib-all-y += $(patsubst %,networking/%,$(sort $(lib-y))) 75 lib-y:= 76 include networking/udhcp/Kbuild 77 lib-all-y += $(patsubst %,networking/udhcp/%,$(sort $(lib-y))) 78 lib-y:= 79 include networking/libiproute/Kbuild 80 lib-all-y += $(patsubst %,networking/libiproute/%,$(sort $(lib-y))) 81 lib-y:= 82 include loginutils/Kbuild 83 lib-all-y += $(patsubst %,loginutils/%,$(sort $(lib-y))) 84 lib-y:= 85 include archival/Kbuild 86 lib-all-y += $(patsubst %,archival/%,$(sort $(lib-y))) 87 lib-y:= 88 include archival/libarchive/Kbuild 89 lib-all-y += $(patsubst %,archival/libarchive/%,$(sort $(lib-y))) 90 lib-y:= 91 include applets/Kbuild 92 lib-all-y += $(patsubst %,applets/%,$(sort $(lib-y))) 93 lib-y:= 94 include e2fsprogs/Kbuild 95 lib-all-y += $(patsubst %,e2fsprogs/%,$(sort $(lib-y))) 96 lib-y:= 97 #include e2fsprogs/old_e2fsprogs/Kbuild 98 #lib-all-y += $(patsubst %,e2fsprogs/old_e2fsprogs/%,$(sort $(lib-y))) 99 #lib-y:= 100 #include e2fsprogs/old_e2fsprogs/ext2fs/Kbuild 101 #lib-all-y += $(patsubst %,e2fsprogs/old_e2fsprogs/ext2fs/%,$(sort $(lib-y))) 102 #lib-y:= 103 #include e2fsprogs/old_e2fsprogs/blkid/Kbuild 104 #lib-all-y += $(patsubst %,e2fsprogs/old_e2fsprogs/blkid/%,$(sort $(lib-y))) 105 #lib-y:= 106 #include e2fsprogs/old_e2fsprogs/uuid/Kbuild 107 #lib-all-y += $(patsubst %,e2fsprogs/old_e2fsprogs/uuid/%,$(sort $(lib-y))) 108 #lib-y:= 109 #include e2fsprogs/old_e2fsprogs/e2p/Kbuild 110 #lib-all-y += $(patsubst %,e2fsprogs/old_e2fsprogs/e2p/%,$(sort $(lib-y))) 111 #lib-y:= 112 include debianutils/Kbuild 113 lib-all-y += $(patsubst %,debianutils/%,$(sort $(lib-y))) 114 lib-y:= 115 include runit/Kbuild 116 lib-all-y += $(patsubst %,runit/%,$(sort $(lib-y))) 117 lib-y:= 118 include modutils/Kbuild 119 lib-all-y += $(patsubst %,modutils/%,$(sort $(lib-y))) 120 lib-y:= 121 include miscutils/Kbuild 122 lib-all-y += $(patsubst %,miscutils/%,$(sort $(lib-y))) 123 lib-y:= 124 include coreutils/libcoreutils/Kbuild 125 lib-all-y += $(patsubst %,coreutils/libcoreutils/%,$(sort $(lib-y))) 126 lib-y:= 127 include coreutils/Kbuild 128 lib-all-y += $(patsubst %,coreutils/%,$(sort $(lib-y))) 129 lib-y:= 130 include sysklogd/Kbuild 131 lib-all-y += $(patsubst %,sysklogd/%,$(sort $(lib-y))) 132 lib-y:= 133 include shell/Kbuild 134 lib-all-y += $(patsubst %,shell/%,$(sort $(lib-y))) 135 lib-y:= 136 include console-tools/Kbuild 137 lib-all-y += $(patsubst %,console-tools/%,$(sort $(lib-y))) 138 lib-y:= 139 include findutils/Kbuild 140 lib-all-y += $(patsubst %,findutils/%,$(sort $(lib-y))) 141 lib-y:= 142 include util-linux/Kbuild 143 lib-all-y += $(patsubst %,util-linux/%,$(sort $(lib-y))) 144 lib-y:= 145 include util-linux/volume_id/Kbuild 146 lib-all-y += $(patsubst %,util-linux/volume_id/%,$(sort $(lib-y))) 147 lib-y:= 148 include init/Kbuild 149 lib-all-y += $(patsubst %,init/%,$(sort $(lib-y))) 150 lib-y:= 151 include libpwdgrp/Kbuild 152 lib-all-y += $(patsubst %,libpwdgrp/%,$(sort $(lib-y))) 153 lib-y:= 154 include editors/Kbuild 155 lib-all-y += $(patsubst %,editors/%,$(sort $(lib-y))) 156 lib-y:= 157 include printutils/Kbuild 158 lib-all-y += $(patsubst %,printutils/%,$(sort $(lib-y))) 159 lib-y:= 160 include selinux/Kbuild 161 lib-all-y += $(patsubst %,selinux/%,$(sort $(lib-y))) 162 lib-y:= 163 include scripts/Kbuild 164 lib-all-y += $(patsubst %,scripts/%,$(sort $(lib-y))) 165 lib-y:= 166 include libbb/Kbuild 167 lib-all-y += $(patsubst %,libbb/%,$(sort $(lib-y))) 168 lib-y:= 169 170 comma:=, 171 busybox_unstripped.o: $(usage_stuff) include/applet_tables.h include/autoconf.h 172 $(CC) $(CPPFLAGS) $(CFLAGS) $(EXTRA_CFLAGS) \ 173 $(patsubst %,-Wl$(comma)%,$(LDFLAGS) $(EXTRA_LDFLAGS)) \ 174 -DGCC_COMBINE=1 \ 175 --combine $(WHOLE_PROGRAM) \ 133 176 -funit-at-a-time -Wno-error -std=gnu99 \ 134 -o $(@)_unstripped $(lib-all-y:.o=.c) \ 135 -Wl,--start-group -lcrypt -lm -Wl,--end-group 177 -c -o busybox_unstripped.o \ 178 $(lib-all-y:.o=.c) 179 180 busybox: busybox_unstripped.o 181 $(srctree)/scripts/trylink \ 182 busybox_unstripped \ 183 "$(CC) $(CFLAGS_busybox)" \ 184 "$(CFLAGS)" \ 185 "$(LDFLAGS)" \ 186 "busybox_unstripped.o" \ 187 "" \ 188 "crypt m" 136 189 cp -f $(@)_unstripped $@ 137 190 -$(STRIP) -s -R .note -R .comment -R .version $@ 138 191 139 applets/usage: 140 $(HOSTCC) -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -I$(srctree)/include -o applets/usage applets/usage.c 141 include/usage_compressed.h: $(srctree)/include/usage.h applets/usage 192 # If .config is newer than include/autoconf.h, someone tinkered 193 # with it and forgot to run make oldconfig. 194 include/autoconf.h: .config 195 $(MAKE) -f $(srctree)/Makefile silentoldconfig 196 197 applets/usage: include/autoconf.h 198 $(HOSTCC) -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -I$(srctree)/include -o applets/usage applets/usage.c 199 200 applets/applet_tables: include/autoconf.h 201 $(HOSTCC) -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -I$(srctree)/include -o applets/applet_tables applets/applet_tables.c 202 203 include/usage_compressed.h: include/usage.h applets/usage 142 204 $(srctree)/applets/usage_compressed include/usage_compressed.h applets 143 205 206 include/applet_tables.h: include/applets.h 207 applets/applet_tables include/applet_tables.h -
branches/2.2.9/mindi-busybox/scripts/Makefile.build
r1765 r2725 14 14 15 15 # The filename Kbuild has precedence over Makefile 16 # bbox: we also try to include Kbuild file in obj tree first 16 17 kbuild-dir := $(if $(filter /%,$(src)),$(src),$(srctree)/$(src)) 17 include $(if $(wildcard $(kbuild-dir)/Kbuild), $(kbuild-dir)/Kbuild, $(kbuild-dir)/Makefile) 18 include $(if $(wildcard $(src)/Kbuild), $(src)/Kbuild, \ 19 $(if $(wildcard $(kbuild-dir)/Kbuild), $(kbuild-dir)/Kbuild, \ 20 $(kbuild-dir)/Makefile \ 21 ) \ 22 ) 18 23 19 24 include scripts/Makefile.lib … … 252 257 # If the list of objects to link is empty, just create an empty built-in.o 253 258 cmd_link_o_target = $(if $(strip $(obj-y)),\ 254 255 259 $(LD) $(ld_flags) -r -o $@ $(filter $(obj-y), $^),\ 260 rm -f $@; $(AR) rcs $@) 256 261 257 262 $(builtin-target): $(obj-y) FORCE -
branches/2.2.9/mindi-busybox/scripts/Makefile.clean
r1765 r2725 15 15 # The filename Kbuild has precedence over Makefile 16 16 kbuild-dir := $(if $(filter /%,$(src)),$(src),$(srctree)/$(src)) 17 include $(if $(wildcard $(kbuild-dir)/Kbuild), $(kbuild-dir)/Kbuild, $(kbuild-dir)/Makefile)17 -include $(if $(wildcard $(kbuild-dir)/Kbuild), $(kbuild-dir)/Kbuild, $(kbuild-dir)/Makefile) 18 18 19 19 # Figure out what we need to build from the various variables -
branches/2.2.9/mindi-busybox/scripts/Makefile.host
r1765 r2725 100 100 quiet_cmd_host-csingle = HOSTCC $@ 101 101 cmd_host-csingle = $(HOSTCC) $(hostc_flags) -o $@ $< \ 102 102 $(HOST_LOADLIBES) $(HOSTLOADLIBES_$(@F)) 103 103 $(host-csingle): %: %.c FORCE 104 104 $(call if_changed_dep,host-csingle) … … 154 154 targets += $(host-csingle) $(host-cmulti) $(host-cobjs)\ 155 155 $(host-cxxmulti) $(host-cxxobjs) $(host-cshlib) $(host-cshobjs) 156 -
branches/2.2.9/mindi-busybox/scripts/Makefile.lib
r1765 r2725 118 118 cpp_flags = -Wp,-MD,$(depfile) $(NOSTDINC_FLAGS) $(__cpp_flags) 119 119 120 ld_flags = $(LDFLAGS) $(EXTRA_LDFLAGS) 120 # Seems to be a wrong thing to do. LDFLAGS contains gcc's flags, 121 # yet ld_flags is fed to ld. 122 #ld_flags = $(LDFLAGS) $(EXTRA_LDFLAGS) 123 # Remove the -Wl, prefix from linker options normally passed through gcc 124 ld_flags = $(filter-out -Wl$(comma)%,$(LDFLAGS) $(EXTRA_LDFLAGS)) 125 121 126 122 127 # Finds the multi-part object the current object will be linked into … … 147 152 # --------------------------------------------------------------------------- 148 153 154 # TODO: LDFLAGS usually is supposed to contain gcc's flags, not ld's. 155 # but here we feed them to ld! 149 156 quiet_cmd_ld = LD $@ 150 157 cmd_ld = $(LD) $(LDFLAGS) $(EXTRA_LDFLAGS) $(LDFLAGS_$(@F)) \ … … 162 169 quiet_cmd_gzip = GZIP $@ 163 170 cmd_gzip = gzip -f -9 < $< > $@ 164 165 -
branches/2.2.9/mindi-busybox/scripts/basic/docproc.c
r1765 r2725 80 80 pid_t pid; 81 81 int ret; 82 char real_filename[PATH_MAX + 1]; 82 char *real_filename; 83 int rflen; 84 83 85 /* Make sure output generated so far are flushed */ 84 86 fflush(stdout); 85 87 switch(pid=fork()) { 86 88 case -1: 87 perror(" fork");89 perror("vfork"+1); 88 90 exit(1); 89 91 case 0: 90 memset(real_filename, 0, sizeof(real_filename)); 91 strncat(real_filename, getenv("SRCTREE"), PATH_MAX); 92 strncat(real_filename, KERNELDOCPATH KERNELDOC, 93 PATH_MAX - strlen(real_filename)); 92 rflen = strlen(getenv("SRCTREE")); 93 rflen += strlen(KERNELDOCPATH KERNELDOC); 94 real_filename = alloca(rflen + 1); 95 strcpy(real_filename, getenv("SRCTREE")); 96 strcat(real_filename, KERNELDOCPATH KERNELDOC); 94 97 execvp(real_filename, svec); 95 98 fprintf(stderr, "exec "); … … 167 170 char line[MAXLINESZ]; 168 171 if (filename_exist(filename) == NULL) { 169 char real_filename[PATH_MAX + 1]; 170 memset(real_filename, 0, sizeof(real_filename)); 171 strncat(real_filename, getenv("SRCTREE"), PATH_MAX); 172 strncat(real_filename, filename, 173 PATH_MAX - strlen(real_filename)); 172 int rflen = strlen(getenv("SRCTREE")) + strlen(filename); 173 char *real_filename = alloca(rflen + 1); 174 strcpy(real_filename, getenv("SRCTREE")); 175 strcat(real_filename, filename); 174 176 sym = add_new_file(filename); 175 177 fp = fopen(real_filename, "r"); … … 250 252 251 253 /* 252 * Document sp åecific function(s) in a file.254 * Document specific function(s) in a file. 253 255 * Call kernel-doc with the following parameters: 254 256 * kernel-doc -docbook -function function1 [-function function2] … … 396 398 return exitstatus; 397 399 } 398 -
branches/2.2.9/mindi-busybox/scripts/basic/fixdep.c
r1765 r2725 204 204 void use_config(char *m, int slen) 205 205 { 206 char s[PATH_MAX];206 char *s = alloca(slen+1); 207 207 char *p; 208 208 … … 226 226 { 227 227 /* modified for bbox */ 228 char *end_ 4 = map + len - 4; /* 4 == length of "USE_" */228 char *end_3 = map + len - 3; /* 3 == length of "IF_" */ 229 229 char *end_7 = map + len - 7; 230 230 char *p = map; … … 232 232 int off; 233 233 234 for (; p < end_4; p++) { 234 for (; p <= end_3; p++) { 235 /* Find next identifier's beginning */ 236 if (!(isalnum(*p) || *p == '_')) 237 continue; 238 239 /* Check it */ 235 240 if (p < end_7 && p[6] == '_') { 236 241 if (!memcmp(p, "CONFIG", 6)) goto conf7; 237 242 if (!memcmp(p, "ENABLE", 6)) goto conf7; 238 } 239 /* We have at least 5 chars: for() has 240 * "p < end-4", not "p <= end-4" 241 * therefore we don't need to check p <= end-5 here */ 242 if (p[4] == '_') 243 if (!memcmp(p, "SKIP", 4)) goto conf5; 244 /* Ehhh, gcc is too stupid to just compare it as 32bit int */ 245 if (p[0] == 'U') 246 if (!memcmp(p, "USE_", 4)) goto conf4; 243 if (!memcmp(p, "IF_NOT", 6)) goto conf7; 244 } 245 /* we have at least 3 chars because of p <= end_3 */ 246 /*if (!memcmp(p, "IF_", 3)) ...*/ 247 if (p[0] == 'I' && p[1] == 'F' && p[2] == '_') { 248 off = 3; 249 goto conf; 250 } 251 252 /* This identifier is not interesting, skip it */ 253 while (p <= end_3 && (isalnum(*p) || *p == '_')) 254 p++; 247 255 continue; 248 256 249 conf4: off = 4;250 conf5: off = 5;251 257 conf7: off = 7; 258 conf: 252 259 p += off; 253 for (q = p; q < end_ 4+4; q++) {260 for (q = p; q < end_3+3; q++) { 254 261 if (!(isalnum(*q) || *q == '_')) 255 262 break; 256 263 } 257 use_config(p, q-p); 264 if (q != p) { 265 use_config(p, q-p); 266 } 258 267 } 259 268 } … … 307 316 char *end = m + len; 308 317 char *p; 309 char s[PATH_MAX];318 char *s = alloca(len); 310 319 311 320 p = memchr(m, ':', len); -
branches/2.2.9/mindi-busybox/scripts/basic/split-include.c
r1765 r2725 111 111 if (line[0] != '#') 112 112 continue; 113 if ((str_config = strstr(line, " CONFIG_")) == NULL)113 if ((str_config = strstr(line, " CONFIG_")) == NULL) 114 114 continue; 115 115 116 /* Make the output file name. */ 117 str_config += sizeof("CONFIG_") - 1; 116 /* We found #define CONFIG_foo or #undef CONFIG_foo. 117 * Make the output file name. */ 118 str_config += sizeof(" CONFIG_") - 1; 118 119 for (itarget = 0; !isspace(str_config[itarget]); itarget++) 119 120 { … … 155 156 156 157 /* Write the file. */ 157 if ((fp_target = fopen(ptarget, "w")) == NULL)158 if ((fp_target = fopen(ptarget, "w")) == NULL) 158 159 ERROR_EXIT(ptarget); 159 160 fputs(line, fp_target); -
branches/2.2.9/mindi-busybox/scripts/bloat-o-meter
r1765 r2725 8 8 # of the GNU General Public License, incorporated herein by reference. 9 9 10 import sys, os , re10 import sys, os#, re 11 11 12 if len(sys.argv) != 3:13 sys.stderr.write("usage: %s file1 file2\n" % sys.argv[0])12 def usage(): 13 sys.stderr.write("usage: %s [-t] file1 file2\n" % sys.argv[0]) 14 14 sys.exit(-1) 15 15 16 for f in sys.argv[1], sys.argv[2]: 17 if not os.path.exists(f): 18 sys.stderr.write("Error: file '%s' does not exist\n" % f) 19 sys.exit(-1) 16 f1, f2 = (None, None) 17 flag_timing, dashes = (False, False) 20 18 19 for f in sys.argv[1:]: 20 if f.startswith("-"): 21 if f == "--": # sym_args 22 dashes = True 23 break 24 if f == "-t": # timings 25 flag_timing = True 26 else: 27 if not os.path.exists(f): 28 sys.stderr.write("Error: file '%s' does not exist\n" % f) 29 usage() 30 if f1 is None: 31 f1 = f 32 elif f2 is None: 33 f2 = f 34 if flag_timing: 35 import time 36 if f1 is None or f2 is None: 37 usage() 38 39 sym_args = " ".join(sys.argv[3 + flag_timing + dashes:]) 21 40 def getsizes(file): 22 sym = {} 23 for l in os.popen("nm --size-sort " + file).readlines(): 24 size, type, name = l[:-1].split() 25 if type in "tTdDbBrR": 26 if "." in name: name = "static." + name.split(".")[0] 27 sym[name] = sym.get(name, 0) + int(size, 16) 28 for l in os.popen("readelf -S " + file).readlines(): 41 sym, alias, lut = {}, {}, {} 42 #dynsym_filter = re.compile("^\d+:\s+[\dA-Fa-f]+\s+\d+\s+\w+\s+\w+\s+\w+\s+\w+\s+\w+$") 43 for l in os.popen("readelf -W -s %s %s" % (sym_args, file)).readlines(): 44 if True: 45 l = l.strip() 46 if not (len(l) and l[0].isdigit() and len(l.split()) == 8): 47 continue 48 num, value, size, typ, bind, vis, ndx, name = l.split() 49 if ndx == "UND": continue # skip undefined 50 if typ in ["SECTION", "FILES"]: continue # skip sections and files 51 #else: 52 # l = l.strip() 53 # match = dynsym_filter.match(l) 54 # if not match: continue 55 # x, value, size, typ, bind, x, ndx, name = l.split() 56 # if ndx == "UND": continue # skip undefined 57 # if typ in ["SECTION", "FILES"]: continue # skip sections and files 58 if "." in name: name = "static." + name.split(".")[0] 59 value = int(value, 16) 60 size = int(size) 61 if vis != "DEFAULT" and bind != "GLOBAL": # see if it is an alias 62 alias[(value, size)] = {"name" : name} 63 else: 64 sym[name] = {"addr" : value, "size": size} 65 lut[(value, size)] = 0 66 for addr, sz in iter(alias.keys()): 67 # If the non-GLOBAL sym has an implementation elsewhere then 68 # it's an alias, disregard it. 69 if not (addr, sz) in lut: 70 # If this non-GLOBAL sym does not have an implementation at 71 # another address, then treat it as a normal symbol. 72 sym[alias[(addr, sz)]["name"]] = {"addr" : addr, "size": sz} 73 for l in os.popen("readelf -W -S " + file).readlines(): 29 74 x = l.split() 30 if len(x)<6 or x[1] != ".rodata": continue 31 sym[".rodata"] = int(x[5], 16) 75 if len(x)<6: continue 76 # Should take these into account too! 77 #if x[1] not in [".text", ".rodata", ".symtab", ".strtab"]: continue 78 if x[1] not in [".rodata"]: continue 79 sym[x[1]] = {"addr" : int(x[3], 16), "size" : int(x[5], 16)} 32 80 return sym 33 81 34 old = getsizes(sys.argv[1]) 35 new = getsizes(sys.argv[2]) 82 if flag_timing: 83 start_t1 = int(time.time() * 1e9) 84 old = getsizes(f1) 85 if flag_timing: 86 end_t1 = int(time.time() * 1e9) 87 start_t2 = int(time.time() * 1e9) 88 new = getsizes(f2) 89 if flag_timing: 90 end_t2 = int(time.time() * 1e9) 91 start_t3 = int(time.time() * 1e9) 36 92 grow, shrink, add, remove, up, down = 0, 0, 0, 0, 0, 0 37 93 delta, common = [], {} 38 94 39 for a in old:40 if ain new:41 common[ a] = 195 for name in iter(old.keys()): 96 if name in new: 97 common[name] = 1 42 98 43 99 for name in old: 44 100 if name not in common: 45 101 remove += 1 46 down += old[name] 47 delta.append((-old[name], name)) 102 sz = old[name]["size"] 103 down += sz 104 delta.append((-sz, name)) 48 105 49 106 for name in new: 50 107 if name not in common: 51 108 add += 1 52 up += new[name] 53 delta.append((new[name], name)) 109 sz = new[name]["size"] 110 up += sz 111 delta.append((sz, name)) 54 112 55 113 for name in common: 56 d = new .get(name, 0) - old.get(name, 0)114 d = new[name].get("size", 0) - old[name].get("size", 0) 57 115 if d>0: grow, up = grow+1, up+d 58 if d<0: shrink, down = shrink+1, down-d 116 elif d<0: shrink, down = shrink+1, down-d 117 else: 118 continue 59 119 delta.append((d, name)) 60 120 61 121 delta.sort() 62 122 delta.reverse() 123 if flag_timing: 124 end_t3 = int(time.time() * 1e9) 63 125 64 print "%-48s %7s %7s %+7s" % ("function", "old", "new", "delta")126 print("%-48s %7s %7s %+7s" % ("function", "old", "new", "delta")) 65 127 for d, n in delta: 66 if d: print "%-48s %7s %7s %+7d" % (n, old.get(n,"-"), new.get(n,"-"), d) 67 print "-"*78 128 if d: 129 old_sz = old.get(n, {}).get("size", "-") 130 new_sz = new.get(n, {}).get("size", "-") 131 print("%-48s %7s %7s %+7d" % (n, old_sz, new_sz, d)) 132 print("-"*78) 68 133 total="(add/remove: %s/%s grow/shrink: %s/%s up/down: %s/%s)%%sTotal: %s bytes"\ 69 134 % (add, remove, grow, shrink, up, -down, up-down) 70 print total % (" "*(80-len(total))) 135 print(total % (" "*(80-len(total)))) 136 if flag_timing: 137 print("\n%d/%d; %d Parse origin/new; processing nsecs" % 138 (end_t1-start_t1, end_t2-start_t2, end_t3-start_t3)) 139 print("total nsecs: %d" % (end_t3-start_t1)) -
branches/2.2.9/mindi-busybox/scripts/checkhelp.awk
r1765 r2725 2 2 # AWK script to check for missing help entries for config options 3 3 # 4 # Copyright (C) 2006 Bernhard Fischer4 # Copyright (C) 2006 Bernhard Reutner-Fischer 5 5 # 6 6 # This file is distributed under the terms and conditions of the … … 33 33 END { 34 34 for (i = 0; i <= pos; i++) { 35 # 35 # printf("%s: help for #%i '%s' == %i\n", file[i], i, conf[i], help[i]); 36 36 if (help[i] == 0) { 37 37 printf("%s: No helptext for '%s'\n", file[i], conf[i]); -
branches/2.2.9/mindi-busybox/scripts/checkstack.pl
r1765 r2725 127 127 $addr = "0x$addr"; 128 128 129 my $intro = "$addr $func [$file]:"; 129 # bbox: was: my $intro = "$addr $func [$file]:"; 130 my $intro = "$func [$file]:"; 130 131 my $padlen = 56 - length($intro); 131 132 while ($padlen > 0) { -
branches/2.2.9/mindi-busybox/scripts/cleanup_printf2puts
r1765 r2725 4 4 # printf("abc\n") -> puts("abc"). Beware of fprintf etc... 5 5 6 # BTW, gcc 4.1.2 already does th asame! Can't believe it...6 # BTW, gcc 4.1.2 already does the same! Can't believe it... 7 7 8 8 grep -lr 'printf\([^%%]*\\n"\)' . | grep '.[ch]$' | xargs -n1 \ -
branches/2.2.9/mindi-busybox/scripts/find_stray_common_vars
r1765 r2725 4 4 # This script will show all commons in *.o, sorted by size 5 5 6 find -name '*.o' \6 find ! -path './scripts/*' -a ! -name built-in.o -a -name '*.o' \ 7 7 | while read name; do 8 8 b=`basename "$name"` -
branches/2.2.9/mindi-busybox/scripts/kconfig/Makefile
r1765 r2725 18 18 $< Config.in 19 19 20 # Mtime granularity problem. 21 # It was observed that these commands: 22 # make allnoconfig; sed -i -e '/CONFIG_TRUE/s/.*/CONFIG_TRUE=y/' .config; make 23 # sometimes produce busybox with "true" applet still disabled. 24 # This is caused by .config updated by sed having mtime which is still 25 # equal to (not bigger than) include/autoconf.h's mtime, 26 # and thus 2nd make does not regenerate include/autoconf.h. 27 # Waiting for 1 second after non-interactive "make XXXXconfig" 28 # prevents this from happening. 29 # 30 # We'd like to detect whether filesystem we are on has coarse mtimes, 31 # but can't do it yet, bbox ls hasn't got --full-time. 32 #MTIME_IS_COARSE:=@ls --full-time -ld | grep -F .000 >/dev/null 33 MTIME_IS_COARSE:=@true 34 20 35 oldconfig: $(obj)/conf 21 36 $< -o Config.in 37 $(MTIME_IS_COARSE) && sleep 1 22 38 23 39 silentoldconfig: $(obj)/conf 24 40 $< -s Config.in 41 $(MTIME_IS_COARSE) && sleep 1 25 42 26 43 update-po-config: $(obj)/kxgettext … … 47 64 randconfig: $(obj)/conf 48 65 $< -r Config.in 66 $(MTIME_IS_COARSE) && sleep 1 49 67 50 68 allyesconfig: $(obj)/conf 51 69 $< -y Config.in 70 $(MTIME_IS_COARSE) && sleep 1 52 71 53 72 allnoconfig: $(obj)/conf 54 73 $< -n Config.in 74 $(MTIME_IS_COARSE) && sleep 1 55 75 56 76 allmodconfig: $(obj)/conf 57 77 $< -m Config.in 78 $(MTIME_IS_COARSE) && sleep 1 58 79 59 80 defconfig: $(obj)/conf … … 64 85 $(Q)$< -D $(KBUILD_DEFCONFIG) Config.in 65 86 endif 87 $(MTIME_IS_COARSE) && sleep 1 66 88 67 89 %_defconfig: $(obj)/conf 68 90 $(Q)$< -D $@ Config.in 91 $(MTIME_IS_COARSE) && sleep 1 69 92 70 93 # Help text used by make help … … 118 141 subdir- += lxdialog 119 142 120 # Needed for systems without gettext 121 KBUILD_HAVE_NLS := $(shell \ 122 if echo "\#include <libintl.h>" | $(HOSTCC) $(HOSTCFLAGS) -E - > /dev/null 2>&1 ; \ 123 then echo yes ; \ 124 else echo no ; fi) 125 ifeq ($(KBUILD_HAVE_NLS),no) 126 HOSTCFLAGS += -DKBUILD_NO_NLS 127 endif 143 # Add environment specific flags 144 HOST_EXTRACFLAGS += $(shell $(CONFIG_SHELL) $(srctree)/$(src)/check.sh $(HOSTCC) $(HOSTCFLAGS)) 128 145 129 146 # generated files seem to need this to find local include files -
branches/2.2.9/mindi-busybox/scripts/kconfig/conf.c
r1765 r2725 504 504 case 's': 505 505 input_mode = ask_silent; 506 valid_stdin = isatty(0) && isatty(1) && isatty(2);506 valid_stdin = isatty(0); //bbox: && isatty(1) && isatty(2); 507 507 break; 508 508 case 'd': … … 606 606 } while (conf_cnt); 607 607 if (conf_write(NULL)) { 608 fprintf(stderr, _("\n*** Error during writing of the busyboxconfiguration.\n\n"));608 fprintf(stderr, _("\n*** Error during writing of the configuration.\n\n")); 609 609 return 1; 610 610 } -
branches/2.2.9/mindi-busybox/scripts/kconfig/confdata.c
r1765 r2725 23 23 const char conf_def_filename[] = ".config"; 24 24 25 const char conf_defname[] = " scripts/defconfig";25 const char conf_defname[] = "/dev/null"; //bbox 26 26 27 27 const char *conf_confnames[] = { … … 71 71 { 72 72 struct stat buf; 73 static char fullname[PATH_MAX+1];73 static char *fullname = NULL; 74 74 char *env, *name; 75 75 … … 77 77 env = getenv(SRCTREE); 78 78 if (env) { 79 fullname = realloc(fullname, strlen(env) + strlen(name) + 2); 79 80 sprintf(fullname, "%s/%s", env, name); 80 81 if (!stat(fullname, &buf)) … … 405 406 strftime(buf, sizeof(buf), "#define AUTOCONF_TIMESTAMP " 406 407 "\"%Y-%m-%d %H:%M:%S\"\n", localtime(&now)); 408 } else { /* bbox */ 409 strcpy(buf, "#define AUTOCONF_TIMESTAMP \"\"\n"); 407 410 } 408 411 fprintf(out_h, "/*\n" … … 436 439 } else if (!(sym->flags & SYMBOL_CHOICE)) { 437 440 sym_calc_value(sym); 438 /* bbox: we want to all syms441 /* bbox: we want to see all syms 439 442 if (!(sym->flags & SYMBOL_WRITE)) 440 443 goto next; … … 457 460 /* bbox */ 458 461 fprintf(out_h, "#define ENABLE_%s 0\n", sym->name); 459 fprintf(out_h, "#define USE_%s(...)\n", sym->name);460 fprintf(out_h, "#define SKIP_%s(...) __VA_ARGS__\n", sym->name);462 fprintf(out_h, "#define IF_%s(...)\n", sym->name); 463 fprintf(out_h, "#define IF_NOT_%s(...) __VA_ARGS__\n", sym->name); 461 464 } 462 465 break; … … 472 475 /* bbox */ 473 476 fprintf(out_h, "#define ENABLE_%s 1\n", sym->name); 474 fprintf(out_h, "#define USE_%s(...) __VA_ARGS__\n", sym->name);475 fprintf(out_h, "#define SKIP_%s(...)\n", sym->name);477 fprintf(out_h, "#define IF_%s(...) __VA_ARGS__\n", sym->name); 478 fprintf(out_h, "#define IF_NOT_%s(...)\n", sym->name); 476 479 } 477 480 break; … … 504 507 /* bbox */ 505 508 fprintf(out_h, "#define ENABLE_%s 1\n", sym->name); 506 fprintf(out_h, "#define USE_%s(...) __VA_ARGS__\n", sym->name);507 fprintf(out_h, "#define SKIP_%s(...)\n", sym->name);509 fprintf(out_h, "#define IF_%s(...) __VA_ARGS__\n", sym->name); 510 fprintf(out_h, "#define IF_NOT_%s(...)\n", sym->name); 508 511 } 509 512 break; … … 516 519 /* bbox */ 517 520 fprintf(out_h, "#define ENABLE_%s 1\n", sym->name); 518 fprintf(out_h, "#define USE_%s(...) __VA_ARGS__\n", sym->name);519 fprintf(out_h, "#define SKIP_%s(...)\n", sym->name);521 fprintf(out_h, "#define IF_%s(...) __VA_ARGS__\n", sym->name); 522 fprintf(out_h, "#define IF_NOT_%s(...)\n", sym->name); 520 523 } 521 524 break; … … 523 526 case S_INT: 524 527 str = sym_get_string_value(sym); 528 if (!str[0]) 529 str = "0"; 525 530 fprintf(out, "CONFIG_%s=%s\n", sym->name, str); 526 531 if (out_h) { … … 528 533 /* bbox */ 529 534 fprintf(out_h, "#define ENABLE_%s 1\n", sym->name); 530 fprintf(out_h, "#define USE_%s(...) __VA_ARGS__\n", sym->name);531 fprintf(out_h, "#define SKIP_%s(...)\n", sym->name);535 fprintf(out_h, "#define IF_%s(...) __VA_ARGS__\n", sym->name); 536 fprintf(out_h, "#define IF_NOT_%s(...)\n", sym->name); 532 537 } 533 538 break; -
branches/2.2.9/mindi-busybox/scripts/kconfig/gconf.c
r1765 r2725 742 742 GtkWidget *dialog; 743 743 const gchar *intro_text = _( 744 "Welcome to gkc, the GTK+ graphical busybox configuration tool\n" 745 "for Linux.\n" 744 "Welcome to gkc, the GTK+ graphical configuration tool.\n" 746 745 "For each option, a blank box indicates the feature is disabled, a\n" 747 746 "check indicates it is enabled, and a dot indicates that it is to\n" -
branches/2.2.9/mindi-busybox/scripts/kconfig/lex.zconf.c_shipped
r1765 r2725 785 785 { 786 786 int new_size = text_size + size + 1; 787 if (size > 70) { 788 fprintf (stderr, "%s:%d error: Overlong line\n", 789 current_file->name, current_file->lineno); 790 } 791 787 792 if (new_size > text_asize) { 788 793 new_size += START_STRSIZE - 1; … … 842 847 static int yy_flex_strlen (yyconst char * ); 843 848 #endif 849 850 //bbox: suppressing "defined but not used" warning 851 #define YY_NO_INPUT 1 844 852 845 853 #ifndef YY_NO_INPUT … … 2228 2236 FILE *zconf_fopen(const char *name) 2229 2237 { 2230 char *env , fullname[PATH_MAX+1];2238 char *env; 2231 2239 FILE *f; 2232 2240 … … 2235 2243 env = getenv(SRCTREE); 2236 2244 if (env) { 2245 char *fullname = alloca(strlen(env) + strlen(name) + 2); 2237 2246 sprintf(fullname, "%s/%s", env, name); 2238 2247 f = fopen(fullname, "r"); … … 2315 2324 return current_pos.file ? current_pos.file->name : "<none>"; 2316 2325 } 2317 -
branches/2.2.9/mindi-busybox/scripts/kconfig/lxdialog/BIG.FAT.WARNING
r1765 r2725 1 1 This is NOT the official version of dialog. This version has been 2 significantly modified from the original. It is for useby the Linux3 busybox configuration script. Please do not bother Savio Lam with 4 questions about this program.2 significantly modified from the original. It was used by the Linux 3 kernel configuration script, and subsequently adapted for busybox. 4 Please do not bother Savio Lam with questions about this program. -
branches/2.2.9/mindi-busybox/scripts/kconfig/lxdialog/Makefile
r1765 r2725 13 13 PHONY += dochecklxdialog 14 14 $(obj)/dochecklxdialog: 15 $(Q)$(CONFIG_SHELL) $(check-lxdialog) -check $(HOSTCC) $(HOST_ LOADLIBES)15 $(Q)$(CONFIG_SHELL) $(check-lxdialog) -check $(HOSTCC) $(HOST_EXTRACFLAGS) $(HOST_LOADLIBES) 16 16 17 17 hostprogs-y := lxdialog -
branches/2.2.9/mindi-busybox/scripts/kconfig/lxdialog/check-lxdialog.sh
r1765 r2725 5 5 ldflags() 6 6 { 7 $cc -print-file-name=libncursesw.so | grep -q / 8 if [ $? -eq 0 ]; then 9 echo '-lncursesw' 10 exit 11 fi 12 $cc -print-file-name=libncurses.so | grep -q / 13 if [ $? -eq 0 ]; then 14 echo '-lncurses' 15 exit 16 fi 17 $cc -print-file-name=libcurses.so | grep -q / 18 if [ $? -eq 0 ]; then 19 echo '-lcurses' 20 exit 21 fi 7 for ext in so a dylib ; do 8 for lib in ncursesw ncurses curses ; do 9 $cc -print-file-name=lib${lib}.${ext} | grep -q / 10 if [ $? -eq 0 ]; then 11 echo "-l${lib}" 12 exit 13 fi 14 done 15 done 22 16 exit 1 23 17 } … … 26 20 ccflags() 27 21 { 28 if [ -f /usr/include/ncurses/ncurses.h ]; then 22 if [ -f /usr/include/ncursesw/ncurses.h ]; then 23 echo '-I/usr/include/ncursesw -DCURSES_LOC="<ncurses.h>"' 24 elif [ -f /usr/include/ncursesw/curses.h ]; then 25 echo '-I/usr/include/ncursesw -DCURSES_LOC="<ncursesw/curses.h>"' 26 elif [ -f /usr/include/ncurses/ncurses.h ]; then 29 27 echo '-I/usr/include/ncurses -DCURSES_LOC="<ncurses.h>"' 30 28 elif [ -f /usr/include/ncurses/curses.h ]; then … … 43 41 # Check if we can link to ncurses 44 42 check() { 45 echo "main() {}" | $cc -xc - -o $tmp 2> /dev/null 43 $cc -xc - -o $tmp 2>/dev/null <<'EOF' 44 #include CURSES_LOC 45 main() {} 46 EOF 46 47 if [ $? != 0 ]; then 47 echo " *** Unable to find the ncurses libraries." 1>&2 48 echo " *** make menuconfig require the ncurses libraries" 1>&2 49 echo " *** " 1>&2 50 echo " *** Install ncurses (ncurses-devel) and try again" 1>&2 51 echo " *** " 1>&2 52 exit 1 48 echo " *** Unable to find the ncurses libraries or the" 1>&2 49 echo " *** required header files." 1>&2 50 echo " *** 'make menuconfig' requires the ncurses libraries." 1>&2 51 echo " *** " 1>&2 52 echo " *** Install ncurses (ncurses-devel) and try again." 1>&2 53 echo " *** " 1>&2 54 exit 1 53 55 fi 54 56 } 55 57 56 58 usage() { 57 printf "Usage: $0 [-check compiler options|- header|-library]\n"59 printf "Usage: $0 [-check compiler options|-ccflags|-ldflags compiler options]\n" 58 60 } 59 61 60 if [ $# ==0 ]; then62 if [ $# -eq 0 ]; then 61 63 usage 62 64 exit 1 -
branches/2.2.9/mindi-busybox/scripts/kconfig/mconf.c
r1765 r2725 116 116 "Menuconfig supports the use of alternate configuration files for\n" 117 117 "those who, for various reasons, find it necessary to switch\n" 118 "between different busyboxconfigurations.\n"118 "between different configurations.\n" 119 119 "\n" 120 120 "At the end of the main menu you will find two options. One is\n" … … 149 149 "Optional personality available\n" 150 150 "------------------------------\n" 151 "If you prefer to have all of the busyboxoptions listed in a single\n"151 "If you prefer to have all of the options listed in a single\n" 152 152 "menu, rather than the default multimenu hierarchy, run the menuconfig\n" 153 153 "with MENUCONFIG_MODE environment variable set to single_menu. Example:\n" … … 194 194 load_config_help[] = N_( 195 195 "\n" 196 "For various reasons, one may wish to keep several different busybox\n"196 "For various reasons, one may wish to keep several different\n" 197 197 "configurations available on a single machine.\n" 198 198 "\n" 199 "If you have saved a previous configuration in a file other than 200 " busybox'sdefault, entering the name of the file here will allow you\n"199 "If you have saved a previous configuration in a file other than\n" 200 "default, entering the name of the file here will allow you\n" 201 201 "to modify that configuration.\n" 202 202 "\n" … … 208 208 save_config_help[] = N_( 209 209 "\n" 210 "For various reasons, one may wish to keep different busybox\n"210 "For various reasons, one may wish to keep different\n" 211 211 "configurations available on a single machine.\n" 212 212 "\n" … … 259 259 static char buf[4096], *bufptr = buf; 260 260 static char input_buf[4096]; 261 static c har filename[PATH_MAX+1] = ".config";261 static const char filename[] = ".config"; 262 262 static char *args[1024], **argptr = args; 263 263 static int indent; … … 1071 1071 cprint_init(); 1072 1072 cprint("--yesno"); 1073 cprint(_("Do you wish to save your new busyboxconfiguration?"));1073 cprint(_("Do you wish to save your new configuration?")); 1074 1074 cprint("5"); 1075 1075 cprint("60"); … … 1080 1080 if (conf_write(NULL)) { 1081 1081 fprintf(stderr, _("\n\n" 1082 "Error during writing of the busyboxconfiguration.\n"1083 "Your busyboxconfiguration changes were NOT saved."1082 "Error during writing of the configuration.\n" 1083 "Your configuration changes were NOT saved." 1084 1084 "\n\n")); 1085 1085 return 1; 1086 1086 } 1087 1087 printf(_("\n\n" 1088 "*** End of busyboxconfiguration.\n"1089 "*** Execute 'make' to build busyboxor try 'make help'."1088 "*** End of configuration.\n" 1089 "*** Execute 'make' to build the project or try 'make help'." 1090 1090 "\n\n")); 1091 1091 } else { 1092 1092 fprintf(stderr, _("\n\n" 1093 "Your busyboxconfiguration changes were NOT saved."1093 "Your configuration changes were NOT saved." 1094 1094 "\n\n")); 1095 1095 } -
branches/2.2.9/mindi-busybox/scripts/kconfig/menu.c
r1765 r2725 395 395 return menu; 396 396 } 397 -
branches/2.2.9/mindi-busybox/scripts/kconfig/qconf.cc
r1765 r2725 1300 1300 void ConfigMainWindow::showIntro(void) 1301 1301 { 1302 static char str[] = "Welcome to the qconf graphical busybox configuration tool for Linux.\n\n"1302 static char str[] = "Welcome to the qconf graphical configuration tool.\n\n" 1303 1303 "For each option, a blank box indicates the feature is disabled, a check\n" 1304 1304 "indicates it is enabled, and a dot indicates that it is to be compiled\n" … … 1317 1317 void ConfigMainWindow::showAbout(void) 1318 1318 { 1319 static char str[] = "qconf is Copyright (C) 2002 Roman Zippel <zippel@linux-m68k.org>.\n\n" 1320 "Bug reports and feature request can also be entered at http://bugs.busybox.net/\n"; 1319 static char str[] = "qconf is Copyright (C) 2002 Roman Zippel <zippel@linux-m68k.org>.\n"; 1321 1320 1322 1321 QMessageBox::information(this, "qconf", str); -
branches/2.2.9/mindi-busybox/scripts/kconfig/util.c
r1765 r2725 45 45 fprintf(out, "\t%s\n", file->name); 46 46 } 47 fprintf(out, "\n.config include/autoconf.h: $(deps_config)\n\n$(deps_config):\n"); 47 fprintf(out, 48 "\n" 49 ".config include/autoconf.h: $(deps_config)\n" 50 "\n" 51 "include/autoconf.h: .config\n" /* bbox */ 52 "\n" 53 "$(deps_config):\n"); 48 54 fclose(out); 49 55 rename("..config.tmp", name); … … 52 58 53 59 54 /* Allocate initial growable st ing */60 /* Allocate initial growable string */ 55 61 struct gstr str_new(void) 56 62 { … … 107 113 return gs->s; 108 114 } 109 -
branches/2.2.9/mindi-busybox/scripts/kconfig/zconf.hash.c_shipped
r1765 r2725 229 229 return 0; 230 230 } 231 -
branches/2.2.9/mindi-busybox/scripts/kconfig/zconf.l
r1765 r2725 50 50 { 51 51 int new_size = text_size + size + 1; 52 if (size > 70) { 53 fprintf (stderr, "%s:%d error: Overlong line\n", 54 current_file->name, current_file->lineno); 55 } 52 56 if (new_size > text_asize) { 53 57 new_size += START_STRSIZE - 1; … … 262 266 FILE *zconf_fopen(const char *name) 263 267 { 264 char *env , fullname[PATH_MAX+1];268 char *env; 265 269 FILE *f; 266 270 … … 269 273 env = getenv(SRCTREE); 270 274 if (env) { 275 char *fullname = alloca(strlen(env) + strlen(name) + 2); 271 276 sprintf(fullname, "%s/%s", env, name); 272 277 f = fopen(fullname, "r"); -
branches/2.2.9/mindi-busybox/scripts/kconfig/zconf.tab.c_shipped
r1765 r2725 1104 1104 `yyls': related to locations. 1105 1105 1106 Refer to the stacks thr useparate pointers, to allow yyoverflow1106 Refer to the stacks through separate pointers, to allow yyoverflow 1107 1107 to reallocate them elsewhere. */ 1108 1108 … … 2174 2174 #include "symbol.c" 2175 2175 #include "menu.c" 2176 2177 -
branches/2.2.9/mindi-busybox/scripts/kconfig/zconf.y
r1765 r2725 14 14 #define LKC_DIRECT_LINK 15 15 #include "lkc.h" 16 17 #include "zconf.hash.c"18 16 19 17 #define printd(mask, fmt...) if (cdebug & (mask)) printf(fmt) … … 100 98 } if_entry menu_entry choice_entry 101 99 100 %{ 101 #include "zconf.hash.c" 102 %} 103 102 104 %% 103 105 input: stmt_list; … … 472 474 for_all_symbols(i, sym) { 473 475 sym_check_deps(sym); 474 476 } 475 477 476 478 sym_change_count = 1; -
branches/2.2.9/mindi-busybox/scripts/mkconfigs
r1765 r2725 27 27 # - lines that use double-quotes must \\-escape-quote them 28 28 29 config="$1" 30 if [ $# -lt 1 ] 31 then 32 config=.config 33 fi 29 config=.config 34 30 31 { 35 32 echo "\ 36 33 #ifndef _BBCONFIGOPTS_H … … 39 36 * busybox configuration settings. 40 37 * 41 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details.38 * Licensed under GPLv2 or later, see file LICENSE in this source tree. 42 39 * 43 40 * This file is generated automatically by scripts/mkconfigs. 44 41 * Do not edit. 45 *46 42 */ 47 static const char *const bbconfig_config="43 static const char bbconfig_config[] ALIGN1 =" 48 44 49 sed 's/\"/\\\"/g' $config | grep "^#\? \?CONFIG_" | awk '{print "\"" $0 "\\n\"";}' 45 grep '^#\? \?CONFIG_' "$config" \ 46 | sed -e 's/\"/\\\"/g' -e 's/^/"/' -e 's/$/\\n"/' 50 47 51 48 echo ";" 52 echo "#endif /* _BBCONFIGOPTS_H */" 49 echo "#endif" 50 } >"$1" 51 52 { 53 echo "\ 54 #ifndef _BBCONFIGOPTS_BZ2_H 55 #define _BBCONFIGOPTS_BZ2_H 56 /* 57 * busybox configuration settings. 58 * 59 * Licensed under GPLv2 or later, see file LICENSE in this source tree. 60 * 61 * This file is generated automatically by scripts/mkconfigs. 62 * Do not edit. 63 */ 64 static const char bbconfig_config_bz2[] ALIGN1 = {" 65 66 grep '^#\? \?CONFIG_' "$config" \ 67 | bzip2 -1 | dd bs=2 skip=1 2>/dev/null \ 68 | od -v -t x1 \ 69 | sed -e 's/^[^ ]*//' \ 70 -e 's/ //g' \ 71 -e '/^$/d' \ 72 -e 's/\(..\)/0x\1,/g' 73 74 echo "};" 75 echo "#endif" 76 } >"$2" -
branches/2.2.9/mindi-busybox/scripts/mkmakefile
r1765 r2725 32 32 Makefile:; 33 33 34 \$(filter-out all Makefile,\$(MAKECMDGOALS)) %/: 34 \$(filter-out all Makefile,\$(MAKECMDGOALS)): 35 \$(MAKE) -C \$(KERNELSRC) O=\$(KERNELOUTPUT) \$@ 36 37 %/: 35 38 \$(MAKE) -C \$(KERNELSRC) O=\$(KERNELOUTPUT) \$@ 36 39 EOF -
branches/2.2.9/mindi-busybox/scripts/objsizes
r1765 r2725 17 17 done 18 18 printf "%9d %11d %9d %9d %s\n" $((t_text+t_data)) $t_text $t_data $t_bss "TOTAL" 19 } | sort -r19 } | env -uLANG -uLC_ALL sort -r -
branches/2.2.9/mindi-busybox/scripts/showasm
r821 r2725 2 2 3 3 # Copyright 2006 Rob Landley <rob@landley.net> 4 # Licensed under GPLv2 or later, see file LICENSE in this tarball for details.4 # Licensed under GPLv2 or later, see file LICENSE in this source tree. 5 5 6 6 # Dumb little utility function to print out the assembly dump of a single … … 19 19 20 20 objdump -d $1 | sed -n -e '/./{H;$!d}' -e "x;/^.[0-9a-fA-F]* <$2>:/p" 21 -
branches/2.2.9/mindi-busybox/scripts/trylink
r1765 r2725 3 3 debug=false 4 4 5 # Linker flags used: 6 # 7 # Informational: 8 # --warn-common 9 # -Map $EXE.map 10 # --verbose 11 # 12 # Optimizations: 13 # --sort-common reduces padding 14 # --sort-section alignment reduces padding 15 # --gc-sections throws out unused sections, 16 # does not work for shared libs 17 # -On Not used, maybe useful? 18 # 19 # List of files to link: 20 # $l_list == --start-group -llib1 -llib2 --end-group 21 # --start-group $O_FILES $A_FILES --end-group 22 # 23 # Shared library link: 24 # -shared self-explanatory 25 # -fPIC position-independent code 26 # --enable-new-dtags ? 27 # -z,combreloc ? 28 # -soname="libbusybox.so.$BB_VER" 29 # --undefined=lbb_main Seed name to start pulling from 30 # (otherwise we'll need --whole-archive) 31 # -static Not used, but may be useful! manpage: 32 # "... This option can be used with -shared. 33 # Doing so means that a shared library 34 # is being created but that all of the library's 35 # external references must be resolved by pulling 36 # in entries from static libraries." 37 38 5 39 try() { 6 added="$1" 7 shift 8 $debug && echo "Trying: $* $added" 9 "$@" $added 2>busybox_ld.err 10 } 40 printf "%s\n" "Output of:" >$EXE.out 41 printf "%s\n" "$*" >>$EXE.out 42 printf "%s\n" "==========" >>$EXE.out 43 $debug && echo "Trying: $*" 44 $@ >>$EXE.out 2>&1 45 return $? 46 } 47 48 check_cc() { 49 local tempname="/tmp/temp.$$.$RANDOM" 50 # Can use "-o /dev/null", but older gcc tend to *unlink it* on failure! :( 51 # "-xc": C language. "/dev/null" is an empty source file. 52 if $CC $1 -shared -xc /dev/null -o "$tempname".o >/dev/null 2>&1; then 53 echo "$1"; 54 else 55 echo "$2"; 56 fi 57 rm "$tempname".o 2>/dev/null 58 } 59 60 check_libc_is_glibc() { 61 local tempname="/tmp/temp.$$.$RANDOM" 62 echo "\ 63 #include <stdlib.h> 64 /* Apparently uclibc defines __GLIBC__ (compat trick?). Oh well. */ 65 #if defined(__GLIBC__) && !defined(__UCLIBC__) 66 syntax error here 67 #endif 68 " >"$tempname".c 69 if $CC "$tempname".c -c -o "$tempname".o >/dev/null 2>&1; then 70 echo "$2"; 71 else 72 echo "$1"; 73 fi 74 rm "$tempname".c "$tempname".o 2>/dev/null 75 } 76 77 EXE="$1" 78 CC="$2" 79 CFLAGS="$3" 80 LDFLAGS="$4" 81 O_FILES="$5" 82 A_FILES="$6" 83 LDLIBS="$7" 84 85 # The --sort-section option is not supported by older versions of ld 86 SORT_SECTION=`check_cc "-Wl,--sort-section,alignment" ""` 87 88 START_GROUP="-Wl,--start-group" 89 END_GROUP="-Wl,--end-group" 90 INFO_OPTS="-Wl,--warn-common -Wl,-Map,$EXE.map -Wl,--verbose" 91 92 # gold may not support --sort-common (yet) 93 SORT_COMMON=`check_cc "-Wl,--sort-common" ""` 94 95 # Static linking against glibc produces buggy executables 96 # (glibc does not cope well with ld --gc-sections). 97 # See sources.redhat.com/bugzilla/show_bug.cgi?id=3400 98 # Note that glibc is unsuitable for static linking anyway. 99 # We are removing -Wl,--gc-sections from link command line. 100 GC_SECTIONS=`( 101 . ./.config 102 if test x"$CONFIG_STATIC" = x"y"; then 103 check_libc_is_glibc "" "-Wl,--gc-sections" 104 else 105 echo "-Wl,--gc-sections" 106 fi 107 )` 108 109 # The --gc-sections option is not supported by older versions of ld 110 if test -n "$GC_SECTIONS"; then 111 GC_SECTIONS=`check_cc "$GC_SECTIONS" ""` 112 fi 11 113 12 114 # Sanitize lib list (dups, extra spaces etc) 13 #echo "BBOX_LIB_LIST=$BBOX_LIB_LIST" 14 BBOX_LIB_LIST=`echo "$BBOX_LIB_LIST" | xargs -n1 | sort | uniq | xargs` 115 LDLIBS=`echo "$LDLIBS" | xargs -n1 | sort | uniq | xargs` 15 116 16 117 # First link with all libs. If it fails, bail out 17 echo "Trying libraries: $BBOX_LIB_LIST" 18 l_list=`echo "$BBOX_LIB_LIST" | sed -e 's/ / -l/g' -e 's/^/-l/' -e 's/^-l$//'` 19 test "x$l_list" != "x" && l_list="-Wl,--start-group $l_list -Wl,--end-group" 20 try "$l_list" "$@" \ 118 echo "Trying libraries: $LDLIBS" 119 # "lib1 lib2 lib3" -> "-llib1 -llib2 -llib3" 120 l_list=`echo "$LDLIBS" | sed -e 's/ / -l/g' -e 's/^/-l/' -e 's/^-l$//'` 121 test "x$l_list" != "x" && l_list="$START_GROUP $l_list $END_GROUP" 122 try $CC $CFLAGS $LDFLAGS \ 123 -o $EXE \ 124 $SORT_COMMON \ 125 $SORT_SECTION \ 126 $GC_SECTIONS \ 127 $START_GROUP $O_FILES $A_FILES $END_GROUP \ 128 $l_list \ 21 129 || { 22 echo "Failed: $ * -Wl,--start-group $l_list -Wl,--end-group"23 cat busybox_ld.err130 echo "Failed: $l_list" 131 cat $EXE.out 24 132 exit 1 25 133 } … … 27 135 # Now try to remove each lib and build without it. 28 136 # Stop when no lib can be removed. 29 while test "$ BBOX_LIB_LIST"; do30 $debug && echo "Trying libraries: $ BBOX_LIB_LIST"137 while test "$LDLIBS"; do 138 $debug && echo "Trying libraries: $LDLIBS" 31 139 all_needed=true 32 for one in $BBOX_LIB_LIST; do 33 without_one=`echo " $BBOX_LIB_LIST " | sed "s/ $one / /g" | xargs` 140 last_needed=false 141 for one in $LDLIBS; do 142 without_one=`echo " $LDLIBS " | sed "s/ $one / /g" | xargs` 143 # "lib1 lib2 lib3" -> "-llib1 -llib2 -llib3" 34 144 l_list=`echo "$without_one" | sed -e 's/ / -l/g' -e 's/^/-l/' -e 's/^-l$//'` 35 test "x$l_list" != "x" && l_list="-Wl,--start-group $l_list -Wl,--end-group"145 test x"$l_list" != x"" && l_list="$START_GROUP $l_list $END_GROUP" 36 146 $debug && echo "Trying -l options: '$l_list'" 37 if try "$l_list" "$@"; then 38 echo "Library $one is not needed" 39 BBOX_LIB_LIST="$without_one" 40 all_needed=false 147 try $CC $CFLAGS $LDFLAGS \ 148 -o $EXE \ 149 $SORT_COMMON \ 150 $SORT_SECTION \ 151 $GC_SECTIONS \ 152 $START_GROUP $O_FILES $A_FILES $END_GROUP \ 153 $l_list 154 if test $? = 0; then 155 echo " Library $one is not needed, excluding it" 156 LDLIBS="$without_one" 157 all_needed=false 158 last_needed=false 41 159 else 42 echo "Library $one is needed" 160 echo " Library $one is needed, can't exclude it (yet)" 161 last_needed=true 43 162 fi 44 163 done 45 164 # All libs were needed, can't remove any 46 165 $all_needed && break 47 # If there is no space char, the list has just one lib. 48 # I'm not sure that in this case lib really is 100% needed. 49 # Let's try linking without it anyway... thus commented out. 50 #{ echo "$BBOX_LIB_LIST" | grep -q ' '; } || break 166 # Optimization: was the last tried lib needed? 167 if $last_needed; then 168 # Was it the only one lib left? Don't test again then. 169 { echo "$LDLIBS" | grep -q ' '; } || break 170 fi 51 171 done 52 172 53 173 # Make the binary with final, minimal list of libs 54 echo "Final link with: $ BBOX_LIB_LIST"55 l_list=`echo "$ BBOX_LIB_LIST" | sed -e 's/ / -l/g' -e 's/^/-l/' -e 's/^-l$//'`56 test "x$l_list" != "x" && l_list=" -Wl,--start-group $l_list -Wl,--end-group -Wl,--verbose"174 echo "Final link with: ${LDLIBS:-<none>}" 175 l_list=`echo "$LDLIBS" | sed -e 's/ / -l/g' -e 's/^/-l/' -e 's/^-l$//'` 176 test "x$l_list" != "x" && l_list="$START_GROUP $l_list $END_GROUP" 57 177 # --verbose gives us gobs of info to stdout (e.g. linker script used) 58 178 if ! test -f busybox_ldscript; then 59 try "$l_list -Wl,--verbose" "$@" >busybox_ld.out 179 try $CC $CFLAGS $LDFLAGS \ 180 -o $EXE \ 181 $SORT_COMMON \ 182 $SORT_SECTION \ 183 $GC_SECTIONS \ 184 $START_GROUP $O_FILES $A_FILES $END_GROUP \ 185 $l_list \ 186 $INFO_OPTS \ 187 || { 188 cat $EXE.out 189 exit 1 190 } 60 191 else 61 192 echo "Custom linker script 'busybox_ldscript' found, using it" 62 # Add SORT_BY_ALIGNMENT to linker script (found in busybox_ld.out):193 # Add SORT_BY_ALIGNMENT to linker script (found in $EXE.out): 63 194 # .rodata : { *(.rodata SORT_BY_ALIGNMENT(.rodata.*) .gnu.linkonce.r.*) } 64 195 # *(.data SORT_BY_ALIGNMENT(.data.*) .gnu.linkonce.d.*) 65 196 # *(.bss SORT_BY_ALIGNMENT(.bss.*) .gnu.linkonce.b.*) 66 # This will eliminate most of the data padding (~3kb). 67 try "$l_list -Wl,--verbose -Wl,-T -Wl,busybox_ldscript" "$@" >busybox_ld.out 68 fi 197 # This will eliminate most of the padding (~3kb). 198 # Hmm, "ld --sort-section alignment" should do it too. 199 try $CC $CFLAGS $LDFLAGS \ 200 -o $EXE \ 201 $SORT_COMMON \ 202 $SORT_SECTION \ 203 $GC_SECTIONS \ 204 -Wl,-T,busybox_ldscript \ 205 $START_GROUP $O_FILES $A_FILES $END_GROUP \ 206 $l_list \ 207 $INFO_OPTS \ 208 || { 209 cat $EXE.out 210 exit 1 211 } 212 fi 213 214 . ./.config 215 216 sharedlib_dir="0_lib" 217 218 if test "$CONFIG_BUILD_LIBBUSYBOX" = y; then 219 mkdir "$sharedlib_dir" 2>/dev/null 220 test -d "$sharedlib_dir" || { 221 echo "Cannot make directory $sharedlib_dir" 222 exit 1 223 } 224 ln -s "libbusybox.so.$BB_VER" "$sharedlib_dir"/libbusybox.so 2>/dev/null 225 226 EXE="$sharedlib_dir/libbusybox.so.${BB_VER}_unstripped" 227 try $CC $CFLAGS $LDFLAGS \ 228 -o $EXE \ 229 -shared -fPIC \ 230 -Wl,--enable-new-dtags \ 231 -Wl,-z,combreloc \ 232 -Wl,-soname="libbusybox.so.$BB_VER" \ 233 -Wl,--undefined=lbb_main \ 234 $SORT_COMMON \ 235 $SORT_SECTION \ 236 $START_GROUP $A_FILES $END_GROUP \ 237 $l_list \ 238 $INFO_OPTS \ 239 || { 240 echo "Linking $EXE failed" 241 cat $EXE.out 242 exit 1 243 } 244 $STRIP -s --remove-section=.note --remove-section=.comment $EXE -o "$sharedlib_dir/libbusybox.so.$BB_VER" 245 chmod a+x "$sharedlib_dir/libbusybox.so.$BB_VER" 246 echo "libbusybox: $sharedlib_dir/libbusybox.so.$BB_VER" 247 fi 248 249 if test "$CONFIG_FEATURE_SHARED_BUSYBOX" = y; then 250 EXE="$sharedlib_dir/busybox_unstripped" 251 try $CC $CFLAGS $LDFLAGS \ 252 -o $EXE \ 253 $SORT_COMMON \ 254 $SORT_SECTION \ 255 $GC_SECTIONS \ 256 $START_GROUP $O_FILES $END_GROUP \ 257 -L"$sharedlib_dir" -lbusybox \ 258 $INFO_OPTS \ 259 || { 260 echo "Linking $EXE failed" 261 cat $EXE.out 262 exit 1 263 } 264 $STRIP -s --remove-section=.note --remove-section=.comment $EXE -o "$sharedlib_dir/busybox" 265 echo "busybox linked against libbusybox: $sharedlib_dir/busybox" 266 fi 267 268 if test "$CONFIG_FEATURE_INDIVIDUAL" = y; then 269 echo "Linking individual applets against libbusybox (see $sharedlib_dir/*)" 270 gcc -DNAME_MAIN_CNAME -E -include include/autoconf.h include/applets.h \ 271 | grep -v "^#" \ 272 | grep -v "^$" \ 273 > applet_lst.tmp 274 while read name main junk; do 275 276 echo "\ 277 void lbb_prepare(const char *applet, char **argv); 278 int $main(int argc, char **argv); 279 280 int main(int argc, char **argv) 281 { 282 lbb_prepare(\"$name\", argv); 283 return $main(argc, argv); 284 } 285 " >"$sharedlib_dir/applet.c" 286 287 EXE="$sharedlib_dir/$name" 288 try $CC $CFLAGS $LDFLAGS "$sharedlib_dir/applet.c" \ 289 -o $EXE \ 290 $SORT_COMMON \ 291 $SORT_SECTION \ 292 $GC_SECTIONS \ 293 -L"$sharedlib_dir" -lbusybox \ 294 -Wl,--warn-common \ 295 || { 296 echo "Linking $EXE failed" 297 cat $EXE.out 298 exit 1 299 } 300 rm -- "$sharedlib_dir/applet.c" $EXE.out 301 $STRIP -s --remove-section=.note --remove-section=.comment $EXE 302 303 done <applet_lst.tmp 304 fi 305 306 # libbusybox.so is needed only for -lbusybox at link time, 307 # it is not needed at runtime. Deleting to reduce confusion. 308 rm "$sharedlib_dir"/libbusybox.so 2>/dev/null 309 exit 0 # or else we may confuse make
Note:
See TracChangeset
for help on using the changeset viewer.