diff options
author | Peter Simons <simons@cryp.to> | 2022-04-25 13:54:42 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-25 13:54:42 +0200 |
commit | bb8b3c0657408c46e4d7939e34b959c511a5e2ba (patch) | |
tree | f7270b0022977ee1b2f13ec792d5da0853435821 | |
parent | 7290e0e0bcf1afd212683aedc43d5fe7325437e9 (diff) | |
parent | 1d3b0b9c0705b4698ec0a65fe7b56e2a75d94c4d (diff) | |
download | autoconf-archive-bb8b3c0657408c46e4d7939e34b959c511a5e2ba.tar.gz |
Merge pull request #249 from bogdro/ax_prototype
Fix deprecated things in ax_prototype.m4
-rw-r--r-- | m4/ax_prototype.m4 | 24 |
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) |