diff --git a/configure.ac b/configure.ac index 2d28da70..82a83a07 100644 --- a/configure.ac +++ b/configure.ac @@ -83,6 +83,23 @@ else AC_MSG_ERROR([C99 is not supported by $CC.]) fi +dnl ================================================================ +dnl FreeBSD check. +dnl ================================================================ +AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ + #if ! defined(__FreeBSD__) + #error macro not defined + #endif + ]])], [FREEBSD_FOUND="yes"], [FREEBSD_FOUND="no"]) + +AC_MSG_CHECKING([if targeting FreeBSD]) +if test "$FREEBSD_FOUND" = "yes" ; then + AC_MSG_RESULT([-D__BSD_VISIBLE]) + CFLAGS="$CFLAGS -D__BSD_VISIBLE" +else + AC_MSG_RESULT([no]) +fi + dnl ================================================================ dnl library checks. dnl ================================================================