changeset 9762:8e277dcf1223

prefer dlopen on OS X systems
author Thomas Treichl <Thomas.Treichl@gmx.net>
date Thu, 29 Oct 2009 18:10:53 -0400
parents 5f8971be8e12
children 63d554a54da6
files ChangeLog configure.ac
diffstat 2 files changed, 18 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Thu Oct 29 13:36:03 2009 -0400
+++ b/ChangeLog	Thu Oct 29 18:10:53 2009 -0400
@@ -1,3 +1,7 @@
+2009-10-29  Thomas Treichl  <Thomas.Treichl@gmx.net>
+
+	* configure.in: Add support for dlopen on Mac systems.
+
 2009-10-20  Jaroslav Hajek  <highegg@gmail.com>
 
 	* NEWS: Update.
--- a/configure.ac	Thu Oct 29 13:36:03 2009 -0400
+++ b/configure.ac	Thu Oct 29 18:10:53 2009 -0400
@@ -1579,10 +1579,20 @@
   ## Check for dyld first since OS X can have a non-standard libdl	
 
   save_LIBS="$LIBS"
-  AC_CHECK_HEADER(mach-o/dyld.h)
-  if test "$ac_cv_header_mach_o_dyld_h" = yes; then
-    dyld_api=true
-  else 
+  use_mach_dyld=false
+  AC_ARG_ENABLE(mach-dyld,
+    [AS_HELP_STRING([--enable-mach-dyld], [enable older Mach-O dyld interface])],
+      [if test "x$enableval" = xno; then
+         use_mach_dyld=false;
+       else
+         use_mach_dyld=true;
+       fi], [use_mach_dyld=true])
+  if $use_mach_dyld; then
+    AC_CHECK_HEADER(mach-o/dyld.h)
+    if test "$ac_cv_header_mach_o_dyld_h" = yes; then
+      dyld_api=true
+    fi
+  elif test "$dyld_api" = false; then
     AC_CHECK_LIB(dld, shl_load, [DL_LIBS=-ldld; LIBS="$LIBS $DL_LIBS"])
     AC_CHECK_FUNCS(shl_load shl_findsym)
     if test "$ac_cv_func_shl_load" = yes \