From adb8d69984ee2f8bbb1011390decbeb5bbb67b49 Mon Sep 17 00:00:00 2001 From: Antoine Leca Date: Mon, 29 Aug 2016 13:48:31 +0200 Subject: [PATCH] Improve the process for GNU tools Do not run configure on each run when MKUPDATE=yes The .WAIT serialization instruction between fetching and other configure sources was raising a new run of configure at each compilation. Avoid it by using two rules. Change-Id: Ie24950ccbb5c5067f3c1ea57b7bd8294e4c9445e --- tools/Makefile.gnuhost | 16 ++++++++++------ tools/binutils/Makefile | 2 +- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/tools/Makefile.gnuhost b/tools/Makefile.gnuhost index fe2a0c17f..bf17145f0 100644 --- a/tools/Makefile.gnuhost +++ b/tools/Makefile.gnuhost @@ -28,17 +28,21 @@ GNUHOSTDIST?= ${.CURDIR}/../../gnu/dist/${MODULE} .if defined(__MINIX) # 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. +# in-tree, for licensing reasons. 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 +# source parent directory, which also conveniently hides from git. .if exists(${GNUHOSTDIST:H}/fetch.sh) ${GNUHOSTDIST:H}/.gitignore: ${GNUHOSTDIST:H}/fetch.sh SED=${TOOL_SED} ${HOST_SH} ${GNUHOSTDIST:H}/fetch.sh @test -e ${GNUHOSTDIST}/configure @echo "${MODULE:U${.CURDIR:T}:C,gcc[0-9]*,gcc,:C,gmake*,make,}-*.tar.*z*" >> $@ @echo ${GNUHOSTDIST:T} >> $@ -_gnu_get_src=${GNUHOSTDIST:H}/.gitignore + +# Do the fecthing as an extra step, to force serialization +.fetch_done: ${GNUHOSTDIST:H}/.gitignore + @touch $@ +fetch_done=.fetch_done .endif # exists(GNUHOSTDIST:H/fetch.sh) on MINIX # AL - Special target for MINIX, reset the source tree as pristine @@ -134,7 +138,7 @@ configure_cleanup=configure_cleanup .endif # AL For MINIX, fetch the source if not there -.configure_done: ${_gnu_get_src} .WAIT ${_GNU_CFGSRC} ${.CURDIR}/Makefile ${configure_cleanup} +.configure_done: ${fetch_done} ${_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} > $@ diff --git a/tools/binutils/Makefile b/tools/binutils/Makefile index 79fa6a822..5f3abfefa 100644 --- a/tools/binutils/Makefile +++ b/tools/binutils/Makefile @@ -16,7 +16,7 @@ CONFIGURE_ARGS= --target=${MACHINE_GNU_PLATFORM} --disable-nls \ --disable-werror \ ${BRANDING} -.if !defined(__MINIX) +.if !defined(__MINIX) || ${MKUPDATE:Uno} == "yes" build/gas/m68k-parse.c: ${GNUHOSTDIST}/gas/m68k-parse.c .else # MINIX: LSC: Make sure we trigger the fetch rule