X-Git-Url: https://git.tokkee.org/?p=sysdb.git;a=blobdiff_plain;f=configure.ac;fp=configure.ac;h=baf1137b530197b1689be9106ff4f9751b70377b;hp=088a4b59fc994ad313dbd9540b1fc70901808b6d;hb=f8809a7d245d9147bba60d907dd11a398941d868;hpb=a9ae0d1a4c9e2992d932489c96cd63b2ce2a0c56 diff --git a/configure.ac b/configure.ac index 088a4b5..baf1137 100644 --- a/configure.ac +++ b/configure.ac @@ -344,6 +344,46 @@ AC_SUBST([PROFILING_LDFLAGS]) m4_divert_once([HELP_ENABLE], [ Build dependencies:]) +AC_CHECK_HEADERS([ucred.h]) +dnl On OpenBSD, sys/param.h is required for sys/ucred.h. +AC_CHECK_HEADERS([sys/ucred.h], [], [], + [[ #include ]]) + +AC_CHECK_TYPES([struct ucred], + [have_struct_ucred="yes"], [have_struct_ucred="no"], + [[ +#include +#include +#if HAVE_UCRED_H +# include +#endif + ]]) + +if test "x$have_struct_ucred" != "xyes"; then + AC_MSG_CHECKING([for struct ucred when using _GNU_SOURCE]) + orig_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -D_GNU_SOURCE" + dnl Don't reuse AC_CHECK_HEADERS; for one it'll use the cached value + dnl but also, it will print the "checking for" message a second time. + AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[ +#include +#include +#if HAVE_UCRED_H +# include +#endif + ]], + [if (sizeof(struct ucred)) return 0;] + )], + [have_struct_ucred="yes"], [have_struct_ucred="no"]) + CFLAGS="$orig_CFLAGS" + if test "x$have_struct_ucred" = "xyes"; then + AC_DEFINE([_GNU_SOURCE], 1, [Define to enable GNU features.]) + fi + AC_MSG_RESULT([$have_struct_ucred]) +fi + dnl Testing. PKG_CHECK_MODULES([CHECK], [check >= 0.9.4], [unit_tests="yes"], [unit_tests="no"]) @@ -482,11 +522,11 @@ if test "x$have_libfacter" = "xyes"; then AC_MSG_CHECKING([for facter::facts::collection in -lfacter]) AC_LINK_IFELSE( [AC_LANG_PROGRAM( - [[[ #include ]]], - [[[ + [[ #include ]], + [[ facter::facts::collection facts; facts.add_default_facts(); - ]]] + ]] )], [TEST_LIBS=$TEST_LIBS -lfacter], [have_libfacter="yes"],