libtool-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

fixes for darwin framework handling


From: Benjamin Reed
Subject: fixes for darwin framework handling
Date: Fri, 02 Jan 2004 18:24:29 -0500
User-agent: Mozilla Thunderbird 0.5a (20031229)

Attached is a patch that fixes using frameworks when paths containing <foo>.framework in them show up in library flags.

For example, I have a framework that contains some libraries inside the Resources directory in the framework that gets referenced like so:

  -L/Library/Frameworks/glib.framework/Resources

Because of the framework name munging this gets turned into:

  -framework -L/Library/Frameworks/glib/Resources

...on the gcc command-line, which is wrong.

Instead, I use "ltframework" as the intermediate framework naming convention, to avoid conflicts with foo.framework.

It also contains a 1-liner fix for $shrext being used in the clear when it needs to be evaluated first.


Index: ltmain.in
===================================================================
RCS file: /cvsroot/libtool/libtool/ltmain.in,v
retrieving revision 1.363
diff -u -r1.363 ltmain.in
--- ltmain.in   2 Jan 2004 01:59:10 -0000       1.363
+++ ltmain.in   2 Jan 2004 23:20:00 -0000
@@ -1225,8 +1225,8 @@
          case $host in
            *-*-darwin*)
              case "$deplibs " in
-               *" $qarg.framework "*) ;;
-               *) deplibs="$deplibs $qarg.framework" # this is fixed later
+               *" $qarg.ltframework "*) ;;
+               *) deplibs="$deplibs $qarg.ltframework" # this is fixed later
                   ;;
               esac
               ;;
@@ -1355,7 +1355,7 @@
            ;;
          *-*-rhapsody* | *-*-darwin1.[012])
            # Rhapsody C and math libraries are in the System framework
-           deplibs="$deplibs System.framework"
+           deplibs="$deplibs System.ltframework"
            continue
          esac
        elif test "X$arg" = "X-lc_r"; then
@@ -1879,7 +1879,8 @@
          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
-           for search_ext in .la $shrext .so .a; do
+           eval shared_ext=\"$shrext\"
+           for search_ext in .la $shared_ext .so .a; do
              # Search the libtool library
              lib="$searchdir/lib${name}${search_ext}"
              if test -f "$lib"; then
@@ -2083,7 +2084,7 @@
        case $host in
        *-*-darwin*)
          # Convert "-framework foo" to "foo.framework" in dependency_libs
-         test -n "$dependency_libs" && dependency_libs=`$echo 
"X$dependency_libs" | $Xsed -e 's/-framework \([^ $]*\)/\1.framework/g'`
+         test -n "$dependency_libs" && dependency_libs=`$echo 
"X$dependency_libs" | $Xsed -e 's/-framework \([^ $]*\)/\1.ltframework/g'`
          ;;
        esac
 
@@ -3220,7 +3221,7 @@
            ;;
          *-*-rhapsody* | *-*-darwin1.[012])
            # Rhapsody C library is in the System framework
-           deplibs="$deplibs System.framework"
+           deplibs="$deplibs System.ltframework"
            ;;
          *-*-netbsd*)
            # Don't link with libc until the a.out ld.so is fixed.
@@ -3513,7 +3514,7 @@
        case $host in
        *-*-rhapsody* | *-*-darwin1.[012])
          # On Rhapsody replace the C library is the System framework
-         newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / 
System.framework /'`
+         newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / 
System.ltframework /'`
          ;;
        esac
 
@@ -3562,8 +3563,8 @@
        # Time to change all our "foo.framework" stuff back to "-framework foo"
        case $host in
          *-*-darwin*)
-           newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's% \([^ 
$]*\).framework% -framework \1%g'`
-           dependency_libs=`$echo "X $dependency_libs" | $Xsed -e 's% \([^ 
$]*\).framework% -framework \1%g'`
+           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!
@@ -4156,8 +4157,8 @@
       case $host in
       *-*-rhapsody* | *-*-darwin1.[012])
        # On Rhapsody replace the C library is the System framework
-       compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / 
System.framework /'`
-       finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / 
System.framework /'`
+       compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / 
System.ltframework /'`
+       finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / 
System.ltframework /'`
        ;;
       esac
 
@@ -4169,8 +4170,8 @@
         finalize_command="$finalize_command ${wl}-bind_at_load"
         fi
        # Time to change all our "foo.framework" stuff back to "-framework foo"
-       compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's% \([^ 
$]*\).framework% -framework \1%g'`
-       finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's% \([^ 
$]*\).framework% -framework \1%g'`
+       compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's% \([^ 
$]*\).ltframework% -framework \1%g'`
+       finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's% \([^ 
$]*\).ltframework% -framework \1%g'`
         ;;
       esac
 

Attachment: pgpFbduR9bkxg.pgp
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]