From c3544ed053e91ba98b79fabc0620a8f6d3ee4504 Mon Sep 17 00:00:00 2001 From: Jean-Yves Avenard Date: Fri, 2 Mar 2012 17:04:00 +1100 Subject: [PATCH] Fix mac compilation 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. --- mythtv/configure | 34 ++++++++++++++++++++-------------- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/mythtv/configure b/mythtv/configure index 8c7f8ae0425..09152493dda 100755 --- a/mythtv/configure +++ b/mythtv/configure @@ -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) @@ -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"