]>
Commit | Line | Data |
---|---|---|
c2ac22cc | 1 | dnl $Id: configure.ac 25574 2008-06-20 21:49:06Z 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 | ||
8 | AC_PREREQ(2.60) | |
9 | AUTOMAKE_OPTIONS = 1.10 | |
10 | dnl Sneaky way to get an Id tag into the configure script | |
c2ac22cc | 11 | AC_COPYRIGHT([$Id: configure.ac 25574 2008-06-20 21:49:06Z 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 | |
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(AR, ar) | |
54 | AC_PATH_PROG(LD, ld) | |
55 | AC_PATH_PROG(RANLIB, ranlib) | |
56 | AC_PATH_PROG(TOUCH, touch) | |
57 | AC_LANG(C) | |
58 | ||
59 | AC_PROG_LIBTOOL | |
60 | ||
61 | LIBTOOL="$LIBTOOL --silent" | |
62 | ||
63 | AC_CONFIG_SUBDIRS(libltdl) | |
64 | ||
65 | ||
66 | case "$host_os" in | |
67 | *cygwin*) | |
68 | AC_DEFINE_UNQUOTED(CYGWIN,1,[This is a Cygwin system]) | |
69 | AC_DEFINE_UNQUOTED(WINDOWS,1,[This is a Windows system]) | |
70 | ;; | |
71 | *mingw*) | |
72 | AC_DEFINE_UNQUOTED(MINGW,1,[This is a MinGW system]) | |
73 | AC_DEFINE_UNQUOTED(WINDOWS,1,[This is a Windows system]) | |
74 | AC_CHECK_HEADER(windows.h, , [AC_MSG_ERROR([** MinGW and no windows.h. I give up.])]) | |
75 | AC_CHECK_HEADER(winsock2.h, , [AC_MSG_ERROR([** MinGW and no winsock2.h. I give up.])]) | |
76 | LIBS="$LIBS -lws2_32 -liphlpapi" | |
77 | is_mingw="yes" | |
78 | ;; | |
79 | *interix*) | |
80 | CPPFLAGS="$CFLAGS -D_ALL_SOURCE -D_XOPEN_SOURCE=500" | |
81 | ;; | |
82 | *solaris*) | |
83 | CPPFLAGS="$CFLAGS -D_POSIX_PTHREAD_SEMANTICS" | |
84 | ;; | |
85 | *) | |
86 | ;; | |
87 | esac | |
88 | ||
89 | AM_CONDITIONAL([MINGW], [test "$is_mingw" = "yes"]) | |
90 | ||
91 | ||
92 | # backwards support for IRC_CFLAGS | |
93 | CFLAGS="$IRC_CFLAGS $CFLAGS -O0 -Wall" | |
94 | ||
95 | dnl use directory structure of cached as default (hack) | |
96 | if test "$libexecdir" = '${exec_prefix}/libexec' && | |
97 | test "$localstatedir" = '${prefix}/var'; then | |
98 | libexecdir='${bindir}' | |
99 | localstatedir='${prefix}' | |
100 | fi | |
101 | ||
102 | AC_TYPE_INT8_T | |
103 | AC_TYPE_INT16_T | |
104 | AC_TYPE_INT32_T | |
105 | AC_TYPE_INT64_T | |
106 | AC_TYPE_UINT8_T | |
107 | AC_TYPE_UINT16_T | |
108 | AC_TYPE_UINT32_T | |
109 | AC_TYPE_UINT64_T | |
110 | ||
111 | RB_TYPE_INTPTR_T | |
112 | RB_TYPE_INTMAX_T | |
113 | RB_TYPE_UINTMAX_T | |
114 | RB_TYPE_UINTPTR_T | |
115 | ||
116 | AC_TYPE_PID_T | |
117 | AC_TYPE_SIZE_T | |
118 | AC_TYPE_SSIZE_T | |
119 | AC_TYPE_UID_T | |
120 | ||
121 | ||
122 | dnl Checks for header files. | |
123 | AC_HEADER_STDC | |
124 | ||
125 | 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]) | |
126 | AC_HEADER_TIME | |
127 | ||
128 | dnl Networking Functions | |
129 | dnl ==================== | |
130 | ||
131 | AC_SEARCH_LIBS(socket, [socket],,) | |
132 | ||
133 | ||
134 | AC_CHECK_MEMBER([struct sockaddr.sa_len], [AC_DEFINE(SOCKADDR_IN_HAS_LEN, 1, [Define to 1 if sockaddr has a 'sa_len' | |
135 | member.])],,[[ | |
136 | #ifdef HAVE_SYS_TYPES_H | |
137 | #include <sys/types.h> | |
138 | #endif | |
139 | #ifdef HAVE_SYS_SOCKET_H | |
140 | #include <sys/socket.h> | |
141 | #endif | |
142 | #ifdef HAVE_WINSOCK2_H | |
143 | #include <winsock2.h> | |
144 | #endif | |
145 | ]]) | |
146 | ||
147 | AC_CHECK_TYPE(socklen_t, , | |
148 | [AC_DEFINE([socklen_t], [unsigned int], | |
149 | [If we don't have a real socklen_t, unsigned int is good enough.])], | |
150 | [ | |
151 | #ifdef HAVE_SYS_TYPES_H | |
152 | #include <sys/types.h> | |
153 | #endif | |
154 | #ifdef HAVE_SYS_SOCKET_H | |
155 | #include <sys/socket.h> | |
156 | #endif | |
157 | #ifdef HAVE_WINSOCK2_H | |
158 | #include <winsock2.h> | |
159 | #endif | |
160 | ||
161 | ]) | |
162 | ||
163 | AC_ARG_ENABLE(ipv6,AC_HELP_STRING([--disable-ipv6],[Disable IPv6 support]),[ipv6=$enableval],[ipv6=yes]) | |
164 | ||
165 | if test x$ipv6 != xyes; then | |
166 | have_v6="no" | |
167 | else | |
168 | ||
169 | have_v6=yes | |
170 | RB_PROTO_INET6([], [ | |
171 | AC_MSG_NOTICE([Disabling IPv6 support: PF_INET6 not found]) | |
172 | have_v6=no | |
173 | ]) | |
174 | ||
175 | if test "X$have_v6" = "Xyes"; then | |
176 | RB_TYPE_STRUCT_SOCKADDR_IN6([], [ | |
177 | AC_MSG_NOTICE([Disabling IPv6 support: struct sockaddr_in6 not found]) | |
178 | have_v6=no | |
179 | ]) | |
180 | fi | |
181 | ||
182 | fi | |
183 | ||
184 | AC_CHECK_TYPES([struct sockaddr_storage],[ | |
185 | rb_have_sockaddr_storage=yes | |
186 | ],[], [ | |
187 | #include <sys/types.h> | |
188 | #include <sys/socket.h> | |
189 | ]) | |
190 | ||
191 | ||
192 | save_LIBS=$LIBS | |
193 | AC_SEARCH_LIBS(crypt, [crypt descrypt],,) | |
194 | LIBS=$save_LIBS | |
195 | ||
196 | CRYPT_LIB=$ac_cv_search_crypt | |
197 | ||
198 | if test "$CRYPT_LIB" = "none required"; then | |
199 | unset CRYPT_LIB | |
200 | elif test "$CRYPT_LIB" = no; then | |
201 | need_crypt=yes; | |
202 | AC_DEFINE(NEED_CRYPT, 1, [Define if your system needs crypt.]) | |
203 | unset CRYPT_LIB | |
204 | fi | |
205 | ||
e961093c | 206 | AM_CONDITIONAL([NEED_CRYPT], [test x"$need_crypt" = "xyes"]) |
db137867 AC |
207 | |
208 | ||
209 | AC_SUBST(CRYPT_LIB) | |
210 | ||
211 | dnl Check for stdarg.h - if we cant find it, halt configure | |
212 | AC_CHECK_HEADER(stdarg.h, , [AC_MSG_ERROR([** stdarg.h could not be found - libratbox will not compile without it **])]) | |
213 | ||
214 | AC_CHECK_TYPE([sa_family_t], [], | |
215 | [AC_DEFINE(sa_family_t, [u_int16_t], [If system does not define sa_family_t, define it here.])], | |
216 | [[#include <sys/types.h> | |
217 | #include <sys/socket.h>]]) | |
218 | ||
219 | ||
220 | dnl check for various functions... | |
221 | 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]) | |
222 | ||
223 | AC_SEARCH_LIBS(nanosleep, rt posix4, AC_DEFINE(HAVE_NANOSLEEP, 1, [Define if you have nanosleep])) | |
224 | AC_SEARCH_LIBS(timer_create, rt, AC_DEFINE(HAVE_TIMER_CREATE, 1, [Define if you have timer_create])) | |
225 | RB_CHECK_TIMER_CREATE | |
226 | ||
227 | AC_FUNC_ALLOCA | |
228 | AC_FUNC_VFORK | |
229 | AC_FUNC_MMAP | |
230 | ||
231 | AC_MSG_CHECKING(for /dev/poll) | |
232 | if test -c "/dev/poll"; then | |
233 | AC_MSG_RESULT(yes) | |
234 | AC_DEFINE(HAVE_DEVPOLL, [1], [Define to 1 if you have devpoll]) | |
235 | else | |
236 | AC_MSG_RESULT(no) | |
237 | fi | |
238 | ||
239 | ||
240 | if test "$is_mingw" = "yes"; then | |
241 | AC_DEFINE(HAVE_WIN32, [1], [Define to 1 if you are on windows]) | |
242 | fi | |
243 | ||
244 | ||
245 | dnl OpenSSL support | |
246 | AC_MSG_CHECKING(for OpenSSL) | |
247 | AC_ARG_ENABLE(openssl, | |
248 | [AC_HELP_STRING([--enable-openssl[=DIR]],[Enable OpenSSL support (DIR optional).]) | |
249 | AC_HELP_STRING([--disable-openssl],[Disable OpenSSL support.])], | |
250 | [cf_enable_openssl=$enableval], | |
251 | [cf_enable_openssl="auto"]) | |
252 | ||
253 | if test "$cf_enable_openssl" != "no" ; then | |
254 | cf_openssl_basedir="" | |
255 | if test "$cf_enable_openssl" != "auto" && | |
256 | test "$cf_enable_openssl" != "yes" ; then | |
257 | dnl Support for --enable-openssl=/some/place | |
258 | cf_openssl_basedir="`echo ${cf_enable_openssl} | sed 's/\/$//'`" | |
259 | else | |
260 | dnl Do the auto-probe here. Check some common directory paths. | |
261 | for dirs in /usr/local/ssl /usr/pkg /usr/local \ | |
262 | /usr/local/openssl ; do | |
263 | if test -f "${dirs}/include/openssl/opensslv.h" ; then | |
264 | cf_openssl_basedir="${dirs}" | |
265 | break | |
266 | fi | |
267 | done | |
268 | unset dirs | |
269 | fi | |
270 | dnl Now check cf_openssl_found to see if we found anything. | |
271 | if test ! -z "$cf_openssl_basedir"; then | |
272 | if test -f "${cf_openssl_basedir}/include/openssl/opensslv.h" ; then | |
c2ac22cc | 273 | SSL_CFLAGS="-I${cf_openssl_basedir}/include" |
db137867 AC |
274 | SSL_LIBS="-L${cf_openssl_basedir}/lib" |
275 | else | |
276 | dnl OpenSSL wasn't found in the directory specified. Naughty | |
277 | dnl administrator... | |
278 | cf_openssl_basedir="" | |
279 | fi | |
280 | else | |
281 | dnl Check for stock FreeBSD 4.x and 5.x systems, since their files | |
282 | dnl are in /usr/include and /usr/lib. In this case, we don't want to | |
283 | dnl change INCLUDES or LIBS, but still want to enable OpenSSL. | |
284 | dnl We can't do this check above, because some people want two versions | |
285 | dnl of OpenSSL installed (stock FreeBSD 4.x/5.x and /usr/local/ssl) | |
286 | dnl and they want /usr/local/ssl to have preference. | |
287 | if test -f "/usr/include/openssl/opensslv.h" ; then | |
288 | cf_openssl_basedir="/usr" | |
289 | fi | |
290 | fi | |
291 | ||
292 | dnl If we have a basedir defined, then everything is okay. Otherwise, | |
293 | dnl we have a problem. | |
294 | if test ! -z "$cf_openssl_basedir"; then | |
295 | AC_MSG_RESULT($cf_openssl_basedir) | |
296 | cf_enable_openssl="yes" | |
297 | else | |
298 | AC_MSG_RESULT([not found. Specify a correct path?]) | |
299 | cf_enable_openssl="no" | |
300 | fi | |
301 | unset cf_openssl_basedir | |
302 | else | |
303 | dnl If --disable-openssl was specified | |
304 | AC_MSG_RESULT(disabled) | |
305 | fi | |
306 | ||
307 | save_CPPFLAGS="$CPPFLAGS" | |
c2ac22cc | 308 | CPPFLAGS="$CPPFLAGS $SSL_CFLAGS" |
db137867 AC |
309 | save_LIBS="$LIBS" |
310 | LIBS="$LIBS $SSL_LIBS" | |
311 | if test "$cf_enable_openssl" != no; then | |
312 | dnl Check OpenSSL version (must be 0.9.7 or above!) | |
313 | AC_MSG_CHECKING(for OpenSSL 0.9.7 or above) | |
314 | AC_RUN_IFELSE( | |
315 | AC_LANG_PROGRAM( | |
316 | [#include <openssl/opensslv.h> | |
317 | #include <stdlib.h>], | |
318 | [[if (OPENSSL_VERSION_NUMBER >= 0x00907000) | |
319 | exit(0); else exit(1);]]), | |
320 | cf_enable_openssl=yes, | |
321 | cf_enable_openssl=no, | |
322 | cf_enable_openssl=no) | |
323 | ||
324 | if test "$cf_enable_openssl" != no; then | |
325 | AC_MSG_RESULT(found) | |
326 | else | |
327 | AC_MSG_RESULT(no - OpenSSL support disabled) | |
328 | fi | |
329 | ||
330 | fi | |
331 | ||
332 | ||
333 | if test "$cf_enable_openssl" != no; then | |
334 | CPPFLAGS="$CPPFLAGS $SSL_LIBS" | |
335 | AC_CHECK_LIB(crypto, RAND_status, | |
336 | [cf_enable_openssl=yes], | |
337 | [cf_enable_openssl=no]) | |
338 | fi | |
339 | ||
340 | ||
341 | if test "$cf_enable_openssl" != no; then | |
342 | CPPFLAGS="$CPPFLAGS $SSL_LIBS" | |
343 | AC_CHECK_LIB(ssl, SSL_read, | |
344 | [SSL_LIBS="-lssl -lcrypto"], | |
345 | [cf_enable_openssl=no], [-lcrypto]) | |
346 | fi | |
347 | ||
c2ac22cc VY |
348 | |
349 | ||
350 | dnl GnuTLS support | |
351 | AC_MSG_CHECKING(for GnuTLS) | |
352 | AC_ARG_ENABLE(gnutls, | |
353 | [AC_HELP_STRING([--enable-gnutls],[Enable GnuTLS support.]) | |
354 | AC_HELP_STRING([--disable-gnutls],[Disable GnuTLS support.])], | |
355 | [cf_enable_gnutls=$enableval], | |
356 | [cf_enable_gnutls="auto"]) | |
357 | ||
358 | if test "$cf_enable_gnutls" != no; then | |
359 | PKG_CHECK_MODULES(GNUTLS, [gnutls], [ | |
360 | cf_enable_gnutls="yes" | |
361 | ], [cf_enable_gnutls="no"]) | |
362 | fi | |
363 | ||
364 | if test "$cf_enable_gnutls" = "auto" -a "$cf_enable_openssl" = "yes"; then | |
365 | cf_enable_gnutls="no" | |
366 | fi | |
367 | ||
368 | if test x"$cf_enable_openssl" != xno; then | |
db137867 | 369 | AC_DEFINE(HAVE_OPENSSL,1,[Has OpenSSL]) |
c2ac22cc VY |
370 | GNUTLS_CFLAGS="" |
371 | GNUTLS_LIBS="" | |
372 | SSL_TYPE="openssl" | |
373 | elif test x"$cf_enable_gnutls" != xno; then | |
374 | AC_DEFINE(HAVE_GNUTLS, 1, [Has GnuTLS]) | |
375 | SSL_LIBS="" | |
376 | SSL_CFLAGS="" | |
377 | SSL_TYPE="gnutls" | |
db137867 AC |
378 | fi |
379 | ||
380 | ||
c2ac22cc VY |
381 | |
382 | ||
db137867 AC |
383 | CPPFLAGS="$save_CPPFLAGS" |
384 | LIBS="$save_LIBS" | |
385 | ||
386 | dnl End OpenSSL detection | |
387 | ||
388 | ||
389 | ||
390 | ||
391 | dnl Debug-related options | |
392 | dnl ===================== | |
393 | ||
394 | AC_ARG_ENABLE(assert, | |
395 | AC_HELP_STRING([--enable-assert],[Enable assert(). Choose between soft(warnings) and hard(aborts the daemon)]), | |
396 | [assert=$enableval], [assert=no]) | |
397 | ||
398 | if test "$assert" = no; then | |
399 | AC_DEFINE(NDEBUG, 1, [Define this to disable debugging support.]) | |
400 | elif test "$assert" = soft; then | |
401 | AC_DEFINE(SOFT_ASSERT, 1, [Define this to enable soft asserts.]) | |
402 | AC_DEFINE(NDEBUG, 1, [Define this to disable debugging support.]) | |
403 | elif test "$assert" = yes; then | |
404 | assert = "hard"; | |
405 | fi | |
406 | ||
407 | AC_MSG_CHECKING(if you want to do a profile build) | |
408 | AC_ARG_ENABLE(profile, | |
409 | AC_HELP_STRING([--enable-profile],[Enable profiling]), | |
410 | [profile=$enableval], [profile=no]) | |
411 | ||
412 | if test "$profile" = yes; then | |
413 | if test "$ac_cv_c_compiler_gnu" = yes; then | |
414 | CFLAGS="$CFLAGS -pg -static" | |
415 | AC_MSG_RESULT([yes, adding -pg -static]) | |
416 | AC_DEFINE(RATBOX_PROFILE, 1, [Defined to mark profiling is enabled]) | |
417 | else | |
418 | AC_MSG_RESULT([no, profile builds only work with gcc]) | |
419 | fi | |
420 | else | |
421 | AC_MSG_RESULT(no) | |
422 | fi | |
423 | ||
424 | AC_ARG_ENABLE(balloc, | |
425 | AC_HELP_STRING([--disable-balloc],[Disable the block allocator.]), | |
426 | [balloc=$enableval], [balloc=yes]) | |
427 | ||
428 | if test "$balloc" = no; then | |
429 | AC_DEFINE([NOBALLOC], 1, [Define to 1 if you wish to disable the block allocator.]) | |
430 | fi | |
431 | ||
432 | AC_ARG_ENABLE(warnings, | |
433 | AC_HELP_STRING([--enable-warnings],[Enable all sorts of warnings for debugging.]), | |
434 | [CFLAGS="$CFLAGS -Wall -Werror -Wcast-qual -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wshadow -Wwrite-strings -W -Wno-unused -Wunused-function -Wunused-variable"],[]) | |
435 | ||
436 | AC_SUBST(LDFLAGS) | |
437 | AC_SUBST(PICFLAGS) | |
438 | AC_SUBST(CFLAGS) | |
439 | AC_SUBST(SEDOBJ) | |
c2ac22cc | 440 | AC_SUBST(SSL_CFLAGS) |
db137867 | 441 | AC_SUBST(SSL_LIBS) |
c2ac22cc VY |
442 | AC_SUBST(GNUTLS_CFLAGS) |
443 | AC_SUBST(GNUTLS_LIBS) | |
db137867 AC |
444 | |
445 | if test "$prefix" = "NONE"; then | |
446 | AC_DEFINE_UNQUOTED(RB_PREFIX, "$ac_default_prefix", [Prefix where libratbox is installed.]) | |
447 | ||
448 | else | |
449 | ||
450 | dnl Don't get bitten by Cygwin's stupidity if the user specified | |
451 | dnl a custom prefix with a trailing slash | |
452 | ||
453 | prefix=`echo $prefix | sed 's/\/$//'` | |
454 | AC_DEFINE_UNQUOTED(RB_PREFIX, "$prefix", [Prefix where libratbox is installed.]) | |
455 | ||
456 | fi | |
457 | ||
458 | AC_SUBST(RB_PREFIX) | |
459 | ||
460 | for dtype in uint64_t uint32_t uint16_t uint8_t int64_t int32_t int16_t int8_t intmax_t intptr_t uintmax_t uintptr_t | |
461 | do | |
462 | var="\$ac_cv_c_${dtype}" | |
463 | t_type=$(eval echo $var); | |
464 | if test "x$t_type" = "xyes"; then | |
465 | eval rb_$dtype="\"$dtype\"" | |
466 | else | |
467 | eval rb_$dtype="\"$t_type\"" | |
468 | fi | |
469 | done | |
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 | if test "x$rb_sockaddr_sa_len" = "xyes"; then | |
556 | echo '#define RB_SOCKADDR_HAS_SA_LEN 1' >> $outfile | |
557 | fi | |
558 | ||
559 | echo "typedef $rb_uint64_t rb_uint64_t;" >> $outfile | |
560 | echo "typedef $rb_uint32_t rb_uint32_t;" >> $outfile | |
561 | echo "typedef $rb_uint16_t rb_uint16_t;" >> $outfile | |
562 | echo "typedef $rb_uint8_t rb_uint8_t;" >> $outfile | |
563 | echo "typedef $rb_int64_t rb_int64_t;" >> $outfile | |
564 | echo "typedef $rb_int32_t rb_int32_t;" >> $outfile | |
565 | echo "typedef $rb_int16_t rb_int16_t;" >> $outfile | |
566 | echo "typedef $rb_int8_t rb_int8_t;" >> $outfile | |
567 | echo "typedef $rb_intmax_t rb_intmax_t;" >> $outfile | |
568 | echo "typedef $rb_intptr_t rb_intptr_t;" >> $outfile | |
569 | echo "typedef $rb_uintmax_t rb_uintmax_t;" >> $outfile | |
570 | echo "typedef $rb_uintptr_t rb_uintptr_t;" >> $outfile | |
571 | echo "typedef $rb_socklen_t rb_socklen_t;" >> $outfile | |
572 | ||
573 | if test "x$rb_sockaddr_storage" = "xyes"; then | |
574 | echo '#define rb_sockaddr_storage sockaddr_storage' >> $outfile | |
575 | else | |
576 | echo 'struct rb_sockaddr_storage { rb_uint8_t _padding[128]; };' >> $outfile | |
577 | fi | |
578 | ||
579 | cat >> $outfile <<\_______EOF | |
580 | #endif /* __LIBRB_CONFIG_H */ | |
581 | _______EOF | |
582 | ||
583 | if cmp -s $outfile include/librb-config.h; then | |
584 | AC_MSG_NOTICE([include/librb-config.h is unchanged]) | |
585 | ${rb_rm} -f $outfile | |
586 | else | |
587 | ${rb_mv} $outfile include/librb-config.h | |
588 | fi | |
589 | ||
590 | ],[ | |
591 | rb_uint64_t="$rb_uint64_t" | |
592 | rb_uint32_t="$rb_uint32_t" | |
593 | rb_uint16_t="$rb_uint16_t" | |
594 | rb_uint8_t="$rb_uint8_t" | |
595 | rb_int64_t="$rb_int64_t" | |
596 | rb_int32_t="$rb_int32_t" | |
597 | rb_int16_t="$rb_int16_t" | |
598 | rb_int8_t="$rb_int8_t" | |
599 | rb_intmax_t="$rb_intmax_t" | |
600 | rb_intptr_t="$rb_intptr_t" | |
601 | rb_uintmax_t="$rb_uintmax_t" | |
602 | rb_uintptr_t="$rb_uintptr_t" | |
603 | if test x$ac_cv_header_stdc = xyes; then | |
604 | rb_header_stdc=yes | |
605 | fi | |
606 | if test x$ac_cv_header_stdlib_h = xyes; then | |
607 | rb_header_stdlib_h=yes | |
608 | fi | |
609 | if test x$ac_cv_header_string_h = xyes; then | |
610 | rb_header_string_h=yes | |
611 | fi | |
612 | if test x$ac_cv_header_memory_h = xyes; then | |
613 | rb_header_memory_h=yes | |
614 | fi | |
615 | if test "x${ac_cv_working_alloca_h+set}" = xset ; then | |
616 | rb_alloca_h="$ac_cv_working_alloca_h" | |
617 | else | |
618 | rb_alloc_h="$ac_cv_header_alloca_h" | |
619 | fi | |
620 | if test x$ac_cv_member_struct_sockaddr_sa_len = xyes; then | |
621 | rb_sockaddr_sa_len=yes | |
622 | fi | |
623 | if test x$ac_cv_header_sys_socket_h = xyes; then | |
624 | rb_sys_socket_h=yes | |
625 | fi | |
626 | if test x$ac_cv_header_sys_types_h = xyes; then | |
627 | rb_sys_types_h=yes | |
628 | fi | |
629 | if test x$ac_cv_header_sys_stat_h = xyes; then | |
630 | rb_sys_stat_h=yes | |
631 | fi | |
632 | if test x$ac_cv_header_sys_time_h = xyes; then | |
633 | rb_sys_time_h=yes | |
634 | fi | |
635 | if test x$ac_cv_header_time = xyes; then | |
636 | rb_time_h=yes | |
637 | fi | |
638 | ||
639 | if test x$ac_cv_header_stdint_h = xyes; then | |
640 | rb_stdint_h=yes | |
641 | fi | |
642 | if test x$ac_cv_header_inttypes_h = xyes; then | |
643 | rb_inttypes_h=yes | |
644 | fi | |
645 | if test x$ac_cv_header_netinet_in_h = xyes; then | |
646 | rb_netinet_in_h=yes | |
647 | fi | |
648 | ||
649 | if test x$ac_cv_header_crypt_h = xyes; then | |
650 | rb_crypt_h=yes | |
651 | fi | |
652 | if test x$ac_cv_header_errno_h = xyes; then | |
653 | rb_errno_h=yes | |
654 | fi | |
655 | if test x$ac_cv_header_unistd_h = xyes; then | |
656 | rb_unistd_h=yes | |
657 | fi | |
658 | if test x$ac_cv_header_windows_h = xyes; then | |
659 | rb_windows_h=yes | |
660 | fi | |
661 | if test x$ac_cv_header_winsock2_h = xyes; then | |
662 | rb_winsock2_h=yes | |
663 | fi | |
664 | if test x$ac_cv_type_socklen_t = xyes; then | |
665 | rb_socklen_t="socklen_t" | |
666 | else | |
667 | rb_socklen_t="unsigned int" | |
668 | fi | |
669 | if test "x$rb_have_sockaddr_storage" = "xyes"; then | |
670 | rb_sockaddr_storage="yes" | |
671 | else | |
672 | rb_sockaddr_storage="no" | |
673 | fi | |
674 | ||
675 | rb_have_ipv6="$have_v6" | |
676 | ||
677 | rb_mv="$MV" | |
678 | rb_rm="$RM" | |
679 | ||
680 | ] | |
681 | ||
682 | ||
683 | ) | |
684 | ||
c2ac22cc VY |
685 | |
686 | AC_CONFIG_FILES( \ | |
687 | src/Makefile \ | |
688 | Makefile \ | |
689 | libratbox.pc \ | |
690 | ) | |
db137867 AC |
691 | |
692 | AC_OUTPUT | |
693 | ||
694 | dnl Make it look sexay! | |
695 | ||
696 | echo | |
697 | echo "Compiling $PACKAGE_NAME $PACKAGE_VERSION" | |
698 | echo | |
699 | ||
700 | echo "Installing into: $prefix" | |
701 | ||
702 | echo "IPv6 support ................... $have_v6" | |
703 | echo "Assert debugging ............... $assert" | |
704 | echo "Block allocator ................ $balloc" | |
c2ac22cc | 705 | echo "SSL Type........................ $SSL_TYPE" |
db137867 AC |
706 | echo |
707 |