~ubuntu-branches/ubuntu/trusty/charybdis/trusty-proposed

« back to all changes in this revision

Viewing changes to libratbox/configure.ac

  • Committer: Package Import Robot
  • Author(s): Antoine Beaupré
  • Date: 2011-11-10 23:07:37 UTC
  • Revision ID: package-import@ubuntu.com-20111110230737-kqo6qsglp5oh02hr
Tags: upstream-3.3.0
Import upstream version 3.3.0

Show diffs side-by-side

added added

removed removed

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