summaryrefslogtreecommitdiff
path: root/configure
diff options
context:
space:
mode:
authorRoland McGrath <roland@hack.frob.com>2012-05-14 15:42:52 -0700
committerRoland McGrath <roland@hack.frob.com>2012-05-16 16:20:59 -0700
commit61653dfb81b776bb72ce4304175b861d77c357a8 (patch)
tree588d62fd799fae6b3aef3958788ef72d7f71bd37 /configure
parent90c885c87bdb3380d430d3f72a4a5cabf2835167 (diff)
downloadglibc-61653dfb81b776bb72ce4304175b861d77c357a8.tar.gz
BZ#10375: Configure magic to use -U_FORTIFY_SOURCE if needed.
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure35
1 files changed, 35 insertions, 0 deletions
diff --git a/configure b/configure
index e664260b06..c295277e40 100755
--- a/configure
+++ b/configure
@@ -632,6 +632,7 @@ libc_cv_localedir
libc_cv_slibdir
old_glibc_headers
libc_cv_gcc_unwind_find_fde
+CPPUNDEFS
sizeof_long_double
EGREP
GREP
@@ -7542,6 +7543,40 @@ _ACEOF
sizeof_long_double=$ac_cv_sizeof_long_double
+CPPUNDEFS=
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for _FORTIFY_SOURCE predefine" >&5
+$as_echo_n "checking for _FORTIFY_SOURCE predefine... " >&6; }
+if ${libc_cv_predef_fortify_source+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+#ifdef _FORTIFY_SOURCE
+# error bogon
+#endif
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ libc_cv_predef_fortify_source=no
+else
+ libc_cv_predef_fortify_source=yes
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_predef_fortify_source" >&5
+$as_echo "$libc_cv_predef_fortify_source" >&6; }
+if test $libc_cv_predef_fortify_source = yes; then
+ CPPUNDEFS="${CPPUNDEFS:+$CPPUNDEFS }-U_FORTIFY_SOURCE"
+fi
+
+
### End of automated tests.
### Now run sysdeps configure fragments.