Skip to content

Commit

Permalink
Fix mac compilation
Browse files Browse the repository at this point in the history
Update mac configure code with FFmpeg current, this avoids the linker warning:
ld: warning: -read_only_relocs cannot be used with x86_64
Now use -read_only_relocs flag only on 32-bit x86

Also fix compiling on Tiger which would get '-dylib_compatibility_version must be greater than zero' error.
  • Loading branch information
jyavenard committed Mar 2, 2012
1 parent 6bfda0c commit c3544ed
Showing 1 changed file with 20 additions and 14 deletions.
34 changes: 20 additions & 14 deletions mythtv/configure
Expand Up @@ -3127,18 +3127,18 @@ case $target_os in
strip="strip -d"
;;
darwin)
_restrict=__restrict__
enable malloc_aligned
gas="gas-preprocessor.pl $cc"
enabled ppc && add_asflags -force_cpusubtype_ALL
# Workaround compile errors from missing u_int/uint def
CPPFLAGS=`echo $CPPFLAGS | sed 's/-D_POSIX_C_SOURCE=200112//'`
# Workaround compile errors from missing ru_maxrss
add_cppflags -D_DARWIN_C_SOURCE
enable appleremote
enable backend
enable darwin
disable dvb
disable v4l1
disable v4l2
disable x11
# Workaround compile errors from missing u_int/uint def
CFLAGS=`echo $CFLAGS | sed 's/-D_POSIX_C_SOURCE=200112//'`
CPPFLAGS=`echo $CPPFLAGS | sed 's/-D_POSIX_C_SOURCE=200112//'`
# Workaround compile errors from missing ru_maxrss
add_cppflags -D_DARWIN_C_SOURCE
# Prevent linker problems on default Intel 10.5 XCode:
ldver=$(ld -v 2>&1 | sed -e s/^[^-]*-//)
osxver=$(uname -r | cut -c 1)
Expand All @@ -3151,13 +3151,19 @@ EOF
disable mmx
enable disable_mmx_for_debugging # prevent later call to die
fi
disable v4l1
disable v4l2
disable x11
# Workaround compile errors from missing gmtime_r/localtime_r/uint def
CFLAGS=`echo $CFLAGS | sed 's/-D_POSIX_C_SOURCE=200112//'`

###### Standard ffmpeg configure stuff follows:
SHFLAGS='-dynamiclib -Wl,-single_module -Wl,-install_name,$(SHLIBDIR)/$(SLIBNAME),-current_version,$(LIBVERSION),-compatibility_version,$(LIBMAJOR) -Wl,-read_only_relocs,suppress'
enable malloc_aligned
gas="gas-preprocessor.pl $cc"
enabled ppc && add_asflags -force_cpusubtype_ALL

build_os_ver=$(uname -r)
if test ${build_os_ver:0:1} = 8; then
SHFLAGS='-dynamiclib -Wl,-single_module -Wl,-install_name,$(SHLIBDIR)/$(SLIBNAME),-current_version,$(LIBVERSION)'
else
SHFLAGS='-dynamiclib -Wl,-single_module -Wl,-install_name,$(SHLIBDIR)/$(SLIBNAME),-current_version,$(LIBVERSION),-compatibility_version,$(LIBMAJOR)'
fi
enabled x86_32 && append SHFLAGS -Wl,-read_only_relocs,suppress
strip="${strip} -x"
add_ldflags -Wl,-dynamic,-search_paths_first
SLIBSUF=".dylib"
Expand Down

0 comments on commit c3544ed

Please sign in to comment.