|
AC_DEFUN([CHECK_OS_OPTIONS], [
|
|
|
|
CFLAGS="$CFLAGS -Wall -std=gnu99 -fno-strict-aliasing"
|
|
|
|
case $host_os in
|
|
*darwin*)
|
|
HOST_OS=darwin
|
|
AC_DEFINE(SETEUID_BREAKS_SETUID,[],[setuid after seteuid does not work])
|
|
AC_DEFINE(BROKEN_SETREUID,[], [Broken setreuid])
|
|
AC_DEFINE(BROKEN_SETREGID,[], [Broken setregid])
|
|
AC_DEFINE(YYSTYPE_IS_DECLARED,[], [Broken bison])
|
|
AC_DEFINE([SPT_TYPE], [SPT_REUSEARGV])
|
|
;;
|
|
*freebsd*)
|
|
HOST_OS=freebsd
|
|
AC_SUBST([PROG_LDADD], ['-lthr'])
|
|
;;
|
|
*linux*)
|
|
HOST_OS=linux
|
|
CFLAGS="$CFLAGS -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_GNU_SOURCE"
|
|
AC_DEFINE([SPT_TYPE], [SPT_REUSEARGV])
|
|
;;
|
|
*netbsd*)
|
|
HOST_OS=netbsd
|
|
;;
|
|
*openbsd*)
|
|
HOST_OS=openbsd
|
|
AC_DEFINE([HAVE_ATTRIBUTE__BOUNDED__], [1], [OpenBSD has __bounded__])
|
|
AC_DEFINE([HAVE_ATTRIBUTE__DEAD], [1], [OpenBSD has __dead])
|
|
;;
|
|
*solaris*)
|
|
HOST_OS=solaris
|
|
CFLAGS="$CFLAGS -D__EXTENSIONS__ -D_XOPEN_SOURCE=600 -DBSD_COMP"
|
|
AC_SUBST([PLATFORM_LDADD], ['-lnsl -lsocket'])
|
|
;;
|
|
*) ;;
|
|
esac
|
|
|
|
AM_CONDITIONAL([HOST_DARWIN], [test x$HOST_OS = xdarwin])
|
|
AM_CONDITIONAL([HOST_FREEBSD], [test x$HOST_OS = xfreebsd])
|
|
AM_CONDITIONAL([HOST_LINUX], [test x$HOST_OS = xlinux])
|
|
AM_CONDITIONAL([HOST_NETBSD], [test x$HOST_OS = xnetbsd])
|
|
AM_CONDITIONAL([HOST_OPENBSD], [test x$HOST_OS = xopenbsd])
|
|
AM_CONDITIONAL([HOST_SOLARIS], [test x$HOST_OS = xsolaris])
|
|
])
|