summaryrefslogtreecommitdiff
path: root/ltmain.sh
diff options
context:
space:
mode:
authorAndreas Tobler <a.tobler@schweiz.ch>2003-11-19 06:29:32 +0100
committerAndreas Tobler <andreast@gcc.gnu.org>2003-11-19 06:29:32 +0100
commit43d8d958ceabe3fa77308f115e2e616d307b9b3d (patch)
treea48bbeae29df42ceed0c81554bc0e2cce1f201d5 /ltmain.sh
parentf7a75b82d2228bdd8b92bef1138660b78454fae2 (diff)
libtool.m4: Sync darwin bits from libtool cvs to build a gcc with shared/dylibed libraries.
2003-11-19 Andreas Tobler <a.tobler@schweiz.ch> * libtool.m4: Sync darwin bits from libtool cvs to build a gcc with shared/dylibed libraries. * ltmain.sh: Likewise. * ltcf-c.sh: Likewise, disable shared library build for OS-X < 10.3. * ltcf-cxx.sh: Likewise. * ltcf-gcj.sh: Likewise. * ltconfig: Likewise. From-SVN: r73729
Diffstat (limited to 'ltmain.sh')
-rw-r--r--ltmain.sh59
1 files changed, 58 insertions, 1 deletions
diff --git a/ltmain.sh b/ltmain.sh
index 5d4281c54d2..5ccf95c7d1d 100644
--- a/ltmain.sh
+++ b/ltmain.sh
@@ -1111,6 +1111,19 @@ EOF
finalize_command="$finalize_command $wl$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=
@@ -1363,6 +1376,10 @@ EOF
prev=xlinker
continue
;;
+ -framework)
+ prev=framework
+ continue
+ ;;
# Some other compiler flag.
-* | +*)
@@ -1841,6 +1858,13 @@ EOF
*) . ./$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 = oldlib && test $linkmode = obj; }; then
@@ -2446,6 +2470,7 @@ EOF
case $outputname in
lib*)
name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
+ eval shared_ext=\"$shrext\"
eval libname=\"$libname_spec\"
;;
*)
@@ -2457,6 +2482,7 @@ EOF
if test "$need_lib_prefix" != no; then
# Add the "lib" prefix for modules if required
name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
+ eval shared_ext=\"$shrext\"
eval libname=\"$libname_spec\"
else
libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
@@ -2644,7 +2670,16 @@ EOF
# Clear the version info if we defaulted, and they specified a release.
if test -z "$vinfo" && test -n "$release"; then
major=
- verstring="0.0"
+ case $version_type in
+ darwin)
+ # we can't check for "0.0" in archive_cmds due to quoting
+ # problems, so we reset it completely
+ verstring=
+ ;;
+ *)
+ verstring="0.0"
+ ;;
+ esac
if test "$need_version" = no; then
versuffix=
else
@@ -3020,6 +3055,14 @@ EOF
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!
# Done checking deplibs!
deplibs=$newdeplibs
fi
@@ -3088,6 +3131,7 @@ EOF
# Get the real and link names of the library.
eval library_names=\"$library_names_spec\"
+ eval shared_ext=\"$shrext\"
set dummy $library_names
realname="$2"
shift; shift
@@ -3533,6 +3577,19 @@ EOF
;;
esac
+ case $host in
+ *-*-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
+
compile_command="$compile_command $compile_deplibs"
finalize_command="$finalize_command $finalize_deplibs"