]> jfr.im git - solanum.git/blame - librb/configure.ac
remove RB_IPV6
[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 ;;
36b3cff7 65*mingw* | *msys*)
db137867
AC
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
7b2c764f 107AC_CHECK_HEADERS([crypt.h unistd.h sys/socket.h sys/stat.h sys/time.h time.h netinet/in.h netinet/tcp.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])
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>
eb558775 147#include <ws2tcpip.h>
3202e249 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 174
db137867
AC
175AC_CHECK_TYPES([struct sockaddr_storage],[
176 rb_have_sockaddr_storage=yes
177 ],[], [
178 #include <sys/types.h>
179 #include <sys/socket.h>
180 ])
5203cba5 181
db137867 182
db137867 183dnl Check for stdarg.h - if we cant find it, halt configure
fe037171 184AC_CHECK_HEADER(stdarg.h, , [AC_MSG_ERROR([** stdarg.h could not be found - librb will not compile without it **])])
db137867
AC
185
186AC_CHECK_TYPE([sa_family_t], [],
187[AC_DEFINE(sa_family_t, [u_int16_t], [If system does not define sa_family_t, define it here.])],
188[[#include <sys/types.h>
189#include <sys/socket.h>]])
190
191
192dnl check for various functions...
508e25a8 193AC_CHECK_FUNCS([snprintf vsnprintf socketpair gettimeofday writev sendmsg gmtime_r strtok_r usleep posix_spawn getexecname strlcpy strlcat strnlen strcasestr strcasecmp strncasecmp fstat signalfd select poll kevent port_create epoll_ctl arc4random getrusage timerfd_create])
db137867 194
790e4dce 195AC_SEARCH_LIBS(dlinfo, dl, AC_DEFINE(HAVE_DLINFO, 1, [Define if you have dlinfo]))
db137867
AC
196AC_SEARCH_LIBS(nanosleep, rt posix4, AC_DEFINE(HAVE_NANOSLEEP, 1, [Define if you have nanosleep]))
197AC_SEARCH_LIBS(timer_create, rt, AC_DEFINE(HAVE_TIMER_CREATE, 1, [Define if you have timer_create]))
198RB_CHECK_TIMER_CREATE
3202e249 199RB_CHECK_TIMERFD_CREATE
db137867
AC
200
201AC_FUNC_ALLOCA
202AC_FUNC_VFORK
203AC_FUNC_MMAP
204
205AC_MSG_CHECKING(for /dev/poll)
206if test -c "/dev/poll"; then
207 AC_MSG_RESULT(yes)
208 AC_DEFINE(HAVE_DEVPOLL, [1], [Define to 1 if you have devpoll])
209else
5203cba5 210 AC_MSG_RESULT(no)
db137867
AC
211fi
212
213
214if test "$is_mingw" = "yes"; then
215 AC_DEFINE(HAVE_WIN32, [1], [Define to 1 if you are on windows])
216fi
217
218
219dnl OpenSSL support
220AC_MSG_CHECKING(for OpenSSL)
221AC_ARG_ENABLE(openssl,
222[AC_HELP_STRING([--enable-openssl[=DIR]],[Enable OpenSSL support (DIR optional).])
223AC_HELP_STRING([--disable-openssl],[Disable OpenSSL support.])],
224[cf_enable_openssl=$enableval],
225[cf_enable_openssl="auto"])
226
227if test "$cf_enable_openssl" != "no" ; then
228 cf_openssl_basedir=""
229 if test "$cf_enable_openssl" != "auto" &&
230 test "$cf_enable_openssl" != "yes" ; then
231 dnl Support for --enable-openssl=/some/place
232 cf_openssl_basedir="`echo ${cf_enable_openssl} | sed 's/\/$//'`"
233 else
234 dnl Do the auto-probe here. Check some common directory paths.
235 for dirs in /usr/local/ssl /usr/pkg /usr/local \
236 /usr/local/openssl ; do
237 if test -f "${dirs}/include/openssl/opensslv.h" ; then
238 cf_openssl_basedir="${dirs}"
239 break
240 fi
241 done
242 unset dirs
243 fi
244 dnl Now check cf_openssl_found to see if we found anything.
245 if test ! -z "$cf_openssl_basedir"; then
246 if test -f "${cf_openssl_basedir}/include/openssl/opensslv.h" ; then
c2ac22cc 247 SSL_CFLAGS="-I${cf_openssl_basedir}/include"
db137867
AC
248 SSL_LIBS="-L${cf_openssl_basedir}/lib"
249 else
250 dnl OpenSSL wasn't found in the directory specified. Naughty
251 dnl administrator...
252 cf_openssl_basedir=""
253 fi
254 else
255 dnl Check for stock FreeBSD 4.x and 5.x systems, since their files
256 dnl are in /usr/include and /usr/lib. In this case, we don't want to
257 dnl change INCLUDES or LIBS, but still want to enable OpenSSL.
258 dnl We can't do this check above, because some people want two versions
259 dnl of OpenSSL installed (stock FreeBSD 4.x/5.x and /usr/local/ssl)
260 dnl and they want /usr/local/ssl to have preference.
261 if test -f "/usr/include/openssl/opensslv.h" ; then
262 cf_openssl_basedir="/usr"
263 fi
264 fi
265
266 dnl If we have a basedir defined, then everything is okay. Otherwise,
267 dnl we have a problem.
268 if test ! -z "$cf_openssl_basedir"; then
269 AC_MSG_RESULT($cf_openssl_basedir)
270 cf_enable_openssl="yes"
271 else
272 AC_MSG_RESULT([not found. Specify a correct path?])
273 cf_enable_openssl="no"
274 fi
275 unset cf_openssl_basedir
276else
277 dnl If --disable-openssl was specified
278 AC_MSG_RESULT(disabled)
279fi
280
281save_CPPFLAGS="$CPPFLAGS"
c2ac22cc 282CPPFLAGS="$CPPFLAGS $SSL_CFLAGS"
db137867
AC
283save_LIBS="$LIBS"
284LIBS="$LIBS $SSL_LIBS"
285if test "$cf_enable_openssl" != no; then
286 dnl Check OpenSSL version (must be 0.9.7 or above!)
287 AC_MSG_CHECKING(for OpenSSL 0.9.7 or above)
288 AC_RUN_IFELSE(
d5ef3fd3 289 [AC_LANG_PROGRAM(
db137867
AC
290 [#include <openssl/opensslv.h>
291 #include <stdlib.h>],
292 [[if (OPENSSL_VERSION_NUMBER >= 0x00907000)
d5ef3fd3 293 exit(0); else exit(1);]])],
db137867
AC
294 cf_enable_openssl=yes,
295 cf_enable_openssl=no,
296 cf_enable_openssl=no)
297
298 if test "$cf_enable_openssl" != no; then
299 AC_MSG_RESULT(found)
300 else
301 AC_MSG_RESULT(no - OpenSSL support disabled)
302 fi
303
304fi
305
306
307if test "$cf_enable_openssl" != no; then
308 CPPFLAGS="$CPPFLAGS $SSL_LIBS"
5203cba5 309 AC_CHECK_LIB(crypto, RAND_status,
db137867
AC
310 [cf_enable_openssl=yes],
311 [cf_enable_openssl=no])
312fi
313
db137867
AC
314if test "$cf_enable_openssl" != no; then
315 CPPFLAGS="$CPPFLAGS $SSL_LIBS"
5203cba5 316 AC_CHECK_LIB(ssl, SSL_read,
3202e249 317 [SSL_LIBS="$SSL_LIBS -lssl -lcrypto"],
db137867
AC
318 [cf_enable_openssl=no], [-lcrypto])
319fi
320
c2ac22cc 321
6f57a957
AC
322dnl mbedTLS support
323AC_ARG_ENABLE(mbedtls,
324[AC_HELP_STRING([--enable-mbedtls], [Enable mbedTLS support.])
325AC_HELP_STRING([--disable-mbedtls], [Disable mbedTLS support.])],
326[cf_enable_mbedtls=$enableval],
327[cf_enable_mbedtls="auto"])
328
329if test "$cf_enable_mbedtls" != no; then
330 save_CPPFLAGS="$CPPFLAGS"
331 save_LIBS="$LIBS"
332 LIBS="$LIBS $MBEDTLS_LIBS"
333 AC_CHECK_LIB(mbedtls, mbedtls_ssl_init, [
bf3bcbb5 334 MBEDTLS_LIBS="$MBEDTLS_LIBS -lmbedtls -lmbedx509 -lmbedcrypto"
6f57a957 335 cf_enable_mbedtls=yes
bf3bcbb5 336 ], [cf_enable_mbedtls=no], [-lmbedx509 -lmbedcrypto])
6f57a957 337fi
c2ac22cc 338
2bd29df9
AB
339dnl GnuTLS support
340AC_MSG_CHECKING(for GnuTLS)
341AC_ARG_ENABLE(gnutls,
342[AC_HELP_STRING([--enable-gnutls],[Enable GnuTLS support.])
343AC_HELP_STRING([--disable-gnutls],[Disable GnuTLS support.])],
344[cf_enable_gnutls=$enableval],
345[cf_enable_gnutls="auto"])
5203cba5 346
2bd29df9
AB
347if test "$cf_enable_gnutls" != no; then
348 PKG_CHECK_MODULES(GNUTLS, [gnutls], [
5203cba5
VI
349 cf_enable_gnutls="yes"
350 ], [cf_enable_gnutls="no"])
2bd29df9
AB
351fi
352
6f57a957
AC
353dnl mbed TLS is given highest preference when no specified TLS library is provided
354if test "$cf_enable_openssl" = "auto" -a "$cf_enable_mbedtls" = "yes"; then
355 cf_enable_openssl="no"
356fi
357
358if test "$cf_enable_gnutls" = "auto" -a "$cf_enable_openssl" = "yes" -a "$cf_enable_mbedtls" = "yes"; then
2bd29df9
AB
359 cf_enable_gnutls="no"
360fi
361
c2ac22cc 362if test x"$cf_enable_openssl" != xno; then
db137867 363 AC_DEFINE(HAVE_OPENSSL,1,[Has OpenSSL])
2bd29df9
AB
364 GNUTLS_CFLAGS=""
365 GNUTLS_LIBS=""
6f57a957
AC
366 MBEDTLS_LIBS=""
367 MBEDTLS_CFLAGS=""
c2ac22cc 368 SSL_TYPE="openssl"
6f57a957
AC
369elif test x"$cf_enable_mbedtls" != xno; then
370 AC_DEFINE(HAVE_MBEDTLS, 1, [Has mbedTLS])
371 SSL_LIBS=""
5203cba5 372 SSL_CFLAGS=""
6f57a957
AC
373 GNUTLS_CFLAGS=""
374 GNUTLS_LIBS=""
5203cba5 375 SSL_TYPE="mbedtls"
2bd29df9
AB
376elif test x"$cf_enable_gnutls" != xno; then
377 AC_DEFINE(HAVE_GNUTLS, 1, [Has GnuTLS])
378 SSL_LIBS=""
6f57a957
AC
379 SSL_CFLAGS=""
380 MBEDTLS_LIBS=""
381 MBEDTLS_CFLAGS=""
2bd29df9 382 SSL_TYPE="gnutls"
db137867
AC
383fi
384
385
c2ac22cc
VY
386
387
db137867
AC
388CPPFLAGS="$save_CPPFLAGS"
389LIBS="$save_LIBS"
390
391dnl End OpenSSL detection
392
393
394
395
396dnl Debug-related options
397dnl =====================
398
399AC_ARG_ENABLE(assert,
400AC_HELP_STRING([--enable-assert],[Enable assert(). Choose between soft(warnings) and hard(aborts the daemon)]),
401[assert=$enableval], [assert=no])
402
403if test "$assert" = no; then
404 AC_DEFINE(NDEBUG, 1, [Define this to disable debugging support.])
405elif test "$assert" = soft; then
406 AC_DEFINE(SOFT_ASSERT, 1, [Define this to enable soft asserts.])
407 AC_DEFINE(NDEBUG, 1, [Define this to disable debugging support.])
408elif test "$assert" = yes; then
409 assert = "hard";
410fi
411
412AC_MSG_CHECKING(if you want to do a profile build)
413AC_ARG_ENABLE(profile,
414AC_HELP_STRING([--enable-profile],[Enable profiling]),
415[profile=$enableval], [profile=no])
416
417if test "$profile" = yes; then
418 if test "$ac_cv_c_compiler_gnu" = yes; then
419 CFLAGS="$CFLAGS -pg -static"
420 AC_MSG_RESULT([yes, adding -pg -static])
3a29f678 421 AC_DEFINE(RB_PROFILE, 1, [Defined to mark profiling is enabled])
db137867
AC
422 else
423 AC_MSG_RESULT([no, profile builds only work with gcc])
424 fi
425else
426 AC_MSG_RESULT(no)
427fi
428
db137867
AC
429AC_ARG_ENABLE(warnings,
430AC_HELP_STRING([--enable-warnings],[Enable all sorts of warnings for debugging.]),
431[CFLAGS="$CFLAGS -Wall -Werror -Wcast-qual -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wshadow -Wwrite-strings -W -Wno-unused -Wunused-function -Wunused-variable"],[])
432
433AC_SUBST(LDFLAGS)
434AC_SUBST(PICFLAGS)
435AC_SUBST(CFLAGS)
436AC_SUBST(SEDOBJ)
c2ac22cc 437AC_SUBST(SSL_CFLAGS)
db137867 438AC_SUBST(SSL_LIBS)
2bd29df9
AB
439AC_SUBST(GNUTLS_CFLAGS)
440AC_SUBST(GNUTLS_LIBS)
cd492e44
AC
441AC_SUBST(MBEDTLS_CFLAGS)
442AC_SUBST(MBEDTLS_LIBS)
db137867 443
5203cba5 444if test "$prefix" = "NONE"; then
fe037171 445 AC_DEFINE_UNQUOTED(RB_PREFIX, "$ac_default_prefix", [Prefix where librb is installed.])
db137867
AC
446
447else
448
449dnl Don't get bitten by Cygwin's stupidity if the user specified
450dnl a custom prefix with a trailing slash
451
452 prefix=`echo $prefix | sed 's/\/$//'`
fe037171 453 AC_DEFINE_UNQUOTED(RB_PREFIX, "$prefix", [Prefix where librb is installed.])
5203cba5 454
db137867
AC
455fi
456
457AC_SUBST(RB_PREFIX)
458
db137867
AC
459AC_CONFIG_COMMANDS([include/librb-config.h],
460[
461 outfile=include/librb-config.h.tmp
462 cat > $outfile <<\_______EOF
5203cba5 463/*
fe037171 464 * librb-config.h: librb config file. Please modify configure.ac
db137867 465 */
5203cba5 466
db137867
AC
467#ifndef __LIBRB_CONFIG_H
468#define __LIBRB_CONFIG_H
469
5203cba5 470_______EOF
db137867 471
db137867
AC
472if test "x$rb_windows_h" = "xyes"; then
473 echo '#define WIN32_LEAN_AND_MEAN 1' >> $outfile
474 echo '#include <windows.h>' >> $outfile
475 echo '#include <winsock2.h>' >> $outfile
fe277230 476 echo '#include <ws2tcpip.h>' >> $outfile
db137867
AC
477 echo '#include <iphlpapi.h>' >> $outfile
478fi
479
480if test "x$rb_alloca_h" = "xyes"; then
481 echo '#define RB_HAVE_ALLOCA_H 1' >> $outfile
482fi
483
484if test "x$rb_header_stdc" = "xyes"; then
485 echo '#include <stdlib.h>' >> $outfile
486 echo '#include <stddef.h>' >> $outfile
487elif test "x$rb_header_stdlib" = "xyes"; then
488 echo '#include <stdlib.h>' >> $outfile
489fi
490
491if test "x$rb_header_string_h" = "xyes"; then
492 echo '#include <string.h>' >> $outfile
493fi
494
495if test "x$rb_stdint_h" = "xyes"; then
496 echo '#include <stdint.h>' >> $outfile
497fi
498
499if test "x$rb_inttypes_h" = "xyes"; then
500 echo '#include <inttypes.h>' >> $outfile
501fi
502
503if test "x$rb_sys_types_h" = "xyes"; then
504 echo '#include <sys/types.h>' >> $outfile
505fi
506if test "x$rb_sys_time_h" = "xyes"; then
507 echo '#include <sys/time.h>' >> $outfile
508fi
509if test "x$rb_sys_stat_h" = "xyes"; then
510 echo '#include <sys/stat.h>' >> $outfile
511fi
512if test "x$rb_time_h" = "xyes"; then
513 echo '#include <time.h>' >> $outfile
514fi
515
516if test "x$rb_sys_socket_h" = "xyes"; then
517 echo '#include <sys/socket.h>' >> $outfile
518fi
519
520if test "x$rb_netinet_in_h" = "xyes"; then
521 echo '#include <netinet/in.h>' >> $outfile
522fi
523
468ef960
EM
524if test "x$rb_netinet_tcp_h" == "xyes"; then
525 echo '#include <netinet/tcp.h>' >> $outfile
526fi
527
db137867
AC
528if test "x$rb_arpa_inet_h" = "xyes"; then
529 echo '#include <arpa/inet.h>' >> $outfile
530fi
531
532if test "x$rb_unistd_h" = "xyes"; then
533 echo '#include <unistd.h>' >> $outfile
534fi
535
536if test "x$rb_crypt_h" = "xyes"; then
537 echo '#include <crypt.h>' >> $outfile
538fi
539
540if test "x$rb_errno_h" = "xyes"; then
541 echo '#include <errno.h>' >> $outfile
542fi
543
a9fb3ed0
VY
544echo "typedef $rb_socklen_t rb_socklen_t;" >> $outfile
545
546
db137867
AC
547if test "x$rb_sockaddr_sa_len" = "xyes"; then
548 echo '#define RB_SOCKADDR_HAS_SA_LEN 1' >> $outfile
549fi
550
db137867
AC
551if test "x$rb_sockaddr_storage" = "xyes"; then
552 echo '#define rb_sockaddr_storage sockaddr_storage' >> $outfile
553else
3202e249 554 echo 'struct rb_sockaddr_storage { uint8_t _padding[[128]]; };' >> $outfile
db137867
AC
555fi
556
557cat >> $outfile <<\_______EOF
558#endif /* __LIBRB_CONFIG_H */
559_______EOF
560
561if cmp -s $outfile include/librb-config.h; then
562 AC_MSG_NOTICE([include/librb-config.h is unchanged])
563 ${rb_rm} -f $outfile
564else
565 ${rb_mv} $outfile include/librb-config.h
566fi
567
568],[
db137867
AC
569 if test x$ac_cv_header_stdc = xyes; then
570 rb_header_stdc=yes
571 fi
572 if test x$ac_cv_header_stdlib_h = xyes; then
573 rb_header_stdlib_h=yes
574 fi
575 if test x$ac_cv_header_string_h = xyes; then
576 rb_header_string_h=yes
577 fi
578 if test x$ac_cv_header_memory_h = xyes; then
579 rb_header_memory_h=yes
580 fi
581 if test "x${ac_cv_working_alloca_h+set}" = xset ; then
582 rb_alloca_h="$ac_cv_working_alloca_h"
583 else
584 rb_alloc_h="$ac_cv_header_alloca_h"
585 fi
586 if test x$ac_cv_member_struct_sockaddr_sa_len = xyes; then
587 rb_sockaddr_sa_len=yes
588 fi
589 if test x$ac_cv_header_sys_socket_h = xyes; then
590 rb_sys_socket_h=yes
591 fi
592 if test x$ac_cv_header_sys_types_h = xyes; then
593 rb_sys_types_h=yes
594 fi
595 if test x$ac_cv_header_sys_stat_h = xyes; then
596 rb_sys_stat_h=yes
597 fi
598 if test x$ac_cv_header_sys_time_h = xyes; then
599 rb_sys_time_h=yes
600 fi
601 if test x$ac_cv_header_time = xyes; then
602 rb_time_h=yes
603 fi
604
605 if test x$ac_cv_header_stdint_h = xyes; then
606 rb_stdint_h=yes
607 fi
608 if test x$ac_cv_header_inttypes_h = xyes; then
609 rb_inttypes_h=yes
610 fi
611 if test x$ac_cv_header_netinet_in_h = xyes; then
612 rb_netinet_in_h=yes
613 fi
468ef960
EM
614 if test x$ac_cv_header_netinet_tcp_h = xyes; then
615 rb_netinet_tcp_h=yes
616 fi
db137867
AC
617
618 if test x$ac_cv_header_crypt_h = xyes; then
619 rb_crypt_h=yes
620 fi
621 if test x$ac_cv_header_errno_h = xyes; then
622 rb_errno_h=yes
623 fi
624 if test x$ac_cv_header_unistd_h = xyes; then
625 rb_unistd_h=yes
626 fi
627 if test x$ac_cv_header_windows_h = xyes; then
628 rb_windows_h=yes
629 fi
630 if test x$ac_cv_header_winsock2_h = xyes; then
631 rb_winsock2_h=yes
632 fi
a9fb3ed0
VY
633
634 rb_socklen_t=$rb_socklen_t
635
db137867 636 if test "x$rb_have_sockaddr_storage" = "xyes"; then
5203cba5 637 rb_sockaddr_storage="yes"
db137867
AC
638 else
639 rb_sockaddr_storage="no"
640 fi
5203cba5 641
db137867
AC
642 rb_mv="$MV"
643 rb_rm="$RM"
5203cba5 644
db137867 645]
5203cba5 646
db137867
AC
647
648)
649
c2ac22cc
VY
650
651AC_CONFIG_FILES( \
652 src/Makefile \
653 Makefile \
c83f2f5e 654 librb.pc
c2ac22cc 655)
db137867
AC
656
657AC_OUTPUT
658
659dnl Make it look sexay!
660
661echo
662echo "Compiling $PACKAGE_NAME $PACKAGE_VERSION"
663echo
664
665echo "Installing into: $prefix"
666
db137867 667echo "Assert debugging ............... $assert"
c2ac22cc 668echo "SSL Type........................ $SSL_TYPE"
db137867 669echo