Portable build framework for OpenNTPD
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

45 lines
1.3 KiB

  1. AC_DEFUN([CHECK_OS_OPTIONS], [
  2. CFLAGS="$CFLAGS -Wall -std=gnu99 -fno-strict-aliasing"
  3. case $host_os in
  4. *darwin*)
  5. HOST_OS=darwin
  6. AC_DEFINE(SETEUID_BREAKS_SETUID,[],[setuid after seteuid does not work])
  7. AC_DEFINE(BROKEN_SETREUID,[], [Broken setreuid])
  8. AC_DEFINE(BROKEN_SETREGID,[], [Broken setregid])
  9. AC_DEFINE(YYSTYPE_IS_DECLARED,[], [Broken bison])
  10. AC_DEFINE([SPT_TYPE], [SPT_REUSEARGV])
  11. ;;
  12. *freebsd*)
  13. HOST_OS=freebsd
  14. AC_SUBST([PROG_LDADD], ['-lthr'])
  15. ;;
  16. *linux*)
  17. HOST_OS=linux
  18. CFLAGS="$CFLAGS -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_GNU_SOURCE"
  19. AC_DEFINE([SPT_TYPE], [SPT_REUSEARGV])
  20. ;;
  21. *netbsd*)
  22. HOST_OS=netbsd
  23. ;;
  24. *openbsd*)
  25. HOST_OS=openbsd
  26. AC_DEFINE([HAVE_ATTRIBUTE__BOUNDED__], [1], [OpenBSD has __bounded__])
  27. AC_DEFINE([HAVE_ATTRIBUTE__DEAD], [1], [OpenBSD has __dead])
  28. ;;
  29. *solaris*)
  30. HOST_OS=solaris
  31. CFLAGS="$CFLAGS -D__EXTENSIONS__ -D_XOPEN_SOURCE=600 -DBSD_COMP"
  32. AC_SUBST([PLATFORM_LDADD], ['-lnsl -lsocket'])
  33. ;;
  34. *) ;;
  35. esac
  36. AM_CONDITIONAL([HOST_DARWIN], [test x$HOST_OS = xdarwin])
  37. AM_CONDITIONAL([HOST_FREEBSD], [test x$HOST_OS = xfreebsd])
  38. AM_CONDITIONAL([HOST_LINUX], [test x$HOST_OS = xlinux])
  39. AM_CONDITIONAL([HOST_NETBSD], [test x$HOST_OS = xnetbsd])
  40. AM_CONDITIONAL([HOST_OPENBSD], [test x$HOST_OS = xopenbsd])
  41. AM_CONDITIONAL([HOST_SOLARIS], [test x$HOST_OS = xsolaris])
  42. ])