Skip to content

Commit

Permalink
Date: Mon, 17 Nov 2003 23:12:59 +0100
Browse files Browse the repository at this point in the history
From: Max Horn
Subject: SDL building "the unix way" on OS X

I just noticed that building current SDL CVS "the unix way" (using
configure/make) is (and has been for some time, it seems) broken.
That's because Sam updated to a newer libtool version, which removed my
"-framework" patches.

Attached is a patch which once again makes ltmain.sh aware of
"-framework". Note that this is simply a backport of the corresponding
changes in libtool CVS (i.e. the next libtool release will contain
those same changes).
  • Loading branch information
slouken committed Nov 18, 2003
1 parent d5b58c2 commit d653a41
Showing 1 changed file with 64 additions and 4 deletions.
68 changes: 64 additions & 4 deletions ltmain.sh
Expand Up @@ -1148,6 +1148,19 @@ EOF
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=
Expand Down Expand Up @@ -1459,6 +1472,11 @@ EOF
continue
;;

-framework)
prev=framework
continue
;;

# Some other compiler flag.
-* | +*)
# Unknown arguments in both finalize_command and compile_command need
Expand Down Expand Up @@ -1868,6 +1886,18 @@ EOF
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)
Expand Down Expand Up @@ -1996,6 +2026,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" != prog && test "$linkmode" != lib; }; then
Expand Down Expand Up @@ -2568,14 +2605,18 @@ EOF
if test -f "$path/$depdepl" ; then
depdepl="$path/$depdepl"
fi
newlib_search_path="$newlib_search_path $path"
path=""
# do not add paths which are already there
case " $newlib_search_path " in
*" $path "*) ;;
*) newlib_search_path="$newlib_search_path $path";;
esac
fi
path=""
;;
*)
path="-L$path"
;;
esac
esac

;;
-l*)
Expand All @@ -2594,6 +2635,15 @@ EOF
*) continue ;;
esac
;;

*.framework)
case $host in
*-*-darwin*)
depdepl="$deplib"
;;
esac
;;

*) continue ;;
esac
case " $deplibs " in
Expand Down Expand Up @@ -3446,6 +3496,13 @@ 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!
deplibs=$newdeplibs
fi
Expand Down Expand Up @@ -4025,12 +4082,15 @@ EOF
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

Expand Down

0 comments on commit d653a41

Please sign in to comment.