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