]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
* ltmain.in: Implement a new deplibs_check_method called
authorNick Hudson <skrll@netbsd.org>
Fri, 6 Apr 2001 21:24:52 +0000 (21:24 +0000)
committerGary V. Vaughan <gary@gnu.org>
Fri, 6 Apr 2001 21:24:52 +0000 (21:24 +0000)
match_pattern that does pattern matching on filenames...
* libtool.m4: ...use it with NetBSD

ChangeLog
libtool.m4
ltmain.in

index db8eb62d1608d7f45a731dcbf29492415d79b003..8d0e5e76d7b22c721364b1f8a9f270fffa17e026 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2001-04-06  Nick Hudson  <skrll@netbsd.org>
+
+       * ltmain.in: Implement a new deplibs_check_method called
+       match_pattern that does pattern matching on filenames...
+       * libtool.m4: ...use it with NetBSD
+
 2001-04-05  Gary V. Vaughan  <gvv@techie.com>
 
        * doc/libtool.texi (Multiple dependencies): A note about the
index 0be8bc25228e284aa3b470c7d2328147a5e1fec5..d4422290336f104249fdba68239ffaa840d5842c 100644 (file)
@@ -608,12 +608,10 @@ linux-gnu*)
 
 netbsd*)
   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
-    [lt_cv_deplibs_check_method='file_magic NetBSD/[a-z0-9]* demand paged shared library']
+    [lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$']
   else
-    [lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB shared object']
+    [lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so$']
   fi
-  lt_cv_file_magic_cmd='/usr/bin/file -L'
-  lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
   ;;
 
 newsos6)
index acdac4ba30d6ead80b477c5cdebabc9de987947e..67d4d3881c56d149b28d8dc4340d563f6f8a9868 100644 (file)
--- a/ltmain.in
+++ b/ltmain.in
@@ -2913,6 +2913,40 @@ EOF
            fi
          done # Gone through all deplibs.
          ;;
+       match_pattern*)
+         set dummy $deplibs_check_method
+         match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
+         for a_deplib in $deplibs; do
+           name="`expr $a_deplib : '-l\(.*\)'`"
+           # If $name is empty we are operating on a -L argument.
+           if test "$name" != "" -a "$name" != "0"; then
+             libname=`eval \\$echo \"$libname_spec\"`
+             for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
+               potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
+               for potent_lib in $potential_libs; do
+                 if eval echo \"$potent_lib\" 2>/dev/null \
+                     | sed 10q \
+                     | egrep "$match_pattern_regex" > /dev/null; then
+                   newdeplibs="$newdeplibs $a_deplib"
+                   a_deplib=""
+                   break 2
+                 fi
+               done
+             done
+             if test -n "$a_deplib" ; then
+               droppeddeps=yes
+               echo
+               echo "*** Warning: This library needs some functionality provided by $a_deplib."
+               echo "*** I have the capability to make that library automatically link in when"
+               echo "*** you link to this library.  But I can only do this if you have a"
+               echo "*** shared version of the library, which you do not appear to have."
+             fi
+           else
+             # Add a -L argument.
+             newdeplibs="$newdeplibs $a_deplib"
+           fi
+         done # Gone through all deplibs.
+         ;;
        none | unknown | *)
          newdeplibs=""
          if $echo "X $deplibs" | $Xsed -e 's/ -lc$//' \