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