aboutsummaryrefslogtreecommitdiffhomepage
path: root/configure.ac
diff options
context:
space:
mode:
authorGravatar netocrat <netocrat@dodo.com.au>2006-08-13 13:08:06 +1000
committerGravatar netocrat <netocrat@dodo.com.au>2006-08-13 13:08:06 +1000
commit2b0d64184a4e8a203ae75cccf0cab3e78ef3030e (patch)
treeadd0c2dcf01c514c93e5663148ab1de28c6699f4 /configure.ac
parent51d7159ba766ef5cfa9b606e98b57fc03c6ba7f8 (diff)
Switch back to using -D for _POSIX_C_SOURCE and _XOPEN_SOURCE - solves build problem on Solaris 10
darcs-hash:20060813030806-344c5-ad0eec62d3ce93d98adcad4b93318b06538eef95.gz
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac19
1 files changed, 11 insertions, 8 deletions
diff --git a/configure.ac b/configure.ac
index 4c2ee620..58ac8124 100644
--- a/configure.ac
+++ b/configure.ac
@@ -72,10 +72,6 @@ for i in /usr/pkg /sw /opt /opt/local; do
done
-# These help out with getting better prototypes on some platforms
-AC_DEFINE( _XOPEN_SOURCE, 600, [Macro to enable additional prototypes under Posix] )
-AC_DEFINE( _POSIX_C_SOURCE, 200112L, [Macro to enable additional prototypes under Posix] )
-
AC_SUBST( optbindirs, $optbindirs )
# Tell autoconf to create config.h header
@@ -107,15 +103,22 @@ else
AC_SUBST( XSEL_MAN_PATH,[ ])
fi
+# These help out with getting better prototypes on some platforms
+
#
# Test if the compiler accepts the -std=c99 flag. If so, using it
# increases the odds of correct compilation, since we want to use the
-# *wprintf functions, which where defined in C99.
-#
+# *wprintf functions, which where defined in C99. On some platforms
+# (Solaris 10) adding -std=c99 in turn requires that _POSIX_C_SOURCE
+# be defined to 200112L otherwise several POSIX-specific, non-ISO-C99
+# types/prototypes are made unavailable e.g. siginfo_t. Finally,
+# defining _XOPEN_SOURCE to 600 is compatible with the
+# _POSIX_C_SOURCE value and provides a little assurance that
+# extension functions' prototypes are available, e.g. killpg().
XCFLAGS="$CFLAGS"
-CFLAGS="$CFLAGS -std=c99"
-AC_MSG_CHECKING(if -std=c99 works)
+CFLAGS="$CFLAGS -std=c99 -D_XOPEN_SOURCE=600 -D_POSIX_C_SOURCE=200112L"
+AC_MSG_CHECKING(if -std=c99 -D_XOPEN_SOURCE=600 -D_POSIX_C_SOURCE=200112L works)
AC_CACHE_VAL(local_cv_has__std_c99,[
AC_TRY_RUN([
#include <stdlib.h>