aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorReimar Döffinger <Reimar.Doeffinger@gmx.de>2009-11-10 12:57:28 +0000
committerReimar Döffinger <Reimar.Doeffinger@gmx.de>2009-11-10 12:57:28 +0000
commit5755bc88e51a82dd00897d840df2a688631da768 (patch)
tree4a3696f43b2874f2c2c4319db38fb0febfbbc5ff
parent00fa73f052c1c0c0185ee4d2accb8fba065132f1 (diff)
downloadffmpeg-5755bc88e51a82dd00897d840df2a688631da768.tar.gz
Check if PIC is somehow already enabled (e.g. a compiler that enables it by default).
This in particular ensures that -DPIC is set appropriately for YASM, which avoids linking failures on x86_64 for compilers that have PIE enabled by default (e.g. hardened Gentoo). It also makes the macho64 special-case hack adding -DPIC to YASMFLAGS obsolete. Originally committed as revision 20497 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rwxr-xr-xconfigure4
1 files changed, 3 insertions, 1 deletions
diff --git a/configure b/configure
index 7ad3c2638e..83791fc02b 100755
--- a/configure
+++ b/configure
@@ -1876,6 +1876,9 @@ esac
enable $arch $subarch
enabled spic && enable pic
+# This is the same check as used in libavutil/internal.h
+# to enable RIP-relative addressing for x86_64 inline asm.
+check_cpp_condition stdlib.h "defined(__PIC__) || defined(__pic__) || defined(PIC)" && enable pic
# OS specific
case $target_os in
@@ -2237,7 +2240,6 @@ EOF
test -n "$extern_prefix" && append YASMFLAGS "-DPREFIX"
case "$objformat" in
elf) enabled debug && append YASMFLAGS "-g dwarf2" ;;
- macho64) append YASMFLAGS "-DPIC" ;;
esac
disabled yasm || { check_yasm "pabsw xmm0, xmm0" && enable yasm; }