summary refs log tree commit diff
path: root/pkgs/development/compilers/ecl
diff options
context:
space:
mode:
authorTomas Hlavaty <tom@logand.com>2015-03-28 01:57:00 +0100
committerMichael Raskin <7c6f434c@mail.ru>2015-03-28 12:42:23 +0300
commita31471876d9e80709759d01d929f0d2f105b7b7c (patch)
treebb92786a478b52bf72f339aadb3009d975c25492 /pkgs/development/compilers/ecl
parent5281377fb5132489f481244219cf741926def1cd (diff)
downloadnixpkgs-a31471876d9e80709759d01d929f0d2f105b7b7c.tar
nixpkgs-a31471876d9e80709759d01d929f0d2f105b7b7c.tar.gz
nixpkgs-a31471876d9e80709759d01d929f0d2f105b7b7c.tar.bz2
nixpkgs-a31471876d9e80709759d01d929f0d2f105b7b7c.tar.lz
nixpkgs-a31471876d9e80709759d01d929f0d2f105b7b7c.tar.xz
nixpkgs-a31471876d9e80709759d01d929f0d2f105b7b7c.tar.zst
nixpkgs-a31471876d9e80709759d01d929f0d2f105b7b7c.zip
ensure that gmp and libffi are found when compiling with gcc dynamically
Diffstat (limited to 'pkgs/development/compilers/ecl')
-rw-r--r--pkgs/development/compilers/ecl/default.nix15
-rw-r--r--pkgs/development/compilers/ecl/libffi-prefix.patch39
2 files changed, 52 insertions, 2 deletions
diff --git a/pkgs/development/compilers/ecl/default.nix b/pkgs/development/compilers/ecl/default.nix
index be65061c544..bb57ebbfa87 100644
--- a/pkgs/development/compilers/ecl/default.nix
+++ b/pkgs/development/compilers/ecl/default.nix
@@ -1,4 +1,5 @@
 {stdenv, fetchurl
+, libtool, autoconf, automake
 , gmp, mpfr, libffi
 , noUnicode ? false, 
 }:
@@ -13,10 +14,10 @@ let
     sha256="13wlxkd5prm93gcm2dhm7v52fl803yx93aa97lrb39z0y6xzziid";
   };
   buildInputs = [
-    libffi
+    libtool autoconf automake
   ];
   propagatedBuildInputs = [
-    gmp mpfr
+    libffi gmp mpfr
   ];
 in
 stdenv.mkDerivation {
@@ -25,8 +26,18 @@ stdenv.mkDerivation {
   src = fetchurl {
     inherit (s) url sha256;
   };
+  patches = [ ./libffi-prefix.patch ];
+  preConfigure = ''
+    (cd src ; libtoolize -f)
+    (cd src ; autoheader -f)
+    (cd src ; aclocal)
+    (cd src ; automake --add-missing -c)
+    (cd src ; autoconf -f)
+  '';
   configureFlags = [
     "--enable-threads"
+    "--with-gmp-prefix=${gmp}"
+    "--with-libffi-prefix=${libffi}"
     ]
     ++
     (stdenv.lib.optional (! noUnicode)
diff --git a/pkgs/development/compilers/ecl/libffi-prefix.patch b/pkgs/development/compilers/ecl/libffi-prefix.patch
new file mode 100644
index 00000000000..d02cc214f31
--- /dev/null
+++ b/pkgs/development/compilers/ecl/libffi-prefix.patch
@@ -0,0 +1,39 @@
+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