index : pacman | |
Archlinux32 fork of pacman | gitolite user |
summaryrefslogtreecommitdiff |
author | Allan McRae <allan@archlinux.org> | 2012-07-16 14:24:29 +1000 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2012-08-01 09:16:46 -0500 |
commit | d2669b47812aebfe3ada7df4c7d7525790ef9c33 (patch) | |
tree | ac0640af441883a043a468704895ea5cd7862755 /m4/acinclude.m4 | |
parent | e94876089a934fde13984b59e735b35f92837d96 (diff) |
-rw-r--r-- | m4/acinclude.m4 | 12 |
diff --git a/m4/acinclude.m4 b/m4/acinclude.m4 index 4455d261..f57a515e 100644 --- a/m4/acinclude.m4 +++ b/m4/acinclude.m4 @@ -40,11 +40,15 @@ AC_DEFUN([GCC_STACK_PROTECT_CC],[ dnl GCC_FORTIFY_SOURCE_CC dnl checks -D_FORTIFY_SOURCE with the C compiler, if it exists then updates -dnl CFLAGS +dnl CPPFLAGS AC_DEFUN([GCC_FORTIFY_SOURCE_CC],[ AC_LANG_ASSERT(C) if test "X$CC" != "X"; then AC_MSG_CHECKING(for FORTIFY_SOURCE support) + fs_old_cppflags="$CPPFLAGS" + fs_old_cflags="$CFLAGS" + CPPFLAGS="$CPPFLAGS -D_FORTIFY_SOURCE=2" + CFLAGS="$CFLAGS -Werror" AC_TRY_COMPILE([#include <features.h>], [ int main() { #if !(__GNUC_PREREQ (4, 1) ) @@ -54,10 +58,12 @@ AC_DEFUN([GCC_FORTIFY_SOURCE_CC],[ } ], [ AC_MSG_RESULT(yes) - CPPFLAGS="$CPPFLAGS -D_FORTIFY_SOURCE=2" + CFLAGS="$df_old_cflags" ], [ AC_MSG_RESULT(no) - ]) + CPPFLAGS="$df_old_cppflags" + CFLAGS="$df_old_cflags" + ]) fi ]) |