isl_sample_piplib.c \
isl_sample_piplib.h \
isl_piplib.c
-libisl_la_LIBADD = @PIPLIB_LIBS@ -lgmp
+libisl_la_LIBADD = @PIPLIB_LIBS@ @GMP_LIBS@
libisl_la_LDFLAGS = -version-info @versioninfo@ \
@PIPLIB_LDFLAGS@ @GMP_LDFLAGS@
libisl_la_CPPFLAGS = $(INCLUDES) @PIPLIB_CPPFLAGS@ @GMP_CPPFLAGS@
isl_test_CPPFLAGS = $(INCLUDES) @GMP_CPPFLAGS@
isl_test_LDFLAGS = @GMP_LDFLAGS@
-isl_test_LDADD = libisl.la -lgmp
+isl_test_LDADD = libisl.la @GMP_LIBS@
isl_polyhedron_sample_CPPFLAGS = $(INCLUDES) @GMP_CPPFLAGS@
isl_polyhedron_sample_LDADD = libisl.la
isl_pip_CPPFLAGS = $(INCLUDES) @GMP_CPPFLAGS@
isl_pip_LDFLAGS = @GMP_LDFLAGS@
-isl_pip_LDADD = libisl.la -lgmp
+isl_pip_LDADD = libisl.la @GMP_LIBS@
isl_pip_SOURCES = \
pip.c
isl_bound_CPPFLAGS = $(INCLUDES) @GMP_CPPFLAGS@
isl_bound_LDFLAGS = @GMP_LDFLAGS@
-isl_bound_LDADD = libisl.la -lgmp
+isl_bound_LDADD = libisl.la @GMP_LIBS@
isl_bound_SOURCES = \
bound.c
isl_polyhedron_minimize_CPPFLAGS = $(INCLUDES) @GMP_CPPFLAGS@
isl_polyhedron_minimize_LDFLAGS = @GMP_LDFLAGS@
-isl_polyhedron_minimize_LDADD = libisl.la -lgmp
+isl_polyhedron_minimize_LDADD = libisl.la @GMP_LIBS@
isl_polyhedron_minimize_SOURCES = \
polyhedron_minimize.c
AX_CREATE_STDINT_H(include/isl/stdint.h)
-AX_SUBMODULE(gmp,system,system)
+AX_SUBMODULE(gmp,system|build,system)
AC_SUBST(GMP_CPPFLAGS)
AC_SUBST(GMP_LDFLAGS)
-if test "x$with_gmp_prefix" != "x"; then
- isl_configure_args="$isl_configure_args --with-gmp=$with_gmp_prefix"
- GMP_CPPFLAGS="-I$with_gmp_prefix/include"
- GMP_LDFLAGS="-L$with_gmp_prefix/lib"
-fi
+AC_SUBST(GMP_LIBS)
+case "$with_gmp" in
+system)
+ if test "x$with_gmp_prefix" != "x"; then
+ isl_configure_args="$isl_configure_args --with-gmp=$with_gmp_prefix"
+ GMP_CPPFLAGS="-I$with_gmp_prefix/include"
+ GMP_LDFLAGS="-L$with_gmp_prefix/lib"
+ fi
+ GMP_LIBS=-lgmp
+ ;;
+build)
+ GMP_CPPFLAGS="-I$gmp_srcdir -I$with_gmp_builddir"
+ GMP_LIBS="$with_gmp_builddir/libgmp.la"
+ ;;
+esac
SAVE_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$GMP_CPPFLAGS $CPPFLAGS"
need_get_memory_functions=false