Skip to content

Instantly share code, notes, and snippets.

@codebrainz
Created June 21, 2015 21:55
Show Gist options
  • Save codebrainz/1e6a48b8ed4a31235f33 to your computer and use it in GitHub Desktop.
Save codebrainz/1e6a48b8ed4a31235f33 to your computer and use it in GitHub Desktop.
AC_DEFUN([AX_POSIX], [
AC_MSG_CHECKING([for POSIX 2008 support])
AC_COMPILE_IFELSE([AC_LANG_SOURCE([
#define _POSIX_C_SOURCE 200809L
#include <unistd.h>
# if !defined(_POSIX_VERSION) || _POSIX_VERSION < 200809L
# error "Not POSIX 2008"
#endif
int main() { return 0; }
])], [
AC_MSG_RESULT([yes])
AC_DEFINE([_POSIX_SOURCE], [1], [defined if POSIX is available])
AC_DEFINE([_POSIX_C_SOURCE], [200809L], [defined if POSIX 2008 is available])
], [
AC_MSG_RESULT([no])
AC_MSG_ERROR([POSIX 2008 support is required])
])
])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment