Changeset 2725 in MondoRescue for branches/2.2.9/mindi-busybox/scripts


Ignore:
Timestamp:
Feb 25, 2011, 9:26:54 PM (13 years ago)
Author:
Bruno Cornec
Message:
  • Update mindi-busybox to 1.18.3 to avoid problems with the tar command which is now failing on recent versions with busybox 1.7.3
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
    12###
    23# scripts contains sources for various helper programs used throughout
  • branches/2.2.9/mindi-busybox/scripts/Makefile.IMA

    r1765 r2725  
    11# This is completely unsupported.
     2#
     3# Uasge: make -f scripts/Makefile.IMA
     4#
    25# Fix COMBINED_COMPILE upstream (in the Kbuild) and propagate
    36# the changes back
     
    710obj     := $(objtree)
    811
     12# Look for make include files relative to root of kernel src
     13MAKEFLAGS += --include-dir=$(srctree)
     14
    915default: busybox
     16
    1017include .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
     20ifeq ($(CROSS_COMPILE),)
     21CROSS_COMPILE := $(subst ",,$(CONFIG_CROSS_COMPILER_PREFIX))
     22endif
     23
     24ifneq ($(CROSS_COMPILE),)
     25SUBARCH := $(shell echo $(CROSS_COMPILE) | cut -d- -f1)
     26else
     27SUBARCH := $(shell uname -m)
     28endif
     29SUBARCH := $(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/ )
     33ARCH ?= $(SUBARCH)
     34
     35ifndef HOSTCC
     36HOSTCC = cc
     37endif
    12038AS              = $(CROSS_COMPILE)as
    12139CC              = $(CROSS_COMPILE)gcc
     
    12846OBJDUMP         = $(CROSS_COMPILE)objdump
    12947
     48CFLAGS   := $(CFLAGS)
     49CPPFLAGS += -D"KBUILD_STR(s)=\#s" #-Q
     50
     51# We need some generic definitions
     52include $(srctree)/scripts/Kbuild.include
     53
     54include Makefile.flags
     55
     56-include $(srctree)/arch/$(ARCH)/Makefile
     57ifdef CONFIG_FEATURE_COMPRESS_USAGE
     58usage_stuff = include/usage_compressed.h
     59endif
     60
     61ifndef BB_VER
     62BB_VER:=""
     63endif
     64
    13065WHOLE_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
     68lib-all-y := applets/applets.o
     69lib-y:=
     70include procps/Kbuild
     71lib-all-y += $(patsubst %,procps/%,$(sort $(lib-y)))
     72lib-y:=
     73include networking/Kbuild
     74lib-all-y += $(patsubst %,networking/%,$(sort $(lib-y)))
     75lib-y:=
     76include networking/udhcp/Kbuild
     77lib-all-y += $(patsubst %,networking/udhcp/%,$(sort $(lib-y)))
     78lib-y:=
     79include networking/libiproute/Kbuild
     80lib-all-y += $(patsubst %,networking/libiproute/%,$(sort $(lib-y)))
     81lib-y:=
     82include loginutils/Kbuild
     83lib-all-y += $(patsubst %,loginutils/%,$(sort $(lib-y)))
     84lib-y:=
     85include archival/Kbuild
     86lib-all-y += $(patsubst %,archival/%,$(sort $(lib-y)))
     87lib-y:=
     88include archival/libarchive/Kbuild
     89lib-all-y += $(patsubst %,archival/libarchive/%,$(sort $(lib-y)))
     90lib-y:=
     91include applets/Kbuild
     92lib-all-y += $(patsubst %,applets/%,$(sort $(lib-y)))
     93lib-y:=
     94include e2fsprogs/Kbuild
     95lib-all-y += $(patsubst %,e2fsprogs/%,$(sort $(lib-y)))
     96lib-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:=
     112include debianutils/Kbuild
     113lib-all-y += $(patsubst %,debianutils/%,$(sort $(lib-y)))
     114lib-y:=
     115include runit/Kbuild
     116lib-all-y += $(patsubst %,runit/%,$(sort $(lib-y)))
     117lib-y:=
     118include modutils/Kbuild
     119lib-all-y += $(patsubst %,modutils/%,$(sort $(lib-y)))
     120lib-y:=
     121include miscutils/Kbuild
     122lib-all-y += $(patsubst %,miscutils/%,$(sort $(lib-y)))
     123lib-y:=
     124include coreutils/libcoreutils/Kbuild
     125lib-all-y += $(patsubst %,coreutils/libcoreutils/%,$(sort $(lib-y)))
     126lib-y:=
     127include coreutils/Kbuild
     128lib-all-y += $(patsubst %,coreutils/%,$(sort $(lib-y)))
     129lib-y:=
     130include sysklogd/Kbuild
     131lib-all-y += $(patsubst %,sysklogd/%,$(sort $(lib-y)))
     132lib-y:=
     133include shell/Kbuild
     134lib-all-y += $(patsubst %,shell/%,$(sort $(lib-y)))
     135lib-y:=
     136include console-tools/Kbuild
     137lib-all-y += $(patsubst %,console-tools/%,$(sort $(lib-y)))
     138lib-y:=
     139include findutils/Kbuild
     140lib-all-y += $(patsubst %,findutils/%,$(sort $(lib-y)))
     141lib-y:=
     142include util-linux/Kbuild
     143lib-all-y += $(patsubst %,util-linux/%,$(sort $(lib-y)))
     144lib-y:=
     145include util-linux/volume_id/Kbuild
     146lib-all-y += $(patsubst %,util-linux/volume_id/%,$(sort $(lib-y)))
     147lib-y:=
     148include init/Kbuild
     149lib-all-y += $(patsubst %,init/%,$(sort $(lib-y)))
     150lib-y:=
     151include libpwdgrp/Kbuild
     152lib-all-y += $(patsubst %,libpwdgrp/%,$(sort $(lib-y)))
     153lib-y:=
     154include editors/Kbuild
     155lib-all-y += $(patsubst %,editors/%,$(sort $(lib-y)))
     156lib-y:=
     157include printutils/Kbuild
     158lib-all-y += $(patsubst %,printutils/%,$(sort $(lib-y)))
     159lib-y:=
     160include selinux/Kbuild
     161lib-all-y += $(patsubst %,selinux/%,$(sort $(lib-y)))
     162lib-y:=
     163include scripts/Kbuild
     164lib-all-y += $(patsubst %,scripts/%,$(sort $(lib-y)))
     165lib-y:=
     166include libbb/Kbuild
     167lib-all-y += $(patsubst %,libbb/%,$(sort $(lib-y)))
     168lib-y:=
     169
     170comma:=,
     171busybox_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) \
    133176        -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
     180busybox: 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"
    136189    cp -f $(@)_unstripped $@
    137190    -$(STRIP) -s -R .note -R .comment -R .version $@
    138191
    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.
     194include/autoconf.h: .config
     195    $(MAKE) -f $(srctree)/Makefile silentoldconfig
     196
     197applets/usage: include/autoconf.h
     198    $(HOSTCC) -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -I$(srctree)/include -o applets/usage applets/usage.c
     199
     200applets/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
     203include/usage_compressed.h: include/usage.h applets/usage
    142204    $(srctree)/applets/usage_compressed include/usage_compressed.h applets
    143205
     206include/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  
    1414
    1515# The filename Kbuild has precedence over Makefile
     16# bbox: we also try to include Kbuild file in obj tree first
    1617kbuild-dir := $(if $(filter /%,$(src)),$(src),$(srctree)/$(src))
    17 include $(if $(wildcard $(kbuild-dir)/Kbuild), $(kbuild-dir)/Kbuild, $(kbuild-dir)/Makefile)
     18include $(if $(wildcard $(src)/Kbuild), $(src)/Kbuild, \
     19        $(if $(wildcard $(kbuild-dir)/Kbuild), $(kbuild-dir)/Kbuild, \
     20            $(kbuild-dir)/Makefile \
     21        ) \
     22    )
    1823
    1924include scripts/Makefile.lib
     
    252257# If the list of objects to link is empty, just create an empty built-in.o
    253258cmd_link_o_target = $(if $(strip $(obj-y)),\
    254               $(LD) $(ld_flags) -r -o $@ $(filter $(obj-y), $^),\
    255               rm -f $@; $(AR) rcs $@)
     259        $(LD) $(ld_flags) -r -o $@ $(filter $(obj-y), $^),\
     260        rm -f $@; $(AR) rcs $@)
    256261
    257262$(builtin-target): $(obj-y) FORCE
  • branches/2.2.9/mindi-busybox/scripts/Makefile.clean

    r1765 r2725  
    1515# The filename Kbuild has precedence over Makefile
    1616kbuild-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)
    1818
    1919# Figure out what we need to build from the various variables
  • branches/2.2.9/mindi-busybox/scripts/Makefile.host

    r1765 r2725  
    100100quiet_cmd_host-csingle  = HOSTCC  $@
    101101      cmd_host-csingle  = $(HOSTCC) $(hostc_flags) -o $@ $< \
    102         $(HOST_LOADLIBES) $(HOSTLOADLIBES_$(@F))
     102              $(HOST_LOADLIBES) $(HOSTLOADLIBES_$(@F))
    103103$(host-csingle): %: %.c FORCE
    104104    $(call if_changed_dep,host-csingle)
     
    154154targets += $(host-csingle)  $(host-cmulti) $(host-cobjs)\
    155155       $(host-cxxmulti) $(host-cxxobjs) $(host-cshlib) $(host-cshobjs)
    156 
  • branches/2.2.9/mindi-busybox/scripts/Makefile.lib

    r1765 r2725  
    118118cpp_flags      = -Wp,-MD,$(depfile) $(NOSTDINC_FLAGS) $(__cpp_flags)
    119119
    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
     124ld_flags       = $(filter-out -Wl$(comma)%,$(LDFLAGS) $(EXTRA_LDFLAGS))
     125
    121126
    122127# Finds the multi-part object the current object will be linked into
     
    147152# ---------------------------------------------------------------------------
    148153
     154# TODO: LDFLAGS usually is supposed to contain gcc's flags, not ld's.
     155# but here we feed them to ld!
    149156quiet_cmd_ld = LD      $@
    150157cmd_ld = $(LD) $(LDFLAGS) $(EXTRA_LDFLAGS) $(LDFLAGS_$(@F)) \
     
    162169quiet_cmd_gzip = GZIP    $@
    163170cmd_gzip = gzip -f -9 < $< > $@
    164 
    165 
  • branches/2.2.9/mindi-busybox/scripts/basic/docproc.c

    r1765 r2725  
    8080    pid_t pid;
    8181    int ret;
    82     char real_filename[PATH_MAX + 1];
     82    char *real_filename;
     83    int rflen;
     84
    8385    /* Make sure output generated so far are flushed */
    8486    fflush(stdout);
    8587    switch(pid=fork()) {
    8688        case -1:
    87             perror("fork");
     89            perror("vfork"+1);
    8890            exit(1);
    8991        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);
    9497            execvp(real_filename, svec);
    9598            fprintf(stderr, "exec ");
     
    167170    char line[MAXLINESZ];
    168171    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);
    174176        sym = add_new_file(filename);
    175177        fp = fopen(real_filename, "r");
     
    250252
    251253/*
    252  * Document spåecific function(s) in a file.
     254 * Document specific function(s) in a file.
    253255 * Call kernel-doc with the following parameters:
    254256 * kernel-doc -docbook -function function1 [-function function2]
     
    396398    return exitstatus;
    397399}
    398 
  • branches/2.2.9/mindi-busybox/scripts/basic/fixdep.c

    r1765 r2725  
    204204void use_config(char *m, int slen)
    205205{
    206     char s[PATH_MAX];
     206    char *s = alloca(slen+1);
    207207    char *p;
    208208
     
    226226{
    227227    /* 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_" */
    229229    char *end_7 = map + len - 7;
    230230    char *p = map;
     
    232232    int off;
    233233
    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 */
    235240        if (p < end_7 && p[6] == '_') {
    236241            if (!memcmp(p, "CONFIG", 6)) goto conf7;
    237242            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++;
    247255        continue;
    248256
    249     conf4:  off = 4;
    250     conf5:  off = 5;
    251257    conf7:  off = 7;
     258    conf:
    252259        p += off;
    253         for (q = p; q < end_4+4; q++) {
     260        for (q = p; q < end_3+3; q++) {
    254261            if (!(isalnum(*q) || *q == '_'))
    255262                break;
    256263        }
    257         use_config(p, q-p);
     264        if (q != p) {
     265            use_config(p, q-p);
     266        }
    258267    }
    259268}
     
    307316    char *end = m + len;
    308317    char *p;
    309     char s[PATH_MAX];
     318    char *s = alloca(len);
    310319
    311320    p = memchr(m, ':', len);
  • branches/2.2.9/mindi-busybox/scripts/basic/split-include.c

    r1765 r2725  
    111111    if (line[0] != '#')
    112112        continue;
    113     if ((str_config = strstr(line, "CONFIG_")) == NULL)
     113    if ((str_config = strstr(line, " CONFIG_")) == NULL)
    114114        continue;
    115115
    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;
    118119    for (itarget = 0; !isspace(str_config[itarget]); itarget++)
    119120    {
     
    155156
    156157        /* Write the file. */
    157         if ((fp_target = fopen(ptarget, "w" )) == NULL)
     158        if ((fp_target = fopen(ptarget,  "w")) == NULL)
    158159        ERROR_EXIT(ptarget);
    159160        fputs(line, fp_target);
  • branches/2.2.9/mindi-busybox/scripts/bloat-o-meter

    r1765 r2725  
    88# of the GNU General Public License, incorporated herein by reference.
    99
    10 import sys, os, re
     10import sys, os#, re
    1111
    12 if len(sys.argv) != 3:
    13     sys.stderr.write("usage: %s file1 file2\n" % sys.argv[0])
     12def usage():
     13    sys.stderr.write("usage: %s [-t] file1 file2\n" % sys.argv[0])
    1414    sys.exit(-1)
    1515
    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)
     16f1, f2 = (None, None)
     17flag_timing, dashes = (False, False)
    2018
     19for 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
     34if flag_timing:
     35    import time
     36if f1 is None or f2 is None:
     37    usage()
     38
     39sym_args = " ".join(sys.argv[3 + flag_timing + dashes:])
    2140def 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():
    2974        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)}
    3280    return sym
    3381
    34 old = getsizes(sys.argv[1])
    35 new = getsizes(sys.argv[2])
     82if flag_timing:
     83    start_t1 = int(time.time() * 1e9)
     84old = getsizes(f1)
     85if flag_timing:
     86    end_t1 = int(time.time() * 1e9)
     87    start_t2 = int(time.time() * 1e9)
     88new = getsizes(f2)
     89if flag_timing:
     90    end_t2 = int(time.time() * 1e9)
     91    start_t3 = int(time.time() * 1e9)
    3692grow, shrink, add, remove, up, down = 0, 0, 0, 0, 0, 0
    3793delta, common = [], {}
    3894
    39 for a in old:
    40     if a in new:
    41         common[a] = 1
     95for name in iter(old.keys()):
     96    if name in new:
     97        common[name] = 1
    4298
    4399for name in old:
    44100    if name not in common:
    45101        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))
    48105
    49106for name in new:
    50107    if name not in common:
    51108        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))
    54112
    55113for 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)
    57115        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
    59119        delta.append((d, name))
    60120
    61121delta.sort()
    62122delta.reverse()
     123if flag_timing:
     124    end_t3 = int(time.time() * 1e9)
    63125
    64 print "%-48s %7s %7s %+7s" % ("function", "old", "new", "delta")
     126print("%-48s %7s %7s %+7s" % ("function", "old", "new", "delta"))
    65127for 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))
     132print("-"*78)
    68133total="(add/remove: %s/%s grow/shrink: %s/%s up/down: %s/%s)%%sTotal: %s bytes"\
    69134    % (add, remove, grow, shrink, up, -down, up-down)
    70 print total % (" "*(80-len(total)))
     135print(total % (" "*(80-len(total))))
     136if 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  
    22# AWK script to check for missing help entries for config options
    33#
    4 # Copyright (C) 2006 Bernhard Fischer
     4# Copyright (C) 2006 Bernhard Reutner-Fischer
    55#
    66# This file is distributed under the terms and conditions of the
     
    3333END {
    3434    for (i = 0; i <= pos; i++) {
    35 #   printf("%s: help for #%i '%s' == %i\n", file[i], i, conf[i], help[i]);
     35#   printf("%s: help for #%i '%s' == %i\n", file[i], i, conf[i], help[i]);
    3636        if (help[i] == 0) {
    3737            printf("%s: No helptext for '%s'\n", file[i], conf[i]);
  • branches/2.2.9/mindi-busybox/scripts/checkstack.pl

    r1765 r2725  
    127127        $addr = "0x$addr";
    128128
    129         my $intro = "$addr $func [$file]:";
     129        # bbox: was: my $intro = "$addr $func [$file]:";
     130        my $intro = "$func [$file]:";
    130131        my $padlen = 56 - length($intro);
    131132        while ($padlen > 0) {
  • branches/2.2.9/mindi-busybox/scripts/cleanup_printf2puts

    r1765 r2725  
    44# printf("abc\n") -> puts("abc"). Beware of fprintf etc...
    55
    6 # BTW, gcc 4.1.2 already does tha same! Can't believe it...
     6# BTW, gcc 4.1.2 already does the same! Can't believe it...
    77
    88grep -lr 'printf\([^%%]*\\n"\)' . | grep '.[ch]$' | xargs -n1 \
  • branches/2.2.9/mindi-busybox/scripts/find_stray_common_vars

    r1765 r2725  
    44# This script will show all commons in *.o, sorted by size
    55
    6 find -name '*.o' \
     6find ! -path './scripts/*' -a ! -name built-in.o -a -name '*.o' \
    77| while read name; do
    88    b=`basename "$name"`
  • branches/2.2.9/mindi-busybox/scripts/kconfig/Makefile

    r1765 r2725  
    1818    $< Config.in
    1919
     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
     33MTIME_IS_COARSE:=@true
     34
    2035oldconfig: $(obj)/conf
    2136    $< -o Config.in
     37    $(MTIME_IS_COARSE) && sleep 1
    2238
    2339silentoldconfig: $(obj)/conf
    2440    $< -s Config.in
     41    $(MTIME_IS_COARSE) && sleep 1
    2542
    2643update-po-config: $(obj)/kxgettext
     
    4764randconfig: $(obj)/conf
    4865    $< -r Config.in
     66    $(MTIME_IS_COARSE) && sleep 1
    4967
    5068allyesconfig: $(obj)/conf
    5169    $< -y Config.in
     70    $(MTIME_IS_COARSE) && sleep 1
    5271
    5372allnoconfig: $(obj)/conf
    5473    $< -n Config.in
     74    $(MTIME_IS_COARSE) && sleep 1
    5575
    5676allmodconfig: $(obj)/conf
    5777    $< -m Config.in
     78    $(MTIME_IS_COARSE) && sleep 1
    5879
    5980defconfig: $(obj)/conf
     
    6485    $(Q)$< -D $(KBUILD_DEFCONFIG) Config.in
    6586endif
     87    $(MTIME_IS_COARSE) && sleep 1
    6688
    6789%_defconfig: $(obj)/conf
    6890    $(Q)$< -D $@ Config.in
     91    $(MTIME_IS_COARSE) && sleep 1
    6992
    7093# Help text used by make help
     
    118141subdir- += lxdialog
    119142
    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
     144HOST_EXTRACFLAGS += $(shell $(CONFIG_SHELL) $(srctree)/$(src)/check.sh $(HOSTCC) $(HOSTCFLAGS))
    128145
    129146# generated files seem to need this to find local include files
  • branches/2.2.9/mindi-busybox/scripts/kconfig/conf.c

    r1765 r2725  
    504504        case 's':
    505505            input_mode = ask_silent;
    506             valid_stdin = isatty(0) && isatty(1) && isatty(2);
     506            valid_stdin = isatty(0); //bbox: && isatty(1) && isatty(2);
    507507            break;
    508508        case 'd':
     
    606606    } while (conf_cnt);
    607607    if (conf_write(NULL)) {
    608         fprintf(stderr, _("\n*** Error during writing of the busybox configuration.\n\n"));
     608        fprintf(stderr, _("\n*** Error during writing of the configuration.\n\n"));
    609609        return 1;
    610610    }
  • branches/2.2.9/mindi-busybox/scripts/kconfig/confdata.c

    r1765 r2725  
    2323const char conf_def_filename[] = ".config";
    2424
    25 const char conf_defname[] = "scripts/defconfig";
     25const char conf_defname[] = "/dev/null"; //bbox
    2626
    2727const char *conf_confnames[] = {
     
    7171{
    7272    struct stat buf;
    73     static char fullname[PATH_MAX+1];
     73    static char *fullname = NULL;
    7474    char *env, *name;
    7575
     
    7777    env = getenv(SRCTREE);
    7878    if (env) {
     79        fullname = realloc(fullname, strlen(env) + strlen(name) + 2);
    7980        sprintf(fullname, "%s/%s", env, name);
    8081        if (!stat(fullname, &buf))
     
    405406                strftime(buf, sizeof(buf), "#define AUTOCONF_TIMESTAMP "
    406407                    "\"%Y-%m-%d %H:%M:%S\"\n", localtime(&now));
     408        } else { /* bbox */
     409            strcpy(buf, "#define AUTOCONF_TIMESTAMP \"\"\n");
    407410        }
    408411        fprintf(out_h, "/*\n"
     
    436439        } else if (!(sym->flags & SYMBOL_CHOICE)) {
    437440            sym_calc_value(sym);
    438 /* bbox: we want to all syms
     441/* bbox: we want to see all syms
    439442            if (!(sym->flags & SYMBOL_WRITE))
    440443                goto next;
     
    457460                        /* bbox */
    458461                        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);
    461464                    }
    462465                    break;
     
    472475                        /* bbox */
    473476                        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);
    476479                    }
    477480                    break;
     
    504507                    /* bbox */
    505508                    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);
    508511                }
    509512                break;
     
    516519                        /* bbox */
    517520                        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);
    520523                    }
    521524                    break;
     
    523526            case S_INT:
    524527                str = sym_get_string_value(sym);
     528                if (!str[0])
     529                    str = "0";
    525530                fprintf(out, "CONFIG_%s=%s\n", sym->name, str);
    526531                if (out_h) {
     
    528533                    /* bbox */
    529534                    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);
    532537                }
    533538                break;
  • branches/2.2.9/mindi-busybox/scripts/kconfig/gconf.c

    r1765 r2725  
    742742    GtkWidget *dialog;
    743743    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"
    746745        "For each option, a blank box indicates the feature is disabled, a\n"
    747746        "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  
    785785{
    786786    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
    787792    if (new_size > text_asize) {
    788793        new_size += START_STRSIZE - 1;
     
    842847static int yy_flex_strlen (yyconst char * );
    843848#endif
     849
     850//bbox: suppressing "defined but not used" warning
     851#define YY_NO_INPUT 1
    844852
    845853#ifndef YY_NO_INPUT
     
    22282236FILE *zconf_fopen(const char *name)
    22292237{
    2230     char *env, fullname[PATH_MAX+1];
     2238    char *env;
    22312239    FILE *f;
    22322240
     
    22352243        env = getenv(SRCTREE);
    22362244        if (env) {
     2245            char *fullname = alloca(strlen(env) + strlen(name) + 2);
    22372246            sprintf(fullname, "%s/%s", env, name);
    22382247            f = fopen(fullname, "r");
     
    23152324    return current_pos.file ? current_pos.file->name : "<none>";
    23162325}
    2317 
  • branches/2.2.9/mindi-busybox/scripts/kconfig/lxdialog/BIG.FAT.WARNING

    r1765 r2725  
    11This is NOT the official version of dialog.  This version has been
    2 significantly modified from the original.  It is for use by the Linux
    3 busybox configuration script.  Please do not bother Savio Lam with
    4 questions about this program.
     2significantly modified from the original.  It was used by the Linux
     3kernel configuration script, and subsequently adapted for busybox.
     4Please do not bother Savio Lam with questions about this program.
  • branches/2.2.9/mindi-busybox/scripts/kconfig/lxdialog/Makefile

    r1765 r2725  
    1313PHONY += dochecklxdialog
    1414$(obj)/dochecklxdialog:
    15     $(Q)$(CONFIG_SHELL) $(check-lxdialog) -check $(HOSTCC) $(HOST_LOADLIBES)
     15    $(Q)$(CONFIG_SHELL) $(check-lxdialog) -check $(HOSTCC) $(HOST_EXTRACFLAGS) $(HOST_LOADLIBES)
    1616
    1717hostprogs-y := lxdialog
  • branches/2.2.9/mindi-busybox/scripts/kconfig/lxdialog/check-lxdialog.sh

    r1765 r2725  
    55ldflags()
    66{
    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
    2216    exit 1
    2317}
     
    2620ccflags()
    2721{
    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
    2927        echo '-I/usr/include/ncurses -DCURSES_LOC="<ncurses.h>"'
    3028    elif [ -f /usr/include/ncurses/curses.h ]; then
     
    4341# Check if we can link to ncurses
    4442check() {
    45     echo "main() {}" | $cc -xc - -o $tmp 2> /dev/null
     43        $cc -xc - -o $tmp 2>/dev/null <<'EOF'
     44#include CURSES_LOC
     45main() {}
     46EOF
    4647    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
    5355    fi
    5456}
    5557
    5658usage() {
    57     printf "Usage: $0 [-check compiler options|-header|-library]\n"
     59    printf "Usage: $0 [-check compiler options|-ccflags|-ldflags compiler options]\n"
    5860}
    5961
    60 if [ $# == 0 ]; then
     62if [ $# -eq 0 ]; then
    6163    usage
    6264    exit 1
  • branches/2.2.9/mindi-busybox/scripts/kconfig/mconf.c

    r1765 r2725  
    116116"Menuconfig supports the use of alternate configuration files for\n"
    117117"those who, for various reasons, find it necessary to switch\n"
    118 "between different busybox configurations.\n"
     118"between different configurations.\n"
    119119"\n"
    120120"At the end of the main menu you will find two options.  One is\n"
     
    149149"Optional personality available\n"
    150150"------------------------------\n"
    151 "If you prefer to have all of the busybox options listed in a single\n"
     151"If you prefer to have all of the options listed in a single\n"
    152152"menu, rather than the default multimenu hierarchy, run the menuconfig\n"
    153153"with MENUCONFIG_MODE environment variable set to single_menu. Example:\n"
     
    194194load_config_help[] = N_(
    195195    "\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"
    197197    "configurations available on a single machine.\n"
    198198    "\n"
    199     "If you have saved a previous configuration in a file other than \n"
    200     "busybox's default, 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"
    201201    "to modify that configuration.\n"
    202202    "\n"
     
    208208save_config_help[] = N_(
    209209    "\n"
    210     "For various reasons, one may wish to keep different busybox\n"
     210    "For various reasons, one may wish to keep different\n"
    211211    "configurations available on a single machine.\n"
    212212    "\n"
     
    259259static char buf[4096], *bufptr = buf;
    260260static char input_buf[4096];
    261 static char filename[PATH_MAX+1] = ".config";
     261static const char filename[] = ".config";
    262262static char *args[1024], **argptr = args;
    263263static int indent;
     
    10711071        cprint_init();
    10721072        cprint("--yesno");
    1073         cprint(_("Do you wish to save your new busybox configuration?"));
     1073        cprint(_("Do you wish to save your new configuration?"));
    10741074        cprint("5");
    10751075        cprint("60");
     
    10801080        if (conf_write(NULL)) {
    10811081            fprintf(stderr, _("\n\n"
    1082                 "Error during writing of the busybox configuration.\n"
    1083                 "Your busybox configuration changes were NOT saved."
     1082                "Error during writing of the configuration.\n"
     1083                "Your configuration changes were NOT saved."
    10841084                "\n\n"));
    10851085            return 1;
    10861086        }
    10871087        printf(_("\n\n"
    1088             "*** End of busybox configuration.\n"
    1089             "*** Execute 'make' to build busybox or try 'make help'."
     1088            "*** End of configuration.\n"
     1089            "*** Execute 'make' to build the project or try 'make help'."
    10901090            "\n\n"));
    10911091    } else {
    10921092        fprintf(stderr, _("\n\n"
    1093             "Your busybox configuration changes were NOT saved."
     1093            "Your configuration changes were NOT saved."
    10941094            "\n\n"));
    10951095    }
  • branches/2.2.9/mindi-busybox/scripts/kconfig/menu.c

    r1765 r2725  
    395395    return menu;
    396396}
    397 
  • branches/2.2.9/mindi-busybox/scripts/kconfig/qconf.cc

    r1765 r2725  
    13001300void ConfigMainWindow::showIntro(void)
    13011301{
    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"
    13031303        "For each option, a blank box indicates the feature is disabled, a check\n"
    13041304        "indicates it is enabled, and a dot indicates that it is to be compiled\n"
     
    13171317void ConfigMainWindow::showAbout(void)
    13181318{
    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";
    13211320
    13221321    QMessageBox::information(this, "qconf", str);
  • branches/2.2.9/mindi-busybox/scripts/kconfig/util.c

    r1765 r2725  
    4545            fprintf(out, "\t%s\n", file->name);
    4646    }
    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");
    4854    fclose(out);
    4955    rename("..config.tmp", name);
     
    5258
    5359
    54 /* Allocate initial growable sting */
     60/* Allocate initial growable string */
    5561struct gstr str_new(void)
    5662{
     
    107113    return gs->s;
    108114}
    109 
  • branches/2.2.9/mindi-busybox/scripts/kconfig/zconf.hash.c_shipped

    r1765 r2725  
    229229  return 0;
    230230}
    231 
  • branches/2.2.9/mindi-busybox/scripts/kconfig/zconf.l

    r1765 r2725  
    5050{
    5151    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    }
    5256    if (new_size > text_asize) {
    5357        new_size += START_STRSIZE - 1;
     
    262266FILE *zconf_fopen(const char *name)
    263267{
    264     char *env, fullname[PATH_MAX+1];
     268    char *env;
    265269    FILE *f;
    266270
     
    269273        env = getenv(SRCTREE);
    270274        if (env) {
     275            char *fullname = alloca(strlen(env) + strlen(name) + 2);
    271276            sprintf(fullname, "%s/%s", env, name);
    272277            f = fopen(fullname, "r");
  • branches/2.2.9/mindi-busybox/scripts/kconfig/zconf.tab.c_shipped

    r1765 r2725  
    11041104     `yyls': related to locations.
    11051105
    1106      Refer to the stacks thru separate pointers, to allow yyoverflow
     1106     Refer to the stacks through separate pointers, to allow yyoverflow
    11071107     to reallocate them elsewhere.  */
    11081108
     
    21742174#include "symbol.c"
    21752175#include "menu.c"
    2176 
    2177 
  • branches/2.2.9/mindi-busybox/scripts/kconfig/zconf.y

    r1765 r2725  
    1414#define LKC_DIRECT_LINK
    1515#include "lkc.h"
    16 
    17 #include "zconf.hash.c"
    1816
    1917#define printd(mask, fmt...) if (cdebug & (mask)) printf(fmt)
     
    10098} if_entry menu_entry choice_entry
    10199
     100%{
     101#include "zconf.hash.c"
     102%}
     103
    102104%%
    103105input: stmt_list;
     
    472474    for_all_symbols(i, sym) {
    473475        sym_check_deps(sym);
    474         }
     476    }
    475477
    476478    sym_change_count = 1;
  • branches/2.2.9/mindi-busybox/scripts/mkconfigs

    r1765 r2725  
    2727#      - lines that use double-quotes must \\-escape-quote them
    2828
    29 config="$1"
    30 if [ $# -lt 1 ]
    31 then
    32     config=.config
    33 fi
     29config=.config
    3430
     31{
    3532echo "\
    3633#ifndef _BBCONFIGOPTS_H
     
    3936 * busybox configuration settings.
    4037 *
    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.
    4239 *
    4340 * This file is generated automatically by scripts/mkconfigs.
    4441 * Do not edit.
    45  *
    4642 */
    47 static const char *const bbconfig_config ="
     43static const char bbconfig_config[] ALIGN1 ="
    4844
    49 sed 's/\"/\\\"/g' $config | grep "^#\? \?CONFIG_" | awk '{print "\"" $0 "\\n\"";}'
     45grep '^#\? \?CONFIG_' "$config" \
     46| sed -e 's/\"/\\\"/g' -e 's/^/"/' -e 's/$/\\n"/'
    5047
    5148echo ";"
    52 echo "#endif /* _BBCONFIGOPTS_H */"
     49echo "#endif"
     50} >"$1"
     51
     52{
     53echo "\
     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 */
     64static const char bbconfig_config_bz2[] ALIGN1 = {"
     65
     66grep '^#\? \?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
     74echo "};"
     75echo "#endif"
     76} >"$2"
  • branches/2.2.9/mindi-busybox/scripts/mkmakefile

    r1765 r2725  
    3232Makefile:;
    3333
    34 \$(filter-out all Makefile,\$(MAKECMDGOALS)) %/:
     34\$(filter-out all Makefile,\$(MAKECMDGOALS)):
     35    \$(MAKE) -C \$(KERNELSRC) O=\$(KERNELOUTPUT) \$@
     36
     37%/:
    3538    \$(MAKE) -C \$(KERNELSRC) O=\$(KERNELOUTPUT) \$@
    3639EOF
  • branches/2.2.9/mindi-busybox/scripts/objsizes

    r1765 r2725  
    1717done
    1818printf "%9d %11d %9d %9d %s\n" $((t_text+t_data)) $t_text $t_data $t_bss "TOTAL"
    19 } | sort -r
     19} | env -uLANG -uLC_ALL sort -r
  • branches/2.2.9/mindi-busybox/scripts/showasm

    r821 r2725  
    22
    33# 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.
    55
    66# Dumb little utility function to print out the assembly dump of a single
     
    1919
    2020objdump -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  
    33debug=false
    44
     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
    539try() {
    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
     48check_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
     60check_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
     77EXE="$1"
     78CC="$2"
     79CFLAGS="$3"
     80LDFLAGS="$4"
     81O_FILES="$5"
     82A_FILES="$6"
     83LDLIBS="$7"
     84
     85# The --sort-section option is not supported by older versions of ld
     86SORT_SECTION=`check_cc "-Wl,--sort-section,alignment" ""`
     87
     88START_GROUP="-Wl,--start-group"
     89END_GROUP="-Wl,--end-group"
     90INFO_OPTS="-Wl,--warn-common -Wl,-Map,$EXE.map -Wl,--verbose"
     91
     92# gold may not support --sort-common (yet)
     93SORT_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.
     100GC_SECTIONS=`(
     101. ./.config
     102if test x"$CONFIG_STATIC" = x"y"; then
     103    check_libc_is_glibc "" "-Wl,--gc-sections"
     104else
     105    echo "-Wl,--gc-sections"
     106fi
     107)`
     108
     109# The --gc-sections option is not supported by older versions of ld
     110if test -n "$GC_SECTIONS"; then
     111    GC_SECTIONS=`check_cc "$GC_SECTIONS" ""`
     112fi
    11113
    12114# 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`
     115LDLIBS=`echo "$LDLIBS" | xargs -n1 | sort | uniq | xargs`
    15116
    16117# 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" "$@" \
     118echo "Trying libraries: $LDLIBS"
     119# "lib1 lib2 lib3" -> "-llib1 -llib2 -llib3"
     120l_list=`echo "$LDLIBS" | sed -e 's/ / -l/g' -e 's/^/-l/' -e 's/^-l$//'`
     121test "x$l_list" != "x" && l_list="$START_GROUP $l_list $END_GROUP"
     122try $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 \
    21129|| {
    22     echo "Failed: $* -Wl,--start-group $l_list -Wl,--end-group"
    23     cat busybox_ld.err
     130    echo "Failed: $l_list"
     131    cat $EXE.out
    24132    exit 1
    25133}
     
    27135# Now try to remove each lib and build without it.
    28136# Stop when no lib can be removed.
    29 while test "$BBOX_LIB_LIST"; do
    30     $debug && echo "Trying libraries: $BBOX_LIB_LIST"
     137while test "$LDLIBS"; do
     138    $debug && echo "Trying libraries: $LDLIBS"
    31139    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"
    34144    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"
    36146    $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
    41159    else
    42         echo "Library $one is needed"
     160        echo " Library $one is needed, can't exclude it (yet)"
     161        last_needed=true
    43162    fi
    44163    done
    45164    # All libs were needed, can't remove any
    46165    $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
    51171done
    52172
    53173# 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"
     174echo "Final link with: ${LDLIBS:-<none>}"
     175l_list=`echo "$LDLIBS" | sed -e 's/ / -l/g' -e 's/^/-l/' -e 's/^-l$//'`
     176test "x$l_list" != "x" && l_list="$START_GROUP $l_list $END_GROUP"
    57177# --verbose gives us gobs of info to stdout (e.g. linker script used)
    58178if ! 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    }
    60191else
    61192    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):
    63194    #  .rodata         : { *(.rodata SORT_BY_ALIGNMENT(.rodata.*) .gnu.linkonce.r.*) }
    64195    #  *(.data SORT_BY_ALIGNMENT(.data.*) .gnu.linkonce.d.*)
    65196    #  *(.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    }
     212fi
     213
     214. ./.config
     215
     216sharedlib_dir="0_lib"
     217
     218if 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"
     247fi
     248
     249if 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"
     266fi
     267
     268if 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 "\
     277void lbb_prepare(const char *applet, char **argv);
     278int $main(int argc, char **argv);
     279
     280int 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
     304fi
     305
     306# libbusybox.so is needed only for -lbusybox at link time,
     307# it is not needed at runtime. Deleting to reduce confusion.
     308rm "$sharedlib_dir"/libbusybox.so 2>/dev/null
     309exit 0 # or else we may confuse make
Note: See TracChangeset for help on using the changeset viewer.