From 6d1032e1934a5f1cb24a919722a85d1a6088225a Mon Sep 17 00:00:00 2001 From: Christophe Grenier Date: Sun, 10 Apr 2016 19:16:16 +0200 Subject: [PATCH] Modify configure.ac so ./configure autoreconf generated under Centos 6 works Problem introduced by commit 0 bd7038e19eae2cf7bea47b19bfd90a6dcf1ef97 --- configure.ac | 51 ++++++++++++++++++++++++--------------------------- 1 file changed, 24 insertions(+), 27 deletions(-) diff --git a/configure.ac b/configure.ac index bf21a55b..14e9a47d 100644 --- a/configure.ac +++ b/configure.ac @@ -933,12 +933,12 @@ ACX_PTHREAD([enable_threads="pthread"],[enable_threads="no"]) CFLAGS="$SAVE_CFLAGS" # If using stack protection, try -fstack-protector-strong, if not try to fallback to -fstack-protector-all -AS_IF( - [test $stackProtector = 1], - [AC_MSG_CHECKING([whether stack protection works with gcc])] - [SAVE_CFLAGS="$CFLAGS"] - [CFLAGS="$SAVE_CFLAGS -fstack-protector-strong"] - [AC_COMPILE_IFELSE( +if test $stackProtector = 1; +then + AC_MSG_CHECKING([whether stack protection works with gcc]) + SAVE_CFLAGS="$CFLAGS" + CFLAGS="$SAVE_CFLAGS -fstack-protector-strong" + AC_COMPILE_IFELSE( [AC_LANG_PROGRAM([])], [has_option=yes], [CFLAGS="$SAVE_CFLAGS -fstack-protector-all"] @@ -948,19 +948,18 @@ AS_IF( [has_option=no; CFLAGS="$SAVE_CFLAGS"] [AC_MSG_WARN([Cannot configure with stack protection])] )] - )] - [AC_MSG_RESULT($has_option)] - [unset has_option] - [unset SAVE_CFLAGS], - [] - ) -AS_IF( - [test $stackProtector = 1], - [AC_MSG_CHECKING([whether stack protection works with g++])] - [AC_LANG_PUSH([C++])] - [SAVE_CXXFLAGS="$CXXFLAGS"] - [CXXFLAGS="$SAVE_CXXFLAGS -fstack-protector-strong"] - [AC_COMPILE_IFELSE( + ) + AC_MSG_RESULT($has_option) + unset has_option + unset SAVE_CFLAGS +fi +if test $stackProtector = 1; +then + AC_MSG_CHECKING([whether stack protection works with g++]) + AC_LANG_PUSH([C++]) + SAVE_CXXFLAGS="$CXXFLAGS" + CXXFLAGS="$SAVE_CXXFLAGS -fstack-protector-strong" + AC_COMPILE_IFELSE( [AC_LANG_PROGRAM([])], [has_option=yes], [CXXFLAGS="$SAVE_CXXFLAGS -fstack-protector-all"] @@ -971,14 +970,12 @@ AS_IF( [CXXFLAGS="$SAVE_CXXFLAGS"] [AC_MSG_WARN([Cannot configure with stack protection])] )] - )] - [AC_MSG_RESULT($has_option)] - [unset has_option] - [unset SAVE_CXXFLAGS] - [AC_LANG_POP([C++])], - [] - ) - + ) + AC_MSG_RESULT($has_option) + unset has_option + unset SAVE_CXXFLAGS + AC_LANG_POP([C++]) +fi photorecf_LDADD=$photorec_LDADD CFLAGS="$CFLAGS $coverage_flags"