From 0af74b7cd66f3f0d0f2c4c399cc5c1fb96f98127 Mon Sep 17 00:00:00 2001 From: Olaf Bergmann Date: Tue, 3 Mar 2015 19:08:38 +0100 Subject: [PATCH] Add Solaris to known platforms For Solaris, XPG4v2 must be enabled for ancillary data while the compiler flag -std=c99 restricts the code to C99 and nothing else. To make this work anyway, we have to use the following compiler flags: -D_XOPEN_SOURCE=600 -D_XOPEN_SOURCE_EXTENDED=600 -D__EXTENSIONS__=1 --- configure.ac | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/configure.ac b/configure.ac index 2663d55d..7a2bbb1b 100644 --- a/configure.ac +++ b/configure.ac @@ -260,6 +260,15 @@ case $host in CFLAGS="$CFLAGS -D_GNU_SOURCE -DWITH_POSIX" ;; + *-solaris*) + AC_MSG_RESULT([Solaris]) + backend="sunos" + # set _XOPEN_SOURCE and _XOPEN_SOURCE_EXTENDED to enable XPG4v2 (POSIX 2004) + # set __EXTENSION__ to shut up feature test macros that restrict -std=c99 + # to only C99 (and nothing newer) + CFLAGS="$CFLAGS -D_XOPEN_SOURCE=600 -D_XOPEN_SOURCE_EXTENDED=600 -D__EXTENSIONS__=1 -DWITH_POSIX" + ;; + *) AC_MSG_WARN([==> Currently unsupported operating system!]) AC_MSG_ERROR([==> If you can provide patches to support your operating system please write to 'libcoap-developers@lists.sourceforge.net'.]) @@ -270,6 +279,9 @@ case $backend in AC_DEFINE(OS_LINUX, 1, [Linux backend]) AC_SUBST(OS_LINUX) ;; + + sunos) + ;; esac # Override the various template files, currently just makefiles and the