From f69066726257d07257fce6c5f076bbf27f49b376 Mon Sep 17 00:00:00 2001 From: Brent Cook Date: Tue, 9 Nov 2021 22:34:58 -0600 Subject: [PATCH] Autoconf updates Move machine/endian.h to endian.h, use AC_HEADER_RESOLV over individual header checks, and include prerequisites for netinet/ip.h check. --- include/Makefile.am | 3 +-- include/compat/{machine => }/endian.h | 7 ++----- m4/check-libc.m4 | 8 ++++++-- 3 files changed, 9 insertions(+), 9 deletions(-) rename include/compat/{machine => }/endian.h (90%) diff --git a/include/Makefile.am b/include/Makefile.am index 4184cf8..aed6721 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -7,6 +7,7 @@ SUBDIRS = openssl noinst_HEADERS = pqueue.h noinst_HEADERS += compat/dirent.h noinst_HEADERS += compat/dirent_msvc.h +noinst_HEADERS += compat/endian.h noinst_HEADERS += compat/err.h noinst_HEADERS += compat/fcntl.h noinst_HEADERS += compat/limits.h @@ -26,8 +27,6 @@ noinst_HEADERS += compat/win32netcompat.h noinst_HEADERS += compat/arpa/inet.h noinst_HEADERS += compat/arpa/nameser.h -noinst_HEADERS += compat/machine/endian.h - noinst_HEADERS += compat/netinet/in.h noinst_HEADERS += compat/netinet/ip.h noinst_HEADERS += compat/netinet/tcp.h diff --git a/include/compat/machine/endian.h b/include/compat/endian.h similarity index 90% rename from include/compat/machine/endian.h rename to include/compat/endian.h index bb22f5b..1ed255e 100644 --- a/include/compat/machine/endian.h +++ b/include/compat/endian.h @@ -1,6 +1,6 @@ /* * Public domain - * machine/endian.h compatibility shim + * endian.h compatibility shim */ #ifndef LIBCRYPTOCOMPAT_BYTE_ORDER_H_ @@ -22,7 +22,7 @@ #endif #elif defined(HAVE_ENDIAN_H) -#include +#include_next #elif defined(__sun) || defined(_AIX) || defined(__hpux) #include @@ -32,9 +32,6 @@ #include #include -#else -#include_next - #endif #ifndef __STRICT_ALIGNMENT diff --git a/m4/check-libc.m4 b/m4/check-libc.m4 index cca97c3..40df67f 100644 --- a/m4/check-libc.m4 +++ b/m4/check-libc.m4 @@ -1,7 +1,11 @@ AC_DEFUN([CHECK_LIBC_COMPAT], [ # Check for libc headers -AC_CHECK_HEADERS([err.h readpassphrase.h]) -AC_CHECK_HEADERS([arpa/nameser.h endian.h netinet/ip.h resolv.h]) +AC_CHECK_HEADERS([endian.h err.h readpassphrase.h]) +AC_CHECK_HEADERS([netinet/ip.h], [], [], +[#include +#include +]) +AC_HEADER_RESOLV # Check for general libc functions AC_CHECK_FUNCS([asprintf freezero memmem]) AC_CHECK_FUNCS([readpassphrase reallocarray recallocarray])