summaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
authorSebastien Estienne <sebastien.estienne@gmail.com>2005-10-28 23:55:00 +0000
committerSebastien Estienne <sebastien.estienne@gmail.com>2005-10-28 23:55:00 +0000
commit114621ca1b0a02f6cb12cf29c5f700da79c57a8d (patch)
tree975cd3771519c1ee2685fd0fc66ac80db1f958d2 /configure.ac
parent12ca6bf367c9903d97b9cac6297e3df422c3cd44 (diff)
fixes needed for windows and solaris
git-svn-id: file:///home/lennart/svn/public/libdaemon/trunk@94 153bfa13-eec0-0310-be40-b0cb6a0e1b4b
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac21
1 files changed, 20 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac
index 66ed2a6..b7ff615 100644
--- a/configure.ac
+++ b/configure.ac
@@ -42,8 +42,27 @@ AC_PROG_LIBTOOL()
if test "x$GCC" = "xyes" ; then
CFLAGS="$CFLAGS -pipe -W -Wall -pedantic"
+ # Test whether sys/signal.h can be included when compiled with -std=c99
+ AC_MSG_CHECKING([checking whether sys/signal.h can be included with -std=c99])
+ OLDCFLAGS="$CFLAGS"
+ CFLAGS="-std=c99"
+ AC_TRY_COMPILE([#include <sys/signal.h>],
+ [int main(void) {
+ struct sigaction sa;
+ sa.sa_handler = 0;
+ return 0;
+ };], use_stdc99=yes, use_stdc99=no)
+
+ if test x"$use_stdc99" = xyes; then
+ CFLAGS="-std=c99 $OLDCFLAGS"
+ AC_MSG_RESULT([yes])
+ else
+ AC_MSG_RESULT([no])
+ CFLAGS="$OLDCFLAGS"
+ fi
+
AC_LANG_CONFTEST([int main() {}])
- $CC -c conftest.c -std=c99 -Wno-unused-parameter $CFLAGS > /dev/null 2> /dev/null && CFLAGS="$CFLAGS -std=c99 -Wno-unused-parameter"
+ $CC -c conftest.c -Wno-unused-parameter $CFLAGS > /dev/null 2> /dev/null && CFLAGS="$CFLAGS -Wno-unused-parameter"
rm -f conftest.o
fi