Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
correct use of AC_LINK_IFELSE
Browse files Browse the repository at this point in the history
this macro does not know anything about the names of libs to test,
so it actually needs to be called with modified LDFLAGS.

So this is a lesson to learn about other C++ libraries...
  • Loading branch information
dimpase committed May 22, 2019
1 parent b986753 commit d7ec6ab
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion build/pkgs/ntl/spkg-configure.m4
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,16 @@ SAGE_SPKG_CONFIGURE([ntl], [
if test x$sage_spkg_install_ntl != xyes; then
AC_CHECK_HEADER([NTL/ZZ.h], [], [sage_spkg_install_ntl=yes])
AC_MSG_CHECKING([whether we can link a program using NTL])
NTL_SAVED_LDFLAGS=$LDFLAGS
LDFLAGS="$LDFLAGS -lntl"
AC_LINK_IFELSE([
AC_LANG_PROGRAM([[#include <NTL/ZZ.h>]],
[[NTL::ZZ a;]]
)], [AC_MSG_RESULT([yes])], [
)], [LIBS=$LIBS -lntl]
[AC_MSG_RESULT([yes])], [
AC_MSG_RESULT([no]); sage_spkg_install_ntl=yes
])
LDFLAGS=$NTL_SAVED_LDFLAGS
AC_MSG_CHECKING([NTL version >= ]SAGE_NTL_VERSION_MAJOR[.]SAGE_NTL_VERSION_MINOR)
AC_RUN_IFELSE([
AC_LANG_PROGRAM(
Expand Down

0 comments on commit d7ec6ab

Please sign in to comment.