commit c59427c506d2ef9128e705a75134bb3a3b4d2848 from: Thomas Adam date: Thu Oct 13 20:04:35 2022 UTC portable: check for sys/tree.h more fully When checking for sys/tree.h on non-BSD systems, either it will be in the standard include path (such as on MacOS), or it won't be found, until libbsd is overlayed. In cases where we want to find sys/tree.h via libbsd, perform a AC_CHECK_DECL for a known #define in sys/tree.h -- which will still find sys/tree.h in either location, or uses compat/tree.h in all other cases. commit - 4e5e98e8510dc01d4848f809792357a7ea446baf commit + c59427c506d2ef9128e705a75134bb3a3b4d2848 blob - bfbb9d0326cf096b9b8c70fa8f486a6e2a7c552f blob + 2d7ea8afd93b32e81fbcc8e10c990368f137b962 --- configure.ac +++ configure.ac @@ -547,7 +547,19 @@ if test "x$found_queue_h" = xyes; then else AC_MSG_ERROR("*** sys/queue.h missing key defines ***) fi + +AC_CHECK_DECL( + RB_GENERATE_STATIC, + found_sys_tree_h=yes, + found_sys_tree_h=no, + [#include ] +) +if test "x$found_sys_tree_h" = xyes; then + AC_DEFINE(HAVE_TREE_H) +else + AC_MSG_NOTICE("Using compat/tree.h") +fi # Look for __progname. AC_MSG_CHECKING(for __progname)