]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
* libtool.m4 (darwin): Use "-undefined dynamic_lookup" if the
authorPeter O'Gorman <peter@pogma.com>
Fri, 1 Aug 2003 19:08:14 +0000 (19:08 +0000)
committerRobert Boehne <rboehne@gnu.org>
Fri, 1 Aug 2003 19:08:14 +0000 (19:08 +0000)
user set MACOSX_DEPLOYMENT_TARGET to 10.3 or greater.
* libltdl/ltdl.c (dyld): Save the error from the first lookup
to report in lt_dlerror(). Otherwise the error is always
"Symbol _foo not in /usr/lib/libSystem.dylib".
Thanks to Chris Zubrzycki for reporting this.

ChangeLog
libltdl/ltdl.c
libtool.m4

index 0ba2bfaf15afb80e092c2b5256dcc9056eb20afc..5a70aaf6c6153c9aea120d4d55d47d4c11ee70ad 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2003-08-01  Peter O'Gorman  <peter@pogma.com>
+
+       * libtool.m4 (darwin): Use "-undefined dynamic_lookup" if the
+       user set MACOSX_DEPLOYMENT_TARGET to 10.3 or greater.  
+       * libltdl/ltdl.c (dyld): Save the error from the first lookup
+       to report in lt_dlerror(). Otherwise the error is always
+       "Symbol _foo not in /usr/lib/libSystem.dylib".
+       Thanks to Chris Zubrzycki for reporting this.
+
 2003-08-01  Robert Boehne  <rboehne@gnu.org>
 
        * libltdl/ltdl.h: Tweak the header to support visual studio.
index b6de7dbe28762d7400e4f9a8fd2efdf9a7e59ab2..d45de1550af38a6aac8a51f28f7c7d008e09bdfc 100644 (file)
@@ -1870,6 +1870,7 @@ sys_dyld_sym (loader_data, module, symbol)
        NSSymbol *nssym = 0;
        void *unused;
        const struct mach_header *mh=NULL;
+       char saveError[256] = "Symbol not found";
        if (module == (lt_module)-1)
        {
                _dyld_lookup_and_bind(symbol,(unsigned long*)&address,&unused);
@@ -1900,12 +1901,14 @@ sys_dyld_sym (loader_data, module, symbol)
        }
        if (!nssym)
        {
+               strncpy(saveError, lt_int_dyld_error(LT_DLSTRERROR(SYMBOL_NOT_FOUND)), 255);
+               saveError[255] = 0;
                if (!mh) mh=lt_int_dyld_get_mach_header_from_nsmodule(module);
                nssym = lt_int_dyld_NSlookupSymbolInLinkedLibs(symbol,mh);
        }
        if (!nssym)
        {
-               LT_DLMUTEX_SETERROR (lt_int_dyld_error(LT_DLSTRERROR(SYMBOL_NOT_FOUND)));
+               LT_DLMUTEX_SETERROR (saveError);
                return NULL;
        }
        return NSAddressOfSymbol(nssym);
index 7b08d2809cf60eae86d38fc85fc4ea5b067a6fea..88a2816cfee55ebc3ad60179a1d9f77169a90f49 100644 (file)
@@ -2567,7 +2567,18 @@ aix4*)
       _LT_AC_TAGVAR(allow_undefined_flag, $1)='-undefined suppress'
       ;;
     *) # Darwin 1.3 on
-      test -z ${LD_TWOLEVEL_NAMESPACE} && _LT_AC_TAGVAR(allow_undefined_flag, $1)='-flat_namespace -undefined suppress'
+      if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
+       _LT_AC_TAGVAR(allow_undefined_flag, $1)='-flat_namespace -undefined suppress'
+      else
+        case ${MACOSX_DEPLOYMENT_TARGET} in
+          10.[[012]])
+            _LT_AC_TAGVAR(allow_undefined_flag, $1)='-flat_namespace -undefined suppress'
+            ;;
+          10.*)
+            _LT_AC_TAGVAR(allow_undefined_flag, $1)='-undefined dynamic_lookup'
+            ;;            
+        esac
+      fi
       ;;
     esac
     output_verbose_link_cmd='echo'
@@ -2893,7 +2904,18 @@ case $host_os in
       _LT_AC_TAGVAR(allow_undefined_flag, $1)='-undefined suppress'
       ;;
     *) # Darwin 1.3 on
-      test -z ${LD_TWOLEVEL_NAMESPACE} && _LT_AC_TAGVAR(allow_undefined_flag, $1)='-flat_namespace -undefined suppress'
+      if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
+       _LT_AC_TAGVAR(allow_undefined_flag, $1)='-flat_namespace -undefined suppress'
+      else
+        case ${MACOSX_DEPLOYMENT_TARGET} in
+          10.[[012]])
+            _LT_AC_TAGVAR(allow_undefined_flag, $1)='-flat_namespace -undefined suppress'
+            ;;
+          10.*)
+            _LT_AC_TAGVAR(allow_undefined_flag, $1)='-undefined dynamic_lookup'
+            ;;            
+        esac
+      fi
       ;;
     esac
     lt_int_apple_cc_single_mod=no
@@ -5344,7 +5366,18 @@ EOF
        _LT_AC_TAGVAR(allow_undefined_flag, $1)='-undefined suppress'
        ;;
       *) # Darwin 1.3 on
-       test -z ${LD_TWOLEVEL_NAMESPACE} && _LT_AC_TAGVAR(allow_undefined_flag, $1)='-flat_namespace -undefined suppress'
+      if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
+       _LT_AC_TAGVAR(allow_undefined_flag, $1)='-flat_namespace -undefined suppress'
+      else
+        case ${MACOSX_DEPLOYMENT_TARGET} in
+          10.[[012]])
+            _LT_AC_TAGVAR(allow_undefined_flag, $1)='-flat_namespace -undefined suppress'
+            ;;
+          10.*)
+            _LT_AC_TAGVAR(allow_undefined_flag, $1)='-undefined dynamic_lookup'
+            ;;            
+        esac
+      fi
        ;;
       esac
        lt_int_apple_cc_single_mod=no