3 dnl Check for bool support. Defines bool, true, and false.
5 AH_TEMPLATE([HAVE_POSIX_THREAD], [])
6 AH_TEMPLATE([_REENTRANT], [])
7 AH_TEMPLATE([ssize_t], [Define to "int" if <sys/types.h> does not define.])
12 AC_DEFUN(DAST_CHECK_BOOL, [
15 if test "$ac_cv_sizeof_bool" = 0 ; then
19 AC_CACHE_CHECK(if true is defined, ac_cv_have_true,
23 [unsigned int i = true],
29 if test "$ac_cv_have_true" != yes ; then
36 dnl ===================================================================
37 dnl DAST_REPLACE_TYPE( type, sizeof )
38 dnl Check for the type as AC_CHECK_TYPE does. Define HAVE_<type>
39 dnl if type exists; don't define <type> to anything if it doesn't exist.
40 dnl Useful if there is no well-defined default type, such as int32_t
42 AC_DEFUN(DAST_REPLACE_TYPE, [
44 AC_CACHE_CHECK(for $1, ac_cv_type_$1,
45 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[$ac_includes_default]],
50 if test $ac_cv_type_$1 != yes ; then
51 if test "$ac_cv_sizeof_char" = $2; then
53 elif test "$ac_cv_sizeof_short" = $2; then
55 elif test "$ac_cv_sizeof_int" = $2; then
57 elif test "$ac_cv_sizeof_long" = $2; then
59 elif test "$ac_cv_sizeof_long_long" = $2; then
60 ac_cv_type_$1="long long"
64 if test "$ac_cv_type_$1" != no; then
65 if test "$ac_cv_type_$1" != yes; then
66 AC_DEFINE_UNQUOTED($1, $ac_cv_type_$1)
68 AC_DEFINE_UNQUOTED(HAVE_`echo $1 | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`)
73 AC_DEFUN(DAST_REPLACE_TYPE_UNSIGNED, [
75 AC_CACHE_CHECK(for $1, ac_cv_type_$1,
76 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[$ac_includes_default]],
81 if test $ac_cv_type_$1 != yes ; then
82 if test "$ac_cv_sizeof_unsigned_char" = $2; then
83 ac_cv_type_$1="unsigned char"
84 elif test "$ac_cv_sizeof_unsigned_short" = $2; then
85 ac_cv_type_$1="unsigned short"
86 elif test "$ac_cv_sizeof_unsigned_int" = $2; then
87 ac_cv_type_$1="unsigned int"
88 elif test "$ac_cv_sizeof_unsigned_long" = $2; then
89 ac_cv_type_$1="unsigned long"
90 elif test "$ac_cv_sizeof_unsigned_long_long" = $2; then
91 ac_cv_type_$1="unsigned long long"
95 if test "$ac_cv_type_$1" != no; then
96 if test "$ac_cv_type_$1" != yes; then
97 AC_DEFINE_UNQUOTED($1, $ac_cv_type_$1)
99 AC_DEFINE_UNQUOTED(HAVE_`echo $1 | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`)
105 dnl Check for the 3rd arguement to accept
107 AC_DEFUN(DAST_ACCEPT_ARG, [
108 if test -z "$ac_cv_accept_arg" ; then
112 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
113 [[$ac_includes_default
114 #include <sys/socket.h>]],
116 accept( 0, 0, &length );]])],
123 dnl Configure paths for Web100. Based off of Owen Taylor's gtk.m4 from gtk+-1.2.10
124 dnl AM_PATH_WEB100([EXACT-VERSION [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
125 dnl Test for Web100, and define WEB100_CFLAGS and WEB100_LIBS
127 AC_DEFUN(AM_PATH_WEB100,
131 AC_PATH_PROG([WEB100_CONFIG], [web100-config], [no])
133 AC_MSG_CHECKING(for Web100)
135 if test "$WEB100_CONFIG" != "no"; then
136 WEB100_CFLAGS=`$WEB100_CONFIG --cflags`
137 WEB100_LIBS=`$WEB100_CONFIG --libs`
141 echo "*** The web100-config script installed by Web100 could not be found"
142 echo "*** If Web100 was installed in PREFIX, make sure PREFIX/bin is in"
143 echo "*** your path, or set the WEB100_CONFIG environment variable to the"
144 echo "*** full path to web100-config"
148 if test x$web100_success = x; then
149 if test "x$1" != "x"; then
150 AC_MSG_CHECKING(for Web100 - version $1)
152 WEB100_VERSION=`$WEB100_CONFIG --version`
153 if test "$WEB100_VERSION" = "$1"; then
157 echo "*** The requested ($1) and installed ($WEB100_VERSION) versions"
158 echo "*** of Web100 do not match."
164 if test x$web100_success = x; then
168 if test x$web100_success = xyes; then
169 m4_if([$2], [], [:], [$2])
173 m4_if([$3], [], [:], [$3])
176 AC_SUBST(WEB100_CFLAGS)
177 AC_SUBST(WEB100_LIBS)