summaryrefslogtreecommitdiff
path: root/contrib/ffmpeg-universal.sh
diff options
context:
space:
mode:
authorMatthias Ringwald <mringwal@inf.ethz.ch>2008-04-04 00:49:09 +0100
committerMatthias Ringwald <mringwal@inf.ethz.ch>2008-04-04 00:49:09 +0100
commit9fba3dc0e822470dfaa73899365063909121ab57 (patch)
treed4db65857b260af5c534c94f863682f3d8898ed4 /contrib/ffmpeg-universal.sh
parentde706f4f3630a8b306b15b042c5c585d5922ce1f (diff)
downloadxine-lib-9fba3dc0e822470dfaa73899365063909121ab57.tar.gz
xine-lib-9fba3dc0e822470dfaa73899365063909121ab57.tar.bz2
Don't remove -mdynamic-no-pic for linkers other than ld64-77
Removing this flag (probably) helps for mac intel x86-64 builds with XCode 3.0 (with linker ld64-77) but it breaks builds for other (e.g. newer) linker versions on mac intel x86-32. Only remove flag for this particular linker now.
Diffstat (limited to 'contrib/ffmpeg-universal.sh')
-rwxr-xr-xcontrib/ffmpeg-universal.sh20
1 files changed, 14 insertions, 6 deletions
diff --git a/contrib/ffmpeg-universal.sh b/contrib/ffmpeg-universal.sh
index 6e27c56b8..53a9ed425 100755
--- a/contrib/ffmpeg-universal.sh
+++ b/contrib/ffmpeg-universal.sh
@@ -52,12 +52,20 @@ function run_configure {
--extra-ldflags="$EXTRA_LDFLAGS"
local retval=$?
- # We're building ffmpeg to put it into a shared library, but ffmpeg thinks
- # it's building to put it into a static library or program image, so it
- # adds -mdynamic-no-pic to its list of options as an optimization. This is
- # fine in Tiger if later linked with -Wl,-read_only_relocs,warning, but it
- # isn't fine on other versions of Mac OS X.
- if test -f config.mak; then
+ # Although we're building ffmpeg to put it into a shared library, we
+ # configure it as a static library. For static libraries, ffmpeg adds
+ # -mdynamic-no-pic to its list of options as an optimization.
+ #
+ # With this, we end up linking code which uses absolute addressing into
+ # a shared library. This is fine with all versions of Apple's Developer
+ # Tools but not when compiling for x86 with the linker (ld64-77)
+ # contained in XCode 3.0. XCode 3.0 is default for Leopard (10.5.x).
+ #
+ # For x86-64 compilation, removing the -mdynamic-no-pic helps
+ # For x86-32 compilation, either MMX optimization has to be disabled
+ # or the asm code needs to be written in a PIC way (not done here).
+ #
+ if test -f config.mak && what /usr/bin/ld | grep -q ld64-77; then
cat config.mak | sed -e '/OPTFLAGS=/s/-mdynamic-no-pic//g' > config.tmp
mv -f config.tmp config.mak
fi