diff options
| author | Dennis Camera <skonfig@dtnr.ch> | 2022-08-26 00:32:35 +0200 |
|---|---|---|
| committer | Dennis Camera <skonfig@dtnr.ch> | 2022-08-26 00:32:35 +0200 |
| commit | 6e4de72efaefb92542346285d2975992641fd981 (patch) | |
| tree | 990b0cdfb7bc93f142aaebde4c9f5d76b81b4f58 | |
| parent | 43d023eb1a54a622babc6f02527dd68283af7f4e (diff) | |
| download | skonfig-c-6e4de72efaefb92542346285d2975992641fd981.tar.gz skonfig-c-6e4de72efaefb92542346285d2975992641fd981.zip | |
[configure.ac] Check for POSIX conformance after feature checks
| -rw-r--r-- | configure.ac | 47 |
1 files changed, 23 insertions, 24 deletions
diff --git a/configure.ac b/configure.ac index e384395..73f9c3e 100644 --- a/configure.ac +++ b/configure.ac @@ -24,30 +24,6 @@ m4_version_prereq([2.70],[],[AC_PROG_CC_C99]) AC_PROG_CPP AC_PROG_MAKE_SET -# check POSIX conformance level -_want_posix_level=200112L -_posix_level_human=POSIX.1-2001 -AC_MSG_CHECKING([if system POSIX conformance level can be set to ${_posix_level_human}]) -AC_COMPILE_IFELSE([AC_LANG_SOURCE([ -#define _POSIX_C_SOURCE ${_want_posix_level} -#include <unistd.h> -#if _POSIX_VERSION != ${_want_posix_level} -#error incorrect _POSIX_VERSION -#endif -])], -[AC_MSG_RESULT([yes])], -[AC_MSG_RESULT([no]); - AC_MSG_FAILURE([this system does not conform to the ${_posix_level_human} standard]) -]) -AC_DEFINE_UNQUOTED([_POSIX_C_SOURCE], [${_want_posix_level}], [define the POSIX conformance level]) -CFLAGS=${CFLAGS-}${CFLAGS:+ }-D_POSIX_C_SOURCE=${_want_posix_level} - -# set X/Open level -_want_xopen_level=500 -AC_DEFINE_UNQUOTED([_XOPEN_SOURCE], [${_want_xopen_level}], [define the X/Open conformance level]) -CFLAGS=${CFLAGS-}${CFLAGS:+ }-D_XOPEN_SOURCE=${_want_xopen_level} - - # Checks for compiler options. _cccheckingopts=$( # clang (newer versions) don't fail if they see an unknown argument. @@ -155,6 +131,29 @@ AC_DEFINE_UNQUOTED([HAVE_CC_NONNULL_CHECK], $((_sk_cc_nonnull_check)), [Define t # Checks for libraries. +# Check POSIX conformance level. +_want_posix_level=200112L +_posix_level_human=POSIX.1-2001 +AC_MSG_CHECKING([if the POSIX conformance level can be set to ${_posix_level_human}]) +AC_COMPILE_IFELSE([AC_LANG_SOURCE([ +#define _POSIX_C_SOURCE ${_want_posix_level} +#include <unistd.h> +#if _POSIX_VERSION != ${_want_posix_level} +#error incorrect _POSIX_VERSION +#endif +])], +[AC_MSG_RESULT([yes])], +[AC_MSG_RESULT([no]); + AC_MSG_FAILURE([this system does not conform to the ${_posix_level_human} standard]) +]) +AC_DEFINE_UNQUOTED([_POSIX_C_SOURCE], [${_want_posix_level}], [define the POSIX conformance level]) +CFLAGS=${CFLAGS-}${CFLAGS:+ }-D_POSIX_C_SOURCE=${_want_posix_level} + +# Define X/Open conformance level. +_want_xopen_level=500 +AC_DEFINE_UNQUOTED([_XOPEN_SOURCE], [${_want_xopen_level}], [define the X/Open conformance level]) +CFLAGS=${CFLAGS-}${CFLAGS:+ }-D_XOPEN_SOURCE=${_want_xopen_level} + # Checks for header files. AC_HEADER_STDC AC_HEADER_STDBOOL |
