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