check to see if '-Wl,-pie' is supported before using it

This commit is contained in:
Jack Wink 2014-12-28 12:59:53 -05:00
parent 6ebf4030f8
commit 9c9d1edf74

View File

@ -159,10 +159,13 @@ AS_CASE([$host_os], [cygwin*|mingw*|msys|pw32*|cegcc*], [ ], [
AS_IF([test "$enable_pie" != "no"],[ AS_IF([test "$enable_pie" != "no"],[
AX_CHECK_COMPILE_FLAG([-fPIE], [ AX_CHECK_COMPILE_FLAG([-fPIE], [
AX_CHECK_LINK_FLAG([-fPIE], AX_CHECK_LINK_FLAG([-fPIE], [
[AX_CHECK_LINK_FLAG([-pie], CFLAGS="$CFLAGS -fPIE"
[CFLAGS="$CFLAGS -fPIE" AX_CHECK_COMPILE_FLAG(["-Wl,-pie"], [
LDFLAGS="$LDFLAGS -Wl,-pie"]) LDFLAGS="$LDFLAGS -Wl,-pie"
], [
LDFLAGS="$LDFLAGS -pie"
])
]) ])
]) ])
]) ])