about summary refs log tree commit diff
path: root/configure.ac
diff options
context:
space:
mode:
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac37
1 files changed, 35 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac
index 9cbc0bf68f..d5a00461ff 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1468,6 +1468,15 @@ if test $libc_cv_cc_loop_to_function = yes; then
 fi
 AC_SUBST(libc_cv_cc_loop_to_function)
 
+AC_CACHE_CHECK([for -Wimplicit-fallthrough],
+	       libc_cv_cc_wimplicit_fallthrough, [dnl
+LIBC_TRY_CC_OPTION([-Werror -Wimplicit-fallthrough],
+		   [libc_cv_cc_wimplicit_fallthrough=-Wimplicit-fallthrough],
+		   [libc_cv_cc_wimplicit_fallthrough=])
+])
+LIBC_CONFIG_VAR([cc-option-wimplicit-fallthrough],
+		[$libc_cv_cc_wimplicit_fallthrough])
+
 dnl Check whether we have the gd library available.
 AC_MSG_CHECKING(for libgd)
 if test "$with_gd" != "no"; then
@@ -1527,7 +1536,7 @@ dnl If not, then don't use it.
 dnl Note that _FORTIFY_SOURCE may have been set through FLAGS too.
 dnl _FORTIFY_SOURCE value will be selectively disabled for function that can't
 dnl support it
-no_fortify_source="-Wp,-U_FORTIFY_SOURCE"
+no_fortify_source="-U_FORTIFY_SOURCE"
 fortify_source="${no_fortify_source}"
 
 AC_CACHE_CHECK([for maximum supported _FORTIFY_SOURCE level],
@@ -1546,7 +1555,7 @@ AS_CASE([$enable_fortify_source],
         [libc_cv_fortify_source=no])
 
 AS_IF([test "$libc_cv_fortify_source" = yes],
-      [fortify_source="${fortify_source},-D_FORTIFY_SOURCE=${enable_fortify_source}"]
+      [fortify_source="${fortify_source} -D_FORTIFY_SOURCE=${enable_fortify_source}"]
       )
 
 AC_SUBST(enable_fortify_source)
@@ -1555,6 +1564,30 @@ AC_SUBST(no_fortify_source)
 AC_SUBST(fortify_source)
 LIBC_CONFIG_VAR([supported-fortify], [$libc_cv_supported_fortify_source])
 
+dnl Check if compiler define _FILE_OFFSET_BITS by default
+AC_PREPROC_IFELSE([AC_LANG_PROGRAM([[]], [[
+#ifndef _FILE_OFFSET_BITS
+# error _FILE_OFFSET_BITS not defined
+#endif]])],
+	       [libc_cv_compiler_default_file_offset_bits=yes],
+	       [libc_cv_compiler_default_file_offset_bits=no])
+AS_IF([test "$libc_cv_compiler_default_file_offset_bits" = yes],
+      [no_file_offset_bits_source="-U_FILE_OFFSET_BITS"])
+AC_SUBST(no_file_offset_bits_source)
+LIBC_CONFIG_VAR([no-file-offset-bits-source], [$no_file_offset_bits_source])
+
+dnl Check if compiler define _TIME_BITS by default
+AC_PREPROC_IFELSE([AC_LANG_PROGRAM([[]], [[
+#ifndef _TIME_BITS
+# error _TIME_BITS not defined
+#endif]])],
+	       [libc_cv_compiler_default_time_bits=yes],
+	       [libc_cv_compiler_default_time_bits=no])
+AS_IF([test "$libc_cv_compiler_default_time_bits" = yes],
+      [no_time_bits_source="-U_TIME_BITS"])
+AC_SUBST(no_time_bits_source)
+LIBC_CONFIG_VAR([no-time-bits-source], [$no_time_bits_source])
+
 dnl Starting with binutils 2.35, GAS can attach multiple symbol versions
 dnl to one symbol (PR 23840).
 AC_CACHE_CHECK(whether the assembler requires one version per symbol,