Only register fr_fault signal handlers if we're not running under a debugger
[freeradius.git] / configure.ac
index 01b0ec0..ebf1a14 100644 (file)
@@ -145,7 +145,7 @@ dnl #
 dnl #  Set Default CFLAGS for GCC compatible compilers
 dnl #
 if test "x$GCC" = "xyes"; then
-  CFLAGS="$CFLAGS -Wall -D_GNU_SOURCE"
+  CFLAGS="$CFLAGS -Wall -std=c99 -D_GNU_SOURCE"
 fi
 
 dnl #
@@ -929,6 +929,7 @@ AC_CHECK_HEADERS( \
   fcntl.h \
   sys/fcntl.h \
   sys/prctl.h \
+  sys/ptrace.h \
   sys/un.h \
   glob.h \
   prot.h \
@@ -1215,15 +1216,6 @@ FR_CHECK_TYPE_INCLUDE(
   uint64_t, unsigned long long, [uint64_t is required for larger counters]
 )
 
-FR_CHECK_TYPE_INCLUDE(
-  [
-    #ifdef HAVE_SIGNAL_H
-    #  include <signal.h>
-    #endif
-  ],
-  sig_t, void(*sig_t)(int), [signal action callback function]
-)
-
 dnl #
 dnl #  Check for __uint128_t (compiler builtin)
 dnl #
@@ -1286,6 +1278,33 @@ AC_CHECK_TYPE(struct addrinfo, AC_DEFINE(HAVE_STRUCT_ADDRINFO, 1, [Generic DNS l
   ]
 )
 
+dnl #
+dnl #  Check for sig_t
+dnl #
+dnl #  FR_CHECK_TYPE_INCLUDE doesn't work for callbacks as it doesn't produce typedefs
+dnl #
+AC_MSG_CHECKING([if sig_t is defined])
+AC_LINK_IFELSE(
+  [AC_LANG_PROGRAM(
+    [[
+      #ifdef HAVE_SIGNAL_H
+      #  include <signal.h>
+      #endif
+    ]],
+    [[
+      sig_t func;
+      return 0;
+    ]]
+  )],
+  [
+      AC_MSG_RESULT(yes)
+      AC_DEFINE(HAVE_SIG_T, 1, [Define if the type sig_t is defined by signal.h])
+  ],
+  [
+      AC_MSG_RESULT(no)
+  ]
+)
+
 dnl #############################################################
 dnl #
 dnl #  5. Checks for structures and functions