diff --git a/configure.ac b/configure.ac index 1be45244..d4a436bc 100644 --- a/configure.ac +++ b/configure.ac @@ -159,10 +159,13 @@ AS_CASE([$host_os], [cygwin*|mingw*|msys|pw32*|cegcc*], [ ], [ AS_IF([test "$enable_pie" != "no"],[ AX_CHECK_COMPILE_FLAG([-fPIE], [ - AX_CHECK_LINK_FLAG([-fPIE], - [AX_CHECK_LINK_FLAG([-pie], - [CFLAGS="$CFLAGS -fPIE" - LDFLAGS="$LDFLAGS -Wl,-pie"]) + AX_CHECK_LINK_FLAG([-fPIE], [ + CFLAGS="$CFLAGS -fPIE" + AX_CHECK_COMPILE_FLAG(["-Wl,-pie"], [ + LDFLAGS="$LDFLAGS -Wl,-pie" + ], [ + LDFLAGS="$LDFLAGS -pie" + ]) ]) ]) ])