Fix libtool bug where -framework options are silently ignored on a Mac.

Testing appreciated on all platforms.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/branches/BRANCH_1_6_X@29438 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Jean-Marc Lasgouttes 2009-04-29 14:27:22 +00:00
parent 88eca7e8a3
commit 45a25cf67e
2 changed files with 65 additions and 6 deletions

View File

@ -1471,6 +1471,19 @@ EOF
prev=
continue
;;
framework)
case $host in
*-*-darwin*)
case "$deplibs " in
*" $qarg.ltframework "*) ;;
*) deplibs="$deplibs $qarg.ltframework" # this is fixed later
;;
esac
;;
esac
prev=
continue
;;
*)
eval "$prev=\"\$arg\""
prev=
@ -1613,7 +1626,7 @@ EOF
;;
*-*-rhapsody* | *-*-darwin1.[012])
# Rhapsody C and math libraries are in the System framework
deplibs="$deplibs -framework System"
deplibs="$deplibs System.ltframework"
continue
;;
*-*-sco3.2v5* | *-*-sco5v6*)
@ -1841,6 +1854,11 @@ EOF
continue
;;
-framework)
prev=framework
continue
;;
# Some other compiler flag.
-* | +*)
# Unknown arguments in both finalize_command and compile_command need
@ -2229,6 +2247,18 @@ EOF
fi
fi
;; # -l
*.ltframework)
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)
@ -2374,6 +2404,13 @@ EOF
*) . ./$lib ;;
esac
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'`
;;
esac
if test "$linkmode,$pass" = "lib,link" ||
test "$linkmode,$pass" = "prog,scan" ||
{ test "$linkmode" != prog && test "$linkmode" != lib; }; then
@ -3005,6 +3042,15 @@ EOF
*) continue ;;
esac
;;
*.ltframework)
case $host in
*-*-darwin*)
depdepl="$deplib"
;;
esac
;;
*) continue ;;
esac
case " $deplibs " in
@ -3531,7 +3577,7 @@ EOF
;;
*-*-rhapsody* | *-*-darwin1.[012])
# Rhapsody C library is in the System framework
deplibs="$deplibs -framework System"
deplibs="$deplibs System.ltframework"
;;
*-*-netbsd*)
# Don't link with libc until the a.out ld.so is fixed.
@ -3826,7 +3872,7 @@ EOF
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.ltframework /'`
;;
esac
@ -3872,6 +3918,13 @@ 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
@ -4411,18 +4464,21 @@ EOF
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.ltframework /'`
finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / System.ltframework /'`
;;
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.ltframework" stuff back to "-framework foo"
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

View File

@ -298,6 +298,9 @@ What's new
* BUILD/INSTALLATION
- Fix building of LyX/Mac with autotools when using -framework gcc
option.
- Fix build on Cygwin when using gcc4.
- Fix "make check" with gcc 4.3.