]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
* libtool.m4: Update support for NetBSD binary-branch
authorNick Hudson <skrll@netbsd.org>
Fri, 17 May 2002 16:11:41 +0000 (16:11 +0000)
committerRobert Boehne <rboehne@gnu.org>
Fri, 17 May 2002 16:11:41 +0000 (16:11 +0000)
* ltdl.m4: Make sure that libltdl_cv_func_dlopen and
libltdl_cv_lib_dl_dlopen are set and used instead of the
ac_cv_ versions. Also, use lt_cv_sys_global_symbol_pipe
instread of global_symbol_pipe. This fixes the detection of
dlopen on BSD derived plaforms and more importantly fixes
need_uscore detection.

ChangeLog
libtool.m4
ltdl.m4

index dd214e26de4630e5201a1243a34e93202da0628a..010dafc653cfbffb0d1281abff7d1a2a82fb5964 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2002-05-09  Nick Hudson  <skrll@netbsd.org>
+
+       * libtool.m4: Update support for NetBSD
+       * ltdl.m4: Make sure that libltdl_cv_func_dlopen and
+       libltdl_cv_lib_dl_dlopen are set and used instead of the
+       ac_cv_ versions. Also, use lt_cv_sys_global_symbol_pipe
+       instread of global_symbol_pipe. This fixes the detection of
+       dlopen on BSD derived plaforms and more importantly fixes
+       need_uscore detection.
+
 2002-05-06  Paul Eggert  <eggert@twinsun.com>
 
        * libtool.m4 (AC_LIBTOOL_PROG_LD_SHLIBS): head -1 -> sed 1q to
index 7c8add4479161b8353b43e99dd73fe4b671764cb..b238a8eaa973ec389cbf0942a208d7180600b6be 100644 (file)
@@ -1974,9 +1974,9 @@ linux*)
 
 netbsd*)
   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
-    lt_cv_deplibs_check_method='match_pattern /lib[[^/\.]]+\.so\.[[0-9]]+\.[[0-9]]+$'
+    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
   else
-    lt_cv_deplibs_check_method='match_pattern /lib[[^/\.]]+\.so$'
+    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$'
   fi
   ;;
 
@@ -2789,7 +2789,15 @@ case $host_os in
     esac
     ;;
   netbsd*)
-    # NetBSD uses g++ - do we need to do anything?
+    if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable  -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
+      wlarc=
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+    fi
+    # Workaround some broken pre-1.5 toolchains
+    output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | egrep conftest.$objext | sed -e "s:-lgcc -lc -lgcc::"'
     ;;
   osf3*)
     case $cc_basename in
diff --git a/ltdl.m4 b/ltdl.m4
index d24745fbddef9ed284bfbae6aac702d5e6c7f0c8..dd7e239c9d111975c9241fdd5d1589db851224a4 100644 (file)
--- a/ltdl.m4
+++ b/ltdl.m4
@@ -279,7 +279,7 @@ AC_DEFUN([AC_LTDL_DLPREOPEN],
 [AC_REQUIRE([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])
 AC_CACHE_CHECK([whether libtool supports -dlopen/-dlpreopen],
   [libltdl_cv_preloaded_symbols],
-  [if test -n "$global_symbol_pipe"; then
+  [if test -n "$lt_cv_sys_global_symbol_pipe"; then
     libltdl_cv_preloaded_symbols=yes
   else
     libltdl_cv_preloaded_symbols=no
@@ -309,18 +309,18 @@ AC_CHECK_FUNC([shl_load],
     [AC_CHECK_LIB([dl], [dlopen],
          [AC_DEFINE([HAVE_LIBDL], [1],
                     [Define if you have the libdl library or equivalent.])
-         LIBADD_DL="-ldl"],
+               LIBADD_DL="-ldl" libltdl_cv_lib_dl_dlopen="yes"],
       [AC_TRY_LINK([#if HAVE_DLFCN_H
 #  include <dlfcn.h>
 #endif
       ],
        [dlopen(0, 0);],
            [AC_DEFINE([HAVE_LIBDL], [1],
-                      [Define if you have the libdl library or equivalent.])],
+                            [Define if you have the libdl library or equivalent.]) libltdl_cv_func_dlopen="yes"],
        [AC_CHECK_LIB([svld], [dlopen],
              [AC_DEFINE([HAVE_LIBDL], [1],
                         [Define if you have the libdl library or equivalent.])
-             LIBADD_DL="-lsvld"],
+                   LIBADD_DL="-lsvld" libltdl_cv_func_dlopen="yes"],
          [AC_CHECK_LIB([dld], [dld_link],
                [AC_DEFINE([HAVE_DLD], [1],
                           [Define if you have the GNU dld library.])
@@ -332,7 +332,7 @@ AC_CHECK_FUNC([shl_load],
   ])
 ])
 
-if test x"$ac_cv_func_dlopen" = xyes || test x"$ac_cv_lib_dl_dlopen" = xyes
+if test x"$libltdl_cv_func_dlopen" = xyes || test x"$libltdl_cv_lib_dl_dlopen" = xyes
 then
   lt_save_LIBS="$LIBS"
   LIBS="$LIBS $LIBADD_DL"
@@ -358,7 +358,7 @@ EOF
   if AC_TRY_EVAL(ac_compile); then
     # Now try to grab the symbols.
     ac_nlist=conftest.nm
-    if AC_TRY_EVAL(NM conftest.$ac_objext \| $global_symbol_pipe \> $ac_nlist) && test -s "$ac_nlist"; then
+    if AC_TRY_EVAL(NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $ac_nlist) && test -s "$ac_nlist"; then
       # See whether the symbols have a leading underscore.
       if egrep '^. _nm_test_func' "$ac_nlist" >/dev/null; then
         ac_cv_sys_symbol_underscore=yes
@@ -370,7 +370,7 @@ EOF
         fi
       fi
     else
-      echo "configure: cannot run $global_symbol_pipe" >&AC_FD_CC
+      echo "configure: cannot run $lt_cv_sys_global_symbol_pipe" >&AC_FD_CC
     fi
   else
     echo "configure: failed program was:" >&AC_FD_CC
@@ -386,8 +386,8 @@ EOF
 AC_DEFUN([AC_LTDL_DLSYM_USCORE],
 [AC_REQUIRE([AC_LTDL_SYMBOL_USCORE])
 if test x"$ac_cv_sys_symbol_underscore" = xyes; then
-  if test x"$ac_cv_func_dlopen" = xyes ||
-     test x"$ac_cv_lib_dl_dlopen" = xyes ; then
+  if test x"$libltdl_cv_func_dlopen" = xyes ||
+     test x"$libltdl_cv_lib_dl_dlopen" = xyes ; then
        AC_CACHE_CHECK([whether we have to add an underscore for dlsym],
          [libltdl_cv_need_uscore],
          [libltdl_cv_need_uscore=unknown