From f97dcf9fc2ea2a419087bca53f2fea811c5181a9 Mon Sep 17 00:00:00 2001 From: wolfgang Date: Tue, 8 Mar 2005 04:45:38 +0000 Subject: [PATCH] [project @ 2005-03-08 04:45:29 by wolfgang] Mac OS X: Kill HaskellSupport.framework. Instead, look for GMP.framework (a framework-version of libgmp), else look for a normal -lgmp as usual. The other part of HaskellSupport.framework, dlcompat, is no longer needed (as of Mac OS X 10.3, it's included in libSystem). It's enough to just use the normal configure tests for -ldl. MERGE TO STABLE --- configure.ac | 193 +++++++++++++++++++++-------------------------- ghc/rts/Linker.c | 4 +- ghc/rts/Makefile | 2 +- ghc/rts/package.conf.in | 8 +- mk/config.mk.in | 8 +- 5 files changed, 97 insertions(+), 118 deletions(-) diff --git a/configure.ac b/configure.ac index 0a41966..43fe17b 100644 --- a/configure.ac +++ b/configure.ac @@ -1052,20 +1052,20 @@ AC_CHECK_LIB(gmp, __gmpz_fdiv_qr, HaveLibGmp=YES; LibGmp=gmp, AC_SUBST(HaveLibGmp) AC_SUBST(LibGmp) -dnl ** (Mac OS X only: check for HaskellSupport.framework) -HaveFrameworkHaskellSupport=NO +dnl ** (Mac OS X only: check for GMP.framework) +HaveFrameworkGMP=NO if test $HostPlatform = "powerpc-apple-darwin"; then - AC_MSG_CHECKING([for HaskellSupport.framework]) + AC_MSG_CHECKING([for GMP.framework]) save_libs="$LIBS" - LIBS="-framework HaskellSupport" - AC_TRY_LINK_FUNC(__gmpz_fdiv_qr, HaveFrameworkHaskellSupport=YES,) - if test $HaveFrameworkHaskellSupport = YES; then - AC_DEFINE([HAVE_FRAMEWORK_HASKELLSUPPORT], [1], [Define to 1 if the HaskellSupport.framework is installed (Mac OS X only).]) + LIBS="-framework GMP" + AC_TRY_LINK_FUNC(__gmpz_fdiv_qr, HaveFrameworkGMP=YES,) + if test $HaveFrameworkGMP = YES; then + AC_DEFINE([HAVE_FRAMEWORK_GMP], [1], [Define to 1 if GMP.framework is installed (Mac OS X only).]) fi; LIBS="$save_libs" - AC_MSG_RESULT([$HaveFrameworkHaskellSupport]) + AC_MSG_RESULT([$HaveFrameworkGMP]) fi; -AC_SUBST(HaveFrameworkHaskellSupport) +AC_SUBST(HaveFrameworkGMP) dnl ** check for mingwex library AC_CHECK_LIB(mingwex, closedir, HaveLibMingwEx=YES, HaveLibMingwEx=NO) @@ -1133,103 +1133,84 @@ dnl ################################################################ dnl ** check for libdl & RTLD_NEXT -dnl (Mac OS X only) ... but don't check if we already have the -dnl HaskellSupport.framework - -if test $HaveFrameworkHaskellSupport = YES; then - HaveLibDL=NO - HaveRtldNext=NO - HaveRtldLocal=YES - AC_DEFINE([HAVE_RTLDLOCAL], [1], [Define to 1 if RTLD_LOCAL is available.]) - HaveRtldGlobal=YES - AC_DEFINE([HAVE_RTLDGLOBAL], [1], [Define to 1 if RTLD_GLOBAL is available.]) - HaveRtldNow=YES - AC_DEFINE([HAVE_RTLDNOW], [1], [Define to 1 if we can see RTLD_NOW in dlfcn.h.]) - AC_SUBST(HaveLibDL) - AC_SUBST(HaveRtldNext) - AC_SUBST(HaveRtldLocal) - AC_SUBST(HaveRtldGlobal) - AC_SUBST(HaveRtldNow) -else - AC_CHECK_LIB(dl, dlopen, - [HaveLibDL=YES - AC_DEFINE([HAVE_LIBDL], [1], [Define to 1 if you need -ldl to get dlopen().]) - LIBS="$LIBS -ldl"], - [HaveLibDL=NO]) - AC_SUBST(HaveLibDL) - - dnl ** sometimes RTLD_NEXT is hidden in #ifdefs we really don't wan to set - AC_MSG_CHECKING(for RTLD_NEXT from dlfcn.h) - AC_EGREP_CPP(yes, - [ - #include - #ifdef RTLD_NEXT - yes - #endif - ], [ - AC_MSG_RESULT(yes) - AC_DEFINE([HAVE_RTLDNEXT], [1], [Define to 1 if we can see RTLD_NEXT in dlfcn.h.]) - HaveRtldNext=YES - ], [ - AC_MSG_RESULT(no) - HaveRtldNext=NO - ]) - AC_SUBST(HaveRtldNext) - - dnl ** RTLD_LOCAL isn't available on cygwin or openbsd - AC_MSG_CHECKING(for RTLD_LOCAL from dlfcn.h) - AC_EGREP_CPP(yes, - [ - #include - #ifdef RTLD_LOCAL - yes - #endif - ], [ - AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_RTLDLOCAL) - HaveRtldLocal=YES - ], [ - AC_MSG_RESULT(no) - HaveRtldLocal=NO - ]) - AC_SUBST(HaveRtldLocal) - - dnl ** RTLD_GLOBAL isn't available on openbsd - AC_MSG_CHECKING(for RTLD_GLOBAL from dlfcn.h) - AC_EGREP_CPP(yes, - [ - #include - #ifdef RTLD_GLOBAL - yes - #endif - ], [ - AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_RTLDGLOBAL) - HaveRtldGlobal=YES - ], [ - AC_MSG_RESULT(no) - HaveRtldGlobal=NO - ]) - AC_SUBST(HaveRtldGlobal) - - dnl ** RTLD_NOW isn't available on openbsd - AC_MSG_CHECKING(for RTLD_NOW from dlfcn.h) - AC_EGREP_CPP(yes, - [ - #include - #ifdef RTLD_NOW - yes - #endif - ], [ - AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_RTLDNOW) - HaveRtldNow=YES - ], [ - AC_MSG_RESULT(no) - HaveRtldNow=NO - ]) - AC_SUBST(HaveRtldNow) -fi +AC_CHECK_LIB(dl, dlopen, + [HaveLibDL=YES + AC_DEFINE([HAVE_LIBDL], [1], [Define to 1 if you need -ldl to get dlopen().]) + LIBS="$LIBS -ldl"], + [HaveLibDL=NO]) +AC_SUBST(HaveLibDL) + +dnl ** sometimes RTLD_NEXT is hidden in #ifdefs we really don't wan to set +AC_MSG_CHECKING(for RTLD_NEXT from dlfcn.h) +AC_EGREP_CPP(yes, +[ + #include + #ifdef RTLD_NEXT + yes + #endif +], [ + AC_MSG_RESULT(yes) + AC_DEFINE([HAVE_RTLDNEXT], [1], [Define to 1 if we can see RTLD_NEXT in dlfcn.h.]) + HaveRtldNext=YES +], [ + AC_MSG_RESULT(no) + HaveRtldNext=NO + ]) +AC_SUBST(HaveRtldNext) + +dnl ** RTLD_LOCAL isn't available on cygwin or openbsd +AC_MSG_CHECKING(for RTLD_LOCAL from dlfcn.h) +AC_EGREP_CPP(yes, +[ + #include + #ifdef RTLD_LOCAL + yes + #endif +], [ + AC_MSG_RESULT(yes) + AC_DEFINE([HAVE_RTLDLOCAL], [1], [Define to 1 if RTLD_LOCAL is available.]) + HaveRtldLocal=YES +], [ + AC_MSG_RESULT(no) + HaveRtldLocal=NO + ]) +AC_SUBST(HaveRtldLocal) + +dnl ** RTLD_GLOBAL isn't available on openbsd +AC_MSG_CHECKING(for RTLD_GLOBAL from dlfcn.h) +AC_EGREP_CPP(yes, +[ + #include + #ifdef RTLD_GLOBAL + yes + #endif +], [ + AC_MSG_RESULT(yes) + AC_DEFINE([HAVE_RTLDGLOBAL], [1], [Define to 1 if RTLD_GLOBAL is available.]) + HaveRtldGlobal=YES +], [ + AC_MSG_RESULT(no) + HaveRtldGlobal=NO + ]) +AC_SUBST(HaveRtldGlobal) + +dnl ** RTLD_NOW isn't available on openbsd +AC_MSG_CHECKING(for RTLD_NOW from dlfcn.h) +AC_EGREP_CPP(yes, +[ + #include + #ifdef RTLD_NOW + yes + #endif +], [ + AC_MSG_RESULT(yes) + AC_DEFINE([HAVE_RTLDNOW], [1], [Define to 1 if we can see RTLD_NOW in dlfcn.h]) + HaveRtldNow=YES +], [ + AC_MSG_RESULT(no) + HaveRtldNow=NO + ]) +AC_SUBST(HaveRtldNow) dnl -------------------------------------------------- dnl * Miscellaneous feature tests diff --git a/ghc/rts/Linker.c b/ghc/rts/Linker.c index 3811e13..9ee1858 100644 --- a/ghc/rts/Linker.c +++ b/ghc/rts/Linker.c @@ -38,9 +38,7 @@ #include #endif -#if defined(HAVE_FRAMEWORK_HASKELLSUPPORT) -#include -#elif defined(HAVE_DLFCN_H) +#if defined(HAVE_DLFCN_H) #include #endif diff --git a/ghc/rts/Makefile b/ghc/rts/Makefile index 15cbdd4..934c429 100644 --- a/ghc/rts/Makefile +++ b/ghc/rts/Makefile @@ -233,7 +233,7 @@ endif # and not worth re-implementing in our Makefile framework. ifneq "$(HaveLibGmp)" "YES" -ifneq "$(HaveFrameworkHaskellSupport)" "YES" +ifneq "$(HaveFrameworkGMP)" "YES" boot :: if [ -f gmp/config.status ]; then \ cd gmp && CC=$(WhatGccIsCalled) ./config.status; \ diff --git a/ghc/rts/package.conf.in b/ghc/rts/package.conf.in index 119482c..6666863 100644 --- a/ghc/rts/package.conf.in +++ b/ghc/rts/package.conf.in @@ -22,7 +22,7 @@ library-dirs: LIB_DIR # endif #else /* !INSTALLING */ library-dirs: FPTOOLS_TOP_ABS"/ghc/rts" -# ifndef HAVE_LIBGMP +# if !defined(HAVE_LIBGMP) && !defined(HAVE_FRAMEWORK_GMP) , FPTOOLS_TOP_ABS"/ghc/rts/gmp" # endif #endif @@ -30,7 +30,7 @@ library-dirs: FPTOOLS_TOP_ABS"/ghc/rts" hs-libraries: "HSrts" extra-libraries: "m" /* for ldexp() */ -#ifndef HAVE_FRAMEWORK_HASKELLSUPPORT +#ifndef HAVE_FRAMEWORK_GMP , "gmp" #ifdef HAVE_LIBDL , "dl" @@ -138,8 +138,8 @@ ld-options: framework-dirs: -#ifdef HAVE_FRAMEWORK_HASKELLSUPPORT -frameworks: "HaskellSupport" +#ifdef HAVE_FRAMEWORK_GMP +frameworks: "GMP" #else frameworks: #endif diff --git a/mk/config.mk.in b/mk/config.mk.in index c7dc6ec..1cdc1b9 100644 --- a/mk/config.mk.in +++ b/mk/config.mk.in @@ -759,14 +759,14 @@ HaveLibGmp = @HaveLibGmp@ LibGmp = @LibGmp@ #----------------------------------------------------------------------------- -# Mingwex Library +# GMP framework (Mac OS X) # -HaveLibMingwEx = @HaveLibMingwEx@ +HaveFrameworkGMP = @HaveFrameworkGMP@ #----------------------------------------------------------------------------- -# HaskellSupport framework (Mac OS X) +# Mingwex Library # -HaveFrameworkHaskellSupport = @HaveFrameworkHaskellSupport@ +HaveLibMingwEx = @HaveLibMingwEx@ #----------------------------------------------------------------------------- # Flex (currently unused, could be moved to glafp-utils) -- 1.7.10.4