nixpkgs/pkgs/development/compilers/ecl/libffi-prefix.patch

40 lines
1.2 KiB
Diff

diff --git a/src/configure.in b/src/configure.in
index 434da49..642c66c 100644
--- ecl-15.3.7.orig/src/configure.ac
+++ ecl-15.3.7/src/configure.ac
@@ -191,6 +191,11 @@ AC_ARG_WITH(dffi,
[(system|included|auto|no, default=AUTO if libffi available)]),
[enable_libffi=${withval}], [enable_libffi=auto])
+AC_ARG_WITH(libffi-prefix,
+ AS_HELP_STRING( [--with-libffi-prefix=path],
+ [prefix for system LIBFFI includes and libraries] ),
+ [LIBFFI_INCDIR="$withval/include"; LIBFFI_LIBDIR="$withval/lib"], [])
+
AC_ARG_WITH(fpe,
AS_HELP_STRING( [--with-fpe],
[detect floating point exceptions]
@@ -368,6 +373,22 @@ else
INFOEXT=info
fi
+dnl libffi
+
+if test "x$LIBFFI_INCDIR" != "x"; then
+ LIBFFI_CPPFLAGS="-I$LIBFFI_INCDIR"
+fi
+if test "x$LIBFFI_LIBDIR" != "x"; then
+ LIBFFI_LDFLAGS="-L$LIBFFI_LIBDIR"
+ if test "$enable_rpath" = "yes"; then
+ if (echo "$ECL_LDRPATH" | grep '~A') > /dev/null; then
+ LIBFFI_LDFLAGS=`echo $ECL_LDRPATH | sed "s,~A,$LIBFFI_LIBDIR,"`" $LIBFFI_LDFLAGS"
+ fi
+ fi
+fi
+CPPFLAGS="$CPPFLAGS $LIBFFI_CPPFLAGS"
+LDFLAGS="$LDFLAGS $LIBFFI_LDFLAGS"
+
dnl ======================================================================
dnl GNU multiprecision library
dnl