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