From: Nick Hudson Date: Fri, 6 Apr 2001 21:24:52 +0000 (+0000) Subject: * ltmain.in: Implement a new deplibs_check_method called X-Git-Tag: multi-language-merge-point~38 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=23b3e57e153164dce33404f92b2e120d3240c981;p=thirdparty%2Flibtool.git * ltmain.in: Implement a new deplibs_check_method called match_pattern that does pattern matching on filenames... * libtool.m4: ...use it with NetBSD --- diff --git a/ChangeLog b/ChangeLog index db8eb62d1..8d0e5e76d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2001-04-06 Nick Hudson + + * 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 * doc/libtool.texi (Multiple dependencies): A note about the diff --git a/libtool.m4 b/libtool.m4 index 0be8bc252..d44222903 100644 --- a/libtool.m4 +++ b/libtool.m4 @@ -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) diff --git a/ltmain.in b/ltmain.in index acdac4ba3..67d4d3881 100644 --- 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$//' \