changeset 36041:5f730ed5b3d2

Add workaround to allow compiling 64 bit MPlayer with clang on OSX.
author reimar
date Wed, 03 Apr 2013 09:40:30 +0000
parents 5ecbf382ff26
children 134919b73b04
files configure
diffstat 1 files changed, 9 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/configure	Mon Apr 01 18:16:20 2013 +0000
+++ b/configure	Wed Apr 03 09:40:30 2013 +0000
@@ -2851,9 +2851,16 @@
 echocheck "PIC"
 def_pic='#define CONFIG_PIC 0'
 pic=no
-cpp_condition_check '' 'defined(__PIC__) || defined(__pic__) || defined(PIC)' &&
-  pic=yes && extra_cflags="$extra_cflags -DPIC" && def_pic='#define CONFIG_PIC 1'
+cpp_condition_check '' 'defined(__PIC__) || defined(__pic__) || defined(PIC)' && pic=yes
+# This check is needed to work around issues with clang on OSX when compiling 64 bit relocatable binaries.
+if x86_64 && test "$relocatable" = "yes" && test "$pic" = "no"; then
+  res_comment="Broken compiler incorrectly claims PIC not necessary for PIE"
+  pic=yes
+fi
 echores $pic
+if test "$pic" = "yes" ; then
+  extra_cflags="$extra_cflags -DPIC" && def_pic='#define CONFIG_PIC 1'
+fi
 
 
 def_bswap='#define HAVE_BSWAP 0'