Commit 31442604 authored by wolfgang's avatar wolfgang

[project @ 2002-10-12 23:12:08 by wolfgang]

Make the Mac OS X build use the HaskellSupport.framework (a MacOS-style "framework" that includes the required libraries libgmp and dlcompat) if it is present. The HaskellSupport.framework is not yet in CVS, but is available from me.
parent b41b49bd
......@@ -953,6 +953,21 @@ 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
if test $HostPlatform = "powerpc-apple-darwin"; then
AC_MSG_CHECKING([for HaskellSupport.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)
fi;
LIBS="$save_libs"
AC_MSG_RESULT([$HaveFrameworkHaskellSupport])
fi;
AC_SUBST(HaveFrameworkHaskellSupport)
dnl ** check for mingwex library
AC_CHECK_LIB(mingwex, closedir, HaveLibMingwEx=YES, HaveLibMingwEx=NO)
AC_SUBST(HaveLibMingwEx)
......@@ -1027,85 +1042,104 @@ dnl ################################################################
dnl ** check for libdl & RTLD_NEXT
AC_CHECK_LIB(dl, dlopen,
[HaveLibDL=YES
AC_DEFINE(HAVE_LIBDL)
LIBS="$LIBS -ldl"],
[HaveLibDL=NO])
AC_CHECK_FUNCS(dlopen)
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 <dlfcn.h>
#ifdef RTLD_NEXT
yes
#endif
], [
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_RTLDNEXT)
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 <dlfcn.h>
#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 <dlfcn.h>
#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 <dlfcn.h>
#ifdef RTLD_NOW
yes
#endif
], [
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_RTLDNOW)
HaveRtldNow=YES
], [
AC_MSG_RESULT(no)
HaveRtldNow=NO
])
AC_SUBST(HaveRtldNow)
dnl (Mac OS X only) ... but don't check if we already have the
dl HaskellSupport.framework
if test $HaveFrameworkHaskellSupport = YES; then
HaveLibDL = NO
HaveRtldNext=NO
HaveRtldLocal=YES
AC_DEFINE(HAVE_RTLDLOCAL)
HaveRtldGlobal=YES
AC_DEFINE(HAVE_RTLDGLOBAL)
HaveRtldNow=YES
AC_DEFINE(HAVE_RTLDNOW)
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)
LIBS="$LIBS -ldl"],
[HaveLibDL=NO])
AC_CHECK_FUNCS(dlopen)
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 <dlfcn.h>
#ifdef RTLD_NEXT
yes
#endif
], [
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_RTLDNEXT)
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 <dlfcn.h>
#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 <dlfcn.h>
#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 <dlfcn.h>
#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
FPTOOLS_CHECK_LIB_NOWARN(m, atan)
......
/* -----------------------------------------------------------------------------
* $Id: Linker.c,v 1.104 2002/10/02 09:36:00 wolfgang Exp $
* $Id: Linker.c,v 1.105 2002/10/12 23:12:08 wolfgang Exp $
*
* (c) The GHC Team, 2000, 2001
*
......@@ -31,7 +31,9 @@
#include <sys/stat.h>
#endif
#ifdef HAVE_DLFCN_H
#if defined(HAVE_FRAMEWORK_HASKELLSUPPORT)
#include <HaskellSupport/dlfcn.h>
#elif defined(HAVE_DLFCN_H)
#include <dlfcn.h>
#endif
......@@ -502,15 +504,15 @@ typedef struct _RtsSymbolVal {
#define RTS_EXTRA_SYMBOLS \
Sym(__divsf3)
#elif defined(powerpc_TARGET_ARCH)
#define RTS_EXTRA_SYMBOLS \
#define RTS_EXTRA_SYMBOLS \
Sym(__divdi3) \
Sym(__udivdi3) \
Sym(__moddi3) \
Sym(__umoddi3) \
Sym(__ashldi3) \
Sym(__ashrdi3) \
Sym(__lshrdi3) \
SymX(__eprintf)
Sym(__umoddi3) \
Sym(__ashldi3) \
Sym(__ashrdi3) \
Sym(__lshrdi3) \
Sym(__eprintf)
#else
#define RTS_EXTRA_SYMBOLS /* nothing */
#endif
......
......@@ -177,6 +177,7 @@ endif
# and not worth re-implementing in our Makefile framework.
ifneq "$(HaveLibGmp)" "YES"
ifneq "$(HaveFrameworkHaskellSupport)" "YES"
ifneq "$(HOSTPLATFORM)" "i386-unknown-mingw32"
boot ::
cd gmp && ./configure --enable-shared=no \
......@@ -208,6 +209,7 @@ clean distclean maintainer-clean ::
INSTALL_LIBS += gmp/libgmp.a
endif
endif
gmp/libgmp.a ::
$(MAKE) -C gmp MAKEFLAGS=
......
......@@ -21,8 +21,14 @@ Package {
],
hs_libraries = [ "HSrts" ],
extra_libraries = [ "gmp"
, "m" /* for ldexp() */
extra_libraries = [
"m" /* for ldexp() */
#ifndef HAVE_FRAMEWORK_HASKELLSUPPORT
, "gmp"
#ifdef HAVE_LIBDL
, "dl"
#endif
#endif
#ifdef mingw32_TARGET_OS
,"winmm" /* for the threadDelay timer */
,"wsock32" /* for the linker */
......@@ -127,4 +133,7 @@ Package {
, "-u", "__stginit_Prelude"
#endif
]
#ifdef HAVE_FRAMEWORK_HASKELLSUPPORT
, extra_frameworks = [ "HaskellSupport" ]
#endif
}
......@@ -1057,3 +1057,5 @@
/* Define if signal.h defines SIGPOLL */
#undef HAVE_SIGPOLL
/* Define if the HaskellSupport.framework is installed (Mac OS X only) */
#undef HAVE_FRAMEWORK_HASKELLSUPPORT
......@@ -683,6 +683,11 @@ LibGmp = @LibGmp@
#
HaveLibMingwEx = @HaveLibMingwEx@
#-----------------------------------------------------------------------------
# HaskellSupport framework (Mac OS X)
#
HaveFrameworkHaskellSupport = @HaveFrameworkHaskellSupport@
#-----------------------------------------------------------------------------
# Regex libraries
# (if present in libc use that one, otherwise use the one in the tree)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment