commit 1a5441053c16bd493adf7cd6d854c24668b7c545 from: Omar Polo date: Sat Apr 13 08:00:21 2024 UTC fix amused-web build on linux Here we have endian.h but also need some other compat shims; the build was failing with an unclear "can't include machine/endian.h". Alter our local endian.h to #include_next endian.h. Then, move the various #define HAVE_* before including any header in config.h since some of the included headers were pulling in endian.h before HAVE_ENDIAN_H is defined. commit - 07631126da75cdc3e76b2f309ecd52b0ce674921 commit + 1a5441053c16bd493adf7cd6d854c24668b7c545 blob - 497e87b133dfeb21e3bc7097dc37fa81fed4cd58 blob + d96155d4ceb0fb9c2079a566fb4e54b1ace32170 --- configure +++ configure @@ -720,6 +720,52 @@ cat << __HEREDOC__ #if !defined(__END_DECLS) # define __END_DECLS #endif + +__HEREDOC__ + +cat << __HEREDOC__ +/* + * Results of configuration feature-testing. + */ +#define HAVE_CAPSICUM ${HAVE_CAPSICUM} +#define HAVE_ENDIAN_H ${HAVE_ENDIAN_H} +#define HAVE_ERR ${HAVE_ERR} +#define HAVE_EXPLICIT_BZERO ${HAVE_EXPLICIT_BZERO} +#define HAVE_FLOCK ${HAVE_FLOCK} +#define HAVE_FREEZERO ${HAVE_FREEZERO} +#define HAVE_GETDTABLECOUNT ${HAVE_GETDTABLECOUNT} +#define HAVE_GETDTABLESIZE ${HAVE_GETDTABLESIZE} +#define HAVE_GETEXECNAME ${HAVE_GETEXECNAME} +#define HAVE_GETPROGNAME ${HAVE_GETPROGNAME} +#define HAVE_LIB_IMSG ${HAVE_LIB_IMSG} +#define HAVE_INFTIM ${HAVE_INFTIM} +#define HAVE_LANDLOCK ${HAVE_LANDLOCK} +#define HAVE_MEMMEM ${HAVE_MEMMEM} +#define HAVE_MEMRCHR ${HAVE_MEMRCHR} +#define HAVE_MEMSET_S ${HAVE_MEMSET_S} +#define HAVE_OPTRESET ${HAVE_OPTRESET} +#define HAVE_PATH_MAX ${HAVE_PATH_MAX} +#define HAVE_PLEDGE ${HAVE_PLEDGE} +#define HAVE_PROGRAM_INVOCATION_SHORT_NAME ${HAVE_PROGRAM_INVOCATION_SHORT_NAME} +#define HAVE_PR_SET_NAME ${HAVE_PR_SET_NAME} +#define HAVE_REALLOCARRAY ${HAVE_REALLOCARRAY} +#define HAVE_RECALLOCARRAY ${HAVE_RECALLOCARRAY} +#define HAVE_SANDBOX_INIT ${HAVE_SANDBOX_INIT} +#define HAVE_SETPROCTITLE ${HAVE_SETPROCTITLE} +#define HAVE_SIO_FLUSH ${HAVE_SIO_FLUSH} +#define HAVE_SOCK_NONBLOCK ${HAVE_SOCK_NONBLOCK} +#define HAVE_STRLCAT ${HAVE_STRLCAT} +#define HAVE_STRLCPY ${HAVE_STRLCPY} +#define HAVE_STRNDUP ${HAVE_STRNDUP} +#define HAVE_STRNLEN ${HAVE_STRNLEN} +#define HAVE_STRTONUM ${HAVE_STRTONUM} +#define HAVE_SYS_ENDIAN_H ${HAVE_SYS_ENDIAN_H} +#define HAVE_SYS_FILE ${HAVE_SYS_FILE} +#define HAVE_SYS_QUEUE ${HAVE_SYS_QUEUE} +#define HAVE_SYSTRACE ${HAVE_SYSTRACE} +#define HAVE_TIMESPECSUB ${HAVE_TIMESPECSUB} +#define HAVE_UNVEIL ${HAVE_UNVEIL} +#define HAVE___PROGNAME ${HAVE___PROGNAME} __HEREDOC__ @@ -786,52 +832,6 @@ then echo "#define INFTIM (-1) /* poll.h */" echo fi - -cat << __HEREDOC__ -/* - * Results of configuration feature-testing. - */ -#define HAVE_CAPSICUM ${HAVE_CAPSICUM} -#define HAVE_ENDIAN_H ${HAVE_ENDIAN_H} -#define HAVE_ERR ${HAVE_ERR} -#define HAVE_EXPLICIT_BZERO ${HAVE_EXPLICIT_BZERO} -#define HAVE_FLOCK ${HAVE_FLOCK} -#define HAVE_FREEZERO ${HAVE_FREEZERO} -#define HAVE_GETDTABLECOUNT ${HAVE_GETDTABLECOUNT} -#define HAVE_GETDTABLESIZE ${HAVE_GETDTABLESIZE} -#define HAVE_GETEXECNAME ${HAVE_GETEXECNAME} -#define HAVE_GETPROGNAME ${HAVE_GETPROGNAME} -#define HAVE_LIB_IMSG ${HAVE_LIB_IMSG} -#define HAVE_INFTIM ${HAVE_INFTIM} -#define HAVE_LANDLOCK ${HAVE_LANDLOCK} -#define HAVE_MEMMEM ${HAVE_MEMMEM} -#define HAVE_MEMRCHR ${HAVE_MEMRCHR} -#define HAVE_MEMSET_S ${HAVE_MEMSET_S} -#define HAVE_OPTRESET ${HAVE_OPTRESET} -#define HAVE_PATH_MAX ${HAVE_PATH_MAX} -#define HAVE_PLEDGE ${HAVE_PLEDGE} -#define HAVE_PROGRAM_INVOCATION_SHORT_NAME ${HAVE_PROGRAM_INVOCATION_SHORT_NAME} -#define HAVE_PR_SET_NAME ${HAVE_PR_SET_NAME} -#define HAVE_REALLOCARRAY ${HAVE_REALLOCARRAY} -#define HAVE_RECALLOCARRAY ${HAVE_RECALLOCARRAY} -#define HAVE_SANDBOX_INIT ${HAVE_SANDBOX_INIT} -#define HAVE_SETPROCTITLE ${HAVE_SETPROCTITLE} -#define HAVE_SIO_FLUSH ${HAVE_SIO_FLUSH} -#define HAVE_SOCK_NONBLOCK ${HAVE_SOCK_NONBLOCK} -#define HAVE_STRLCAT ${HAVE_STRLCAT} -#define HAVE_STRLCPY ${HAVE_STRLCPY} -#define HAVE_STRNDUP ${HAVE_STRNDUP} -#define HAVE_STRNLEN ${HAVE_STRNLEN} -#define HAVE_STRTONUM ${HAVE_STRTONUM} -#define HAVE_SYS_ENDIAN_H ${HAVE_SYS_ENDIAN_H} -#define HAVE_SYS_FILE ${HAVE_SYS_FILE} -#define HAVE_SYS_QUEUE ${HAVE_SYS_QUEUE} -#define HAVE_SYSTRACE ${HAVE_SYSTRACE} -#define HAVE_TIMESPECSUB ${HAVE_TIMESPECSUB} -#define HAVE_UNVEIL ${HAVE_UNVEIL} -#define HAVE___PROGNAME ${HAVE___PROGNAME} - -__HEREDOC__ # Now we do our function declarations for missing functions. blob - e27efc116264e038cf7aa8fd966c3227d2331a0d blob + bb37d980ec380c90aa4996d4a42f42f9679cd876 --- endian.h +++ endian.h @@ -1,6 +1,8 @@ #include "config.h" -#if HAVE_SYS_ENDIAN_H +#if HAVE_ENDIAN_H +# include_next +#elif HAVE_SYS_ENDIAN_H # include #else # include