summaryrefslogtreecommitdiff
path: root/configure.in
diff options
context:
space:
mode:
authorThorsten Kukuk <kukuk@thkukuk.de>2006-01-12 15:34:49 +0000
committerThorsten Kukuk <kukuk@thkukuk.de>2006-01-12 15:34:49 +0000
commit15d1bd639b095fe63c164dcb5ba8977e8eecb73b (patch)
treec233e06b20af14146282a48a44846072ed3e756b /configure.in
parent94483545da687d9dba81175575d07ba9f77a3eb5 (diff)
Relevant BUGIDs: none
Purpose of commit: new feature Commit summary: --------------- 2006-01-12 Thorsten Kukuk <kukuk@thkukuk.de> * configure.in: Add check for -fpie/-pie * modules/pam_filter/upperLOWER/Makefile.am: Compile/link upperLOWER with -fpie/-pie if supported. * modules/pam_unix/Makefile.am: Compile/link unix_chkpwd with -fpie/-pie if supported.
Diffstat (limited to 'configure.in')
-rw-r--r--configure.in30
1 files changed, 30 insertions, 0 deletions
diff --git a/configure.in b/configure.in
index de800a62..0b0b18f2 100644
--- a/configure.in
+++ b/configure.in
@@ -142,6 +142,36 @@ AM_CONDITIONAL([HAVE_VERSIONING],
[test "$libc_cv_ld_version_script_option" = "yes"])
dnl
+dnl check for -fPIE/-pie support
+dnl
+AC_ARG_ENABLE(pie,AS_HELP_STRING([--disable-pie],
+ [Disable position-independent executeables (PIE)]),
+ USE_PIE=$enableval, USE_PIE=yes)
+
+AC_CACHE_CHECK(for -fpie, libc_cv_fpie, [dnl
+ cat > conftest.c <<EOF
+int foo;
+main () { return 0;}
+EOF
+ if test "$USE_PIE" = "yes" &&
+ 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"
+ else
+ libc_cv_fpie=no
+ PIE_CFLAGS=""
+ PIE_LDFLAGS=""
+ fi
+ rm -f conftest*])
+AC_SUBST(libc_cv_fpie)
+AC_SUBST(PIE_CFLAGS)
+AC_SUBST(PIE_LDFLAGS)
+
+
+dnl
dnl options and defaults
dnl