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