Skip to content

Commit

Permalink
sysinfo.gap: add GAP and GAC variables
Browse files Browse the repository at this point in the history
... and use them in `bin/BuildPackages.sh` and `etc/Makefile.gappkg`.

This strengthen the purpose of sysinfo.gap: that in order to build a
package (or anything that wants to interact with GAP), you just point it
at the sysinfo.gap of the target GAP installation, and it extracts all
it needs from there, including the location of a GAP and GAC executable.

Note that sysinfo.gap can be directly included from POSIX shell scripts
and Makefiles, and it is also fairly easy to parse for other systems.
  • Loading branch information
fingolfin committed Jun 17, 2020
1 parent 0ceac95 commit 946cde4
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 7 deletions.
3 changes: 3 additions & 0 deletions Makefile.rules
Original file line number Diff line number Diff line change
Expand Up @@ -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)"
Expand Down
20 changes: 16 additions & 4 deletions bin/BuildPackages.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 ;;
Expand All @@ -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;
Expand Down Expand Up @@ -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
Expand Down
3 changes: 0 additions & 3 deletions etc/Makefile.gappkg
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 946cde4

Please sign in to comment.