r18956: fix -pie and -fPIE together with configure -C
authorStefan Metzmacher <metze@samba.org>
Wed, 27 Sep 2006 14:10:35 +0000 (14:10 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 17:14:50 +0000 (12:14 -0500)
metze

source/configure.in

index c5ad0aa93a86fc5fb62b352f0433099539b4e66a..d97ca54485b8a3e861fa1c06203beb9f83be7570 100644 (file)
@@ -340,22 +340,23 @@ AC_ARG_ENABLE(pie, [  --enable-pie            Turn on pie support if available (
 
 if test "x$enable_pie" != xno
 then
-       AC_CACHE_CHECK(for -fPIE, libc_cv_fpie, [dnl
+       AC_CACHE_CHECK(for -pie and -fPIE, samba_cv_fpie, [dnl
                cat > conftest.c <<EOF
 int foo;
 main () { return 0;}
 EOF
                if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS -pie -fPIE -o conftest conftest.c 1>&AS_MESSAGE_LOG_FD])
                then
-                       libc_cv_fpie=yes
-                       PIE_CFLAGS="-fPIE"
-                       PIE_LDFLAGS="-pie"
+                       samba_cv_fpie=yes
+               else
+                       samba_cv_fpie=no
                fi
                rm -f conftest*])
 fi
-if test "x$PIE_CFLAGS" = x
+if test x"${samba_cv_fpie}" = x"yes"
 then
-       libc_cv_fpie=no
+       PIE_CFLAGS="-fPIE"
+       PIE_LDFLAGS="-pie"
 fi
 
 m4_include(lib/socket_wrapper/config.m4)