From 3c06c09f61cc0980771668ad480b1539fbf44253 Mon Sep 17 00:00:00 2001 From: Ian Lynagh Date: Tue, 4 Dec 2012 15:12:11 +0000 Subject: Rearrange configure.ac a bit Anything that uses gcc needs to happen after we've made the mingw inplace tree on Windows. --- configure.ac | 118 +++++++++++++++++++++++++++++------------------------------ 1 file changed, 59 insertions(+), 59 deletions(-) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index e5841ed854..de2fd03f4a 100644 --- a/configure.ac +++ b/configure.ac @@ -86,62 +86,6 @@ AC_ARG_WITH([ghc], fi WithGhc="$GHC"]) -# 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 ** Tell the make system which OS we are using dnl $OSTYPE is set by the operating system to "msys" or "cygwin" or something AC_SUBST(OSTYPE) @@ -241,9 +185,6 @@ AC_SUBST([WithGhc]) dnl ** Without optimization some INLINE trickery fails for GHCi SRC_CC_OPTS="-O" -FP_ICONV -FP_GMP - dnl-------------------------------------------------------------------- dnl * Choose host(/target/build) platform dnl-------------------------------------------------------------------- @@ -428,6 +369,65 @@ 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 + XCODE_VERSION() SplitObjsBroken=NO -- cgit v1.2.1