Skip to content

Commit

Permalink
Fix AC_CHECK_HEADERS usage for autoconf 2.69
Browse files Browse the repository at this point in the history
The fourth argument of AC_CHECK_HEADERS (used to indicate the set of
includes), is mandatory for autoconf 2.69 and earlier to force modern
behavior of the macro.

The semantics of the macro changed from using a preprocessor-only check to
a compiler check, and the fourth argument determines the use of: classic
behavior (for compatibility), a transitional check of both and warnings
(returning retro-compatible but potentially inconsistent results), or the
use of the modern compiler-based test only. Specifying this argument also
suppresses a warning about the topic.

Fixes: 4ada39f ("build: fix tirpc usage xinetd-org#27")
Ref: openSUSE#40
Signed-off-by: Ismael Luceno <[email protected]>
  • Loading branch information
ismaell committed Sep 23, 2022
1 parent 4ada39f commit 4560269
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -134,11 +134,16 @@ AS_IF([test x"$with_rpc" != "xno"], [
have_rpc=maybe
save_CPPFLAGS=$CPPFLAGS
CPPFLAGS="$CPPFLAGS $RPC_CFLAGS"
AC_CHECK_HEADERS([rpc/rpc.h],, [have_rpc=no])
dnl TODO: remove 4th arg to AC_CHECK_HEADERS when we AC_PREREQ 2.70+.
dnl It is required with autoconf < 2.70 (the feature has been available
dnl since 2.60 at least), to enforce the modern compiler-based checking
dnl (otherwise it just prints a warning, but uses the result of the
dnl preprocessor-based test instead).
AC_CHECK_HEADERS([rpc/rpc.h],, [have_rpc=no], [AC_INCLUDES_DEFAULT])
dnl FIXME do a linking test
AS_IF([test x"$have_rpc" = xmaybe], [
dnl XXX is this header really optional?
AC_CHECK_HEADERS([rpc/rpcent.h])
dnl TODO check if the following header is really optional
AC_CHECK_HEADERS([rpc/rpcent.h],,, [AC_INCLUDES_DEFAULT])
have_rpc=yes
])
CPPFLAGS=$save_CPPFLAGS
Expand Down

0 comments on commit 4560269

Please sign in to comment.