[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Getting the wrong library
From: |
Benjamin Reed |
Subject: |
Re: Getting the wrong library |
Date: |
Sun, 01 Jun 2003 19:09:37 -0400 |
User-agent: |
Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.3; StumbleUpon.com) Gecko/20030529 |
Peter O'Gorman wrote:
> Hi.
>
> On Monday, June 2, 2003, at 02:13 AM, Benjamin Reed wrote:
>
>> Attached is a patch to fix this. This works on darwin and should work
>> on anything else as I'm using $shrext as part of the extension search.
>
>
> $shrext already has a ".", perhaps changing this to
>
> for search_ext in ".la" $shrext ".so" ".a" is better.
d'oh! you're right. Probably worked for me 'cause it found the .a
anyways or something.
Attached is the fixed patch.
Index: ChangeLog
===================================================================
RCS file: /cvsroot/libtool/libtool/ChangeLog,v
retrieving revision 1.1229
diff -u -r1.1229 ChangeLog
--- ChangeLog 30 May 2003 15:25:10 -0000 1.1229
+++ ChangeLog 1 Jun 2003 17:05:36 -0000
@@ -1,3 +1,8 @@
+2003-06-01 Benjamin Reed <address@hidden>
+
+ * ltmain.in: search libraries in the order of preference, rather
+ than picking .la's even if they're in a less preferred directory.
+
2003-05-30 Gary V. Vaughan <address@hidden>
* libltdl/ltdl.c (argz_insert): Corrected an off by one error when
Index: ltmain.in
===================================================================
RCS file: /cvsroot/libtool/libtool/ltmain.in,v
retrieving revision 1.335
diff -u -r1.335 ltmain.in
--- ltmain.in 9 Apr 2003 17:54:06 -0000 1.335
+++ ltmain.in 1 Jun 2003 16:45:14 -0000
@@ -1813,12 +1813,18 @@
fi
name=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
for searchdir in $newlib_search_path $lib_search_path
$sys_lib_search_path $shlib_search_path; do
- # Search the libtool library
- lib="$searchdir/lib${name}.la"
- if test -f "$lib"; then
- found=yes
- break
- fi
+ for search_ext in .la $shrext .so .a; do
+ # Search the libtool library
+ lib="$searchdir/lib${name}${search_ext}"
+ if test -f "$lib"; then
+ if test "$search_ext" = ".la"; then
+ found=yes
+ else
+ found=no
+ fi
+ break 2
+ fi
+ done
done
if test "$found" != yes; then
# deplib doesn't seem to be a libtool library
pgpeHRjR2XS99.pgp
Description: PGP signature