summaryrefslogtreecommitdiff
path: root/m4
diff options
context:
space:
mode:
authorbogdro <93281795+bogdro@users.noreply.github.com>2022-03-30 19:18:49 +0200
committerGitHub <noreply@github.com>2022-03-30 19:18:49 +0200
commit1d3b0b9c0705b4698ec0a65fe7b56e2a75d94c4d (patch)
tree88fbcd7ae6536e1319b2e90f74c22ec6426f375b /m4
parent203f15bb8aac7a9f793074711c1549003f8796cf (diff)
downloadautoconf-archive-1d3b0b9c0705b4698ec0a65fe7b56e2a75d94c4d.tar.gz
Fix deprecated things in ax_prototype.m4
Fix deprecated things in ax_prototype.m4, other small changes.
Diffstat (limited to 'm4')
-rw-r--r--m4/ax_prototype.m424
1 files changed, 14 insertions, 10 deletions
diff --git a/m4/ax_prototype.m4 b/m4/ax_prototype.m4
index 445dff6..8ce0e38 100644
--- a/m4/ax_prototype.m4
+++ b/m4/ax_prototype.m4
@@ -26,13 +26,13 @@
#
# Generic usage pattern:
#
-# 1) add a call in configure.in
+# 1) add a call in configure.ac
#
# AX_PROTOTYPE(...)
#
# 2) call autoheader to see which symbols are not covered
#
-# 3) add the lines in acconfig.h
+# 3) add the lines in config.h
#
# /* Type of Nth argument of function */
# #undef FUNCTION_ARGN
@@ -41,7 +41,7 @@
#
# Complete example:
#
-# 1) configure.in
+# 1) configure.ac
#
# AX_PROTOTYPE(getpeername,
# [
@@ -59,10 +59,10 @@
#
# 2) call autoheader
#
-# autoheader: Symbol `GETPEERNAME_ARG2' is not covered by ./acconfig.h
-# autoheader: Symbol `GETPEERNAME_ARG3' is not covered by ./acconfig.h
+# autoheader: Symbol `GETPEERNAME_ARG2' is not covered by ./config.h
+# autoheader: Symbol `GETPEERNAME_ARG3' is not covered by ./config.h
#
-# 3) acconfig.h
+# 3) config.h
#
# /* Type of second argument of getpeername */
# #undef GETPEERNAME_ARG2
@@ -114,7 +114,7 @@
# modified version of the Autoconf Macro, you may extend this special
# exception to the GPL to apply to your modified version as well.
-#serial 9
+#serial 10
AU_ALIAS([AC_PROTOTYPE], [AX_PROTOTYPE])
AC_DEFUN([AX_PROTOTYPE],[
@@ -217,9 +217,13 @@ dnl
dnl Activate fatal warnings if possible, gives better guess
dnl
ac_save_CPPFLAGS="$CPPFLAGS"
- ifelse(AC_LANG,CPLUSPLUS,if test "$GXX" = "yes" ; then CPPFLAGS="$CPPFLAGS -Werror" ; fi)
- ifelse(AC_LANG,C,if test "$GCC" = "yes" ; then CPPFLAGS="$CPPFLAGS -Werror" ; fi)
- AC_TRY_COMPILE($2, $1, [
+dnl ifelse(AC_LANG,CPLUSPLUS,if test "$GXX" = "yes" ; then CPPFLAGS="$CPPFLAGS -Werror" ; fi)
+dnl ifelse(AC_LANG,C,if test "$GCC" = "yes" ; then CPPFLAGS="$CPPFLAGS -Werror" ; fi)
+dnl TODO: consider the compiler check from ax_cflags_warn_all.m4
+ if (test "x$GCC" = "xyes" || test "x$GXX" = "xyes" ); then CPPFLAGS="$CPPFLAGS -Werror" ; fi
+
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([$2], [$1])],
+ [
CPPFLAGS="$ac_save_CPPFLAGS"
AC_MSG_RESULT(ok)
AX_PROTOTYPE_DEFINES(tags)