From: Antoine Leca Date: Mon, 21 Jan 2013 14:30:17 +0000 (+0000) Subject: GNU tools: improvements to fetching process X-Git-Tag: v3.2.1~58 X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/zpipe.c?a=commitdiff_plain;h=866355d930880b027077f5698e5e16fff3ecc243;p=minix.git GNU tools: improvements to fetching process - Do not run the fetch.sh script every time - Do not run the configure script with MKUPDATE=yes (build.sh -u) - The fetched GNU source are hidden from `git status` - With CLEANFETCHED=yes, `nbmake -C tools cleandir` will remove the fetched GNU source and return the MINIX tree to its pristine state. - Avoid (harmless) message when building in parallel, about find running against an inexistant path Notice that the GNU tools are "installed" on every run, even with MKUPDATE=yes; this is a feature of the NetBSD build system, because in case of changes in dependencies it is impossible to know them. See commit 1.27 2004-06-12 of tools/Makefile.gnuhost in NetBSD's src/ The downloaded tarballs are not removed with CLEANFETCHED: they are supposed to be unmodified, and the exact name is not known to the Makefile's, since it is engraved in each fetch.sh script (and we do not want to have the same information in several places.) --- diff --git a/tools/Makefile.gnuhost b/tools/Makefile.gnuhost old mode 100644 new mode 100755 index a87363bb6..3cc47a0c3 --- a/tools/Makefile.gnuhost +++ b/tools/Makefile.gnuhost @@ -24,7 +24,21 @@ HOST_CFLAGS+=-O2 -no-cpp-precomp .endif MAKE_PROGRAM?= ${MAKE} -GNUHOSTDIST?= ${.CURDIR}/../../external/gpl3/gcc/dist/ +GNUHOSTDIST?= ${.CURDIR}/../../gnu/dist/${MODULE} + +# AL - MINIX /usr/src does not have the sources for the GNU utilities +# in-tree (they are much bigger than Minix itself!) So to successfully +# use them while cross-compiling, we have to fetch them. The success of +# that operation is indicated by the presence of a .gitignore file in +# the corresponding ${.CURDIR}, which also conveniently hides from git. +.if exists(${GNUHOSTDIST:H}/fetch.sh) +${GNUHOSTDIST:H}/.gitignore: ${GNUHOSTDIST:H}/fetch.sh + ${HOST_SH} ${GNUHOSTDIST:H}/fetch.sh + @test -e ${GNUHOSTDIST}/configure + @echo "${MODULE:U${.CURDIR:T:C,^gcc[0-9]*$,gcc,}}-*.tar.*z*" > $@ + @echo ${GNUHOSTDIST:T} >> $@ +_gnu_get_src=${GNUHOSTDIST:H}/.gitignore +.endif # exists(GNUHOSTDIST:H/fetch.sh) on MINIX FIND_ARGS+= \! \( -type d \( \ -name 'CVS' -o \ @@ -35,24 +49,11 @@ FIND_ARGS+= \! \( -type d \( \ -name 'tests*' \ \) -prune \) -_GNU_GET_SCRIPTS:= \ - external/gpl3/gcc/fetch.sh \ - external/gpl3/binutils/fetch.sh \ - gnu/dist/fetch.sh \ - external/lgpl2/mpc/fetch.sh \ - external/lgpl3/gmp/fetch.sh \ - external/lgpl3/mpfr/fetch.sh - -_gnu_get_src: ${_GNU_GET_SCRIPTS} -.for name in ${_GNU_GET_SCRIPTS} -${name}: - @${HOST_SH} ${.CURDIR}/../../${name} -.endfor - # Do this "find" only if actually building something. +# AL - ... and on MINIX, if the source has already being fetched .if (${USETOOLS} == "yes") && empty(.MAKEFLAGS:M-V*) && \ (make(all) || make(realall) || (!make(clean) && !make(cleandir) && !make(obj))) && \ - !defined(_GNU_CFGSRC) + !defined(_GNU_CFGSRC) && exists(${GNUHOSTDIST}/configure) _GNU_CFGSRC!= find ${GNUHOSTDIST} ${FIND_ARGS} \ -type f \( -name 'config*' -o -name '*.in' \) -print @@ -121,7 +122,8 @@ configure_cleanup: configure_cleanup=configure_cleanup .endif -.configure_done: _gnu_get_src .WAIT ${_GNU_CFGSRC} ${.CURDIR}/Makefile ${configure_cleanup} +# AL For MINIX, fetch the source if not there +.configure_done: ${_gnu_get_src} .WAIT ${_GNU_CFGSRC} ${.CURDIR}/Makefile ${configure_cleanup} @mkdir build 2>/dev/null || true @(cd build && ${CONFIGURE_ENV} ${HOST_SH} ${GNUHOSTDIST}/configure ${CONFIGURE_ARGS}) @echo ${BUILD_PLATFORM} > $@ @@ -150,4 +152,12 @@ clean: clean.gnu clean.gnu: -rm -r -f .*_done build +# AL - Special target for MINIX, reset the source tree as pristine +.if ${CLEANFETCHED:Uno} == "yes" && exists(${GNUHOSTDIST:H}/fetch.sh) +cleandir: clean_gnu_src +clean_gnu_src: + -rm -r -f ${GNUHOSTDIST} ${GNUHOSTDIST:H}/.gitignore +# XXX CHECKME: could have used the content of .gitignore as well? +.endif # CLEANFETCHED == yes + .include