]>
Commit | Line | Data |
---|---|---|
030272f3 | 1 | dnl $Id: configure.ac 26260 2008-12-10 04:08:39Z androsyn $ |
db137867 AC |
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 | ||
030272f3 | 8 | AC_PREREQ(2.63) |
db137867 AC |
9 | AUTOMAKE_OPTIONS = 1.10 |
10 | dnl Sneaky way to get an Id tag into the configure script | |
030272f3 | 11 | AC_COPYRIGHT([$Id: configure.ac 26260 2008-12-10 04:08:39Z androsyn $]) |
db137867 AC |
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 | |
f171dafb | 43 | AC_C_BIGENDIAN |
db137867 AC |
44 | AC_PROG_MAKE_SET |
45 | AC_PROG_INSTALL | |
46 | AC_PATH_PROG(AUTOMAKE, automake) | |
47 | AC_PATH_PROG(ACLOCAL, aclocal) | |
48 | AC_PATH_PROG(AUTOHEADER, autoheader) | |
49 | AC_PATH_PROG(AS, as) | |
50 | AC_PATH_PROG(RM, rm) | |
51 | AC_PATH_PROG(CP, cp) | |
52 | AC_PATH_PROG(MV, mv) | |
53 | AC_PATH_PROG(LN, ln) | |
db137867 AC |
54 | AC_PATH_PROG(TOUCH, touch) |
55 | AC_LANG(C) | |
56 | ||
57 | AC_PROG_LIBTOOL | |
58 | ||
59 | LIBTOOL="$LIBTOOL --silent" | |
60 | ||
db137867 AC |
61 | case "$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 | ;; | |
84 | esac | |
85 | ||
86 | AM_CONDITIONAL([MINGW], [test "$is_mingw" = "yes"]) | |
87 | ||
88 | ||
89 | # backwards support for IRC_CFLAGS | |
3202e249 | 90 | CFLAGS="$IRC_CFLAGS $CFLAGS -Wall" |
db137867 AC |
91 | |
92 | dnl use directory structure of cached as default (hack) | |
93 | if test "$libexecdir" = '${exec_prefix}/libexec' && | |
94 | test "$localstatedir" = '${prefix}/var'; then | |
95 | libexecdir='${bindir}' | |
96 | localstatedir='${prefix}' | |
97 | fi | |
98 | ||
db137867 AC |
99 | AC_TYPE_PID_T |
100 | AC_TYPE_SIZE_T | |
101 | AC_TYPE_SSIZE_T | |
102 | AC_TYPE_UID_T | |
103 | ||
104 | ||
105 | dnl Checks for header files. | |
106 | AC_HEADER_STDC | |
107 | ||
77cb59b3 | 108 | 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 linux/tcp.h]) |
db137867 AC |
109 | AC_HEADER_TIME |
110 | ||
111 | dnl Networking Functions | |
112 | dnl ==================== | |
113 | ||
114 | AC_SEARCH_LIBS(socket, [socket],,) | |
115 | ||
116 | ||
117 | AC_CHECK_MEMBER([struct sockaddr.sa_len], [AC_DEFINE(SOCKADDR_IN_HAS_LEN, 1, [Define to 1 if sockaddr has a 'sa_len' | |
118 | member.])],,[[ | |
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 | 130 | AC_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 |
149 | int getpeername (int, $arg2 *, $t *); |
150 | ],[ | |
151 | $t len; | |
152 | getpeername(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 |
169 | rb_socklen_t=$rb_cv_socklen_t |
170 | ||
a9fb3ed0 VY |
171 | |
172 | ||
173 | ||
db137867 AC |
174 | |
175 | AC_ARG_ENABLE(ipv6,AC_HELP_STRING([--disable-ipv6],[Disable IPv6 support]),[ipv6=$enableval],[ipv6=yes]) | |
176 | ||
177 | if test x$ipv6 != xyes; then | |
178 | have_v6="no" | |
179 | else | |
180 | ||
181 | have_v6=yes | |
182 | RB_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 | ||
194 | fi | |
195 | ||
196 | AC_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 |
204 | dnl Check for stdarg.h - if we cant find it, halt configure |
205 | AC_CHECK_HEADER(stdarg.h, , [AC_MSG_ERROR([** stdarg.h could not be found - libratbox will not compile without it **])]) | |
206 | ||
207 | AC_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 | ||
213 | dnl check for various functions... | |
3202e249 | 214 | 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]) |
db137867 AC |
215 | |
216 | AC_SEARCH_LIBS(nanosleep, rt posix4, AC_DEFINE(HAVE_NANOSLEEP, 1, [Define if you have nanosleep])) | |
217 | AC_SEARCH_LIBS(timer_create, rt, AC_DEFINE(HAVE_TIMER_CREATE, 1, [Define if you have timer_create])) | |
218 | RB_CHECK_TIMER_CREATE | |
3202e249 | 219 | RB_CHECK_TIMERFD_CREATE |
db137867 AC |
220 | |
221 | AC_FUNC_ALLOCA | |
222 | AC_FUNC_VFORK | |
223 | AC_FUNC_MMAP | |
224 | ||
225 | AC_MSG_CHECKING(for /dev/poll) | |
226 | if test -c "/dev/poll"; then | |
227 | AC_MSG_RESULT(yes) | |
228 | AC_DEFINE(HAVE_DEVPOLL, [1], [Define to 1 if you have devpoll]) | |
229 | else | |
230 | AC_MSG_RESULT(no) | |
231 | fi | |
232 | ||
233 | ||
234 | if test "$is_mingw" = "yes"; then | |
235 | AC_DEFINE(HAVE_WIN32, [1], [Define to 1 if you are on windows]) | |
236 | fi | |
237 | ||
238 | ||
239 | dnl OpenSSL support | |
240 | AC_MSG_CHECKING(for OpenSSL) | |
241 | AC_ARG_ENABLE(openssl, | |
242 | [AC_HELP_STRING([--enable-openssl[=DIR]],[Enable OpenSSL support (DIR optional).]) | |
243 | AC_HELP_STRING([--disable-openssl],[Disable OpenSSL support.])], | |
244 | [cf_enable_openssl=$enableval], | |
245 | [cf_enable_openssl="auto"]) | |
246 | ||
247 | if 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 | |
296 | else | |
297 | dnl If --disable-openssl was specified | |
298 | AC_MSG_RESULT(disabled) | |
299 | fi | |
300 | ||
301 | save_CPPFLAGS="$CPPFLAGS" | |
c2ac22cc | 302 | CPPFLAGS="$CPPFLAGS $SSL_CFLAGS" |
db137867 AC |
303 | save_LIBS="$LIBS" |
304 | LIBS="$LIBS $SSL_LIBS" | |
305 | if 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 | ||
324 | fi | |
325 | ||
326 | ||
327 | if 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]) | |
332 | fi | |
333 | ||
db137867 AC |
334 | if 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]) |
339 | fi | |
340 | ||
c2ac22cc VY |
341 | |
342 | ||
2bd29df9 AB |
343 | dnl GnuTLS support |
344 | AC_MSG_CHECKING(for GnuTLS) | |
345 | AC_ARG_ENABLE(gnutls, | |
346 | [AC_HELP_STRING([--enable-gnutls],[Enable GnuTLS support.]) | |
347 | AC_HELP_STRING([--disable-gnutls],[Disable GnuTLS support.])], | |
348 | [cf_enable_gnutls=$enableval], | |
349 | [cf_enable_gnutls="auto"]) | |
350 | ||
351 | if test "$cf_enable_gnutls" != no; then | |
352 | PKG_CHECK_MODULES(GNUTLS, [gnutls], [ | |
353 | cf_enable_gnutls="yes" | |
354 | ], [cf_enable_gnutls="no"]) | |
355 | fi | |
356 | ||
357 | if test "$cf_enable_gnutls" = "auto" -a "$cf_enable_openssl" = "yes"; then | |
358 | cf_enable_gnutls="no" | |
359 | fi | |
360 | ||
c2ac22cc | 361 | if test x"$cf_enable_openssl" != xno; then |
db137867 | 362 | AC_DEFINE(HAVE_OPENSSL,1,[Has OpenSSL]) |
2bd29df9 AB |
363 | GNUTLS_CFLAGS="" |
364 | GNUTLS_LIBS="" | |
c2ac22cc | 365 | SSL_TYPE="openssl" |
2bd29df9 AB |
366 | elif test x"$cf_enable_gnutls" != xno; then |
367 | AC_DEFINE(HAVE_GNUTLS, 1, [Has GnuTLS]) | |
368 | SSL_LIBS="" | |
369 | SSL_CFLAGS="" | |
370 | SSL_TYPE="gnutls" | |
db137867 AC |
371 | fi |
372 | ||
373 | ||
c2ac22cc VY |
374 | |
375 | ||
db137867 AC |
376 | CPPFLAGS="$save_CPPFLAGS" |
377 | LIBS="$save_LIBS" | |
378 | ||
379 | dnl End OpenSSL detection | |
380 | ||
381 | ||
382 | ||
383 | ||
384 | dnl Debug-related options | |
385 | dnl ===================== | |
386 | ||
387 | AC_ARG_ENABLE(assert, | |
388 | AC_HELP_STRING([--enable-assert],[Enable assert(). Choose between soft(warnings) and hard(aborts the daemon)]), | |
389 | [assert=$enableval], [assert=no]) | |
390 | ||
391 | if test "$assert" = no; then | |
392 | AC_DEFINE(NDEBUG, 1, [Define this to disable debugging support.]) | |
393 | elif test "$assert" = soft; then | |
394 | AC_DEFINE(SOFT_ASSERT, 1, [Define this to enable soft asserts.]) | |
395 | AC_DEFINE(NDEBUG, 1, [Define this to disable debugging support.]) | |
396 | elif test "$assert" = yes; then | |
397 | assert = "hard"; | |
398 | fi | |
399 | ||
400 | AC_MSG_CHECKING(if you want to do a profile build) | |
401 | AC_ARG_ENABLE(profile, | |
402 | AC_HELP_STRING([--enable-profile],[Enable profiling]), | |
403 | [profile=$enableval], [profile=no]) | |
404 | ||
405 | if test "$profile" = yes; then | |
406 | if test "$ac_cv_c_compiler_gnu" = yes; then | |
407 | CFLAGS="$CFLAGS -pg -static" | |
408 | AC_MSG_RESULT([yes, adding -pg -static]) | |
409 | AC_DEFINE(RATBOX_PROFILE, 1, [Defined to mark profiling is enabled]) | |
410 | else | |
411 | AC_MSG_RESULT([no, profile builds only work with gcc]) | |
412 | fi | |
413 | else | |
414 | AC_MSG_RESULT(no) | |
415 | fi | |
416 | ||
417 | AC_ARG_ENABLE(balloc, | |
418 | AC_HELP_STRING([--disable-balloc],[Disable the block allocator.]), | |
419 | [balloc=$enableval], [balloc=yes]) | |
420 | ||
421 | if test "$balloc" = no; then | |
422 | AC_DEFINE([NOBALLOC], 1, [Define to 1 if you wish to disable the block allocator.]) | |
423 | fi | |
424 | ||
425 | AC_ARG_ENABLE(warnings, | |
426 | AC_HELP_STRING([--enable-warnings],[Enable all sorts of warnings for debugging.]), | |
427 | [CFLAGS="$CFLAGS -Wall -Werror -Wcast-qual -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wshadow -Wwrite-strings -W -Wno-unused -Wunused-function -Wunused-variable"],[]) | |
428 | ||
429 | AC_SUBST(LDFLAGS) | |
430 | AC_SUBST(PICFLAGS) | |
431 | AC_SUBST(CFLAGS) | |
432 | AC_SUBST(SEDOBJ) | |
c2ac22cc | 433 | AC_SUBST(SSL_CFLAGS) |
db137867 | 434 | AC_SUBST(SSL_LIBS) |
2bd29df9 AB |
435 | AC_SUBST(GNUTLS_CFLAGS) |
436 | AC_SUBST(GNUTLS_LIBS) | |
db137867 AC |
437 | |
438 | if test "$prefix" = "NONE"; then | |
439 | AC_DEFINE_UNQUOTED(RB_PREFIX, "$ac_default_prefix", [Prefix where libratbox is installed.]) | |
440 | ||
441 | else | |
442 | ||
443 | dnl Don't get bitten by Cygwin's stupidity if the user specified | |
444 | dnl a custom prefix with a trailing slash | |
445 | ||
446 | prefix=`echo $prefix | sed 's/\/$//'` | |
447 | AC_DEFINE_UNQUOTED(RB_PREFIX, "$prefix", [Prefix where libratbox is installed.]) | |
448 | ||
449 | fi | |
450 | ||
451 | AC_SUBST(RB_PREFIX) | |
452 | ||
db137867 AC |
453 | AC_CONFIG_COMMANDS([include/librb-config.h], |
454 | [ | |
455 | outfile=include/librb-config.h.tmp | |
456 | cat > $outfile <<\_______EOF | |
457 | /* | |
458 | * librb-config.h: libratbox config file. Please modify configure.ac | |
459 | */ | |
460 | ||
461 | #ifndef __LIBRB_CONFIG_H | |
462 | #define __LIBRB_CONFIG_H | |
463 | ||
464 | _______EOF | |
465 | ||
466 | if test "x$rb_have_ipv6" = "xyes"; then | |
467 | echo "#define RB_IPV6 1" >> $outfile | |
468 | fi | |
469 | ||
470 | if test "x$rb_windows_h" = "xyes"; then | |
471 | echo '#define WIN32_LEAN_AND_MEAN 1' >> $outfile | |
472 | echo '#include <windows.h>' >> $outfile | |
473 | echo '#include <winsock2.h>' >> $outfile | |
474 | echo '#include <iphlpapi.h>' >> $outfile | |
475 | fi | |
476 | ||
477 | if test "x$rb_alloca_h" = "xyes"; then | |
478 | echo '#define RB_HAVE_ALLOCA_H 1' >> $outfile | |
479 | fi | |
480 | ||
481 | if test "x$rb_header_stdc" = "xyes"; then | |
482 | echo '#include <stdlib.h>' >> $outfile | |
483 | echo '#include <stddef.h>' >> $outfile | |
484 | elif test "x$rb_header_stdlib" = "xyes"; then | |
485 | echo '#include <stdlib.h>' >> $outfile | |
486 | fi | |
487 | ||
488 | if test "x$rb_header_string_h" = "xyes"; then | |
489 | echo '#include <string.h>' >> $outfile | |
490 | fi | |
491 | ||
492 | if test "x$rb_stdint_h" = "xyes"; then | |
493 | echo '#include <stdint.h>' >> $outfile | |
494 | fi | |
495 | ||
496 | if test "x$rb_inttypes_h" = "xyes"; then | |
497 | echo '#include <inttypes.h>' >> $outfile | |
498 | fi | |
499 | ||
500 | if test "x$rb_sys_types_h" = "xyes"; then | |
501 | echo '#include <sys/types.h>' >> $outfile | |
502 | fi | |
503 | if test "x$rb_sys_time_h" = "xyes"; then | |
504 | echo '#include <sys/time.h>' >> $outfile | |
505 | fi | |
506 | if test "x$rb_sys_stat_h" = "xyes"; then | |
507 | echo '#include <sys/stat.h>' >> $outfile | |
508 | fi | |
509 | if test "x$rb_time_h" = "xyes"; then | |
510 | echo '#include <time.h>' >> $outfile | |
511 | fi | |
512 | ||
513 | if test "x$rb_sys_socket_h" = "xyes"; then | |
514 | echo '#include <sys/socket.h>' >> $outfile | |
515 | fi | |
516 | ||
517 | if test "x$rb_netinet_in_h" = "xyes"; then | |
518 | echo '#include <netinet/in.h>' >> $outfile | |
519 | fi | |
520 | ||
521 | if test "x$rb_arpa_inet_h" = "xyes"; then | |
522 | echo '#include <arpa/inet.h>' >> $outfile | |
523 | fi | |
524 | ||
525 | if test "x$rb_unistd_h" = "xyes"; then | |
526 | echo '#include <unistd.h>' >> $outfile | |
527 | fi | |
528 | ||
529 | if test "x$rb_crypt_h" = "xyes"; then | |
530 | echo '#include <crypt.h>' >> $outfile | |
531 | fi | |
532 | ||
533 | if test "x$rb_errno_h" = "xyes"; then | |
534 | echo '#include <errno.h>' >> $outfile | |
535 | fi | |
536 | ||
a9fb3ed0 VY |
537 | echo "typedef $rb_socklen_t rb_socklen_t;" >> $outfile |
538 | ||
539 | ||
db137867 AC |
540 | if test "x$rb_sockaddr_sa_len" = "xyes"; then |
541 | echo '#define RB_SOCKADDR_HAS_SA_LEN 1' >> $outfile | |
542 | fi | |
543 | ||
db137867 AC |
544 | if test "x$rb_sockaddr_storage" = "xyes"; then |
545 | echo '#define rb_sockaddr_storage sockaddr_storage' >> $outfile | |
546 | else | |
3202e249 | 547 | echo 'struct rb_sockaddr_storage { uint8_t _padding[[128]]; };' >> $outfile |
db137867 AC |
548 | fi |
549 | ||
550 | cat >> $outfile <<\_______EOF | |
551 | #endif /* __LIBRB_CONFIG_H */ | |
552 | _______EOF | |
553 | ||
554 | if cmp -s $outfile include/librb-config.h; then | |
555 | AC_MSG_NOTICE([include/librb-config.h is unchanged]) | |
556 | ${rb_rm} -f $outfile | |
557 | else | |
558 | ${rb_mv} $outfile include/librb-config.h | |
559 | fi | |
560 | ||
561 | ],[ | |
db137867 AC |
562 | if test x$ac_cv_header_stdc = xyes; then |
563 | rb_header_stdc=yes | |
564 | fi | |
565 | if test x$ac_cv_header_stdlib_h = xyes; then | |
566 | rb_header_stdlib_h=yes | |
567 | fi | |
568 | if test x$ac_cv_header_string_h = xyes; then | |
569 | rb_header_string_h=yes | |
570 | fi | |
571 | if test x$ac_cv_header_memory_h = xyes; then | |
572 | rb_header_memory_h=yes | |
573 | fi | |
574 | if test "x${ac_cv_working_alloca_h+set}" = xset ; then | |
575 | rb_alloca_h="$ac_cv_working_alloca_h" | |
576 | else | |
577 | rb_alloc_h="$ac_cv_header_alloca_h" | |
578 | fi | |
579 | if test x$ac_cv_member_struct_sockaddr_sa_len = xyes; then | |
580 | rb_sockaddr_sa_len=yes | |
581 | fi | |
582 | if test x$ac_cv_header_sys_socket_h = xyes; then | |
583 | rb_sys_socket_h=yes | |
584 | fi | |
585 | if test x$ac_cv_header_sys_types_h = xyes; then | |
586 | rb_sys_types_h=yes | |
587 | fi | |
588 | if test x$ac_cv_header_sys_stat_h = xyes; then | |
589 | rb_sys_stat_h=yes | |
590 | fi | |
591 | if test x$ac_cv_header_sys_time_h = xyes; then | |
592 | rb_sys_time_h=yes | |
593 | fi | |
594 | if test x$ac_cv_header_time = xyes; then | |
595 | rb_time_h=yes | |
596 | fi | |
597 | ||
598 | if test x$ac_cv_header_stdint_h = xyes; then | |
599 | rb_stdint_h=yes | |
600 | fi | |
601 | if test x$ac_cv_header_inttypes_h = xyes; then | |
602 | rb_inttypes_h=yes | |
603 | fi | |
604 | if test x$ac_cv_header_netinet_in_h = xyes; then | |
605 | rb_netinet_in_h=yes | |
606 | fi | |
607 | ||
608 | if test x$ac_cv_header_crypt_h = xyes; then | |
609 | rb_crypt_h=yes | |
610 | fi | |
611 | if test x$ac_cv_header_errno_h = xyes; then | |
612 | rb_errno_h=yes | |
613 | fi | |
614 | if test x$ac_cv_header_unistd_h = xyes; then | |
615 | rb_unistd_h=yes | |
616 | fi | |
617 | if test x$ac_cv_header_windows_h = xyes; then | |
618 | rb_windows_h=yes | |
619 | fi | |
620 | if test x$ac_cv_header_winsock2_h = xyes; then | |
621 | rb_winsock2_h=yes | |
622 | fi | |
a9fb3ed0 VY |
623 | |
624 | rb_socklen_t=$rb_socklen_t | |
625 | ||
db137867 AC |
626 | if test "x$rb_have_sockaddr_storage" = "xyes"; then |
627 | rb_sockaddr_storage="yes" | |
628 | else | |
629 | rb_sockaddr_storage="no" | |
630 | fi | |
631 | ||
632 | rb_have_ipv6="$have_v6" | |
633 | ||
634 | rb_mv="$MV" | |
635 | rb_rm="$RM" | |
636 | ||
637 | ] | |
638 | ||
639 | ||
640 | ) | |
641 | ||
c2ac22cc VY |
642 | |
643 | AC_CONFIG_FILES( \ | |
644 | src/Makefile \ | |
645 | Makefile \ | |
030272f3 | 646 | libratbox.pc |
c2ac22cc | 647 | ) |
db137867 AC |
648 | |
649 | AC_OUTPUT | |
650 | ||
651 | dnl Make it look sexay! | |
652 | ||
653 | echo | |
654 | echo "Compiling $PACKAGE_NAME $PACKAGE_VERSION" | |
655 | echo | |
656 | ||
657 | echo "Installing into: $prefix" | |
658 | ||
659 | echo "IPv6 support ................... $have_v6" | |
660 | echo "Assert debugging ............... $assert" | |
661 | echo "Block allocator ................ $balloc" | |
c2ac22cc | 662 | echo "SSL Type........................ $SSL_TYPE" |
db137867 AC |
663 | echo |
664 |