[commit: ghc] ghc-7.10: Move libffi configuration after basic toolchain setup (d86de4a)

git at git.haskell.org git at git.haskell.org
Tue Apr 14 12:53:47 UTC 2015


Repository : ssh://git@git.haskell.org/ghc

On branch  : ghc-7.10
Link       : http://ghc.haskell.org/trac/ghc/changeset/d86de4a856f61ad4172d6fbdd28ae5906b0d2168/ghc

>---------------------------------------------------------------

commit d86de4a856f61ad4172d6fbdd28ae5906b0d2168
Author: Reid Barton <rwbarton at gmail.com>
Date:   Mon Jan 12 10:59:11 2015 -0500

    Move libffi configuration after basic toolchain setup
    
    Summary:
    The relevant aspect is that the libffi configuration's AC_CHECK_LIB
    and AC_CHECK_HEADERS are moved after FIND_GCC. There are two reasons
    to do this:
    
    1. We should detect the presence of libffi using the C compiler
    that we are eventually going to use to build GHC.
    
    2. Running AC_CHECK_HEADERS before FIND_GCC pollutes the CPP variable
    with "gcc -E" (wrong when cross-compiling), and CPP is not reset
    by FIND_GCC. Thus this patch fixes x86_64 -> i386 cross-compilation
    of integer-gmp2.
    
    Test Plan: Local x86_64 -> i386 cross-compiling validate; Harbormaster
    
    Reviewers: austin
    
    Reviewed By: austin
    
    Subscribers: erikd, carter, thomie
    
    Differential Revision: https://phabricator.haskell.org/D597
    
    (cherry picked from commit a5bc2579afac3268c31626777406c295c7e67755)


>---------------------------------------------------------------

d86de4a856f61ad4172d6fbdd28ae5906b0d2168
 configure.ac | 112 +++++++++++++++++++++++++++++------------------------------
 1 file changed, 56 insertions(+), 56 deletions(-)

diff --git a/configure.ac b/configure.ac
index 8200b90..4f88de0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -355,62 +355,6 @@ then
     fi
 fi
 
-# system libffi
-
-AC_ARG_WITH([system-libffi],
-[AC_HELP_STRING([--with-system-libffi],
-  [Use system provided libffi for RTS [default=no]])
-])
-
-AS_IF([test "x$with_system_libffi" = "xyes"],
-  [UseSystemLibFFI="YES"], [UseSystemLibFFI="NO"]
-)
-
-
-AC_SUBST(UseSystemLibFFI)
-
-AC_ARG_WITH([ffi-includes],
-[AC_HELP_STRING([--with-ffi-includes=ARG],
-  [Find includes for libffi in ARG [default=system default]])
-],
-[
- if test "x$UseSystemLibFFI" != "xYES"; then
-    AC_MSG_WARN([--with-ffi-includes will be ignored, --with-system-libffi not set])
- else
-    FFIIncludeDir="$withval"
-    LIBFFI_CFLAGS="-I$withval"
- fi
-])
-
-AC_SUBST(FFIIncludeDir)
-
-AC_ARG_WITH([ffi-libraries],
-[AC_HELP_STRING([--with-ffi-libraries=ARG],
-  [Find libffi in ARG [default=system default]])
-],
-[
- if test "x$UseSystemLibFFI" != "xYES"; then
-    AC_MSG_WARN([--with-ffi-libraries will be ignored, --with-system-libffi not set])
- else
-    FFILibDir="$withval" LIBFFI_LDFLAGS="-L$withval"
- fi
-])
-
-AC_SUBST(FFILibDir)
-
-AS_IF([test "$UseSystemLibFFI" = "YES"], [
- CFLAGS2="$CFLAGS"
- CFLAGS="$LIBFFI_CFLAGS $CFLAGS"
- LDFLAGS2="$LDFLAGS"
- LDFLAGS="$LIBFFI_LDFLAGS $LDFLAGS"
- AC_CHECK_LIB(ffi, ffi_call,
-  [AC_CHECK_HEADERS([ffi.h], [break], [])
-   AC_DEFINE([HAVE_LIBFFI], [1], [Define to 1 if you have libffi.])],
-  [AC_MSG_ERROR([Cannot find system libffi])])
- CFLAGS="$CFLAGS2"
- LDFLAGS="$LDFLAGS2"
-])
-
 FP_ICONV
 FP_GMP
 FP_CURSES
@@ -867,6 +811,62 @@ dnl ################################################################
 dnl Check for libraries
 dnl ################################################################
 
+# system libffi
+
+AC_ARG_WITH([system-libffi],
+[AC_HELP_STRING([--with-system-libffi],
+  [Use system provided libffi for RTS [default=no]])
+])
+
+AS_IF([test "x$with_system_libffi" = "xyes"],
+  [UseSystemLibFFI="YES"], [UseSystemLibFFI="NO"]
+)
+
+
+AC_SUBST(UseSystemLibFFI)
+
+AC_ARG_WITH([ffi-includes],
+[AC_HELP_STRING([--with-ffi-includes=ARG],
+  [Find includes for libffi in ARG [default=system default]])
+],
+[
+ if test "x$UseSystemLibFFI" != "xYES"; then
+    AC_MSG_WARN([--with-ffi-includes will be ignored, --with-system-libffi not set])
+ else
+    FFIIncludeDir="$withval"
+    LIBFFI_CFLAGS="-I$withval"
+ fi
+])
+
+AC_SUBST(FFIIncludeDir)
+
+AC_ARG_WITH([ffi-libraries],
+[AC_HELP_STRING([--with-ffi-libraries=ARG],
+  [Find libffi in ARG [default=system default]])
+],
+[
+ if test "x$UseSystemLibFFI" != "xYES"; then
+    AC_MSG_WARN([--with-ffi-libraries will be ignored, --with-system-libffi not set])
+ else
+    FFILibDir="$withval" LIBFFI_LDFLAGS="-L$withval"
+ fi
+])
+
+AC_SUBST(FFILibDir)
+
+AS_IF([test "$UseSystemLibFFI" = "YES"], [
+ CFLAGS2="$CFLAGS"
+ CFLAGS="$LIBFFI_CFLAGS $CFLAGS"
+ LDFLAGS2="$LDFLAGS"
+ LDFLAGS="$LIBFFI_LDFLAGS $LDFLAGS"
+ AC_CHECK_LIB(ffi, ffi_call,
+  [AC_CHECK_HEADERS([ffi.h], [break], [])
+   AC_DEFINE([HAVE_LIBFFI], [1], [Define to 1 if you have libffi.])],
+  [AC_MSG_ERROR([Cannot find system libffi])])
+ CFLAGS="$CFLAGS2"
+ LDFLAGS="$LDFLAGS2"
+])
+
 dnl ** check whether we need -ldl to get dlopen()
 AC_CHECK_LIB(dl, dlopen)
 



More information about the ghc-commits mailing list