AC_FUNC_MALLOC
AC_FUNC_REALLOC
AC_FUNC_FORK
-# setproctitle (maybe through libbsd [until 0.5, it is only a stub function])
-AC_SEARCH_LIBS([setproctitle], [util bsd])
+
+# Some functions can be in libbsd
+PKG_CHECK_MODULES([libbsd], [libbsd-overlay], [
+ CFLAGS="$CFLAGS $libbsd_CFLAGS"
+ LIBS="$LIBS $libbsd_LIBS"
+], [])
+# setproctitle may have an _init function
AC_REPLACE_FUNCS([setproctitle])
AC_CHECK_FUNCS([setproctitle_init])
# Other functions
# Optional functions
AC_CHECK_FUNCS([setresuid setresgid])
-case " $LIBS " in
- *\ -lbsd\ *)
- AC_DEFINE(HAVE_LIBBSD, 1, [Define if libbsd is used])
- ;;
-esac
-
# Check for res_init. On OSX, res_init is a symbol in libsystem_info
# and a macro in resolv.h. We need to ensure we test with resolv.h.
m4_pushdef([AC_LANG_CALL(C)], [
#include <stdio.h>
#include <stddef.h>
#include <stdarg.h>
-#ifdef HAVE_LIBBSD
-# include <bsd/stdio.h>
-# include <bsd/string.h>
-# include <bsd/unistd.h>
-#endif
+#include <string.h>
+#include <unistd.h>
#if !HAVE_ASPRINTF
int vasprintf(char **, const char *, va_list) __attribute__ ((format (printf, 2, 0)));