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