Hi Daniel,
thanks for your quick reply.
Daniel Kochmański <jackdan...@hellsgate.pl> writes:
> You can always build ECL with already installed libffi,
Problem is not building ECL with already installed libffi. Problem is
that ECL cannot find libffi when it compiles lisp code later, for
example when starting slime:
;;; Loading "/home/tomas/lisp/slime/swank-loader.lisp"
/nix/store/b8qhjrwf8sf9ggkjxqqav7f1m6w83bh0-binutils-2.23.1/bin/ld: cannot find
-lffi
collect2: error: ld returned 1 exit status
;;; Internal error:
;;; ** Error code 1 when executing
;;; (RUN-PROGRAM "gcc" ("-o"
"/home/tomas/.slime/fasl/2015-02-19/ecl-15.3.7-linux-x86_64/swank.fas"
"-L/nix/store/jrpjnjfhrjrlywn4q78fl0jl2ip9rhgx-ecl-15.3.7/lib/"
"/home/tomas/.slime/fasl/2015-02-19/ecl-15.3.7-linux-x86_64/swank.o"
"-Wl,--rpath,/nix/store/jrpjnjfhrjrlywn4q78fl0jl2ip9rhgx-ecl-15.3.7/lib/"
"-shared"
"-Wl,--rpath,/nix/store/6l8mc2qgfq6z0hs4flgchwjvlxwl4qv7-gmp-5.1.3/lib"
"-L/nix/store/6l8mc2qgfq6z0hs4flgchwjvlxwl4qv7-gmp-5.1.3/lib" "-lecl" "-lgmp"
"-lffi" "-lpthread" "-ldl" "-lm"));;
;; Error while compiling /home/tomas/lisp/slime/swank.lisp:
;; COMPILE-FILE returned NIL.
;; Aborting.
Maybe is a way to somehow convince NixOS to put libffi in the right
environment when running ECL, but so far I have figured it out by adding
the libffi-prefix configure option in a similar way to gmp-prefix
option. It seems like a good solution.
> but there is no reason to not include configurable prefix for it, if
> there is such a need.
Great!
> There are a few problems with this patch however. It applies to
> configure.in, while we have configure.ac for some time instead. It is
> minor, but please rebase your patch on develop branch at:
>
> https://gitlab.com/embeddable-common-lisp/ecl.git
>
> Please also supply appropriate entry, so option will be shown in
> ./configure --help.
>
> Last but not least - please format patch, so it
> can be applied with `git am`, so commit contains your name.
Thanks for the comments. You can find an updated patch attached.
Best Regards,
Tomas
>From 664c4109d8e0e7170fd67d9d85cf41140bc43286 Mon Sep 17 00:00:00 2001
From: Tomas Hlavaty <t...@logand.com>
Date: Tue, 7 Apr 2015 21:56:46 +0200
Subject: [PATCH] add configure option libffi-prefix
similar to gmp-prefix; useful on nixos for example
---
src/configure | 6 ++++++
src/configure.ac | 22 ++++++++++++++++++++++
2 files changed, 28 insertions(+)
diff --git a/src/configure b/src/configure
index 8bf77b8..2954c1f 100755
--- a/src/configure
+++ b/src/configure
@@ -1486,6 +1486,7 @@ Optional Packages:
--with-gmp-prefix=path prefix for system GMP includes and libraries
--with-gmp-incdir=path path to system GMP includes (overrides prefix)
--with-gmp-libdir=path path to system GMP libraries (overrides prefix)
+ --with-libffi-prefix=path prefix for system LIBFFI includes and libraries
--with-__thread Enable __thread thread-local variables (yes|NO|auto)
(supported by NPTL-aware glibc and maybe Windows)
--with-cxx build ECL using C++ compiler (default=NO)
@@ -2717,6 +2718,11 @@ $as_echo "$as_me: WARNING: --with-local-gmp is deprecated, use --with-system-gmp
fi
+# Check whether --with-libffi-prefix was given.
+if test "${with_libffi_prefix+set}" = set; then :
+ withval=$with_libffi_prefix; LIBFFI_INCDIR="$withval/include"; LIBFFI_LIBDIR="$withval/lib"
+fi
+
# Check whether --with-__thread was given.
if test "${with___thread+set}" = set; then :
diff --git a/src/configure.ac b/src/configure.ac
index bc8d84b..1d77c77 100644
--- a/src/configure.ac
+++ b/src/configure.ac
@@ -109,6 +109,11 @@ AC_ARG_ENABLE(local-gmp,
[--with-local-gmp is deprecated, use --with-system-gmp instead!])
with_system_gmp="${enableval}"])
+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(__thread,
AS_HELP_STRING( [--with-__thread],
[Enable __thread thread-local variables (yes|NO|auto)]
@@ -319,6 +324,7 @@ AC_SUBST(ECL_CFLAGS) dnl Similar, but specific to ECL (see src/util/e
AC_SUBST(DEBUG_CFLAGS)
AC_SUBST(GMP_CPPFLAGS) dnl CFLAGS needed for compiling with system GMP library
AC_SUBST(GMP_LDFLAGS) dnl LDFLAGS needed for compiling with system GMP library
+AC_SUBST(LIBFFI_LDFLAGS) dnl LDFLAGS needed for compiling with system LIBFFI library
AC_SUBST(FASL_LIBS) dnl Libraries to link into all ecl code but not
dnl into helper programs.
AC_SUBST(CORE_LIBS, []) dnl Locally compiled libs to link into
@@ -465,6 +471,22 @@ if test "x${with_system_gmp}" = "xno"; then
ECL_GMP_BASED_CONFIG
fi
+dnl ======================================================================
+dnl LIBFFI library
+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 Checks for libraries
--
2.1.4
------------------------------------------------------------------------------
BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT
Develop your own process in accordance with the BPMN 2 standard
Learn Process modeling best practices with Bonita BPM through live exercises
http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual- event?utm_
source=Sourceforge_BPM_Camp_5_6_15&utm_medium=email&utm_campaign=VA_SF
_______________________________________________
Ecls-list mailing list
Ecls-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ecls-list