diff --git a/src/CHANGELOG b/src/CHANGELOG index 64a4a3501..9d1aee01a 100755 --- a/src/CHANGELOG +++ b/src/CHANGELOG @@ -171,6 +171,11 @@ ECL 11.1.2 - SOCKET-MAKE-STREAM now accepts an :ELEMENT-TYPE argument. + - When --enable-rpath is used in combination with --with-gmp-prefix, then the + path of the GMP library is hardcoded into ECL. If the remaining libraries + (GC, libffi) are in a similar location this will make ECL work without + further flags, and without modifying LD_LIBRARY_PATH or DYLD_LIBRARY_PATH. + ;;; Local Variables: *** ;;; mode:text *** ;;; fill-column:79 *** diff --git a/src/configure b/src/configure index 2e3c1245a..ef12ac3a7 100755 --- a/src/configure +++ b/src/configure @@ -2642,21 +2642,21 @@ fi # Check whether --with-gmp-prefix was given. if test "${with_gmp_prefix+set}" = set; then : - withval=$with_gmp_prefix; GMP_CPPFLAGS="-I$withval/include"; GMP_LDFLAGS="-L$withval/lib" + withval=$with_gmp_prefix; GMP_INCDIR="$withval/include"; GMP_LIBDIR="$withval/lib" fi # Check whether --with-gmp-incdir was given. if test "${with_gmp_incdir+set}" = set; then : - withval=$with_gmp_incdir; GMP_CPPFLAGS="-I$withval" + withval=$with_gmp_incdir; GMP_INCDIR="$withval" fi # Check whether --with-gmp-libdir was given. if test "${with_gmp_libdir+set}" = set; then : - withval=$with_gmp_libdir; GMP_LDFLAGS="-L$withval" + withval=$with_gmp_libdir; GMP_LIBDIR="$withval" fi @@ -5073,6 +5073,17 @@ else INFOEXT=info fi +if test "x$GMP_INCDIR" != "x"; then + GMP_CPPFLAGS="-I$GMP_INCDIR" +fi +if test "x$GMP_LIBDIR" != "x"; then + GMP_LDFLAGS="-L$GMP_LIBDIR" + if test "$enable_rpath" = "yes"; then + if (echo "$ECL_LDRPATH" | grep '~A') > /dev/null; then + GMP_LDFLAGS=`echo $ECL_LDRPATH | sed "s,~A,$GMP_LIBDIR,"`" $GMP_LDFLAGS" + fi + fi +fi CPPFLAGS="$CPPFLAGS $GMP_CPPFLAGS" LDFLAGS="$LDFLAGS $GMP_LDFLAGS" diff --git a/src/configure.in b/src/configure.in index 88a2b9f5c..ae59206ec 100644 --- a/src/configure.in +++ b/src/configure.in @@ -84,17 +84,17 @@ AC_ARG_WITH(system-gmp, AC_ARG_WITH(gmp-prefix, AS_HELP_STRING( [--with-gmp-prefix=path], [prefix for system GMP includes and libraries] ), - [GMP_CPPFLAGS="-I$withval/include"; GMP_LDFLAGS="-L$withval/lib"], []) + [GMP_INCDIR="$withval/include"; GMP_LIBDIR="$withval/lib"], []) AC_ARG_WITH(gmp-incdir, AS_HELP_STRING( [--with-gmp-incdir=path], [path to system GMP includes (overrides prefix)] ), - [GMP_CPPFLAGS="-I$withval"], []) + [GMP_INCDIR="$withval"], []) AC_ARG_WITH(gmp-libdir, AS_HELP_STRING( [--with-gmp-libdir=path], [path to system GMP libraries (overrides prefix)] ), - [GMP_LDFLAGS="-L$withval"], []) + [GMP_LIBDIR="$withval"], []) AC_ARG_ENABLE(local-gmp, AS_HELP_STRING( [--enable-local-gmp], @@ -353,6 +353,17 @@ dnl build flags for the library, because GMP may choose to build for 64 dnl or 32 bits executables and ECL has to be compiled / linked using precisely dnl the same flags dnl +if test "x$GMP_INCDIR" != "x"; then + GMP_CPPFLAGS="-I$GMP_INCDIR" +fi +if test "x$GMP_LIBDIR" != "x"; then + GMP_LDFLAGS="-L$GMP_LIBDIR" + if test "$enable_rpath" = "yes"; then + if (echo "$ECL_LDRPATH" | grep '~A') > /dev/null; then + GMP_LDFLAGS=`echo $ECL_LDRPATH | sed "s,~A,$GMP_LIBDIR,"`" $GMP_LDFLAGS" + fi + fi +fi CPPFLAGS="$CPPFLAGS $GMP_CPPFLAGS" LDFLAGS="$LDFLAGS $GMP_LDFLAGS"