/[pkg-silc]/silc-server/trunk/configure.ac
ViewVC logotype

Contents of /silc-server/trunk/configure.ac

Parent Directory Parent Directory | Revision Log Revision Log


Revision 311 - (show annotations) (download)
Tue Oct 7 16:33:59 2008 UTC (4 years, 7 months ago) by micah
File size: 39889 byte(s)
finish svn-upgrade of new silc-server
1 # Automatically generated by Autodist 1.4. Do not edit.
2 # To make changes edit the configure.ad file in the source tree.
3
4 # Source: configure.ad
5 # Generated: Thu Sep 25 14:05:04 EEST 2008 by priikone
6 # Distribution: Server
7 # License:
8
9 #
10 # configure.ad
11 #
12 # Author: Pekka Riikonen <priikone@silcnet.org>
13 #
14 # Copyright (C) 2000 - 2007 Pekka Riikonen
15 #
16 # This program is free software; you can redistribute it and/or modify
17 # it under the terms of the GNU General Public License as published by
18 # the Free Software Foundation; version 2 of the License.
19 #
20 # This program is distributed in the hope that it will be useful,
21 # but WITHOUT ANY WARRANTY; without even the implied warranty of
22 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 # GNU General Public License for more details.
24 #
25
26 AC_INIT([Server], [1.1.13], [silc-devel@lists.silcnet.org], [silc-server])
27 AC_CANONICAL_SYSTEM
28 AM_INIT_AUTOMAKE
29 AC_PREREQ(2.52)
30 AC_CONFIG_HEADERS(silcdefs.h)
31
32 AC_PROG_INSTALL
33 AC_PROG_MAKE_SET
34
35 AC_PROG_LN_S
36 AC_PROG_EGREP
37 AC_SUBST(LN_S)
38 AC_PATH_PROG(sedpath, sed)
39
40 # Put here any platform specific stuff
41 #
42 case "$target" in
43 *-*-linux*)
44 check_threads=true
45 CFLAGS=`echo $CFLAGS -D_GNU_SOURCE`
46 ;;
47 *-*-freebsd*)
48 check_threads=true
49 ;;
50 *-*-netbsd*)
51 check_threads=true
52 ;;
53 *-*-*bsd*)
54 check_threads=false
55 ;;
56 *)
57 check_threads=true
58 ;;
59 esac
60
61 # Get CPU
62 cpu_i386=false
63 cpu_ix86=false
64 cpu_x86_64=false
65 cpu_ppc=false
66 cpu_ia64=false
67 case "$host_cpu" in
68 i386)
69 AC_DEFINE([SILC_I386], [], [SILC_I386])
70 AC_DEFINE([SILC_I486], [], [SILC_I486])
71 cpu_i386=true
72 cpu_ix86=true
73 ;;
74 i?86)
75 AC_DEFINE([SILC_I486], [], [SILC_I486])
76 cpu_ix86=true
77 ;;
78 x86_64)
79 AC_DEFINE([SILC_X86_64], [], [SILC_X86_64])
80 cpu_x86_64=true
81 ;;
82 powerpc*)
83 AC_DEFINE([SILC_POWERPC], [], [SILC_POWERPC])
84 cpu_ppc=true
85 ;;
86 ia64)
87 AC_DEFINE([SILC_IA64], [], [SILC_IA64])
88 cpu_ia64=true
89 ;;
90 esac
91 AM_CONDITIONAL(SILC_I386, test x$cpu_i386 = xtrue)
92 AM_CONDITIONAL(SILC_I486, test x$cpu_ix86 = xtrue)
93 AM_CONDITIONAL(SILC_X86_64, test x$cpu_x86_64 = xtrue)
94 AM_CONDITIONAL(SILC_POWERPC, test x$cpu_ppc = xtrue)
95 AM_CONDITIONAL(SILC_IA64, test x$cpu_ia64 = xtrue)
96
97 # Control compiler optimizations
98 CFLAGS=`echo $CFLAGS | sed 's/-O[ 0123456789s]*//g'`
99
100 AC_PROG_CC
101 AC_C_INLINE
102 AC_C_CONST
103
104 __SILC_HAVE_PTHREAD=""
105 __SILC_HAVE_SIM=""
106 __SILC_ENABLE_DEBUG=""
107
108
109 AC_PROG_RANLIB
110 AC_DISABLE_SHARED
111 AC_PROG_LIBTOOL
112
113 # Header checking
114 #
115 AC_HEADER_STDC
116 AC_HEADER_TIME
117 AC_HEADER_STAT
118
119 # More header checking
120 #
121 AC_CHECK_HEADERS(unistd.h string.h getopt.h errno.h fcntl.h assert.h)
122 AC_CHECK_HEADERS(sys/types.h sys/stat.h sys/time.h stddef.h)
123 AC_CHECK_HEADERS(netinet/in.h netinet/tcp.h xti.h netdb.h sys/resource.h)
124 AC_CHECK_HEADERS(pwd.h grp.h termcap.h paths.h)
125 AC_CHECK_HEADERS(ncurses.h signal.h ctype.h utime.h)
126 AC_CHECK_HEADERS(arpa/inet.h sys/mman.h limits.h termios.h locale.h langinfo.h)
127
128 # Data type checking
129 #
130 AC_TYPE_SIGNAL
131 AC_TYPE_SIZE_T
132 AC_TYPE_MODE_T
133 AC_TYPE_UID_T
134 AC_TYPE_PID_T
135
136 AC_CHECK_SIZEOF(long long, 0)
137 AC_SUBST(SILC_SIZEOF_LONG_LONG, $ac_cv_sizeof_long_long)
138 AC_CHECK_SIZEOF(long, 0)
139 AC_SUBST(SILC_SIZEOF_LONG, $ac_cv_sizeof_long)
140 AC_CHECK_SIZEOF(int, 0)
141 AC_SUBST(SILC_SIZEOF_INT, $ac_cv_sizeof_int)
142 AC_CHECK_SIZEOF(short, 0)
143 AC_SUBST(SILC_SIZEOF_SHORT, $ac_cv_sizeof_short)
144 AC_CHECK_SIZEOF(char, 0)
145 AC_SUBST(SILC_SIZEOF_CHAR, $ac_cv_sizeof_char)
146 AC_CHECK_SIZEOF(void *, 0)
147 AC_SUBST(SILC_SIZEOF_VOID_P, $ac_cv_sizeof_void_p)
148 AC_CHECK_TYPES(long long)
149 AC_CHECK_TYPES(long double)
150
151 # Function to check if compiler flag works
152 # Usage: SILC_ADD_CFLAGS(FLAGS, [ACTION-IF-FAILED])
153 AC_DEFUN([SILC_ADD_CFLAGS],
154 [ tmp_CFLAGS="$CFLAGS"
155 CFLAGS="$CFLAGS $1"
156 AC_MSG_CHECKING(whether $CC accepts $1 flag)
157 AC_TRY_LINK([], [], [AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no)
158 CFLAGS="$tmp_CFLAGS"
159 $2])
160 unset tmp_CFLAGS
161 ])
162
163 # Function to check if compiler flag works, destination specifiable
164 # Usage: SILC_ADD_CC_FLAGS(VAR, FLAGS, [ACTION-IF-FAILED])
165 AC_DEFUN([SILC_ADD_CC_FLAGS],
166 [ tmp_CFLAGS="$1_CFLAGS"
167 $1_CFLAGS="${$1_CFLAGS} $2"
168 AC_MSG_CHECKING(whether $CC accepts $2 flag)
169 AC_TRY_LINK([], [], [AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no)
170 $1_CFLAGS="$tmp_CFLAGS"
171 $3])
172 unset tmp_CFLAGS
173 ])
174
175 # Function and library checking
176 #
177 AC_CHECK_FUNC(gethostbyname, [],
178 [
179 AC_CHECK_LIB(nsl, gethostbyname, LIBS="$LIBS -lnsl")
180 AC_CHECK_FUNC(res_gethostbyname, [],
181 AC_CHECK_LIB(resolv, res_gethostbyname, LIBS="$LIBS -lresolv")
182 )
183 ])
184 AC_CHECK_FUNC(socket, [],
185 AC_CHECK_LIB(socket, socket, LIBS="$LIBS -lsocket")
186 )
187 AC_CHECK_FUNCS(gethostname gethostbyaddr getservbyname getservbyport)
188 AC_CHECK_FUNCS(poll select listen bind shutdown close connect setsockopt)
189 AC_CHECK_FUNCS(setrlimit time ctime utime gettimeofday getrusage)
190 AC_CHECK_FUNCS(chmod fcntl stat fstat getenv putenv strerror)
191 AC_CHECK_FUNCS(getpid getgid getsid getpgid getpgrp getuid sched_yield)
192 AC_CHECK_FUNCS(setgroups initgroups nl_langinfo nanosleep)
193 AC_CHECK_FUNCS(strchr snprintf strstr strcpy strncpy memcpy memset memmove)
194
195 # lib/contrib conditionals
196 #
197 AC_CHECK_HEADER(regex.h,
198 [
199 AC_DEFINE([HAVE_REGEX_H], [], [HAVE_REGEX_H])
200 have_regex=1
201 ], have_regex=0
202 )
203 AM_CONDITIONAL(HAVE_REGEX, test x$have_regex = x1)
204
205 AC_CHECK_FUNC(getopt_long,
206 [
207 AC_DEFINE([HAVE_GETOPT_LONG], [], [HAVE_GETOPT_LONG])
208 have_getopt_long=1
209 ], have_getopt_long=0
210 )
211
212 AC_CHECK_FUNC(getopt,
213 [
214 AC_DEFINE([HAVE_GETOPT], [], [HAVE_GETOPT])
215 have_getopt=1
216 ], have_getopt=0
217 )
218
219 ##
220 ## Enable/disable checking
221 ##
222
223 # IPv6 support
224 #
225 AC_MSG_CHECKING(whether to enable IPv6 support)
226 AC_ARG_ENABLE(ipv6,
227 [ --enable-ipv6 enable IPv6 support],
228 [
229 case "${enableval}" in
230 yes)
231 want_ipv6=true
232 check_ipv6=false
233 summary_ipv6="yes"
234 AC_DEFINE([HAVE_IPV6], [], [HAVE_IPV6])
235 AC_MSG_RESULT(yes)
236 ;;
237 *)
238 want_ipv6=false
239 check_ipv6=false
240 summary_ipv6="no"
241 AC_MSG_RESULT(no)
242 ;;
243 esac
244 ],
245 check_ipv6=true
246 )
247
248 if test x$check_ipv6 = xtrue; then
249 summary_ipv6="no"
250 AC_TRY_COMPILE(
251 [
252 #ifdef HAVE_SYS_TYPES_H
253 #include <sys/types.h>
254 #endif
255 #ifdef HAVE_NETINET_TCP_H
256 #include <netinet/tcp.h>
257 #endif
258 #ifdef HAVE_NETDB_H
259 #include <netdb.h>
260 #endif
261 #include <sys/socket.h>
262 #ifdef HAVE_NETINET_IN_H
263 #include <netinet/in.h>
264 #endif
265 ],
266 [
267 struct sockaddr_in6 sin6;
268 int family = AF_INET6;
269 ],
270 [
271 AC_DEFINE([HAVE_IPV6], [], [HAVE_IPV6])
272 AC_MSG_RESULT(yes)
273 summary_ipv6="yes"
274 ],
275 AC_MSG_RESULT(no)
276 )
277 fi
278
279 # Debug checking
280 #
281 AC_MSG_CHECKING(whether to enable debugging)
282 summary_debug="no"
283 __SILC_ENABLE_DEBUG=""
284 AC_ARG_ENABLE(debug,
285 [ --enable-debug enable debugging],
286 [
287 case "${enableval}" in
288 yes)
289 AC_MSG_RESULT(yes)
290 AC_DEFINE([SILC_DEBUG], [], [enable-debug])
291 summary_debug="yes"
292 __SILC_ENABLE_DEBUG="#define __SILC_ENABLE_DEBUG 1"
293 ;;
294 *)
295 AC_MSG_RESULT(no)
296 ;;
297 esac
298 ],
299 [
300 AC_MSG_RESULT(no)
301 ])
302
303 # Disable all compiler optimizations
304 #
305 AC_MSG_CHECKING(whether to enable compiler optimizations)
306 want_cc_optimizations=true
307 AC_ARG_ENABLE(optimizations,
308 [ --disable-optimizations do not use any compiler optimizations],
309 [
310 AC_MSG_RESULT(no)
311 AC_DEFINE([SILC_NO_CC_OPTIMIZATIONS], [], [SILC_NO_CC_OPTIMIZATIONS])
312 want_cc_optimizations=false
313 ],
314 [
315 AC_MSG_RESULT(yes)
316 want_cc_optimizations=true
317 ])
318 AM_CONDITIONAL(SILC_NO_CC_OPTIMIZATIONS, test x$want_cc_optimizations = xfalse)
319
320 # Disable all assembler optimizations
321 #
322 AC_MSG_CHECKING(whether to enable assembler optimizations)
323 want_asm=true
324 AC_ARG_ENABLE(asm,
325 [ --disable-asm do not use assembler optimizations],
326 [
327 AC_MSG_RESULT(no)
328 AC_DEFINE([SILC_NO_ASM], [], [SILC_NO_ASM])
329 want_asm=false
330 ],
331 [
332 AC_MSG_RESULT(yes)
333 want_asm=true
334 ])
335 AM_CONDITIONAL(SILC_NO_ASM, test x$want_asm = xfalse)
336
337 # Check for assembler
338 #
339 SILC_ASSEMBLER=""
340 have_assembler=false
341 if test x$want_asm = xtrue; then
342 AC_PATH_PROG([NASM], [nasm], [no])
343 if test "x$NASM" != "xno"; then
344 if test x$cpu_x86_64 = xtrue; then
345 SILC_ASSEMBLER="$NASM -O2 -felf64"
346 else
347 SILC_ASSEMBLER="$NASM -O2 -felf"
348 fi
349 have_assembler=true
350 fi
351
352 AC_PATH_PROG([YASM], [yasm], [no])
353 if test "x$YASM" != "xno"; then
354 if test x$cpu_x86_64 = xtrue; then
355 SILC_ASSEMBLER="$YASM -Xgnu -felf64"
356 else
357 SILC_ASSEMBLER="$YASM -Xgnu -felf"
358 fi
359 have_assembler=true
360 fi
361 fi
362 AC_SUBST(SILC_ASSEMBLER)
363
364 ##
365 ## va_copy checks
366 ##
367 va_copy=false
368 AC_MSG_CHECKING(for va_copy)
369 AC_TRY_COMPILE(
370 [
371 #include <stdarg.h>
372 #include <stdlib.h>
373 ],
374 [
375 int t(int x, ...)
376 {
377 va_list va, cp;
378 va_start(va, x);
379 va_copy(cp, va);
380 if (va_arg(cp, int) != 0xff11)
381 return 1;
382 va_end(va);
383 va_end(cp);
384 return 0;
385 }
386 int main()
387 {
388 return t(0, 0xff11);
389 }
390 ],
391 [
392 AC_DEFINE([HAVE_VA_COPY], [], [HAVE_VA_COPY])
393 AC_MSG_RESULT(yes)
394 va_copy=true
395 ],
396 [
397 AC_MSG_RESULT(no)
398 va_copy=false
399 ]
400 )
401
402 if test x$va_copy = xfalse; then
403 AC_MSG_CHECKING(for __va_copy)
404 AC_TRY_COMPILE(
405 [
406 #include <stdarg.h>
407 #include <stdlib.h>
408 ],
409 [
410 int t(int x, ...)
411 {
412 va_list va, cp;
413 va_start(va, x);
414 __va_copy(cp, va);
415 if (va_arg(cp, int) != 0xff11)
416 return 1;
417 va_end(va);
418 va_end(cp);
419 return 0;
420 }
421 int main()
422 {
423 return t(0, 0xff11);
424 }
425 ],
426 [
427 AC_DEFINE([HAVE___VA_COPY], [], [HAVE___VA_COPY])
428 AC_MSG_RESULT(yes)
429 va_copy=true
430 ],
431 [
432 AC_MSG_RESULT(no)
433 va_copy=false
434 ]
435 )
436 fi
437
438 if test x$va_copy = xfalse; then
439 AC_RUN_IFELSE(
440 [
441 #include <stdarg.h>
442 #include <stdlib.h>
443 int t(int x, ...)
444 {
445 va_list va, cp;
446 va_start(va, x);
447 cp = va;
448 if (va_arg(cp, int) != 0xff11)
449 return 1;
450 va_end(va);
451 va_end(cp);
452 return 0;
453 }
454 int main()
455 {
456 return t(0, 0xff11);
457 }
458 ],
459 [va_copy=false],
460 [
461 AC_DEFINE([SILC_VA_COPY_ARRAY], [], [SILC_VA_COPY_ARRAY])
462 ],
463 [va=copy=false]
464 )
465 fi
466
467 ##
468 ## Compiler and compiler flag checks
469 ##
470
471 if test "$GCC"; then
472 # GCC specific options
473 if test "x$summary_debug" = "xyes"; then
474 SILC_ADD_CFLAGS(-g)
475 else
476 SILC_ADD_CFLAGS(-g)
477 fi
478 SILC_ADD_CFLAGS(-Wall -finline-functions)
479 SILC_ADD_CFLAGS(-Wno-pointer-sign)
480 else
481 # Other compilers
482 case "$target" in
483 alpha*-dec-osf*)
484 SILC_ADD_CFLAGS(-g3)
485 ;;
486 mips*-sgi-irix*)
487 SILC_ADD_CFLAGS(-g3)
488 ;;
489 *)
490 SILC_ADD_CFLAGS(-g)
491 ;;
492 esac
493
494 # Intel C++ Compiler needs -restrict
495 if test "x$CC" = "xicc"; then
496 SILC_ADD_CFLAGS(-restrict)
497 fi
498 fi
499
500 if test x$want_cc_optimizations = xtrue; then
501 if test "$GCC"; then
502 # GCC specific options
503 if test "x$summary_debug" = "xyes"; then
504 SILC_ADD_CFLAGS(-O)
505 else
506 SILC_ADD_CFLAGS(-O2)
507 fi
508 else
509 # Other compilers
510 case "$target" in
511 alpha*-dec-osf*)
512 SILC_ADD_CFLAGS(-O2, SILC_ADD_CFLAGS(-O))
513 ;;
514 mips*-sgi-irix*)
515 SILC_ADD_CFLAGS(-O2, SILC_ADD_CFLAGS(-O))
516 ;;
517 *)
518 SILC_ADD_CFLAGS(-O2, SILC_ADD_CFLAGS(-O))
519 ;;
520 esac
521 fi
522 fi
523
524 #
525 # Workaround a bug in GCC 2.x which causes memory exhaustion
526 # when compiling sha1 with optimizations on UltraSPARC.
527 #
528 FIX_SHA1='#'
529 if test "$GCC" -a "$host_cpu" = "sparc64"; then
530 AC_MSG_CHECKING(whether to enable GCC 2.x workaround for SHA1)
531 AC_TRY_COMPILE(
532 [
533 #if defined(__sparc64__) && (__GNUC__ == 2)
534 #else
535 choke me
536 #endif
537 ],
538 [],
539 [
540 FIX_SHA1=''
541 AC_MSG_RESULT(yes)
542 ],
543 AC_MSG_RESULT(no)
544 )
545 fi
546 AC_SUBST(FIX_SHA1)
547
548 ##
549 ## Installation
550 ##
551
552 # Default installation destination
553 #
554 AC_PREFIX_DEFAULT(/usr/local)
555 if test "x$prefix" != xNONE; then
556 silc_prefix="$prefix"
557 else
558 silc_prefix="$ac_default_prefix"
559 prefix="$silc_prefix"
560 fi
561
562 ETCDIR=`eval echo $sysconfdir`;ETCDIR=`eval echo $ETCDIR`
563 AC_SUBST(ETCDIR)
564 AC_DEFINE_UNQUOTED([SILC_ETCDIR], "$ETCDIR", [SILC_ETCDIR])
565
566 DOCDIR=`eval echo $docdir`;DOCDIR=`eval echo $DOCDIR`
567 AC_SUBST(DOCDIR)
568 AC_DEFINE_UNQUOTED([SILC_DOCDIR], "$DOCDIR", [SILC_DOCDIR])
569
570 ##
571 ## With/without checkings
572 ##
573
574 #
575 # SILC library checking
576 compile_libs=true
577 LIBSUBDIR=lib
578
579 AC_ARG_WITH(silc-includes,
580 [ --with-silc-includes=DIR SILC Toolkit includes [search in DIR]],
581 [ac_silc_includes="$withval"], [ac_silc_includes="no"])
582 AC_ARG_WITH(silc-libs,
583 [ --with-silc-libs=DIR SILC Toolkit libraries [search in DIR]],
584 [ac_silc_libs="$withval"], [ac_silc_libs="no"])
585
586 if test -n "$with_silc_includes" || test -n "$with_silc_libs"; then
587
588 # Manually provided libs
589 if test "$ac_silc_includes" != "no"; then
590 compile_libs=false
591 SILC_LIB_INCLUDES="-I$ac_silc_includes"
592 LIBSUBDIR=
593 fi
594 if test "$ac_silc_libs" != "no"; then
595 compile_libs=false
596 LIBSUBDIR=
597 LDFLAGS="-L$ac_silc_libs $LDFLAGS"
598 else
599 LDFLAGS="-L\$(silc_top_srcdir)/lib $LDFLAGS"
600 fi
601
602 # Check libs to link against
603 f=`$EGREP __SILC_HAVE_PTHREAD $ac_silc_includes/silc.h`
604 if test -n "$f"; then
605 LIBS="$LIBS -lpthread"
606 check_threads=false
607 has_threads=true
608 fi
609 f=`$EGREP __SILC_HAVE_SIM $ac_silc_includes/silc.h`
610 if test -n "$f"; then
611 LIBS="$LIBS -ldl"
612 fi
613
614 else
615 # pkg-config check
616 PKG_CHECK_MODULES(SILC, [silc >= 1.1], compile_libs=false, compile_libs=true)
617
618 if test x$compile_libs = xfalse; then
619 LIBSUBDIR=
620 LIBS="$SILC_LIBS $LIBS"
621 CFLAGS="$CFLAGS $SILC_CFLAGS"
622 else
623 LDFLAGS="-L\$(silc_top_srcdir)/lib $LDFLAGS"
624 fi
625 fi
626
627
628 # SOCKS4 support checking
629 #
630 SAVE_LIBS="$LIBS"
631 SAVE_CFLAGS="$CFLAGS"
632 SAVE_LDFLAGS="$LDFLAGS"
633 AC_MSG_CHECKING(whether to support SOCKS4)
634 AC_ARG_WITH(socks4,
635 [[ --with-socks4[=DIR] with SOCKS4 support [search in DIR/lib and DIR/include]]],
636 [
637 case "$withval" in
638 no)
639 AC_MSG_RESULT(no)
640 ;;
641 *)
642 AC_MSG_RESULT(yes)
643 socks=4
644
645 if test -d "$withval/include"; then
646 CFLAGS="$CFLAGS -I$withval/include"
647 fi
648 if test -d "$withval/lib"; then
649 LDFLAGS="$LDFLAGS -L$withval/lib"
650 fi
651
652 LIBS="-lsocks $LIBS"
653 ;;
654 esac
655
656 AC_TRY_LINK([],
657 [
658 Rconnect();
659 ], [],
660 [
661 AC_MSG_ERROR(Could not find SOCKS4 library.)
662 LIBS="$SAVE_LIBS"
663 CFLAGS="$SAVE_CFLAGS"
664 LDFLAGS="$SAVE_LDFLAGS"
665 ])
666 ],
667 AC_MSG_RESULT(no)
668 )
669
670 # SOCKS5 support checking
671 #
672 SAVE_LIBS="$LIBS"
673 SAVE_CFLAGS="$CFLAGS"
674 SAVE_LDFLAGS="$LDFLAGS"
675 AC_MSG_CHECKING(whether to support SOCKS5)
676 AC_ARG_WITH(socks5,
677 [[ --with-socks5[=DIR] with SOCKS5 support [search in DIR/lib and DIR/include]]],
678 [
679 case "$withval" in
680 no)
681 AC_MSG_RESULT(no)
682 ;;
683 *)
684 AC_MSG_RESULT(yes)
685 socks=5
686
687 if test -d "$withval/include"; then
688 CFLAGS="$CFLAGS -I$withval/include"
689 fi
690 if test -d "$withval/lib"; then
691 LDFLAGS="$LDFLAGS -L$withval/lib"
692 fi
693
694 LIBS="-lsocks5 $LIBS"
695 ;;
696 esac
697
698 AC_TRY_LINK([],
699 [
700 SOCKSconnect();
701 ], [],
702 [
703 AC_MSG_ERROR(Could not find SOCKS5 library.)
704 LIBS="$SAVE_LIBS"
705 CFLAGS="$SAVE_CFLAGS"
706 LDFLAGS="$SAVE_LDFLAGS"
707 ])
708 ],
709 AC_MSG_RESULT(no)
710 )
711
712 if test "x$socks" = "x4"; then
713 AC_DEFINE([SOCKS], [], [Socks])
714 CFLAGS="$CFLAGS -Dconnect=Rconnect -Dgetsockname=Rgetsockname -Dbind=Rbind -Daccept=Raccept -Dlisten=Rlisten -Dselect=Rselect"
715 fi
716
717 if test "x$socks" = "x5"; then
718 AC_DEFINE([SOCKS], [], [Socks])
719 AC_DEFINE([SOCKS5], [], [Socks5])
720 AC_DEFINE([Rconnect], [SOCKSconnect], [Socks])
721 AC_DEFINE([Rgetsockname], [SOCKSgetsockname], [Socks])
722 AC_DEFINE([Rgetpeername], [SOCKSgetpeername], [Socks])
723 AC_DEFINE([Rbind], [SOCKSbind], [Socks])
724 AC_DEFINE([Raccept], [SOCKSaccept], [Socks])
725 AC_DEFINE([Rlisten], [SOCKSlisten], [Socks])
726 AC_DEFINE([Rselect], [SOCKSselect], [Socks])
727 AC_DEFINE([Rrecvfrom], [SOCKSrecvfrom], [Socks])
728 AC_DEFINE([Rsendto], [SOCKSsendto], [Socks])
729 AC_DEFINE([Rrecv], [SOCKSrecv], [Socks])
730 AC_DEFINE([Rsend], [SOCKSsend], [Socks])
731 AC_DEFINE([Rread], [SOCKSread], [Socks])
732 AC_DEFINE([Rwrite], [SOCKSwrite], [Socks])
733 AC_DEFINE([Rrresvport], [SOCKSrresvport], [Socks])
734 AC_DEFINE([Rshutdown], [SOCKSshutdown], [Socks])
735 AC_DEFINE([Rlisten], [SOCKSlisten], [Socks])
736 AC_DEFINE([Rclose], [SOCKSclose], [Socks])
737 AC_DEFINE([Rdup], [SOCKSdup], [Socks])
738 AC_DEFINE([Rdup2], [SOCKSdup2], [Socks])
739 AC_DEFINE([Rfclose], [SOCKSfclose], [Socks])
740 AC_DEFINE([Rgethostbyname], [SOCKSgethostbyname], [Socks])
741 fi
742
743 # MP library checking. First check whether user wants to use GMP and use
744 # it if found. If not or not defined then compile the default library in the
745 # source tree.
746 #
747 mp_gmp=false
748 SAVE_LIBS="$LIBS"
749 SAVE_CFLAGS="$CFLAGS"
750 SAVE_LDFLAGS="$LDFLAGS"
751 AC_MSG_CHECKING(whether to search for GMP)
752 AC_ARG_WITH(gmp,
753 [[ --with-gmp[=DIR] use GMP instead of SILC Math [search in DIR/lib and DIR/include]]],
754 [
755 case "$withval" in
756 no)
757 AC_MSG_RESULT(no)
758 ;;
759 *)
760 AC_MSG_RESULT(yes)
761
762 if test -d "$withval/include"; then
763 CFLAGS="$CFLAGS -I$withval/include"
764 fi
765 if test -d "$withval/lib"; then
766 LDFLAGS="$LDFLAGS -L$withval/lib"
767 fi
768
769 LIBS="-lgmp $LIBS"
770 ;;
771 esac
772
773 AC_CHECK_LIB(gmp, __gmpz_init,
774 [
775 mp_gmp=true
776 AC_DEFINE([SILC_MP_GMP], [], [GMP])
777 AC_MSG_RESULT(Using GMP as a MP library.)
778 ],
779 [
780 LIBS="$SAVE_LIBS"
781 CFLAGS="$SAVE_CFLAGS"
782 LDFLAGS="$SAVE_LDFLAGS"
783 ])
784 ],
785 AC_MSG_RESULT(no)
786 )
787
788 AM_CONDITIONAL(SILC_MP_GMP, test x$mp_gmp = xtrue)
789 AM_CONDITIONAL(SILC_MP_SILCMATH, test x$mp_gmp = xfalse)
790 if test x$mp_gmp = xfalse; then
791 AC_DEFINE([SILC_MP_SILCMATH], [], [SILCMATH])
792 AC_MSG_RESULT(Using SILC Math as a MP library.)
793 fi
794
795 # iconv support
796 #
797 check_iconv=true
798 has_iconv=false
799 SAVE_LIBS="$LIBS"
800 SAVE_CFLAGS="$CFLAGS"
801 SAVE_LDFLAGS="$LDFLAGS"
802 SAVE_CPPFLAGS="$CPPFLAGS"
803 AC_MSG_CHECKING(whether to implicit search for libiconv)
804 AC_ARG_WITH(iconv,
805 [[ --with-iconv[=DIR] use libiconv [search in DIR/include and DIR/lib]]],
806 [
807 case "${withval}" in
808 no)
809 AC_MSG_RESULT(no)
810 AC_CHECK_HEADERS(iconv.h,
811 [
812 AC_CHECK_FUNC(iconv, has_iconv=true)
813 ])
814 check_iconv=false
815 ;;
816 *)
817 AC_MSG_RESULT(yes)
818 if test -d $withval/include; then
819 CPPFLAGS="$CPPFLAGS -I$withval/include"
820 CFLAGS="$CFLAGS -I$withval/include"
821 fi
822 if test -d $withval/lib; then
823 LDFLAGS="$LDFLAGS -L$withval/lib"
824 fi
825 ;;
826 esac
827 ],
828 [
829 AC_MSG_RESULT(no)
830 AC_CHECK_HEADERS(iconv.h,
831 [
832 AC_CHECK_FUNCS(iconv,
833 [
834 has_iconv=true
835 check_iconv=false
836 ])
837 ])
838 ])
839
840 if test x$check_iconv = xtrue; then
841 AC_MSG_RESULT(Searching for iconv...)
842
843 # XXX
844 unset ac_cv_header__iconv_h_ ac_cv_header_iconv_h || true
845
846 AC_CHECK_HEADERS(iconv.h,
847 [
848 LIBS="$LIBS -liconv"
849 AC_MSG_CHECKING(for iconv in -liconv)
850 AC_TRY_LINK(
851 [
852 #include <stdlib.h>
853 #include <iconv.h>
854 ],
855 [
856 iconv_t cd = iconv_open("", "");
857 iconv(cd, NULL, NULL, NULL, NULL);
858 iconv_close(cd);
859 ],
860 [
861 echo "yes"
862 AC_DEFINE([HAVE_ICONV], [], [Define if you have the iconv() function.])
863 has_iconv=true
864 check_iconv=false
865 ],
866 [
867 echo "no"
868 LIBS="$SAVE_LIBS"
869 CFLAGS="$SAVE_CFLAGS"
870 LDFLAGS="$SAVE_LDFLAGS"
871 CPPFLAGS="$SAVE_CPPFLAGS"
872 ])
873 ])
874 fi
875
876 if test x$check_iconv = xtrue; then
877 # search for iconv library..
878 SAVE_LIBS="$LIBS"
879 SAVE_CFLAGS="$CFLAGS"
880 SAVE_LDFLAGS="$LDFLAGS"
881 SAVE_CPPFLAGS="$CPPFLAGS"
882
883 for dir in `echo "/usr/local /usr/pkg /usr/contrib"`; do
884 if test x$has_iconv = xfalse; then
885 AC_MSG_RESULT(searching in $dir...)
886
887 if test -d $dir/include; then
888 CPPFLAGS="$CPPFLAGS -I$dir/include"
889 CFLAGS="$CFLAGS -I$dir/include"
890 fi
891 if test -d $dir/lib; then
892 LDFLAGS="$LDFLAGS -L$dir/lib"
893 fi
894
895 # XXX
896 unset ac_cv_header__iconv_h_ ac_cv_header_iconv_h || true
897
898 AC_CHECK_HEADERS(iconv.h,
899 [
900 LIBS="$LIBS -liconv"
901 AC_MSG_CHECKING(for iconv in -liconv)
902 AC_TRY_LINK(
903 [
904 #include <stdlib.h>
905 #include <iconv.h>
906 ],
907 [
908 iconv_t cd = iconv_open("", "");
909 iconv(cd, NULL, NULL, NULL, NULL);
910 iconv_close(cd);
911 ],
912 [
913 echo "yes"
914 has_iconv=true
915 AC_DEFINE([HAVE_ICONV], [], [Define if you have the iconv() function.])
916 ],
917 [
918 echo "no"
919 has_iconv=false
920
921 LIBS="$SAVE_LIBS"
922 CFLAGS="$SAVE_CFLAGS"
923 LDFLAGS="$SAVE_LDFLAGS"
924 CPPFLAGS="$SAVE_CPPFLAGS"
925 ])
926 ],
927 [
928 CFLAGS="$SAVE_CFLAGS"
929 LDFLAGS="$SAVE_LDFLAGS"
930 CPPFLAGS="$SAVE_CPPFLAGS"
931 ])
932 fi
933 done
934 fi
935
936 if test x$has_iconv = xtrue; then
937 # (1) Some implementations of iconv won't convert from UTF-8 to UTF-8.
938 # (2) In glibc-2.1.2 and earlier there is a bug that messes up ob and
939 # obl when args 2 and 3 are 0 (fixed in glibc-2.1.3).
940 #
941 AC_CACHE_CHECK([whether this iconv is good enough], ac_iconv_good,
942 AC_TRY_RUN(
943 [
944 #include <iconv.h>
945 int main() {
946 iconv_t cd;
947 changequote(, )dnl
948 char buf[4];
949 changequote([, ])dnl
950 char *ob;
951 size_t obl;
952 ob = buf, obl = sizeof(buf);
953 return ((cd = iconv_open("UTF-8", "UTF-8")) != (iconv_t)(-1) &&
954 (iconv(cd, 0, 0, &ob, &obl) ||
955 !(ob == buf && obl == sizeof(buf)) ||
956 iconv_close(cd)));
957 }
958 ],
959 [
960 ac_iconv_good=yes
961 ],
962 [
963 ac_iconv_good=no
964 ],
965 [
966 ac_iconv_good=yes
967 ])
968 )
969
970 if test x$ac_iconv_good = xno; then
971 AC_MSG_RESULT(Try using libiconv instead.)
972 fi
973 fi
974
975 # POSIX threads support
976 #
977 AC_MSG_CHECKING(whether to search for POSIX threads)
978 AC_ARG_WITH(pthreads,
979 [[ --with-pthreads[=DIR] use POSIX threads [search in DIR/include and DIR/lib]]],
980 [
981 case "${withval}" in
982 no)
983 check_threads=false
984 ;;
985 *)
986 if test -d $withval/include; then
987 CPPFLAGS="$CPPFLAGS -I$withval/include"
988 CFLAGS="$CFLAGS -I$withval/include"
989 fi
990 if test -d $withval/lib; then
991 LDFLAGS="$LDFLAGS -L$withval/lib"
992 fi
993
994 check_threads=true
995 ;;
996 esac
997 ])
998
999 if test x$check_threads = xtrue; then
1000 has_threads=false
1001 SAVE_LIBS="$LIBS"
1002 SAVE_CFLAGS="$CFLAGS"
1003 SAVE_LDFLAGS="$LDFLAGS"
1004 SAVE_CPPFLAGS="$CPPFLAGS"
1005
1006 AC_MSG_RESULT(yes)
1007 AC_CHECK_HEADERS(pthread.h,
1008 [
1009 LIBS="$LIBS -lpthread"
1010 AC_CHECK_LIB(pthread, pthread_attr_init, has_threads=true,
1011 [
1012 # FreeBSD
1013 case "${target}" in
1014 *-*-freebsd*)
1015 LIBS="$SAVE_LIBS -pthread"
1016 AC_CHECK_LIB(c_r, pthread_attr_init, has_threads=true, LIBS="$SAVE_LIBS")
1017 ;;
1018 *)
1019 LIBS="$SAVE_LIBS"
1020 ;;
1021 esac
1022 ])
1023 ],
1024 [
1025 # search for pthread library..
1026 for dir in `echo "/usr/local /usr/pkg /usr/contrib /usr/pkg/pthreads /usr/local/pthreads"`; do
1027 if test x$has_threads = xfalse; then
1028 AC_MSG_RESULT(searching in $dir...)
1029
1030 if test -d $dir/include; then
1031 CPPFLAGS="$CPPFLAGS -I$dir/include"
1032 CFLAGS="$CFLAGS -I$dir/include"
1033 fi
1034 if test -d $dir/lib; then
1035 LDFLAGS="$LDFLAGS -L$dir/lib"
1036 fi
1037
1038 # XXX
1039 unset ac_cv_header__pthread_h_ ac_cv_header_pthread_h || true
1040
1041 AC_CHECK_HEADERS(pthread.h,
1042 [
1043 LIBS="$LIBS -lpthread"
1044 AC_CHECK_LIB(pthread, pthread_attr_init, has_threads=true,
1045 [
1046 has_threads=false
1047
1048 LIBS="$SAVE_LIBS"
1049 CFLAGS="$SAVE_CFLAGS"
1050 LDFLAGS="$SAVE_LDFLAGS"
1051 CPPFLAGS="$SAVE_CPPFLAGS"
1052 ])
1053 ],
1054 [
1055 CFLAGS="$SAVE_CFLAGS"
1056 LDFLAGS="$SAVE_LDFLAGS"
1057 CPPFLAGS="$SAVE_CPPFLAGS"
1058 ])
1059 fi
1060 done
1061 ])
1062 else
1063 AC_MSG_RESULT(no)
1064 has_threads=false
1065 fi
1066
1067 __SILC_HAVE_PTHREAD=""
1068 AM_CONDITIONAL(SILC_THREADS, test x$has_threads = xtrue)
1069 if test x$has_threads = xtrue; then
1070 CFLAGS="$CFLAGS -D_REENTRANT"
1071
1072 # XXX possibly incomplete
1073 case "${target}" in
1074 *-*-aix*)
1075 CFLAGS="$CFLAGS -D_THREAD_SAFE"
1076 if test x"$GCC" = xyes; then
1077 CFLAGS="$CFLAGS -mthreads"
1078 fi
1079 ;;
1080 *-*-freebsd*)
1081 CFLAGS="$CFLAGS -D_THREAD_SAFE"
1082 ;;
1083 *-*-sysv5uw7*) # UnixWare 7
1084 if test "$GCC" != "yes"; then
1085 CFLAGS="$CFLAGS -Kthread"
1086 else
1087 CFLAGS="$CFLAGS -pthread"
1088 fi
1089 ;;
1090 *-dg-dgux*) # DG/UX
1091 CFLAGS="$CFLAGS -D_POSIX4A_DRAFT10_SOURCE"
1092 ;;
1093 esac
1094
1095 # Check for threads
1096 AC_CHECK_FUNC(pthread_create)
1097
1098 # Check for read/write locks
1099 AC_CHECK_FUNC(pthread_rwlock_init,
1100 [
1101 AC_RUN_IFELSE(
1102 [
1103 #include <pthread.h>
1104 int main()
1105 {
1106 pthread_rwlock_t rwlock;
1107 pthread_rwlock_init(&rwlock, NULL);
1108 pthread_rwlock_destroy(&rwlock);
1109 return 0;
1110 }
1111 ],
1112 [],
1113 [
1114 # Rwlock not defined
1115 CFLAGS="$CFLAGS -D_XOPEN_SOURCE=600"
1116 ]
1117 )
1118 ],
1119 [
1120 # Rwlock not defined
1121 CFLAGS="$CFLAGS -D_XOPEN_SOURCE=600"
1122 ])
1123
1124 AC_DEFINE([SILC_HAVE_PTHREAD], [], [HAVE_PTHREAD])
1125 AC_DEFINE([SILC_THREADS], [], [HAVE_THREAD])
1126 __SILC_HAVE_PTHREAD="#define __SILC_HAVE_PTHREAD 1"
1127 fi
1128
1129 #
1130 # Check for timezone and tm_gmtoff for timezone information
1131 #
1132 AC_MSG_CHECKING(whether system has timezone)
1133 AC_RUN_IFELSE(
1134 [
1135 #include <stdio.h>
1136 #include <time.h>
1137 int main()
1138 {
1139 timezone = 0;
1140 return 0;
1141 }
1142 ],
1143 [ AC_MSG_RESULT(yes)
1144 AC_DEFINE([HAVE_TIMEZONE], [], [HAVE_TIMEZONE]) ],
1145 [ AC_MSG_RESULT(no) ],
1146 [ AC_MSG_RESULT(no) ]
1147 )
1148 AC_MSG_CHECKING(whether system has tm_gmtoff)
1149 AC_RUN_IFELSE(
1150 [
1151 #include <stdio.h>
1152 #include <time.h>
1153 int main()
1154 {
1155 struct tm tm;
1156 tm.tm_gmtoff = 0;
1157 return 0;
1158 }
1159 ],
1160 [ AC_MSG_RESULT(yes)
1161 AC_DEFINE([HAVE_TM_GMTOFF], [], [HAVE_TM_GMTOFF]) ],
1162 [ AC_MSG_RESULT(no) ],
1163 [ AC_MSG_RESULT(no) ]
1164 )
1165 AC_MSG_CHECKING(whether system has __tm_gmtoff)
1166 AC_RUN_IFELSE(
1167 [
1168 #include <stdio.h>
1169 #include <time.h>
1170 int main()
1171 {
1172 struct tm tm;
1173 tm.__tm_gmtoff = 0;
1174 return 0;
1175 }
1176 ],
1177 [ AC_MSG_RESULT(yes)
1178 AC_DEFINE([HAVE___TM_GMTOFF], [], [HAVE___TM_GMTOFF]) ],
1179 [ AC_MSG_RESULT(no) ],
1180 [ AC_MSG_RESULT(no) ]
1181 )
1182 AC_MSG_CHECKING(whether system has __tm_gmtoff__)
1183 AC_RUN_IFELSE(
1184 [
1185 #include <stdio.h>
1186 #include <time.h>
1187 int main()
1188 {
1189 struct tm tm;
1190 tm.__tm_gmtoff__ = 0;
1191 return 0;
1192 }
1193 ],
1194 [ AC_MSG_RESULT(yes)
1195 AC_DEFINE([HAVE___TM_GMTOFF__], [], [HAVE___TM_GMTOFF__]) ],
1196 [ AC_MSG_RESULT(no) ],
1197 [ AC_MSG_RESULT(no) ]
1198 )
1199
1200 # Native WIN32 compilation under cygwin
1201 #
1202 AC_MSG_CHECKING(whether to compile native WIN32 code)
1203 AC_ARG_WITH(win32,
1204 [ --with-win32 compile native WIN32 (MinGW) code (-mno-cygwin)],
1205 [
1206 AC_MSG_RESULT(yes)
1207 AC_DEFINE([SILC_WIN32], [], [SILC_WIN32])
1208 win32_support=true
1209 CFLAGS="-mno-cygwin $CFLAGS"
1210 LIBS="$LIBS -lwsock32"
1211 ],
1212 [
1213 AC_MSG_RESULT(no)
1214 ])
1215 AM_CONDITIONAL(SILC_WIN32, test x$win32_support = xtrue)
1216
1217 # Native Symbian OS support (disabled by default)
1218 #
1219 AM_CONDITIONAL(SILC_SYMBIAN, test xfalse = xtrue)
1220
1221 # Native BeOS support (disabled by default)
1222 #
1223 AM_CONDITIONAL(SILC_BEOS, test xfalse = xtrue)
1224
1225 # Native OS2 support (disabled by default)
1226 #
1227 AM_CONDITIONAL(SILC_OS2, test xfalse = xtrue)
1228
1229 without_silcd=false
1230
1231 libtoolfix=true
1232 AC_MSG_CHECKING(whether to do libtoolfix)
1233 AC_ARG_WITH(libtoolfix,
1234 [ --without-libtoolfix Do not fix libtool, for package builders],
1235 [
1236 AC_MSG_RESULT(no)
1237 libtoolfix=false
1238 ],
1239 [
1240 AC_MSG_RESULT(yes)
1241 ])
1242
1243 AC_SUBST(ETCDIR)
1244 AC_DEFINE_UNQUOTED([SILC_ETCDIR], "$ETCDIR", [SILC_ETCDIR])
1245
1246 ##
1247 ## Misc
1248 ##
1249
1250 # Make enable-shared aware
1251 AM_CONDITIONAL(SILC_ENABLE_SHARED, test "$enable_shared" = yes)
1252
1253 SILC_TOP_SRCDIR=`pwd`
1254
1255 # Included configure scripts
1256 #
1257 # lib/silccrypt/configure.ad
1258 #
1259 # Author: Pekka Riikonen <priikone@silcnet.org>
1260 #
1261 # Copyright (C) 2006 - 2007 Pekka Riikonen
1262 #
1263 # This program is free software; you can redistribute it and/or modify
1264 # it under the terms of the GNU General Public License as published by
1265 # the Free Software Foundation; version 2 of the License.
1266 #
1267 # This program is distributed in the hope that it will be useful,
1268 # but WITHOUT ANY WARRANTY; without even the implied warranty of
1269 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1270 # GNU General Public License for more details.
1271 #
1272
1273 if test x$compile_libs = xtrue; then
1274
1275 AC_MSG_NOTICE([configuring crypto library])
1276 SILC_CRYPTO_CFLAGS=
1277
1278 aes_asm=false
1279
1280 if test "${pic_mode:-default}" != "yes" ; then
1281 case "$host_cpu" in
1282 i?86)
1283 # Don't enable ASM AES with shared libs as the code doesn't support PIC.
1284 if test x$have_assembler = xtrue -a "$enable_shared" != "yes"; then
1285 aes_asm=true
1286 AC_DEFINE([SILC_AES_ASM], [], [SILC_AES_ASM])
1287 fi
1288 ;;
1289 x86_64)
1290 if test x$have_assembler = xtrue -a "$enable_shared" != "yes"; then
1291 aes_asm=true
1292 AC_DEFINE([SILC_AES_ASM], [], [SILC_AES_ASM])
1293 fi
1294 ;;
1295 default)
1296 aes_asm=false
1297 ;;
1298 esac
1299 fi
1300
1301 SILC_ADD_CC_FLAGS(SILC_CRYPTO, -fno-regmove)
1302 if test x$summary_debug = xno -a x$want_cc_optimizations = xtrue; then
1303 SILC_ADD_CC_FLAGS(SILC_CRYPTO, -fomit-frame-pointer -O3)
1304 fi
1305
1306 AC_SUBST(SILC_CRYPTO_CFLAGS)
1307
1308 AC_CONFIG_FILES(
1309 lib/silccrypt/Makefile
1310 )
1311
1312 fi # compile_libs
1313
1314 # AM_CONDITIONAL is so bad that it itself cannot be defined in conditional
1315 AM_CONDITIONAL(SILC_AES_ASM, test x$aes_asm = xtrue)
1316
1317 #
1318 # lib/silcmath/configure.ad
1319 #
1320 # Author: Pekka Riikonen <priikone@silcnet.org>
1321 #
1322 # Copyright (C) 2005 - 2007 Pekka Riikonen
1323 #
1324 # This program is free software; you can redistribute it and/or modify
1325 # it under the terms of the GNU General Public License as published by
1326 # the Free Software Foundation; version 2 of the License.
1327 #
1328 # This program is distributed in the hope that it will be useful,
1329 # but WITHOUT ANY WARRANTY; without even the implied warranty of
1330 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1331 # GNU General Public License for more details.
1332 #
1333
1334 if test x$compile_libs = xtrue; then
1335
1336 AC_MSG_NOTICE([configuring math library])
1337
1338 if test x$want_cc_optimizations = xtrue; then
1339 SILC_ADD_CC_FLAGS(MATH, -O3, SILC_ADD_CC_FLAGS(MATH, -O2))
1340 SILC_ADD_CC_FLAGS(MATH, -funroll-all-loops)
1341 fi
1342 if test x$enable_stack_trace != xyes; then
1343 SILC_ADD_CC_FLAGS(MATH, -fomit-frame-pointer)
1344 fi
1345
1346
1347 AC_SUBST(MATH_CFLAGS)
1348
1349 AC_CONFIG_FILES(
1350 lib/silcmath/Makefile
1351 )
1352
1353 fi # compile_libs
1354 #
1355 # lib/configure.ad
1356 #
1357 # Author: Pekka Riikonen <priikone@silcnet.org>
1358 #
1359 # Copyright (C) 2005, 2007 Pekka Riikonen
1360 #
1361 # This program is free software; you can redistribute it and/or modify
1362 # it under the terms of the GNU General Public License as published by
1363 # the Free Software Foundation; version 2 of the License.
1364 #
1365 # This program is distributed in the hope that it will be useful,
1366 # but WITHOUT ANY WARRANTY; without even the implied warranty of
1367 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1368 # GNU General Public License for more details.
1369 #
1370
1371 if test x$compile_libs = xtrue; then
1372
1373 ##
1374 ## Will compile included libs
1375 ##
1376 AC_MSG_NOTICE([Configuring SILC libraries])
1377
1378 # SILC Library directories
1379 SILC_LIB_INCLUDES="$SILC_LIB_INCLUDES -I$SILC_TOP_SRCDIR/lib/contrib"
1380 SILC_LIB_INCLUDES="$SILC_LIB_INCLUDES -I$SILC_TOP_SRCDIR/lib/silccore"
1381 SILC_LIB_INCLUDES="$SILC_LIB_INCLUDES -I$SILC_TOP_SRCDIR/lib/silccrypt"
1382 SILC_LIB_INCLUDES="$SILC_LIB_INCLUDES -I$SILC_TOP_SRCDIR/lib/silcmath"
1383 SILC_LIB_INCLUDES="$SILC_LIB_INCLUDES -I$SILC_TOP_SRCDIR/lib/silcutil"
1384 SILC_LIB_INCLUDES="$SILC_LIB_INCLUDES -I$SILC_TOP_SRCDIR/lib/silcapputil"
1385 SILC_LIB_INCLUDES="$SILC_LIB_INCLUDES -I$SILC_TOP_SRCDIR/lib/silcske"
1386 SILC_LIB_INCLUDES="$SILC_LIB_INCLUDES -I$SILC_TOP_SRCDIR/lib/silcasn1"
1387 SILC_LIB_INCLUDES="$SILC_LIB_INCLUDES -I$SILC_TOP_SRCDIR/lib/silcskr"
1388 SILC_LIB_INCLUDES="$SILC_LIB_INCLUDES -I$SILC_TOP_SRCDIR/lib/silchttp"
1389
1390 ##
1391 ## Library versioning.
1392 ##
1393 # Do the releases and library versioning according to following rules:
1394 #
1395 # - If any code has changed in library, increment [LIB]_REVISION
1396 # - If functions were added, removed or changed, set [LIB]_REVISION to 0
1397 # - If functions were added, removed or changed, increment [LIB]_CURRENT
1398 # - If functions were added, increment [LIB]_AGE
1399 # - If functions were removed, set [LIB]_AGE to 0
1400 #
1401 # where [LIB] is LIBSILC, LIBSILCCLIENT or LIBSILCSERVER, and where
1402 # "functions" means functions public interfaces (API).
1403 #
1404 # The LIB_BASE_VERSION defines the SILC software major.minor version and
1405 # it is increment only when these version numbers actually change.
1406 #
1407
1408 # Base version for libraries. Do not change this unless SILC version
1409 # changes too.
1410 LIB_BASE_VERSION=1.1
1411
1412 # libsilc versions
1413 LIBSILC_CURRENT=3 # prev = 2
1414 LIBSILC_REVISION=0 # prev = 1
1415 LIBSILC_AGE=1 # prev = 1
1416
1417 # libsilcclient versions
1418 LIBSILCCLIENT_CURRENT=2 # prev = 1
1419 LIBSILCCLIENT_REVISION=1 # prev = 1
1420 LIBSILCCLIENT_AGE=0 # prev = 0
1421
1422 # libsilcserver versions
1423 LIBSILCSERVER_CURRENT=1 # prev = 0
1424 LIBSILCSERVER_REVISION=0 # prev = 0
1425 LIBSILCSERVER_AGE=0 # prev = 0
1426
1427 # Substitute the version numbers
1428 AC_SUBST(LIB_BASE_VERSION)
1429 AC_SUBST(LIBSILC_CURRENT)
1430 AC_SUBST(LIBSILC_REVISION)
1431 AC_SUBST(LIBSILC_AGE)
1432 AC_SUBST(LIBSILCCLIENT_CURRENT)
1433 AC_SUBST(LIBSILCCLIENT_REVISION)
1434 AC_SUBST(LIBSILCCLIENT_AGE)
1435 AC_SUBST(LIBSILCSERVER_CURRENT)
1436 AC_SUBST(LIBSILCSERVER_REVISION)
1437 AC_SUBST(LIBSILCSERVER_AGE)
1438
1439 # Check for big-endian machines
1440 AC_C_BIGENDIAN
1441
1442 # Check for epoll_wait and verify that epoll_create works
1443 AC_CHECK_FUNC(epoll_wait,
1444 [
1445 AC_RUN_IFELSE(
1446 [
1447 #include <sys/epoll.h>
1448 int main()
1449 {
1450 int ret = epoll_create(5);
1451 if (ret < 0)
1452 return 1;
1453 close(ret);
1454 return 0;
1455 }
1456 ],
1457 [
1458 AC_DEFINE([HAVE_EPOLL_WAIT], [1], [HAVE_EPOLL_WAIT])
1459 ],
1460 )
1461 ])
1462
1463 MODULESDIR="$silc_prefix/lib/modules"
1464 AC_SUBST(MODULESDIR)
1465
1466
1467
1468 #
1469 # Makefile outputs
1470 #
1471 AC_CONFIG_FILES(
1472 lib/Makefile
1473 lib/contrib/Makefile
1474 lib/silccore/Makefile
1475 lib/silcske/Makefile
1476 lib/silcutil/Makefile
1477 lib/silcutil/unix/Makefile
1478 lib/silcapputil/Makefile
1479 )
1480
1481
1482
1483
1484 AC_CONFIG_FILES(
1485 lib/silcasn1/Makefile
1486 )
1487
1488 AC_CONFIG_FILES(
1489 lib/silcskr/Makefile
1490 )
1491
1492 AC_CONFIG_FILES(
1493 lib/silchttp/Makefile
1494 )
1495
1496
1497 fi # compile_libs
1498
1499 #
1500 # apps/silcd/configure.ad
1501 #
1502 # Author: Pekka Riikonen <priikone@silcnet.org>
1503 #
1504 # Copyright (C) 2000 - 2005 Pekka Riikonen
1505 #
1506 # This program is free software; you can redistribute it and/or modify
1507 # it under the terms of the GNU General Public License as published by
1508 # the Free Software Foundation; version 2 of the License.
1509 #
1510 # This program is distributed in the hope that it will be useful,
1511 # but WITHOUT ANY WARRANTY; without even the implied warranty of
1512 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1513 # GNU General Public License for more details.
1514 #
1515
1516 SILCD_SUBDIR=
1517
1518
1519 SILCD_SUBDIR=silcd
1520
1521 # Logs directory
1522 #
1523 LOGSDIR="$silc_prefix/logs"
1524 AC_ARG_WITH(logsdir,
1525 [[ --with-logsdir=DIR directory for SILC Server logs [PREFIX/logs]]],
1526 [
1527 case "$withval" in
1528 no|yes)
1529 ;;
1530 *)
1531 LOGSDIR="$withval"
1532 ;;
1533 esac
1534 ])
1535 AC_SUBST(LOGSDIR)
1536 AC_DEFINE_UNQUOTED([SILC_LOGSDIR], "$LOGSDIR", [SILC_LOGSDIR])
1537
1538 # silcd config file checking
1539 #
1540 summary_silcd_configfile="/etc/silc/silcd.conf"
1541 AC_ARG_WITH(silcd-config-file,
1542 [[ --with-silcd-config-file=FILE use FILE as default configuration file
1543 for SILC Server [/etc/silc/silcd.conf]]],
1544 AC_DEFINE_UNQUOTED([SILC_SERVER_CONFIG_FILE], "$withval", [SILC_SERVER_CONFIG_FILE])
1545 summary_silcd_configfile="$withval"
1546 )
1547
1548 # silcd pid file checking
1549 #
1550 if test "x$localstatedir" != 'x${prefix}/var'; then
1551 PIDFILE="$localstatedir/silcd.pid"
1552 else
1553 PIDFILE="$silc_prefix/var/silcd.pid"
1554 fi
1555
1556 AC_ARG_WITH(silcd-pid-file,
1557 [[ --with-silcd-pid-file=FILE use FILE as default pid file for SILC
1558 Server [/var/run/silcd.pid]]],
1559 [
1560 case "$withval" in
1561 no|yes)
1562 ;;
1563 *)
1564 PIDFILE="$withval"
1565 ;;
1566 esac
1567 ])
1568 AC_SUBST(PIDFILE)
1569
1570 AC_CONFIG_FILES(
1571 apps/silcd/Makefile
1572 doc/example_silcd.conf
1573 )
1574
1575 silcd="yes"
1576
1577 AC_SUBST(SILCD_SUBDIR)
1578
1579 #
1580 # Substitutions
1581 #
1582 AC_SUBST(LIBSUBDIR)
1583 AC_SUBST(SILC_TOP_SRCDIR)
1584 AC_SUBST(LDFLAGS)
1585 AC_SUBST(LIBS)
1586 AC_SUBST(SILC_LIB_INCLUDES)
1587 AC_SUBST(__SILC_HAVE_PTHREAD)
1588 AC_SUBST(__SILC_HAVE_SIM)
1589 AC_SUBST(__SILC_ENABLE_DEBUG)
1590 AC_SUBST(__SILC_PACKAGE_VERSION)
1591
1592 #
1593 # Fix the libtool to support run-time configuration. This allows us
1594 # to in run-time specify when to compile shared/static libraries without
1595 # need to reconfigure the entire libtool.
1596 #
1597 if test x$libtoolfix = xtrue; then
1598 ./libtoolfix $SILC_TOP_SRCDIR/ltmain.sh
1599 fi
1600 AM_CONDITIONAL(SILC_LIBTOOLFIX, test x$libtoolfix = xtrue)
1601
1602 INCLUDE_DEFINES_INT="include \$(top_srcdir)/Makefile.defines_int"
1603 AC_SUBST(INCLUDE_DEFINES_INT)
1604
1605
1606 #
1607 # Makefile outputs
1608 #
1609 AC_CONFIG_FILES(
1610 Makefile
1611 doc/Makefile
1612 Makefile.defines
1613 Makefile.defines_int
1614 includes/Makefile
1615 includes/silcversion.h
1616 includes/silc.h
1617 apps/Makefile
1618 )
1619
1620
1621 AC_OUTPUT
1622
1623 s_bindir=`eval echo $bindir`;s_bindir=`eval echo $s_bindir`
1624 s_sbindir=`eval echo $sbindir`;s_sbindir=`eval echo $s_sbindir`
1625 s_mandir=`eval echo $mandir`;s_mandir=`eval echo $s_mandir`
1626 s_includedir=`eval echo $includedir`;s_includedir=`eval echo $s_includedir`
1627
1628 echo ""
1629 echo "$PACKAGE Configuration Summary:"
1630 echo "---------------------------"
1631 echo " Target host ...................: $target"
1632 echo " Compiler ......................: $CC"
1633 echo " CFLAGS ........................: $CFLAGS"
1634 echo " LDFLAGS .......................: $LDFLAGS"
1635 echo " LIBS ..........................: $LIBS"
1636 echo ""
1637 echo " Installation prefix ...........: $prefix"
1638 echo " bin directory .................: $s_bindir"
1639 echo " sbin directory ................: $s_sbindir"
1640 echo " etc directory .................: $ETCDIR"
1641 echo " man directory .................: $s_mandir"
1642 echo " doc directory .................: $DOCDIR"
1643 echo " include directory .............: $s_includedir"
1644 echo ""
1645
1646
1647 if test x$without_silcd = xtrue; then
1648 silcd="no"
1649 fi
1650 echo " Compile SILC Server ...........: $silcd"
1651
1652
1653 echo " IPv6 support ..................: $summary_ipv6"
1654
1655 if test x$has_iconv = xfalse; then
1656 iconv_support="no"
1657 else
1658 iconv_support="yes"
1659 fi
1660 echo " Iconv support .................: $iconv_support"
1661
1662 if test x$want_asm = xfalse; then
1663 summary_asm="no"
1664 else
1665 summary_asm="yes"
1666 fi
1667 echo " Assembler optimizations .......: $summary_asm"
1668
1669 if test x$mp_gmp = xtrue; then
1670 echo " Arithmetic library ............: GMP"
1671 fi
1672
1673 threads="no"
1674 if test x$has_threads = xtrue; then
1675 threads="yes"
1676 fi
1677 echo " Multi-threads support .........: $threads"
1678 echo " Debugging enabled .............: $summary_debug"
1679 echo ""
1680 echo "Compile the sources with 'make' or 'gmake' command."

  ViewVC Help
Powered by ViewVC 1.1.5