configure: Undefine FORTIFY_SOURCE prior to defining it for patched gcc
[asterisk/asterisk.git] / configure.ac
index c97bcab..aa3cfd4 100644 (file)
@@ -1045,9 +1045,9 @@ fi
 AC_SUBST(AST_TRAMPOLINES)
 
 AC_MSG_CHECKING(for _FORTIFY_SOURCE support)
 AC_SUBST(AST_TRAMPOLINES)
 
 AC_MSG_CHECKING(for _FORTIFY_SOURCE support)
-if $(${CC} -D_FORTIFY_SOURCE=2 -S -o /dev/null -xc /dev/null > /dev/null 2>&1); then
+if $(${CC} -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -S -o /dev/null -xc /dev/null > /dev/null 2>&1); then
        AC_MSG_RESULT(yes)
        AC_MSG_RESULT(yes)
-       AST_FORTIFY_SOURCE=-D_FORTIFY_SOURCE=2
+       AST_FORTIFY_SOURCE="-U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2"
 else
        AC_MSG_RESULT(no)
        AST_FORTIFY_SOURCE=
 else
        AC_MSG_RESULT(no)
        AST_FORTIFY_SOURCE=