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}"
27 AC_DEFUN([RB_TYPE_INTMAX_T],
29 AC_REQUIRE([AC_TYPE_LONG_LONG_INT])
30 AC_CHECK_TYPE([intmax_t],
31 [AC_DEFINE([HAVE_INTMAX_T], 1,
32 [Define to 1 if the system has the type `intmax_t'.]) ac_cv_c_intmax_t=yes],
33 [test $ac_cv_type_long_long_int = yes \
34 && ac_type='long long int' \
36 AC_DEFINE_UNQUOTED([intmax_t], [$ac_type],
37 [Define to the widest signed integer type
38 if <stdint.h> and <inttypes.h> do not define.]) ac_cv_c_intmax_t="$ac_type"])
44 AC_DEFUN([RB_TYPE_UINTMAX_T],
46 AC_REQUIRE([AC_TYPE_UNSIGNED_LONG_LONG_INT])
47 AC_CHECK_TYPE([uintmax_t],
48 [AC_DEFINE([HAVE_UINTMAX_T], 1,
49 [Define to 1 if the system has the type `uintmax_t'.]) ac_cv_c_uintmax_t=yes],
50 [test $ac_cv_type_unsigned_long_long_int = yes \
51 && ac_type='unsigned long long int' \
52 || ac_type='unsigned long int'
53 AC_DEFINE_UNQUOTED([uintmax_t], [$ac_type],
54 [Define to the widest unsigned integer type
55 if <stdint.h> and <inttypes.h> do not define.]) ac_cv_c_uintmax_t="$ac_type"])
61 AC_DEFUN([RB_TYPE_INTPTR_T],
63 AC_CHECK_TYPE([intptr_t],
64 [AC_DEFINE([HAVE_INTPTR_T], 1,
65 [Define to 1 if the system has the type `intptr_t'.]) ac_cv_c_intptr_t=yes],
66 [for ac_type in 'int' 'long int' 'long long int'; do
68 [AC_LANG_BOOL_COMPILE_TRY(
69 [AC_INCLUDES_DEFAULT],
70 [[sizeof (void *) <= sizeof ($ac_type)]])],
71 [AC_DEFINE_UNQUOTED([intptr_t], [$ac_type],
72 [Define to the type of a signed integer type wide enough to
73 hold a pointer, if such a type exists, and if the system
74 does not define it.]) ac_cv_c_intptr_t="$ac_type"
76 test -z "$ac_type" && break
83 AC_DEFUN([RB_TYPE_UINTPTR_T],
85 AC_CHECK_TYPE([uintptr_t],
86 [AC_DEFINE([HAVE_UINTPTR_T], 1,
87 [Define to 1 if the system has the type `uintptr_t'.]) ac_cv_c_uintptr_t=yes],
88 [for ac_type in 'unsigned int' 'unsigned long int' \
89 'unsigned long long int'; do
91 [AC_LANG_BOOL_COMPILE_TRY(
92 [AC_INCLUDES_DEFAULT],
93 [[sizeof (void *) <= sizeof ($ac_type)]])],
94 [AC_DEFINE_UNQUOTED([uintptr_t], [$ac_type],
95 [Define to the type of an unsigned integer type wide enough to
96 hold a pointer, if such a type exists, and if the system
97 does not define it.]) ac_cv_c_uintptr_t="$ac_type"
99 test -z "$ac_type" && break
103 dnl IPv6 support macros..pretty much swiped from wget
107 AC_DEFUN([RB_PROTO_INET6],[
108 AC_CACHE_CHECK([for INET6 protocol support], [rb_cv_proto_inet6],[
110 #include <sys/types.h>
111 #include <sys/socket.h>
114 #error Missing PF_INET6
117 #error Mlssing AF_INET6
120 rb_cv_proto_inet6=yes
126 if test "X$rb_cv_proto_inet6" = "Xyes"; then :
134 AC_DEFUN([RB_TYPE_STRUCT_SOCKADDR_IN6],[
135 rb_have_sockaddr_in6=
136 AC_CHECK_TYPES([struct sockaddr_in6],[
137 rb_have_sockaddr_in6=yes
139 rb_have_sockaddr_in6=no
141 #include <sys/types.h>
142 #include <sys/socket.h>
143 #include <netinet/in.h>
146 if test "X$rb_have_sockaddr_in6" = "Xyes"; then :
154 AC_DEFUN([RB_CHECK_TIMER_CREATE],
155 [AC_CACHE_CHECK([for a working timer_create(CLOCK_REALTIME)],
156 [rb__cv_timer_create_works],
167 int main(int argc, char *argv[])
169 #if HAVE_TIMER_CREATE
172 ev.sigev_notify = SIGEV_SIGNAL;
173 ev.sigev_signo = SIGVTALRM;
174 if (timer_create(CLOCK_REALTIME, &ev, &timer) != 0) {
183 [rb__cv_timer_create_works=yes],
184 [rb__cv_timer_create_works=no])
186 case $rb__cv_timer_create_works in
187 yes) AC_DEFINE([USE_TIMER_CREATE], 1,
188 [Define to 1 if we can use timer_create(CLOCK_REALTIME,...)]);;