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