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 #
fnmatch.h \
sia.h \
siad.h \
- features.h
+ features.h \
+ limits.h
)
dnl #
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 #
]
)
+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
AC_DEFINE(HAVE_IN6_PKTINFO, [], [define if you have IN6_PKTINFO (Linux)])
fi
+dnl #
+dnl # Check for htonll and htonlll
+dnl #
+AC_MSG_CHECKING([if htonll is defined])
+AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[
+ #include <sys/types.h>
+ #include <netinet/in.h>
+ ]],
+ [[
+ return htonll(0);
+ ]]
+ )],
+ [
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_HTONLL, 1, [Define if the function (or macro) htonll exists.])
+ ],
+ [
+ AC_MSG_RESULT(no)
+ ]
+)
+
+AC_MSG_CHECKING([if htonlll is defined])
+AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[
+ #include <sys/types.h>
+ #include <netinet/in.h>
+ ]],
+ [[
+ return htonlll(0);
+ ]]
+ )],
+ [
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_HTONLLL, 1, [Define if the function (or macro) htonlll exists.])
+ ],
+ [
+ AC_MSG_RESULT(no)
+ ]
+)
+
dnl #############################################################
dnl #
dnl # 6. Checks for compiler characteristics
AC_DEFINE_UNQUOTED([RADIUSD_VERSION_COMMIT],[${RADIUSD_VERSION_COMMIT}],[Commit HEAD at time of configuring])
fi
+dnl #
+dnl # check for some compiler features
+dnl #
FR_TLS
+FR_HAVE_BUILTIN_CHOOSE_EXPR
+FR_HAVE_BUILTIN_TYPES_COMPATIBLE_P
+FR_HAVE_BUILTIN_BSWAP_64
dnl #############################################################
dnl #