]> jfr.im git - solanum.git/blame - librb/configure.ac
librb: configure: tolerate older msys versions having wrong uname -a output
[solanum.git] / librb / configure.ac
CommitLineData
db137867
AC
1dnl Process this file with autoconf to produce a configure script.
2
3dnl TODO: clean up all the OpenSSL and shared module checking stuff;
4dnl the most major changes have already been made and it looks like
5dnl said functions need to be just about as complex as they already are.
6
030272f3 7AC_PREREQ(2.63)
db137867
AC
8AUTOMAKE_OPTIONS = 1.10
9dnl Sneaky way to get an Id tag into the configure script
fe037171 10AC_INIT([librb],[devel])
eec2776c 11AM_INIT_AUTOMAKE([subdir-objects])
c52df125 12AM_SILENT_RULES([yes])
db137867 13
fe037171 14AM_CONFIG_HEADER(include/librb_config.h)
db137867 15
fe037171 16AC_PREFIX_DEFAULT(/usr/local/librb)
db137867
AC
17AC_GNU_SOURCE
18
19dnl Checks for programs.
20AC_PROG_CC_C99
21
22if test x"$ac_cv_prog_cc_c99" = "xno"; then
fe037171 23 AC_ERROR([charybdis requires a C99 capable compiler])
db137867 24fi
5203cba5 25
db137867
AC
26
27AC_PROG_INSTALL
28AC_PROG_EGREP
29AC_PROG_SED
30
31F77=no
32CXX=no
33GCJ=no
34
35AM_DISABLE_STATIC
36AM_ENABLE_SHARED
37AM_MAINTAINER_MODE
38
39AC_ISC_POSIX
40AC_C_INLINE
41AC_C_CONST
f171dafb 42AC_C_BIGENDIAN
db137867
AC
43AC_PROG_MAKE_SET
44AC_PROG_INSTALL
45AC_PATH_PROG(AUTOMAKE, automake)
46AC_PATH_PROG(ACLOCAL, aclocal)
47AC_PATH_PROG(AUTOHEADER, autoheader)
48AC_PATH_PROG(AS, as)
49AC_PATH_PROG(RM, rm)
50AC_PATH_PROG(CP, cp)
51AC_PATH_PROG(MV, mv)
52AC_PATH_PROG(LN, ln)
db137867
AC
53AC_PATH_PROG(TOUCH, touch)
54AC_LANG(C)
55
56AC_PROG_LIBTOOL
57
58LIBTOOL="$LIBTOOL --silent"
59
db137867
AC
60case "$host_os" in
61*cygwin*)
62 AC_DEFINE_UNQUOTED(CYGWIN,1,[This is a Cygwin system])
63 AC_DEFINE_UNQUOTED(WINDOWS,1,[This is a Windows system])
64 ;;
65*mingw*)
e452b26e 66*msys*)
db137867
AC
67 AC_DEFINE_UNQUOTED(MINGW,1,[This is a MinGW system])
68 AC_DEFINE_UNQUOTED(WINDOWS,1,[This is a Windows system])
69 AC_CHECK_HEADER(windows.h, , [AC_MSG_ERROR([** MinGW and no windows.h. I give up.])])
70 AC_CHECK_HEADER(winsock2.h, , [AC_MSG_ERROR([** MinGW and no winsock2.h. I give up.])])
3202e249
VY
71 AC_DEFINE_UNQUOTED(HAVE_WINSOCK2_H, 1, [Have WINSOCK2_H])
72 AC_DEFINE_UNQUOTED(HAVE_WINSOCK_H, 1, [Have WINSOCK_H])
db137867
AC
73 LIBS="$LIBS -lws2_32 -liphlpapi"
74 is_mingw="yes"
75 ;;
76*interix*)
77 CPPFLAGS="$CFLAGS -D_ALL_SOURCE -D_XOPEN_SOURCE=500"
78 ;;
030272f3
VY
79*solaris*)
80 CPPFLAGS="$CFLAGS -D_POSIX_PTHREAD_SEMANTICS -D_XPG4_2"
db137867
AC
81 ;;
82*)
83 ;;
84esac
85
86AM_CONDITIONAL([MINGW], [test "$is_mingw" = "yes"])
87
88
89# backwards support for IRC_CFLAGS
3202e249 90CFLAGS="$IRC_CFLAGS $CFLAGS -Wall"
db137867
AC
91
92dnl use directory structure of cached as default (hack)
93if test "$libexecdir" = '${exec_prefix}/libexec' &&
94 test "$localstatedir" = '${prefix}/var'; then
95 libexecdir='${bindir}'
96 localstatedir='${prefix}'
97fi
98
db137867
AC
99AC_TYPE_PID_T
100AC_TYPE_SIZE_T
101AC_TYPE_SSIZE_T
102AC_TYPE_UID_T
103
104
105dnl Checks for header files.
106AC_HEADER_STDC
107
77cb59b3 108AC_CHECK_HEADERS([crypt.h unistd.h sys/socket.h sys/stat.h sys/time.h time.h netinet/in.h arpa/inet.h errno.h sys/uio.h spawn.h sys/poll.h sys/epoll.h sys/select.h sys/devpoll.h sys/event.h port.h signal.h sys/signalfd.h sys/timerfd.h linux/tcp.h])
db137867
AC
109AC_HEADER_TIME
110
111dnl Networking Functions
112dnl ====================
113
114AC_SEARCH_LIBS(socket, [socket],,)
115
116
117AC_CHECK_MEMBER([struct sockaddr.sa_len], [AC_DEFINE(SOCKADDR_IN_HAS_LEN, 1, [Define to 1 if sockaddr has a 'sa_len'
118member.])],,[[
119#ifdef HAVE_SYS_TYPES_H
120#include <sys/types.h>
121#endif
122#ifdef HAVE_SYS_SOCKET_H
123#include <sys/socket.h>
124#endif
125#ifdef HAVE_WINSOCK2_H
126#include <winsock2.h>
127#endif
128]])
129
030272f3 130AC_CHECK_TYPE([socklen_t], rb_cv_socklen_t=socklen_t,[
a9fb3ed0 131 AC_MSG_CHECKING([for socklen_t equivalent])
030272f3 132 AC_CACHE_VAL([rb_cv_socklen_t],
a9fb3ed0
VY
133 [
134 # Systems have either "struct sockaddr *" or
135 # "void *" as the second argument to getpeername
030272f3 136 rb_cv_socklen_t=
a9fb3ed0
VY
137 for arg2 in "struct sockaddr" void; do
138 for t in int size_t unsigned long "unsigned long"; do
139 AC_TRY_COMPILE([
3202e249 140#ifdef HAVE_SYS_TYPES_H
db137867 141#include <sys/types.h>
3202e249
VY
142#endif
143#ifdef HAVE_SYS_SOCKET_H
db137867 144#include <sys/socket.h>
3202e249
VY
145#endif
146#ifdef HAVE_WINSOCK2_H
147#include <winsock2.h>
eb558775 148#include <ws2tcpip.h>
3202e249 149#endif
a9fb3ed0
VY
150int getpeername (int, $arg2 *, $t *);
151],[
152$t len;
153getpeername(0,0,&len);
154],[
030272f3 155 rb_cv_socklen_t="$t"
a9fb3ed0 156 break
db137867 157])
a9fb3ed0
VY
158 done
159 done
160
030272f3 161 if test "x$rb_cv_socklen_t" = x; then
3202e249 162 AC_MSG_WARN([Cannot find a type to use in place of socklen_t using int])
030272f3 163 rb_cv_socklen_t=int
a9fb3ed0
VY
164 fi
165 ])
030272f3 166 AC_MSG_RESULT($rb_cv_socklen_t)],
a9fb3ed0
VY
167 [#include <sys/types.h>
168#include <sys/socket.h>])
169
030272f3
VY
170rb_socklen_t=$rb_cv_socklen_t
171
a9fb3ed0
VY
172
173
174
db137867
AC
175
176AC_ARG_ENABLE(ipv6,AC_HELP_STRING([--disable-ipv6],[Disable IPv6 support]),[ipv6=$enableval],[ipv6=yes])
177
178if test x$ipv6 != xyes; then
179 have_v6="no"
180else
181
182have_v6=yes
183RB_PROTO_INET6([], [
184 AC_MSG_NOTICE([Disabling IPv6 support: PF_INET6 not found])
185 have_v6=no
186 ])
187
188 if test "X$have_v6" = "Xyes"; then
189 RB_TYPE_STRUCT_SOCKADDR_IN6([], [
190 AC_MSG_NOTICE([Disabling IPv6 support: struct sockaddr_in6 not found])
191 have_v6=no
192 ])
193 fi
194
5203cba5 195fi
db137867
AC
196
197AC_CHECK_TYPES([struct sockaddr_storage],[
198 rb_have_sockaddr_storage=yes
199 ],[], [
200 #include <sys/types.h>
201 #include <sys/socket.h>
202 ])
5203cba5 203
db137867 204
db137867 205dnl Check for stdarg.h - if we cant find it, halt configure
fe037171 206AC_CHECK_HEADER(stdarg.h, , [AC_MSG_ERROR([** stdarg.h could not be found - librb will not compile without it **])])
db137867
AC
207
208AC_CHECK_TYPE([sa_family_t], [],
209[AC_DEFINE(sa_family_t, [u_int16_t], [If system does not define sa_family_t, define it here.])],
210[[#include <sys/types.h>
211#include <sys/socket.h>]])
212
213
214dnl check for various functions...
5203cba5 215AC_CHECK_FUNCS([snprintf vsnprintf socketpair gettimeofday writev sendmsg gmtime_r strtok_r usleep posix_spawn strlcpy strlcat strnlen fstat signalfd select poll kevent port_create epoll_ctl arc4random getrusage timerfd_create])
db137867
AC
216
217AC_SEARCH_LIBS(nanosleep, rt posix4, AC_DEFINE(HAVE_NANOSLEEP, 1, [Define if you have nanosleep]))
218AC_SEARCH_LIBS(timer_create, rt, AC_DEFINE(HAVE_TIMER_CREATE, 1, [Define if you have timer_create]))
219RB_CHECK_TIMER_CREATE
3202e249 220RB_CHECK_TIMERFD_CREATE
db137867
AC
221
222AC_FUNC_ALLOCA
223AC_FUNC_VFORK
224AC_FUNC_MMAP
225
226AC_MSG_CHECKING(for /dev/poll)
227if test -c "/dev/poll"; then
228 AC_MSG_RESULT(yes)
229 AC_DEFINE(HAVE_DEVPOLL, [1], [Define to 1 if you have devpoll])
230else
5203cba5 231 AC_MSG_RESULT(no)
db137867
AC
232fi
233
234
235if test "$is_mingw" = "yes"; then
236 AC_DEFINE(HAVE_WIN32, [1], [Define to 1 if you are on windows])
237fi
238
239
240dnl OpenSSL support
241AC_MSG_CHECKING(for OpenSSL)
242AC_ARG_ENABLE(openssl,
243[AC_HELP_STRING([--enable-openssl[=DIR]],[Enable OpenSSL support (DIR optional).])
244AC_HELP_STRING([--disable-openssl],[Disable OpenSSL support.])],
245[cf_enable_openssl=$enableval],
246[cf_enable_openssl="auto"])
247
248if test "$cf_enable_openssl" != "no" ; then
249 cf_openssl_basedir=""
250 if test "$cf_enable_openssl" != "auto" &&
251 test "$cf_enable_openssl" != "yes" ; then
252 dnl Support for --enable-openssl=/some/place
253 cf_openssl_basedir="`echo ${cf_enable_openssl} | sed 's/\/$//'`"
254 else
255 dnl Do the auto-probe here. Check some common directory paths.
256 for dirs in /usr/local/ssl /usr/pkg /usr/local \
257 /usr/local/openssl ; do
258 if test -f "${dirs}/include/openssl/opensslv.h" ; then
259 cf_openssl_basedir="${dirs}"
260 break
261 fi
262 done
263 unset dirs
264 fi
265 dnl Now check cf_openssl_found to see if we found anything.
266 if test ! -z "$cf_openssl_basedir"; then
267 if test -f "${cf_openssl_basedir}/include/openssl/opensslv.h" ; then
c2ac22cc 268 SSL_CFLAGS="-I${cf_openssl_basedir}/include"
db137867
AC
269 SSL_LIBS="-L${cf_openssl_basedir}/lib"
270 else
271 dnl OpenSSL wasn't found in the directory specified. Naughty
272 dnl administrator...
273 cf_openssl_basedir=""
274 fi
275 else
276 dnl Check for stock FreeBSD 4.x and 5.x systems, since their files
277 dnl are in /usr/include and /usr/lib. In this case, we don't want to
278 dnl change INCLUDES or LIBS, but still want to enable OpenSSL.
279 dnl We can't do this check above, because some people want two versions
280 dnl of OpenSSL installed (stock FreeBSD 4.x/5.x and /usr/local/ssl)
281 dnl and they want /usr/local/ssl to have preference.
282 if test -f "/usr/include/openssl/opensslv.h" ; then
283 cf_openssl_basedir="/usr"
284 fi
285 fi
286
287 dnl If we have a basedir defined, then everything is okay. Otherwise,
288 dnl we have a problem.
289 if test ! -z "$cf_openssl_basedir"; then
290 AC_MSG_RESULT($cf_openssl_basedir)
291 cf_enable_openssl="yes"
292 else
293 AC_MSG_RESULT([not found. Specify a correct path?])
294 cf_enable_openssl="no"
295 fi
296 unset cf_openssl_basedir
297else
298 dnl If --disable-openssl was specified
299 AC_MSG_RESULT(disabled)
300fi
301
302save_CPPFLAGS="$CPPFLAGS"
c2ac22cc 303CPPFLAGS="$CPPFLAGS $SSL_CFLAGS"
db137867
AC
304save_LIBS="$LIBS"
305LIBS="$LIBS $SSL_LIBS"
306if test "$cf_enable_openssl" != no; then
307 dnl Check OpenSSL version (must be 0.9.7 or above!)
308 AC_MSG_CHECKING(for OpenSSL 0.9.7 or above)
309 AC_RUN_IFELSE(
d5ef3fd3 310 [AC_LANG_PROGRAM(
db137867
AC
311 [#include <openssl/opensslv.h>
312 #include <stdlib.h>],
313 [[if (OPENSSL_VERSION_NUMBER >= 0x00907000)
d5ef3fd3 314 exit(0); else exit(1);]])],
db137867
AC
315 cf_enable_openssl=yes,
316 cf_enable_openssl=no,
317 cf_enable_openssl=no)
318
319 if test "$cf_enable_openssl" != no; then
320 AC_MSG_RESULT(found)
321 else
322 AC_MSG_RESULT(no - OpenSSL support disabled)
323 fi
324
325fi
326
327
328if test "$cf_enable_openssl" != no; then
329 CPPFLAGS="$CPPFLAGS $SSL_LIBS"
5203cba5 330 AC_CHECK_LIB(crypto, RAND_status,
db137867
AC
331 [cf_enable_openssl=yes],
332 [cf_enable_openssl=no])
333fi
334
db137867
AC
335if test "$cf_enable_openssl" != no; then
336 CPPFLAGS="$CPPFLAGS $SSL_LIBS"
5203cba5 337 AC_CHECK_LIB(ssl, SSL_read,
3202e249 338 [SSL_LIBS="$SSL_LIBS -lssl -lcrypto"],
db137867
AC
339 [cf_enable_openssl=no], [-lcrypto])
340fi
341
c2ac22cc 342
6f57a957
AC
343dnl mbedTLS support
344AC_ARG_ENABLE(mbedtls,
345[AC_HELP_STRING([--enable-mbedtls], [Enable mbedTLS support.])
346AC_HELP_STRING([--disable-mbedtls], [Disable mbedTLS support.])],
347[cf_enable_mbedtls=$enableval],
348[cf_enable_mbedtls="auto"])
349
350if test "$cf_enable_mbedtls" != no; then
351 save_CPPFLAGS="$CPPFLAGS"
352 save_LIBS="$LIBS"
353 LIBS="$LIBS $MBEDTLS_LIBS"
354 AC_CHECK_LIB(mbedtls, mbedtls_ssl_init, [
355 MBEDTLS_LIBS="$MBEDTLS_LIBS -lmbedtls -lmbedcrypto -lmbedx509"
356 cf_enable_mbedtls=yes
357 ], [cf_enable_mbedtls=no], [-lmbedcrypto -lmbedx509])
358fi
c2ac22cc 359
2bd29df9
AB
360dnl GnuTLS support
361AC_MSG_CHECKING(for GnuTLS)
362AC_ARG_ENABLE(gnutls,
363[AC_HELP_STRING([--enable-gnutls],[Enable GnuTLS support.])
364AC_HELP_STRING([--disable-gnutls],[Disable GnuTLS support.])],
365[cf_enable_gnutls=$enableval],
366[cf_enable_gnutls="auto"])
5203cba5 367
2bd29df9
AB
368if test "$cf_enable_gnutls" != no; then
369 PKG_CHECK_MODULES(GNUTLS, [gnutls], [
5203cba5
VI
370 cf_enable_gnutls="yes"
371 ], [cf_enable_gnutls="no"])
2bd29df9
AB
372fi
373
6f57a957
AC
374dnl mbed TLS is given highest preference when no specified TLS library is provided
375if test "$cf_enable_openssl" = "auto" -a "$cf_enable_mbedtls" = "yes"; then
376 cf_enable_openssl="no"
377fi
378
379if test "$cf_enable_gnutls" = "auto" -a "$cf_enable_openssl" = "yes" -a "$cf_enable_mbedtls" = "yes"; then
2bd29df9
AB
380 cf_enable_gnutls="no"
381fi
382
c2ac22cc 383if test x"$cf_enable_openssl" != xno; then
db137867 384 AC_DEFINE(HAVE_OPENSSL,1,[Has OpenSSL])
2bd29df9
AB
385 GNUTLS_CFLAGS=""
386 GNUTLS_LIBS=""
6f57a957
AC
387 MBEDTLS_LIBS=""
388 MBEDTLS_CFLAGS=""
c2ac22cc 389 SSL_TYPE="openssl"
6f57a957
AC
390elif test x"$cf_enable_mbedtls" != xno; then
391 AC_DEFINE(HAVE_MBEDTLS, 1, [Has mbedTLS])
392 SSL_LIBS=""
5203cba5 393 SSL_CFLAGS=""
6f57a957
AC
394 GNUTLS_CFLAGS=""
395 GNUTLS_LIBS=""
5203cba5 396 SSL_TYPE="mbedtls"
2bd29df9
AB
397elif test x"$cf_enable_gnutls" != xno; then
398 AC_DEFINE(HAVE_GNUTLS, 1, [Has GnuTLS])
399 SSL_LIBS=""
6f57a957
AC
400 SSL_CFLAGS=""
401 MBEDTLS_LIBS=""
402 MBEDTLS_CFLAGS=""
2bd29df9 403 SSL_TYPE="gnutls"
db137867
AC
404fi
405
406
c2ac22cc
VY
407
408
db137867
AC
409CPPFLAGS="$save_CPPFLAGS"
410LIBS="$save_LIBS"
411
412dnl End OpenSSL detection
413
414
415
416
417dnl Debug-related options
418dnl =====================
419
420AC_ARG_ENABLE(assert,
421AC_HELP_STRING([--enable-assert],[Enable assert(). Choose between soft(warnings) and hard(aborts the daemon)]),
422[assert=$enableval], [assert=no])
423
424if test "$assert" = no; then
425 AC_DEFINE(NDEBUG, 1, [Define this to disable debugging support.])
426elif test "$assert" = soft; then
427 AC_DEFINE(SOFT_ASSERT, 1, [Define this to enable soft asserts.])
428 AC_DEFINE(NDEBUG, 1, [Define this to disable debugging support.])
429elif test "$assert" = yes; then
430 assert = "hard";
431fi
432
433AC_MSG_CHECKING(if you want to do a profile build)
434AC_ARG_ENABLE(profile,
435AC_HELP_STRING([--enable-profile],[Enable profiling]),
436[profile=$enableval], [profile=no])
437
438if test "$profile" = yes; then
439 if test "$ac_cv_c_compiler_gnu" = yes; then
440 CFLAGS="$CFLAGS -pg -static"
441 AC_MSG_RESULT([yes, adding -pg -static])
3a29f678 442 AC_DEFINE(RB_PROFILE, 1, [Defined to mark profiling is enabled])
db137867
AC
443 else
444 AC_MSG_RESULT([no, profile builds only work with gcc])
445 fi
446else
447 AC_MSG_RESULT(no)
448fi
449
db137867
AC
450AC_ARG_ENABLE(warnings,
451AC_HELP_STRING([--enable-warnings],[Enable all sorts of warnings for debugging.]),
452[CFLAGS="$CFLAGS -Wall -Werror -Wcast-qual -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wshadow -Wwrite-strings -W -Wno-unused -Wunused-function -Wunused-variable"],[])
453
454AC_SUBST(LDFLAGS)
455AC_SUBST(PICFLAGS)
456AC_SUBST(CFLAGS)
457AC_SUBST(SEDOBJ)
c2ac22cc 458AC_SUBST(SSL_CFLAGS)
db137867 459AC_SUBST(SSL_LIBS)
2bd29df9
AB
460AC_SUBST(GNUTLS_CFLAGS)
461AC_SUBST(GNUTLS_LIBS)
cd492e44
AC
462AC_SUBST(MBEDTLS_CFLAGS)
463AC_SUBST(MBEDTLS_LIBS)
db137867 464
5203cba5 465if test "$prefix" = "NONE"; then
fe037171 466 AC_DEFINE_UNQUOTED(RB_PREFIX, "$ac_default_prefix", [Prefix where librb is installed.])
db137867
AC
467
468else
469
470dnl Don't get bitten by Cygwin's stupidity if the user specified
471dnl a custom prefix with a trailing slash
472
473 prefix=`echo $prefix | sed 's/\/$//'`
fe037171 474 AC_DEFINE_UNQUOTED(RB_PREFIX, "$prefix", [Prefix where librb is installed.])
5203cba5 475
db137867
AC
476fi
477
478AC_SUBST(RB_PREFIX)
479
db137867
AC
480AC_CONFIG_COMMANDS([include/librb-config.h],
481[
482 outfile=include/librb-config.h.tmp
483 cat > $outfile <<\_______EOF
5203cba5 484/*
fe037171 485 * librb-config.h: librb config file. Please modify configure.ac
db137867 486 */
5203cba5 487
db137867
AC
488#ifndef __LIBRB_CONFIG_H
489#define __LIBRB_CONFIG_H
490
5203cba5 491_______EOF
db137867
AC
492
493if test "x$rb_have_ipv6" = "xyes"; then
494 echo "#define RB_IPV6 1" >> $outfile
495fi
496
497if test "x$rb_windows_h" = "xyes"; then
498 echo '#define WIN32_LEAN_AND_MEAN 1' >> $outfile
499 echo '#include <windows.h>' >> $outfile
500 echo '#include <winsock2.h>' >> $outfile
fe277230 501 echo '#include <ws2tcpip.h>' >> $outfile
db137867
AC
502 echo '#include <iphlpapi.h>' >> $outfile
503fi
504
505if test "x$rb_alloca_h" = "xyes"; then
506 echo '#define RB_HAVE_ALLOCA_H 1' >> $outfile
507fi
508
509if test "x$rb_header_stdc" = "xyes"; then
510 echo '#include <stdlib.h>' >> $outfile
511 echo '#include <stddef.h>' >> $outfile
512elif test "x$rb_header_stdlib" = "xyes"; then
513 echo '#include <stdlib.h>' >> $outfile
514fi
515
516if test "x$rb_header_string_h" = "xyes"; then
517 echo '#include <string.h>' >> $outfile
518fi
519
520if test "x$rb_stdint_h" = "xyes"; then
521 echo '#include <stdint.h>' >> $outfile
522fi
523
524if test "x$rb_inttypes_h" = "xyes"; then
525 echo '#include <inttypes.h>' >> $outfile
526fi
527
528if test "x$rb_sys_types_h" = "xyes"; then
529 echo '#include <sys/types.h>' >> $outfile
530fi
531if test "x$rb_sys_time_h" = "xyes"; then
532 echo '#include <sys/time.h>' >> $outfile
533fi
534if test "x$rb_sys_stat_h" = "xyes"; then
535 echo '#include <sys/stat.h>' >> $outfile
536fi
537if test "x$rb_time_h" = "xyes"; then
538 echo '#include <time.h>' >> $outfile
539fi
540
541if test "x$rb_sys_socket_h" = "xyes"; then
542 echo '#include <sys/socket.h>' >> $outfile
543fi
544
545if test "x$rb_netinet_in_h" = "xyes"; then
546 echo '#include <netinet/in.h>' >> $outfile
547fi
548
549if test "x$rb_arpa_inet_h" = "xyes"; then
550 echo '#include <arpa/inet.h>' >> $outfile
551fi
552
553if test "x$rb_unistd_h" = "xyes"; then
554 echo '#include <unistd.h>' >> $outfile
555fi
556
557if test "x$rb_crypt_h" = "xyes"; then
558 echo '#include <crypt.h>' >> $outfile
559fi
560
561if test "x$rb_errno_h" = "xyes"; then
562 echo '#include <errno.h>' >> $outfile
563fi
564
a9fb3ed0
VY
565echo "typedef $rb_socklen_t rb_socklen_t;" >> $outfile
566
567
db137867
AC
568if test "x$rb_sockaddr_sa_len" = "xyes"; then
569 echo '#define RB_SOCKADDR_HAS_SA_LEN 1' >> $outfile
570fi
571
db137867
AC
572if test "x$rb_sockaddr_storage" = "xyes"; then
573 echo '#define rb_sockaddr_storage sockaddr_storage' >> $outfile
574else
3202e249 575 echo 'struct rb_sockaddr_storage { uint8_t _padding[[128]]; };' >> $outfile
db137867
AC
576fi
577
578cat >> $outfile <<\_______EOF
579#endif /* __LIBRB_CONFIG_H */
580_______EOF
581
582if cmp -s $outfile include/librb-config.h; then
583 AC_MSG_NOTICE([include/librb-config.h is unchanged])
584 ${rb_rm} -f $outfile
585else
586 ${rb_mv} $outfile include/librb-config.h
587fi
588
589],[
db137867
AC
590 if test x$ac_cv_header_stdc = xyes; then
591 rb_header_stdc=yes
592 fi
593 if test x$ac_cv_header_stdlib_h = xyes; then
594 rb_header_stdlib_h=yes
595 fi
596 if test x$ac_cv_header_string_h = xyes; then
597 rb_header_string_h=yes
598 fi
599 if test x$ac_cv_header_memory_h = xyes; then
600 rb_header_memory_h=yes
601 fi
602 if test "x${ac_cv_working_alloca_h+set}" = xset ; then
603 rb_alloca_h="$ac_cv_working_alloca_h"
604 else
605 rb_alloc_h="$ac_cv_header_alloca_h"
606 fi
607 if test x$ac_cv_member_struct_sockaddr_sa_len = xyes; then
608 rb_sockaddr_sa_len=yes
609 fi
610 if test x$ac_cv_header_sys_socket_h = xyes; then
611 rb_sys_socket_h=yes
612 fi
613 if test x$ac_cv_header_sys_types_h = xyes; then
614 rb_sys_types_h=yes
615 fi
616 if test x$ac_cv_header_sys_stat_h = xyes; then
617 rb_sys_stat_h=yes
618 fi
619 if test x$ac_cv_header_sys_time_h = xyes; then
620 rb_sys_time_h=yes
621 fi
622 if test x$ac_cv_header_time = xyes; then
623 rb_time_h=yes
624 fi
625
626 if test x$ac_cv_header_stdint_h = xyes; then
627 rb_stdint_h=yes
628 fi
629 if test x$ac_cv_header_inttypes_h = xyes; then
630 rb_inttypes_h=yes
631 fi
632 if test x$ac_cv_header_netinet_in_h = xyes; then
633 rb_netinet_in_h=yes
634 fi
635
636 if test x$ac_cv_header_crypt_h = xyes; then
637 rb_crypt_h=yes
638 fi
639 if test x$ac_cv_header_errno_h = xyes; then
640 rb_errno_h=yes
641 fi
642 if test x$ac_cv_header_unistd_h = xyes; then
643 rb_unistd_h=yes
644 fi
645 if test x$ac_cv_header_windows_h = xyes; then
646 rb_windows_h=yes
647 fi
648 if test x$ac_cv_header_winsock2_h = xyes; then
649 rb_winsock2_h=yes
650 fi
a9fb3ed0
VY
651
652 rb_socklen_t=$rb_socklen_t
653
db137867 654 if test "x$rb_have_sockaddr_storage" = "xyes"; then
5203cba5 655 rb_sockaddr_storage="yes"
db137867
AC
656 else
657 rb_sockaddr_storage="no"
658 fi
5203cba5 659
db137867 660 rb_have_ipv6="$have_v6"
5203cba5 661
db137867
AC
662 rb_mv="$MV"
663 rb_rm="$RM"
5203cba5 664
db137867 665]
5203cba5 666
db137867
AC
667
668)
669
c2ac22cc
VY
670
671AC_CONFIG_FILES( \
672 src/Makefile \
673 Makefile \
c83f2f5e 674 librb.pc
c2ac22cc 675)
db137867
AC
676
677AC_OUTPUT
678
679dnl Make it look sexay!
680
681echo
682echo "Compiling $PACKAGE_NAME $PACKAGE_VERSION"
683echo
684
685echo "Installing into: $prefix"
686
687echo "IPv6 support ................... $have_v6"
688echo "Assert debugging ............... $assert"
c2ac22cc 689echo "SSL Type........................ $SSL_TYPE"
db137867 690echo