[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: handle the -framework flag
From: |
Peter O'Gorman |
Subject: |
Re: handle the -framework flag |
Date: |
Tue, 9 Sep 2003 22:42:07 +0900 |
This patch allows -framework foo on darwin, passes all but the
mdemo2-exec.test (I submitted a patch for that about a month ago, any
takers on committing it?).
Thanks,
Peter
Index: ChangeLog
===================================================================
RCS file: /cvsroot/libtool/libtool/ChangeLog,v
retrieving revision 1.1256
diff -u -d -b -w -u -r1.1256 ChangeLog
--- ChangeLog 29 Aug 2003 17:07:17 -0000 1.1256
+++ ChangeLog 9 Sep 2003 13:37:34 -0000
@@ -1,3 +1,9 @@
+2003-09-09 Peter O'Gorman <address@hidden>
+
+ * ltmain.in: Accept -framework for darwin and put it in
+ dependency_libs. For non-installed .la's try to avoid having
+ ./.libs/.libs/libfoo.so on the link line.
+
2003-08-29 Gary V. Vaughan <address@hidden>
* bootstrap: Typo.
Index: ltmain.in
===================================================================
RCS file: /cvsroot/libtool/libtool/ltmain.in,v
retrieving revision 1.341
diff -u -d -b -w -u -r1.341 ltmain.in
--- ltmain.in 31 Jul 2003 20:41:34 -0000 1.341
+++ ltmain.in 9 Sep 2003 13:37:36 -0000
@@ -1148,6 +1148,20 @@
finalize_command="$finalize_command $qarg"
continue
;;
+ framework)
+ case $host in
+ *-*-darwin*)
+ case "$deplibs " in
+ *" $qarg.framework "*) ;;
+ *)
+ deplibs="$deplibs $qarg.framework" # this is fixed later
+ ;;
+ esac
+ ;;
+ esac
+ prev=
+ continue
+ ;;
*)
eval "$prev=\"\$arg\""
prev=
@@ -1272,7 +1286,7 @@
;;
*-*-rhapsody* | *-*-darwin1.[012])
# Rhapsody C and math libraries are in the System framework
- deplibs="$deplibs -framework System"
+ deplibs="$deplibs System.framework"
continue
esac
elif test "X$arg" = "X-lc_r"; then
@@ -1459,6 +1473,11 @@
continue
;;
+ -framework)
+ prev=framework
+ continue
+ ;;
+
# Some other compiler flag.
-* | +*)
# Unknown arguments in both finalize_command and compile_command need
@@ -1869,11 +1888,24 @@
fi
fi
;;
+
*) ;;
esac
fi
fi
;; # -l
+ *.framework)
+ if test "$linkmode,$pass" = "prog,link"; then
+ compile_deplibs="$deplib $compile_deplibs"
+ finalize_deplibs="$deplib $finalize_deplibs"
+ else
+ deplibs="$deplib $deplibs"
+ if test "$linkmode" = lib ; then
+ newdependency_libs="$deplib $newdependency_libs"
+ fi
+ fi
+ continue
+ ;;
-L*)
case $linkmode in
lib)
@@ -2001,7 +2033,12 @@
*/* | *\\*) . $lib ;;
*) . ./$lib ;;
esac
-
+ 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'`
+ ;;
+ esac
if test "$linkmode,$pass" = "lib,link" ||
test "$linkmode,$pass" = "prog,scan" ||
{ test "$linkmode" != prog && test "$linkmode" != lib; }; then
@@ -2092,10 +2129,17 @@
absdir="$libdir"
fi
else
+ if test ! -f "$ladir/$objdir/$linklib" && test -f
"$abs_ladir/$linklib"; then
+ dir="$ladir"
+ absdir="$abs_ladir"
+ # Remove this search path later
+ notinst_path="$notinst_path $abs_ladir"
+ else
dir="$ladir/$objdir"
absdir="$abs_ladir/$objdir"
# Remove this search path later
notinst_path="$notinst_path $abs_ladir"
+ fi
fi # $installed = yes
name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
@@ -2604,6 +2648,15 @@
*) continue ;;
esac
;;
+
+ *.framework)
+ case $host in
+ *-*-darwin*)
+ depdepl="$deplib"
+ ;;
+ esac
+ ;;
+
*) continue ;;
esac
case " $deplibs " in
@@ -2717,7 +2770,6 @@
dlfiles="$newdlfiles"
dlprefiles="$newdlprefiles"
fi
-
case $linkmode in
oldlib)
if test -n "$deplibs"; then
@@ -3117,7 +3169,7 @@
;;
*-*-rhapsody* | *-*-darwin1.[012])
# Rhapsody C library is in the System framework
- deplibs="$deplibs -framework System"
+ deplibs="$deplibs System.framework"
;;
*-*-netbsd*)
# Don't link with libc until the a.out ld.so is fixed.
@@ -3410,7 +3462,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 / -framework
System /'`
+ newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc /
System.framework /'`
;;
esac
@@ -3456,6 +3508,13 @@
fi
fi
fi
+ # 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'`
+ ;;
+ esac
# Done checking deplibs!
deplibs=$newdeplibs
fi
@@ -4029,18 +4088,21 @@
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 /
-framework System /'`
- finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc /
-framework System /'`
+ compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc /
System.framework /'`
+ finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc /
System.framework /'`
;;
esac
case $host in
- *darwin*)
+ *-*-darwin*)
# Don't allow lazy linking, it breaks C++ global constructors
if test "$tagname" = CXX ; then
compile_command="$compile_command ${wl}-bind_at_load"
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'`
;;
esac
- handle the -framework flag, Benjamin Reed, 2003/09/04
- Re: handle the -framework flag, Peter O'Gorman, 2003/09/05
- Re: handle the -framework flag,
Peter O'Gorman <=
- Re: handle the -framework flag, Gary V . Vaughan, 2003/09/10
- Re: handle the -framework flag, Peter O'Gorman, 2003/09/10
- Re: handle the -framework flag, Gary V. Vaughan, 2003/09/10
- Re: handle the -framework flag, Benjamin Reed, 2003/09/10
- Re: handle the -framework flag, Peter O'Gorman, 2003/09/10