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