Changeset 2225

Show
Ignore:
Timestamp:
03/21/07 23:01:31 (2 years ago)
Author:
tg
Message:

if a build system has a non-GNU make, or a too old gmake, just
build our own

tested on MirBSD odem.66h.42h.de 10 Kv#10n11-20070318 GENERIC#1014 i386
without gmake installed

if this is not working for you for the one or other reason,
please drop me a private mail with a detailled error description.

this procedure was explicitly ok'd by wbx@

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/freewrt/Makefile

    r2222 r2225  
    8484                ln -s $$(which which) lbin/which; \ 
    8585        fi 
    86         @if lbin/which gmake >/dev/null 2>&1; then \ 
    87                 ln -s $$(lbin/which gmake) lbin/gmake; \ 
    88         else \ 
    89                 ln -s $$(lbin/which make) lbin/gmake; \ 
    90         fi 
    9186        @if ! lbin/which md5sum >/dev/null 2>&1; then \ 
    9287                cp scripts/md5sum.bsd lbin/md5sum; \ 
     
    126121            printf '%s\n%s\nwq\n' ",g#$$TOPDIR#s##\$${TOPDIR}#g" \ 
    127122            "1s#^.*\$$#TOPDIR:=$$TOPDIR#" | ed -s lbin/prereq.mk 
    128         @env NO_ERROR=${NO_ERROR} bash scripts/scan-tools.sh 
     123        @env NO_ERROR=${NO_ERROR} BASH="$$(lbin/which bash)" \ 
     124            CC='${CC}' CPPFLAGS='${CPPFLAGS}' \ 
     125            bash ${_PX} scripts/scan-tools.sh 
    129126        @cc='${CC}'; if test x"$$cc" = x"gcc"; then \ 
    130127                ln -s $$(lbin/which "$$cc") lbin/gcc; \ 
  • trunk/freewrt/scripts/scan-tools.sh

    r2222 r2225  
    3838shopt -s extglob 
    3939topdir=$(pwd) 
    40 export PATH=$topdir/lbin:$PATH 
     40opath=$PATH 
    4141out=0 
    4242 
     
    100100 
    101101set +e 
     102 
     103if [[ ! -e $topdir/lbin/gmake ]]; then 
     104        for f in $topdir/tools_build/gmake/make \ 
     105            "$($topdir/lbin/which gmake)" "$($topdir/lbin/which make)"; do 
     106                [[ -e $f ]] || continue 
     107                if [[ $f = $topdir/tools_build/gmake/make ]]; then 
     108                        install -c -s -m 555 $f $topdir/lbin/gmake 
     109                else 
     110                        ln -s "$f" $topdir/lbin/gmake 
     111                fi 
     112                break 
     113        done 
     114fi 
     115X=$($topdir/lbin/gmake --version 2>&1 | grep '^GNU Make' | \ 
     116    sed -e 's/GNU Make //' -e 's/version //' -e 's/, by.*$//') 
     117[[ $X = +([0-9]).+([0-9]).+([0-9]) ]] && X=${X%.*} 
     118if [[ $X = +([0-9]).+([0-9]) ]]; then 
     119        let major=${X%.*} 
     120        let minor=${X#*.} 
     121elif [[ $X = +([0-9]).+([0-9])beta* ]]; then 
     122        # Beta version is not "the real thing" 
     123        let major=${X%.*} 
     124        X=${X%beta*} 
     125        let minor=${X#*.}-1 
     126else 
     127        let major=0 
     128fi 
     129if (( (major < 3) || ((major == 3) && (minor < 81)) )); then 
     130        echo "---> building GNU make 3.81" 
     131        rm -rf $topdir/tools_build/gmake $topdir/lbin/gmake 
     132        set -e 
     133        mkdir -p $topdir/tools_build/gmake 
     134        cd $topdir/tools_build/gmake 
     135        env CPPFLAGS="$CPPFLAGS -Dstrcmpi=strcasecmp" \ 
     136            CFLAGS="$(grep '^HOSTCFLAGS' $topdir/lbin/prereq.mk | \ 
     137                sed 's/HOSTCFLAGS:=//')" \ 
     138            $BASH $topdir/tools/gmake/configure \ 
     139            --program-prefix=g \ 
     140            --disable-dependency-tracking \ 
     141            --disable-nls \ 
     142            --without-libiconv-prefix \ 
     143            --without-libintl-prefix 
     144        make all 
     145        install -c -s -m 555 make $topdir/lbin/gmake 
     146        set +e 
     147        cd $topdir/lbin; ls -l gmake 
     148        cd $topdir/lbin/tmp 
     149fi 
     150export PATH=$topdir/lbin:$PATH 
     151 
    102152cat >Makefile <<'EOF' 
    103153include ${TOPDIR}/lbin/prereq.mk 
     
    124174        echo "$X" | sed 's/^/| /' 
    125175        echo Cannot compile a simple test programme. 
    126         echo You must install GNU make and a host C compiler, 
     176        echo You must install a host make and C compiler, 
    127177        echo usually GCC, to proceed. 
    128178        echo 
     
    182232    printf '/^HOSTCFLAGS/s/$/ -fno-tree-vrp/\nwq\n' | ed -s ../prereq.mk 
    183233 
    184 X=$(gmake --version 2>&1 | grep '^GNU Make' | \ 
    185     sed -e 's/GNU Make //' -e 's/version //' -e 's/, by.*$//') 
    186 [[ $X = +([0-9]).+([0-9]).+([0-9]) ]] && X=${X%.*} 
    187 if [[ $X = +([0-9]).+([0-9]) ]]; then 
    188         let major=${X%.*} 
    189         let minor=${X#*.} 
    190 elif [[ $X = +([0-9]).+([0-9])beta* ]]; then 
    191         # Beta version is not "the real thing" 
    192         let major=${X%.*} 
    193         X=${X%beta*} 
    194         let minor=${X#*.}-1 
    195 else 
    196         echo Cannot determine GNU make version number. 
    197         echo 
    198         out=1 
    199 fi 
    200 if (( (major < 3) || ((major == 3) && (minor < 81)) )); then 
    201         echo GNU make $major.$minor too old. 
    202         echo Please install GNU make 3.81 or higher to continue. 
    203         echo 
    204         out=1 
    205 fi 
    206  
    207234if ! which flex >/dev/null 2>&1; then 
    208235        echo You must install flex to continue. 
  • trunk/freewrt/tools/gmake/Makefile.in

    r2223 r2225  
    133133ETAGS = etags 
    134134CTAGS = ctags 
    135 DIST_SUBDIRS = glob config po doc w32 
     135DIST_SUBDIRS = glob #config po doc w32 
    136136DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) 
    137137distdir = $(PACKAGE)-$(VERSION) 
     
    262262@WINDOWSENV_TRUE@W32INC = -I $(top_srcdir)/w32/include 
    263263@WINDOWSENV_TRUE@W32LIB = -Lw32 -lw32 
    264 SUBDIRS = glob config po doc $(MAYBE_W32) 
     264SUBDIRS = glob #config po doc $(MAYBE_W32) 
    265265@USE_CUSTOMS_FALSE@remote = remote-stub.c 
    266266@USE_CUSTOMS_TRUE@remote = remote-cstms.c 
     
    276276make_LDADD = @LIBOBJS@ @ALLOCA@ $(GLOBLIB) @GETLOADAVG_LIBS@ @LIBINTL@ \ 
    277277        $(am__append_1) 
    278 man_MANS = make.1 
     278man_MANS = #make.1 
    279279AM_CPPFLAGS = $(GLOBINC) $(am__append_2) 
    280280 
     
    330330am--refresh: 
    331331        @: 
    332 $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps) 
    333         @for dep in $?; do \ 
    334           case '$(am__configure_deps)' in \ 
    335             *$$dep*) \ 
    336               echo ' cd $(srcdir) && $(AUTOMAKE) --gnu '; \ 
    337               cd $(srcdir) && $(AUTOMAKE) --gnu  \ 
    338                 && exit 0; \ 
    339               exit 1;; \ 
    340           esac; \ 
    341         done; \ 
    342         echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu  Makefile'; \ 
    343         cd $(top_srcdir) && \ 
    344           $(AUTOMAKE) --gnu  Makefile 
    345332.PRECIOUS: Makefile 
    346333Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status 
     
    357344        $(SHELL) ./config.status --recheck 
    358345 
    359 $(top_srcdir)/configure:  $(am__configure_deps) 
    360         cd $(srcdir) && $(AUTOCONF) 
    361 $(ACLOCAL_M4):  $(am__aclocal_m4_deps) 
    362         cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) 
    363  
    364346config.h: stamp-h1 
    365347        @if test ! -f $@; then \ 
     
    371353        @rm -f stamp-h1 
    372354        cd $(top_builddir) && $(SHELL) ./config.status config.h 
    373 $(srcdir)/config.h.in:  $(am__configure_deps)  
    374         cd $(top_srcdir) && $(AUTOHEADER) 
    375         rm -f stamp-h1 
    376         touch $@ 
    377355 
    378356distclean-hdr: 
  • trunk/freewrt/tools/gmake/configure

    r2223 r2225  
    1378713787 
    1378813788# Specify what files are to be created. 
    13789                                                             ac_config_files="$ac_config_files Makefile glob/Makefile po/Makefile.in config/Makefile doc/Makefile w32/Makefile
     13789                                                            ac_config_files="$ac_config_files Makefile glob/Makefile
    1379013790 
    1379113791 
     
    1437814378  "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; 
    1437914379  "glob/Makefile" ) CONFIG_FILES="$CONFIG_FILES glob/Makefile" ;; 
    14380   "po/Makefile.in" ) CONFIG_FILES="$CONFIG_FILES po/Makefile.in" ;; 
    14381   "config/Makefile" ) CONFIG_FILES="$CONFIG_FILES config/Makefile" ;; 
    14382   "doc/Makefile" ) CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;; 
    14383   "w32/Makefile" ) CONFIG_FILES="$CONFIG_FILES w32/Makefile" ;; 
    1438414380  "depfiles" ) CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; 
    1438514381  "default-1" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default-1" ;; 
  • trunk/freewrt/tools/gmake/glob/Makefile.in

    r2223 r2225  
    210210.SUFFIXES: 
    211211.SUFFIXES: .c .o .obj 
    212 $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps) 
    213         @for dep in $?; do \ 
    214           case '$(am__configure_deps)' in \ 
    215             *$$dep*) \ 
    216               cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ 
    217                 && exit 0; \ 
    218               exit 1;; \ 
    219           esac; \ 
    220         done; \ 
    221         echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  glob/Makefile'; \ 
    222         cd $(top_srcdir) && \ 
    223           $(AUTOMAKE) --foreign  glob/Makefile 
    224212.PRECIOUS: Makefile 
    225213Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status 
     
    233221 
    234222$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) 
    235         cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh 
    236  
    237 $(top_srcdir)/configure:  $(am__configure_deps) 
    238         cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh 
    239 $(ACLOCAL_M4):  $(am__aclocal_m4_deps) 
    240223        cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh 
    241224