diff --git a/GNUmakefile.in b/GNUmakefile.in index f1a61c0cb0..5e1c3bf88e 100644 --- a/GNUmakefile.in +++ b/GNUmakefile.in @@ -71,6 +71,7 @@ BUILD_GMP = @BUILD_GMP@ GMP_CPPFLAGS = @GMP_CPPFLAGS@ GMP_LDFLAGS = @GMP_LDFLAGS@ GMP_LIBS = @GMP_LIBS@ +GMP_PREFIX = @GMP_PREFIX@ BUILD_ZLIB = @BUILD_ZLIB@ ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@ diff --git a/Makefile.rules b/Makefile.rules index dc619819f4..b099b0e44d 100644 --- a/Makefile.rules +++ b/Makefile.rules @@ -642,6 +642,7 @@ install-sysinfo: SYSINFO_LDFLAGS = $(ABI_CFLAGS) install-sysinfo: SYSINFO_LIBS = install-sysinfo: SYSINFO_GAP = $(libdir)/gap/gap install-sysinfo: SYSINFO_GAC = $(bindir)/gac +install-sysinfo: GMP_PREFIX = install-sysinfo: $(INSTALL) -d -m 0755 $(DESTDIR)$(libdir)/gap @echo "$$sysinfo_gap" > $(DESTDIR)$(libdir)/gap/sysinfo.gap @@ -901,6 +902,11 @@ GAP_LIBS="$(SYSINFO_LIBS)" # Extra flags for use by `gac` GAC_CFLAGS="$(GAC_CFLAGS)" GAC_LDFLAGS="$(GAC_LDFLAGS)" + +# For packages: the search prefix for GMP used by GAP +# (this is left empty when none was specified, or when +# GAP is installed via 'make install') +GMP_PREFIX="$(GMP_PREFIX)" endef export sysinfo_gap diff --git a/configure.ac b/configure.ac index 78e3912b24..705c74431b 100644 --- a/configure.ac +++ b/configure.ac @@ -531,6 +531,7 @@ BUILD_GMP=no GMP_CPPFLAGS= GMP_LDFLAGS= GMP_LIBS="-lgmp" +GMP_PREFIX= AS_CASE([$with_gmp], [builtin],[ # user explicitly requested to use builtin GMP @@ -543,6 +544,7 @@ AS_CASE([$with_gmp], [system],[with_gmp=yes], dnl supported for backwards compatibility with old build system [yes],[], [*],[ + GMP_PREFIX="${with_gmp}" GMP_CPPFLAGS="-I${with_gmp}/include" GMP_LDFLAGS="-L${with_gmp}/lib" ] @@ -565,6 +567,7 @@ AS_IF([test $BUILD_GMP = no], # Use bundled GMP if requested AS_IF([test x$BUILD_GMP = xyes],[ BUILD_GMP=yes + GMP_PREFIX='${abs_builddir}/extern/install/gmp' GMP_CPPFLAGS='-I${abs_builddir}/extern/install/gmp/include' GMP_LDFLAGS='${abs_builddir}/extern/install/gmp/lib/libgmp.la' GMP_LIBS= @@ -574,6 +577,7 @@ AC_SUBST([BUILD_GMP]) AC_SUBST([GMP_CPPFLAGS]) AC_SUBST([GMP_LDFLAGS]) AC_SUBST([GMP_LIBS]) +AC_SUBST([GMP_PREFIX]) dnl Find zlib