summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: c522bd5)
raw | patch | inline | side by side (parent: c522bd5)
author | keescook <keescook@users.sourceforge.net> | |
Wed, 30 Apr 2008 06:34:29 +0000 (06:34 +0000) | ||
committer | keescook <keescook@users.sourceforge.net> | |
Wed, 30 Apr 2008 06:34:29 +0000 (06:34 +0000) |
configure.ac | patch | blob | history |
diff --git a/configure.ac b/configure.ac
index 091ec25ab0ae75703c1ac5bc50625a8c26f49418..822508ef71f0cfc63a34a49fa9fabfbe787dbb5f 100644 (file)
--- a/configure.ac
+++ b/configure.ac
# Enable all default warnings, and also format and format security warnings
CFLAGS="-Wall -Wformat -Wformat-security $CFLAGS"
- # Have linker produce read-only relocations, if it knows how
- CFLAGS="-Wl,-z,relro $CFLAGS"
# What is just plain "-W" ?
# Fortify source requires -O2 or higher, which is handled separately.
CFLAGS="-W -D_FORTIFY_SOURCE=2 $CFLAGS"
CFLAGS="$ink_svd_CFLAGS"
fi
+ # Have linker produce read-only relocations, if it knows how
+ AC_MSG_CHECKING([gcc support for -Wl,-z,relro])
+ ink_svd_CFLAGS="$CFLAGS"
+ CFLAGS="-Wl,-z,relro $CFLAGS"
+ AC_COMPILE_IFELSE(AC_LANG_PROGRAM([]), [gcc_opt_ok=yes], [gcc_opt_ok=no])
+ AC_MSG_RESULT([$gcc_opt_ok])
+ if test "x$gcc_opt_ok" != "xyes"; then
+ CFLAGS="$ink_svd_CFLAGS"
+ fi
+
+
AC_LANG_POP
fi
# Enable all default warnings, and also format and format security warnings
CXXFLAGS="-Wall -Wformat -Wformat-security $CXXFLAGS"
- # Have linker produce read-only relocations, if it knows how
- CXXFLAGS="-Wl,-z,relro $CXXFLAGS"
# What is just plain "-W" ?
# Fortify source requires -O2 or higher, which is handled separately.
CXXFLAGS="-W -D_FORTIFY_SOURCE=2 $CXXFLAGS"
AC_MSG_CHECKING([g++ support for -Werror=format-security])
ink_svd_CXXFLAGS="$CXXFLAGS"
CXXFLAGS="-Werror=format-security $CXXFLAGS"
- AC_COMPILE_IFELSE(AC_LANG_PROGRAM([]), [gxx_opt_ok=yes], [gcc_opt_ok=no])
+ AC_COMPILE_IFELSE(AC_LANG_PROGRAM([]), [gxx_opt_ok=yes], [gxx_opt_ok=no])
+ AC_MSG_RESULT([$gxx_opt_ok])
+ if test "x$gxx_opt_ok" != "xyes"; then
+ CXXFLAGS="$ink_svd_CXXFLAGS"
+ fi
+
+ # Have linker produce read-only relocations, if it knows how
+ AC_MSG_CHECKING([g++ support for -Wl,-z,relro])
+ ink_svd_CXXFLAGS="$CXXFLAGS"
+ CXXFLAGS="-Wl,-z,relro $CXXFLAGS"
+ AC_COMPILE_IFELSE(AC_LANG_PROGRAM([]), [gxx_opt_ok=yes], [gxx_opt_ok=no])
AC_MSG_RESULT([$gxx_opt_ok])
if test "x$gxx_opt_ok" != "xyes"; then
CXXFLAGS="$ink_svd_CXXFLAGS"