1 # $Id: acinclude.m4 23020 2006-09-01 18:20:19Z androsyn $ - aclocal.m4 - Autoconf fun...
2 AC_DEFUN([AC_DEFINE_DIR], [
3 test "x$prefix" = xNONE && prefix="$ac_default_prefix"
4 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
5 ac_define_dir=`eval echo [$]$2`
6 ac_define_dir=`eval echo [$]ac_define_dir`
10 AC_DEFINE_UNQUOTED($1, "$ac_define_dir"),
11 AC_DEFINE_UNQUOTED($1, "$ac_define_dir", $3))
14 AC_DEFUN([AC_SUBST_DIR], [
15 ifelse($2,,,$1="[$]$2")
17 test "x$prefix" = xNONE && prefix="$ac_default_prefix"
18 test "x$exec_prefix" = xNONE && exec_prefix="${prefix}"
25 dnl IPv6 support macros..pretty much swiped from wget
29 AC_DEFUN([RB_PROTO_INET6],[
30 AC_CACHE_CHECK([for INET6 protocol support], [rb_cv_proto_inet6],[
32 #include <sys/types.h>
33 #include <sys/socket.h>
36 #error Missing PF_INET6
39 #error Mlssing AF_INET6
48 if test "X$rb_cv_proto_inet6" = "Xyes"; then :
56 AC_DEFUN([RB_TYPE_STRUCT_SOCKADDR_IN6],[
58 AC_CHECK_TYPES([struct sockaddr_in6],[
59 rb_have_sockaddr_in6=yes
61 rb_have_sockaddr_in6=no
63 #include <sys/types.h>
64 #include <sys/socket.h>
65 #include <netinet/in.h>
68 if test "X$rb_have_sockaddr_in6" = "Xyes"; then :
76 AC_DEFUN([RB_CHECK_TIMER_CREATE],
77 [AC_CACHE_CHECK([for a working timer_create(CLOCK_REALTIME)],
78 [rb__cv_timer_create_works],
89 int main(int argc, char *argv[])
94 ev.sigev_notify = SIGEV_SIGNAL;
95 ev.sigev_signo = SIGVTALRM;
96 if (timer_create(CLOCK_REALTIME, &ev, &timer) != 0) {
105 [rb__cv_timer_create_works=yes],
106 [rb__cv_timer_create_works=no])
108 case $rb__cv_timer_create_works in
109 yes) AC_DEFINE([USE_TIMER_CREATE], 1,
110 [Define to 1 if we can use timer_create(CLOCK_REALTIME,...)]);;
116 AC_DEFUN([RB_CHECK_TIMERFD_CREATE],
117 [AC_CACHE_CHECK([for a working timerfd_create(CLOCK_REALTIME)],
118 [rb__cv_timerfd_create_works],
129 #ifdef HAVE_SYS_TIMERFD_H
130 #include <sys/timerfd.h>
132 int main(int argc, char *argv[])
134 #if defined(HAVE_TIMERFD_CREATE) && defined(HAVE_SYS_TIMERFD_H)
135 if (timerfd_create(CLOCK_REALTIME, 0) < 0) {
144 [rb__cv_timerfd_create_works=yes],
145 [rb__cv_timerfd_create_works=no])
147 case $rb__cv_timerfd_create_works in
148 yes) AC_DEFINE([USE_TIMERFD_CREATE], 1,
149 [Define to 1 if we can use timerfd_create(CLOCK_REALTIME,...)]);;