Skip to content

Commit

Permalink
Export GMP_PREFIX in sysinfo.gap for package build systems
Browse files Browse the repository at this point in the history
  • Loading branch information
fingolfin committed Oct 14, 2022
1 parent 98f6ae0 commit 6a63779
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions GNUmakefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -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@
Expand Down
6 changes: 6 additions & 0 deletions Makefile.rules
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down
4 changes: 4 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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"
]
Expand All @@ -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=
Expand All @@ -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
Expand Down

0 comments on commit 6a63779

Please sign in to comment.