Imported Upstream version 1.6.0
[platform/upstream/augeas.git] / acinclude.m4
index 7168cf3..31988b1 100644 (file)
@@ -19,7 +19,7 @@ AC_DEFUN([AUGEAS_COMPILE_WARNINGS],[
 
     warnCFLAGS=
 
-    common_flags="-Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fasynchronous-unwind-tables"
+    common_flags="-fexceptions -fasynchronous-unwind-tables"
 
     case "$enable_compile_warnings" in
     no)
@@ -45,6 +45,14 @@ AC_DEFUN([AUGEAS_COMPILE_WARNINGS],[
        ;;
     esac
 
+    AH_VERBATIM([FORTIFY_SOURCE],
+    [/* Enable compile-time and run-time bounds-checking, and some warnings,
+        without upsetting newer glibc. */
+     #if !defined _FORTIFY_SOURCE && defined __OPTIMIZE__ && __OPTIMIZE__
+     # define _FORTIFY_SOURCE 2
+     #endif
+    ])
+
     compiler_flags=
     for option in $try_compiler_flags; do
        SAVE_CFLAGS="$CFLAGS"
@@ -134,7 +142,7 @@ AC_DEFUN([AUGEAS_CHECK_READLINE], [
   if test $use_readline = yes; then
       saved_libs=$LIBS
       LIBS=$READLINE_LIBS
-      AC_CHECK_FUNCS([rl_completion_matches])
+      AC_CHECK_FUNCS([rl_completion_matches rl_crlf rl_replace_line])
       LIBS=$saved_libs
   fi
 ])