diff --git a/libbuild2-autoconf/libbuild2/autoconf/checks/BUILD2_AUTOCONF_LIBC_VERSION.h b/libbuild2-autoconf/libbuild2/autoconf/checks/BUILD2_AUTOCONF_LIBC_VERSION.h index 7f5705f..dad33e0 100644 --- a/libbuild2-autoconf/libbuild2/autoconf/checks/BUILD2_AUTOCONF_LIBC_VERSION.h +++ b/libbuild2-autoconf/libbuild2/autoconf/checks/BUILD2_AUTOCONF_LIBC_VERSION.h @@ -31,9 +31,11 @@ * #if defined(__FreeBSD__) * #if defined(__OpenBSD__) * #if defined(__NetBSD__) - * #if defined(__APPLE__) && defined(__MACH__) * - * Note that just __APPLE__ covers all the Apple platforms (MacOS, iOS, etc). + * Except for MacOS, which we detect using our own macro (for the sake of + * simplicity): + * + * #if defined(BUILD2_AUTOCONF_MACOS) * * Macros for detecting platforms and their versions: * @@ -155,8 +157,16 @@ * * Return 1 if the given version number is >= the Mac OS version, or 0 * otherwise. + * + * BUILD2_AUTOCONF_MACOS + * + * Defined if the current platform is MacOS, or undefined otherwise. */ #if defined(__APPLE__) && defined(__MACH__) +/* Note that just __APPLE__ covers all the Apple platforms (MacOS, iOS, etc). + */ +# define BUILD2_AUTOCONF_MACOS 1 + # if !defined(__MAC_OS_X_VERSION_MIN_REQUIRED) # error __MAC_OS_X_VERSION_MIN_REQUIRED not defined # endif @@ -168,6 +178,8 @@ (__MAC_OS_X_VERSION_MIN_REQUIRED >= (maj)*10000 + (min)*100) # endif #else +# undef BUILD2_AUTOCONF_MACOS + # define BUILD2_AUTOCONF_MACOS_PREREQ(maj, min) 0 #endif diff --git a/libbuild2-autoconf/libbuild2/autoconf/checks/HAVE_DLOPEN.h b/libbuild2-autoconf/libbuild2/autoconf/checks/HAVE_DLOPEN.h index d30ad23..7672bae 100644 --- a/libbuild2-autoconf/libbuild2/autoconf/checks/HAVE_DLOPEN.h +++ b/libbuild2-autoconf/libbuild2/autoconf/checks/HAVE_DLOPEN.h @@ -12,6 +12,6 @@ defined(__FreeBSD__) || \ defined(__OpenBSD__) || \ defined(__NetBSD__) || \ - (defined(__APPLE__) && defined(__MACH__)) + defined(BUILD2_AUTOCONF_MACOS) # define HAVE_DLOPEN 1 #endif diff --git a/libbuild2-autoconf/libbuild2/autoconf/checks/HAVE_FCNTL_H.h b/libbuild2-autoconf/libbuild2/autoconf/checks/HAVE_FCNTL_H.h index bb94506..2b4e75b 100644 --- a/libbuild2-autoconf/libbuild2/autoconf/checks/HAVE_FCNTL_H.h +++ b/libbuild2-autoconf/libbuild2/autoconf/checks/HAVE_FCNTL_H.h @@ -1,4 +1,8 @@ -// HAVE_FCNTL_H +// HAVE_FCNTL_H : BUILD2_AUTOCONF_LIBC_VERSION + +#ifndef BUILD2_AUTOCONF_LIBC_VERSION +# error BUILD2_AUTOCONF_LIBC_VERSION appears to be conditionally included +#endif #undef HAVE_FCNTL_H @@ -6,6 +10,6 @@ defined(__FreeBSD__) || \ defined(__OpenBSD__) || \ defined(__NetBSD__) || \ - (defined(__APPLE__) && defined(__MACH__)) + defined(BUILD2_AUTOCONF_MACOS) # define HAVE_FCNTL_H 1 #endif diff --git a/libbuild2-autoconf/libbuild2/autoconf/checks/HAVE_FUTIMES.h b/libbuild2-autoconf/libbuild2/autoconf/checks/HAVE_FUTIMES.h index b5b4579..4b8e9cf 100644 --- a/libbuild2-autoconf/libbuild2/autoconf/checks/HAVE_FUTIMES.h +++ b/libbuild2-autoconf/libbuild2/autoconf/checks/HAVE_FUTIMES.h @@ -14,6 +14,6 @@ BUILD2_AUTOCONF_FREEBSD_PREREQ(3, 0) || \ BUILD2_AUTOCONF_OPENBSD_PREREQ(199610) || \ BUILD2_AUTOCONF_NETBSD_PREREQ(1, 2) || \ - (defined(__APPLE__) && defined(__MACH__)) + defined(BUILD2_AUTOCONF_MACOS) # define HAVE_FUTIMES 1 #endif diff --git a/libbuild2-autoconf/libbuild2/autoconf/checks/HAVE_LINKAT.h b/libbuild2-autoconf/libbuild2/autoconf/checks/HAVE_LINKAT.h index 47e3136..ca8191d 100644 --- a/libbuild2-autoconf/libbuild2/autoconf/checks/HAVE_LINKAT.h +++ b/libbuild2-autoconf/libbuild2/autoconf/checks/HAVE_LINKAT.h @@ -14,6 +14,6 @@ BUILD2_AUTOCONF_FREEBSD_PREREQ(8, 0) || \ BUILD2_AUTOCONF_OPENBSD_PREREQ(201111) || \ BUILD2_AUTOCONF_NETBSD_PREREQ(7, 0) || \ - (defined(__APPLE__) && defined(__MACH__)) + defined(BUILD2_AUTOCONF_MACOS) # define HAVE_LINKAT 1 #endif diff --git a/libbuild2-autoconf/libbuild2/autoconf/checks/HAVE_POLL.h b/libbuild2-autoconf/libbuild2/autoconf/checks/HAVE_POLL.h index 0426e53..4ec16d1 100644 --- a/libbuild2-autoconf/libbuild2/autoconf/checks/HAVE_POLL.h +++ b/libbuild2-autoconf/libbuild2/autoconf/checks/HAVE_POLL.h @@ -14,6 +14,6 @@ defined(__FreeBSD__) || \ defined(__OpenBSD__) || \ BUILD2_AUTOCONF_NETBSD_PREREQ(1, 3) || \ - (defined(__APPLE__) && defined(__MACH__)) + defined(BUILD2_AUTOCONF_MACOS) # define HAVE_POLL 1 #endif diff --git a/libbuild2-autoconf/libbuild2/autoconf/checks/HAVE_UNISTD_H.h b/libbuild2-autoconf/libbuild2/autoconf/checks/HAVE_UNISTD_H.h index 7d57a04..8c5ed52 100644 --- a/libbuild2-autoconf/libbuild2/autoconf/checks/HAVE_UNISTD_H.h +++ b/libbuild2-autoconf/libbuild2/autoconf/checks/HAVE_UNISTD_H.h @@ -1,4 +1,8 @@ -// HAVE_UNISTD_H +// HAVE_UNISTD_H : BUILD2_AUTOCONF_LIBC_VERSION + +#ifndef BUILD2_AUTOCONF_LIBC_VERSION +# error BUILD2_AUTOCONF_LIBC_VERSION appears to be conditionally included +#endif #undef HAVE_UNISTD_H @@ -6,6 +10,6 @@ defined(__FreeBSD__) || \ defined(__OpenBSD__) || \ defined(__NetBSD__) || \ - (defined(__APPLE__) && defined(__MACH__)) + defined(BUILD2_AUTOCONF_MACOS) # define HAVE_UNISTD_H 1 #endif