Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve buildsystem by exporting GMP_PREFIX in sysinfo.gap for package build systems #5079

Merged
merged 1 commit into from
Oct 4, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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