From: Peter O'Gorman Date: Mon, 21 Jun 2004 14:52:57 +0000 (+0000) Subject: * ltmain.in (dependency_libs) [darwin]: Remove -framework stuff from X-Git-Tag: release-1-9b~64 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=50376ef19a408f6ed551877dfd152e1d786a595f;p=thirdparty%2Flibtool.git * ltmain.in (dependency_libs) [darwin]: Remove -framework stuff from dependency_libs. Instead, invent a new .la var "inherited_linker_flags" to keep any linker flags which should be used when linking the library, but are outside the usual -L -l, -R etc that can be used in dependency_libs. Any unusual flags in dependency_libs cause recent versions of libtool to die with "cannot find the library `'", so it is required to move frameworks out of there. :( --- diff --git a/ChangeLog b/ChangeLog index e60159bd7..aec4d61aa 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2004-06-21 Peter O'Gorman + + * ltmain.in (dependency_libs) [darwin]: Remove -framework stuff from + dependency_libs. Instead, invent a new .la var "inherited_linker_flags" + to keep any linker flags which should be used when linking the library, + but are outside the usual -L -l, -R etc that can be used in + dependency_libs. Any unusual flags in dependency_libs cause recent + versions of libtool to die with "cannot find the library `'", so + it is required to move frameworks out of there. :( + 2004-06-21 Gary V. Vaughan From Ralf Wildenhues : diff --git a/ltmain.in b/ltmain.in index 93611e56a..aa8cff5bb 100644 --- a/ltmain.in +++ b/ltmain.in @@ -1904,7 +1904,7 @@ EOF case $pass in dlopen) libs="$dlfiles" ;; dlpreopen) libs="$dlprefiles" ;; - link) libs="$deplibs %DEPLIBS% $dependency_libs" ;; + link) libs="$deplibs %DEPLIBS% $dependency_libs $inherited_linker_flags" ;; esac fi if test "$pass" = dlopen; then @@ -2004,7 +2004,10 @@ EOF else deplibs="$deplib $deplibs" if test "$linkmode" = lib ; then - newdependency_libs="$deplib $newdependency_libs" + case "$inherited_linker_flags " in + *" $deplib "*) ;; + * ) inherited_linker_flags="$inherited_linker_flags $deplib" ;; + esac fi fi continue @@ -2126,6 +2129,7 @@ EOF libdir= library_names= old_library= + inherited_linker_flags= # If the library was installed with an old release of libtool, # it will not redefine variables installed, or shouldnotlink installed=yes @@ -2139,8 +2143,11 @@ EOF case $host in *-*-darwin*) - # Convert "-framework foo" to "foo.ltframework" in dependency_libs - test -n "$dependency_libs" && dependency_libs=`$echo "X$dependency_libs" | $Xsed -e 's/-framework \([^ $]*\)/\1.ltframework/g'` + # Convert "-framework foo" to "foo.ltframework" + if test -n "$inherited_linker_flags"; then + inherited_linker_flags=`$echo "X$inherited_linker_flags" | $Xsed -e 's/-framework \([^ $]*\)/\1.ltframework/g'` + fi + dependency_libs=`$echo "X $dependency_libs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` ;; esac @@ -2689,7 +2696,7 @@ EOF if test "$link_all_deplibs" != no; then # Add the search paths of all dependency libraries - for deplib in $dependency_libs; do + for deplib in $dependency_libs $inherited_linker_flags; do case $deplib in -L*) path="$deplib" ;; *.la) @@ -2763,14 +2770,6 @@ EOF esac ;; - *.ltframework) - case $host in - *-*-darwin*) - depdepl="$deplib" - ;; - esac - ;; - *) continue ;; esac case " $deplibs " in @@ -3635,16 +3634,17 @@ EOF fi fi fi - # Time to change all our "foo.ltframework" stuff back to "-framework foo" - case $host in - *-*-darwin*) - newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` - dependency_libs=`$echo "X $dependency_libs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` - ;; - esac # Done checking deplibs! deplibs=$newdeplibs fi + # Time to change all our "foo.ltframework" stuff back to "-framework foo" + case $host in + *-*-darwin*) + newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` + inherited_linker_flags=`$echo "X $inherited_linker_flags" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` + deplibs=`$echo "X $deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` + ;; + esac # All the library-specific variables (install_libdir is set above). library_names= @@ -5518,6 +5518,9 @@ library_names='$library_names' # The name of the static archive. old_library='$old_library' +# Linker flags that can not go in dependency_libs. +inherited_linker_flags='$inherited_linker_flags' + # Libraries that this one depends upon. dependency_libs='$dependency_libs'