[commit: ghc] master: Move libffi configuration after basic toolchain setup (a5bc257)

git at git.haskell.org git at git.haskell.org
Mon Jan 12 17:02:15 UTC 2015


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

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/a5bc2579afac3268c31626777406c295c7e67755/ghc

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

commit a5bc2579afac3268c31626777406c295c7e67755
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


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

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

diff --git a/configure.ac b/configure.ac
index 8fadf30..16d1605 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
 
@@ -855,6 +799,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