summaryrefslogtreecommitdiff
path: root/m4/ax_cflags_no_writable_strings.m4
diff options
context:
space:
mode:
authorPeter Kokot <peterkokot@gmail.com>2018-07-27 09:18:17 +0200
committerPeter Kokot <peterkokot@gmail.com>2018-07-27 18:35:29 +0200
commitb26684dc2f29222d9581089ea8cfb2fc54319fb4 (patch)
treefc9b3a24381315e755f7d3d965634c2a74875cfd /m4/ax_cflags_no_writable_strings.m4
parent68e93457f1d6f73f8e5019e7a0a97851085dc0fa (diff)
downloadautoconf-archive-b26684dc2f29222d9581089ea8cfb2fc54319fb4.tar.gz
Replace obsolete AC_TRY_COMPILE with AC_COMPILE_IFELSE
Autoconf made several macros obsolete including the AC_TRY_COMPILE in 2000 and since Autoconf 2.50: http://git.savannah.gnu.org/cgit/autoconf.git/tree/ChangeLog.2 These macros should be replaced with the current AC_COMPILE_IFELSE instead. Refs: - https://www.gnu.org/software/autoconf/manual/autoconf-2.69/html_node/Obsolete-Macros.html - https://www.gnu.org/software/autoconf/manual/autoconf-2.69/html_node/AC_005fACT_005fIFELSE-vs-AC_005fTRY_005fACT.html
Diffstat (limited to 'm4/ax_cflags_no_writable_strings.m4')
-rw-r--r--m4/ax_cflags_no_writable_strings.m413
1 files changed, 6 insertions, 7 deletions
diff --git a/m4/ax_cflags_no_writable_strings.m4 b/m4/ax_cflags_no_writable_strings.m4
index 9788479..14478a6 100644
--- a/m4/ax_cflags_no_writable_strings.m4
+++ b/m4/ax_cflags_no_writable_strings.m4
@@ -35,7 +35,7 @@
# and this notice are preserved. This file is offered as-is, without any
# warranty.
-#serial 15
+#serial 16
AC_DEFUN([AX_FLAGS_NO_WRITABLE_STRINGS],[dnl
AS_VAR_PUSHDEF([FLAGS],[_AC_LANG_PREFIX[]FLAGS])dnl
@@ -58,18 +58,17 @@ in "-pedantic -Werror % -fno-writable-strings -Wwrite-strings" dnl GCC
"-fullwarn -use_readonly_const %% ok, its the default" dnl IRIX C
#
do FLAGS="$ac_save_[]FLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'`
- AC_TRY_COMPILE([],[return 0;],
- [VAR=`echo $ac_arg | sed -e 's,.*% *,,'` ; break])
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [[return 0;]])],
+ [VAR=`echo $ac_arg | sed -e 's,.*% *,,'` ; break],[])
done
case ".$VAR" in
.|.no|.no,*) ;;
*) # sanity check - testing strcpy() from string.h
cp config.log config.tmp
- AC_TRY_COMPILE([#include <string.h>],[
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <string.h>]], [[
char test[16];
- if (strcpy (test, "test")) return 1;],
- dnl the original did use test -n `$CC testprogram.c`
- [if test `diff config.log config.tmp | grep -i warning | wc -l` != 0
+ if (strcpy (test, "test")) return 1;]])],[dnl the original did use test -n `$CC testprogram.c`
+ if test `diff config.log config.tmp | grep -i warning | wc -l` != 0
then VAR="no, suppressed, string.h," ; fi],
[VAR="no, suppressed, string.h"])
rm config.tmp