]> git.sesse.net Git - ffmpeg/commitdiff
check for prefix on extern symbols in configure
authorMåns Rullgård <mans@mansr.com>
Tue, 18 Mar 2008 02:01:20 +0000 (02:01 +0000)
committerMåns Rullgård <mans@mansr.com>
Tue, 18 Mar 2008 02:01:20 +0000 (02:01 +0000)
Originally committed as revision 12484 to svn://svn.ffmpeg.org/ffmpeg/trunk

configure
libavutil/internal.h

index 8c241cfcf183651e35825203702be0aff4d88ffc..16860d2514dd9c9967d95be7a7a9b8cd3eceb205 100755 (executable)
--- a/configure
+++ b/configure
@@ -1491,6 +1491,12 @@ if test "$?" != 0; then
     die "C compiler test failed."
 fi
 
+check_cc <<EOF || die "Symbol mangling check failed."
+int ff_extern;
+EOF
+sym=$(nm -P $TMPO)
+extern_prefix=${sym%%ff_extern*}
+
 check_asm inline_asm '""'
 
 if enabled x86; then
@@ -2070,6 +2076,7 @@ enabled asmalign_pot &&
     printf '#define ASMALIGN(ZEROBITS) ".align " #ZEROBITS "\\n\\t"\n' >> $TMPH ||
     printf '#define ASMALIGN(ZEROBITS) ".align 1<<" #ZEROBITS "\\n\\t"\n' >> $TMPH
 
+echo "#define EXTERN_PREFIX \"${extern_prefix}\"" >> $TMPH
 
 echo "#endif /* FFMPEG_CONFIG_H */" >> $TMPH
 
index 6f1dd806398c3eab26dce78e4ce38c04e647018d..ccb0974ad22f58f83220fdab559f8cf52011077a 100644 (file)
 #endif
 
 // Use rip-relative addressing if compiling PIC code on x86-64.
-#if defined(__MINGW32__) || defined(__CYGWIN__) || defined(__DJGPP__) || \
-    defined(__OS2__) || defined(__APPLE__) || \
-    (defined (__OpenBSD__) && !defined(__ELF__))
-#    if defined(ARCH_X86_64) && defined(PIC)
-#        define MANGLE(a) "_" #a"(%%rip)"
-#    else
-#        define MANGLE(a) "_" #a
-#    endif
-#elif defined(ARCH_X86_64) && defined(PIC)
-#    define MANGLE(a) #a"(%%rip)"
+#if defined(ARCH_X86_64) && defined(PIC)
+#    define MANGLE(a) EXTERN_PREFIX #a"(%%rip)"
 #else
-#    define MANGLE(a) #a
+#    define MANGLE(a) EXTERN_PREFIX #a
 #endif
 
 /* debug stuff */