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