diff --git a/Makefile.rules b/Makefile.rules index f3de568b23..07103a78df 100644 --- a/Makefile.rules +++ b/Makefile.rules @@ -724,6 +724,9 @@ GAP_KERNEL_MINOR_VERSION=$(GAP_KERNEL_MINOR_VERSION) GAP_BIN_DIR="$(abs_builddir)" GAP_LIB_DIR="$(abs_srcdir)" +GAP="$(abs_builddir)/bin/gap.sh" +GAC="$(abs_builddir)/gac" + GAP_CC="$(CC)" GAP_CXX="$(CXX)" GAP_CFLAGS="$(GAP_CFLAGS)" diff --git a/bin/BuildPackages.sh b/bin/BuildPackages.sh index 7ae2b734e4..b1269bdcaa 100755 --- a/bin/BuildPackages.sh +++ b/bin/BuildPackages.sh @@ -48,8 +48,8 @@ while [[ "$#" -ge 1 ]]; do --with-gaproot=*) GAPROOT=${option#--with-gaproot=}; ;; --parallel) PARALLEL=yes; ;; - --with-gap) GAP="$1"; shift ;; - --with-gap=*) GAP=${option#--with-gap=}; ;; + --with-gap) GAP_EXE="$1"; shift ;; + --with-gap=*) GAP_EXE=${option#--with-gap=}; ;; --no-color) COLORS=no ;; --color) COLORS=yes ;; @@ -63,8 +63,6 @@ while [[ "$#" -ge 1 ]]; do esac done -GAP="${GAP:-$GAPROOT/bin/gap.sh}" - if [ "x$PARALLEL" = "xyes" ]; then export MAKEFLAGS="${MAKEFLAGS:--j3}" fi; @@ -110,6 +108,20 @@ fi # read in sysinfo source "$GAPROOT/sysinfo.gap" +# determine the GAP executable to call: +# - if the user specified one explicitly via the `--gap` option, then +# GAP_EXE is set and we should use that +# - otherwise if sysinfo.gap set the GAP variable, use that +# - otherwise fall back to $GAPROOT/bin/gap.sh +if [[ -n $GAP_EXE ]] +then + GAP="$GAP_EXE" +else + GAP="${GAP:-$GAPROOT/bin/gap.sh}" +fi + + + # detect whether GAP was built in 32bit mode # TODO: once all packages have adapted to the new build system, # this should no longer be necessary, as package build systems should diff --git a/etc/Makefile.gappkg b/etc/Makefile.gappkg index 30351af17a..e6c94e1fe6 100644 --- a/etc/Makefile.gappkg +++ b/etc/Makefile.gappkg @@ -50,9 +50,6 @@ endif KEXT_BINARCHDIR = bin/$(GAParch) KEXT_SO = $(KEXT_BINARCHDIR)/$(KEXT_NAME).so -GAP = $(GAPPATH)/gap -GAC = $(GAPPATH)/gac - # override KEXT_RECONF if your package needs a different invocation # for reconfiguring (e.g. `./config.status --recheck` for autoconf) ifdef KEXT_USE_AUTOCONF