From 39d89a2d91f77d007abb3b031d49c55d91a9b868 Mon Sep 17 00:00:00 2001 From: vsc Date: Tue, 23 Apr 2002 14:37:56 +0000 Subject: [PATCH] first changes towards dynamic loading in Darwin git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@450 b08c6af1-5177-4d33-ba66-4b1c6b8b522a --- H/Foreign.h | 9 +++++++++ config.h.in | 1 + configure.in | 10 +++++++++- 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/H/Foreign.h b/H/Foreign.h index 93378d3d6..bb79e76c9 100644 --- a/H/Foreign.h +++ b/H/Foreign.h @@ -107,6 +107,15 @@ #define LOAD_SHL 1 #endif +#if defined(__MACH__) && defined(__APPLE__) +#ifdef NO_DYN +#undef NO_DYN +#endif +#ifndef LOAD_DL +#define LOAD_DL 1 +#endif +#endif + extern char YapExecutable[]; extern char LoadMsg[]; diff --git a/config.h.in b/config.h.in index ac847a182..4fe53868f 100644 --- a/config.h.in +++ b/config.h.in @@ -49,6 +49,7 @@ #undef HAVE_CTYPE_H #undef HAVE_DIRECT_H #undef HAVE_DIRENT_H +#undef HAVE_DLFCN_H #undef HAVE_ERRNO_H #undef HAVE_FCNTL_H #undef HAVE_FENV_H diff --git a/configure.in b/configure.in index 0f6a0367c..9e1263666 100644 --- a/configure.in +++ b/configure.in @@ -452,6 +452,13 @@ case $target_os in SHLIB_LD="ld -n32 -shared -rdata_shared" INSTALL_DLLS="" ;; + *darwin*) + SHLIB_CFLAGS="-fno-common" + SHLIB_SUFFIX=".so" + DO_SECOND_LD="" + SHLIB_LD="cc -bundle -flat_namespace -undefined suppress" + INSTALL_DLLS="" + ;; *netbsd*|*freebsd*) if echo __ELF__ | ${CC:-cc} -E - | grep -q __ELF__ then @@ -548,7 +555,8 @@ esac dnl Checks for header files. AC_HEADER_STDC AC_HEADER_SYS_WAIT -AC_CHECK_HEADERS(arpa/inet.h ctype.h direct.h dirent.h errno.h fcntl.h) +AC_CHECK_HEADERS(arpa/inet.h ctype.h direct.h dirent.h dlfcn.h) +AC_CHECK_HEADERS(errno.h fcntl.h) AC_CHECK_HEADERS(fenv.h fpu_control.h ieeefp.h io.h limits.h memory.h) AC_CHECK_HEADERS(netdb.h netinet/in.h regex.h) AC_CHECK_HEADERS(siginfo.h signal.h stdarg.h string.h stropts.h)