4 # Author: Pekka Riikonen <priikone@silcnet.org>
6 # Copyright (C) 2000 - 2005 Pekka Riikonen
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.
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.
22 AC_CONFIG_HEADERS(silcdefs.h)
30 AC_PATH_PROG(sedpath, sed)
32 #ifdef SILC_DIST_COMPILER
33 # Put here any platform specific stuff
52 __SILC_HAVE_PTHREAD=""
54 __SILC_ENABLE_DEBUG=""
66 # More header checking
68 AC_CHECK_HEADERS(unistd.h string.h getopt.h errno.h fcntl.h assert.h)
69 AC_CHECK_HEADERS(sys/types.h sys/stat.h sys/time.h stddef.h)
70 AC_CHECK_HEADERS(netinet/in.h netinet/tcp.h xti.h netdb.h sys/resource.h)
71 AC_CHECK_HEADERS(pwd.h grp.h termcap.h paths.h)
72 AC_CHECK_HEADERS(ncurses.h signal.h ctype.h utime.h)
73 AC_CHECK_HEADERS(arpa/inet.h sys/mman.h limits.h termios.h locale.h langinfo.h)
83 AC_CHECK_SIZEOF(long long, 0)
84 AC_SUBST(SILC_SIZEOF_LONG_LONG, $ac_cv_sizeof_long_long)
85 AC_CHECK_SIZEOF(long, 0)
86 AC_SUBST(SILC_SIZEOF_LONG, $ac_cv_sizeof_long)
87 AC_CHECK_SIZEOF(int, 0)
88 AC_SUBST(SILC_SIZEOF_INT, $ac_cv_sizeof_int)
89 AC_CHECK_SIZEOF(short, 0)
90 AC_SUBST(SILC_SIZEOF_SHORT, $ac_cv_sizeof_short)
91 AC_CHECK_SIZEOF(char, 0)
92 AC_SUBST(SILC_SIZEOF_CHAR, $ac_cv_sizeof_char)
93 AC_CHECK_SIZEOF(void *, 0)
94 AC_SUBST(SILC_SIZEOF_VOID_P, $ac_cv_sizeof_void_p)
96 # Function and library checking
98 AC_CHECK_FUNC(gethostbyname, [],
100 AC_CHECK_LIB(nsl, gethostbyname, LIBS="$LIBS -lnsl")
101 AC_CHECK_FUNC(res_gethostbyname, [],
102 AC_CHECK_LIB(resolv, res_gethostbyname, LIBS="$LIBS -lresolv")
105 AC_CHECK_FUNC(socket, [],
106 AC_CHECK_LIB(socket, socket, LIBS="$LIBS -lsocket")
108 AC_CHECK_FUNCS(gethostname gethostbyaddr getservbyname getservbyport)
109 AC_CHECK_FUNCS(select listen bind shutdown close connect setsockopt)
110 AC_CHECK_FUNCS(time ctime utime gettimeofday getrusage)
111 AC_CHECK_FUNCS(chmod fcntl stat fstat getenv putenv strerror)
112 AC_CHECK_FUNCS(getpid getgid getsid getpgid getpgrp getuid)
113 AC_CHECK_FUNCS(setgroups initgroups nl_langinfo)
114 AC_CHECK_FUNCS(strchr strstr strcpy strncpy memcpy memset memmove)
117 # SIM support checking
118 # XXX These needs to be changed as more supported platforms appear.
119 # XXX This probably needs to be made platform dependant check.
122 AC_MSG_CHECKING(for SIM support)
124 AC_CHECK_HEADERS(dlfcn.h,
126 AC_CHECK_LIB(dl, dlopen,
128 AC_DEFINE([SILC_SIM], [], [HAVE_SIM])
133 AC_CHECK_LIB(c, dlopen,
135 AC_DEFINE([SILC_SIM], [], [HAVE_SIM])
141 AM_CONDITIONAL(SILC_SIM, test x$sim_support = xtrue)
142 if test x$sim_support = xtrue; then
143 AC_MSG_RESULT(Enabled SIM support.)
144 __SILC_HAVE_SIM="#define __SILC_HAVE_SIM 1"
146 AC_MSG_RESULT(No SIM support found.)
150 # lib/contrib conditionals
152 AC_CHECK_HEADER(regex.h,
154 AC_DEFINE([HAVE_REGEX], [], [HAVE_REGEX])
158 AM_CONDITIONAL(HAVE_REGEX, test x$have_regex = x1)
160 AC_CHECK_FUNC(getopt_long,
162 AC_DEFINE([HAVE_GETOPT_LONG], [], [HAVE_GETOPT_LONG])
164 ], have_getopt_long=0
166 AM_CONDITIONAL(HAVE_GETOPT_LONG, test x$have_getopt_long = x1)
169 ## Enable/disable checking
174 AC_MSG_CHECKING(whether to enable IPv6 support)
176 [ --enable-ipv6 enable IPv6 support],
178 case "${enableval}" in
183 AC_DEFINE([HAVE_IPV6], [], [HAVE_IPV6])
197 if test x$check_ipv6 = xtrue; then
201 #ifdef HAVE_SYS_TYPES_H
202 #include <sys/types.h>
204 #ifdef HAVE_NETINET_TCP_H
205 #include <netinet/tcp.h>
210 #include <sys/socket.h>
211 #ifdef HAVE_NETINET_IN_H
212 #include <netinet/in.h>
216 struct sockaddr_in6 sin6;
217 int family = AF_INET6;
220 AC_DEFINE([HAVE_IPV6], [], [HAVE_IPV6])
230 AC_MSG_CHECKING(whether to enable debugging)
232 __SILC_ENABLE_DEBUG=""
234 [ --enable-debug enable debugging],
236 case "${enableval}" in
239 AC_DEFINE([SILC_DEBUG], [], [enable-debug])
241 __SILC_ENABLE_DEBUG="#define __SILC_ENABLE_DEBUG 1"
252 # Disable all assembler optimizations
254 AC_MSG_CHECKING(whether to enable assembler optimizations)
257 [ --disable-asm do not use assembler optimizations],
268 ## Compiler and compiler flag checks
271 # Function to check if compiler flag works
272 # Usage: SILC_ADD_CFLAGS(FLAGS, [ACTION-IF-FAILED])
273 AC_DEFUN([SILC_ADD_CFLAGS],
274 [ tmp_CFLAGS="$CFLAGS"
276 AC_MSG_CHECKING(whether $CC accepts $1 flag)
277 AC_TRY_LINK([], [], [AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no)
284 # GCC specific options
285 if test "x$summary_debug" = "xyes"; then
286 SILC_ADD_CFLAGS(-g -O)
288 SILC_ADD_CFLAGS(-g -O2)
290 SILC_ADD_CFLAGS(-Wall -finline-functions)
295 SILC_ADD_CFLAGS(-g3 -O2, SILC_ADD_CFLAGS(-g3 -O, SILC_ADD_CFLAGS(-O)))
299 SILC_ADD_CFLAGS(-O2, SILC_ADD_CFLAGS(-O))
303 # Intel C++ Compiler needs -restrict
304 if test "x$CC" = "xicc"; then
305 SILC_ADD_CFLAGS(-restrict)
310 # Workaround a bug in GCC 2.x which causes memory exhaustion
311 # when compiling sha1 with optimizations on UltraSPARC.
314 if test "$GCC" -a "$host_cpu" = "sparc64"; then
315 AC_MSG_CHECKING(whether to enable GCC 2.x workaround for SHA1)
318 #if defined(__sparc64__) && (__GNUC__ == 2)
332 #endif SILC_DIST_COMPILER
338 # Default installation destination
340 #ifdef SILC_DIST_AUTODIST
341 AC_PREFIX_DEFAULT(/usr/local)
342 #else !SILC_DIST_AUTODIST
343 AC_PREFIX_DEFAULT(/usr/local/silc)
344 #endif SILC_DIST_AUTODIST
345 if test "x$prefix" != xNONE; then
346 silc_prefix="$prefix"
348 silc_prefix="$ac_default_prefix"
351 #ifndef SILC_DIST_AUTODIST
354 if test "x$sysconfdir" != 'x${prefix}/etc'; then
357 ETCDIR="$silc_prefix/etc"
361 [[ --with-etcdir=DIR directory for system files [/etc/silc]]],
372 AC_DEFINE_UNQUOTED([SILC_ETCDIR], "$ETCDIR", [SILC_ETCDIR])
376 DOCDIR="$silc_prefix/doc"
378 [[ --with-docdir=DIR directory for SILC documentation [PREFIX/doc]]],
389 AC_DEFINE_UNQUOTED([SILC_DOCDIR], "$DOCDIR", [SILC_DOCDIR])
390 #endif SILC_DIST_AUTODIST
392 #ifdef SILC_DIST_CLIENT
395 HELPDIR="$silc_prefix/help"
397 [[ --with-helpdir=DIR directory for SILC help files [PREFIX/help]]],
408 AC_DEFINE_UNQUOTED([SILC_HELPDIR], "$HELPDIR", [SILC_HELPDIR])
409 #endif SILC_DIST_CLIENT
412 # SIM modules directory
414 MODULESDIR="$silc_prefix/modules"
416 [[ --with-simdir=DIR directory for SIM modules [PREFIX/modules]]],
422 MODULESDIR="$withval"
427 AC_DEFINE_UNQUOTED([SILC_MODULESDIR], "$MODULESDIR", [SILC_MODULESDIR])
430 #ifdef SILC_DIST_SERVER
433 LOGSDIR="$silc_prefix/logs"
435 [[ --with-logsdir=DIR directory for SILC Server logs [PREFIX/logs]]],
446 AC_DEFINE_UNQUOTED([SILC_LOGSDIR], "$LOGSDIR", [SILC_LOGSDIR])
448 # silcd config file checking
450 summary_silcd_configfile="/etc/silc/silcd.conf"
451 AC_ARG_WITH(silcd-config-file,
452 [[ --with-silcd-config-file=FILE use FILE as default configuration file
453 for SILC Server [/etc/silc/silcd.conf]]],
454 AC_DEFINE_UNQUOTED([SILC_SERVER_CONFIG_FILE], "$withval", [SILC_SERVER_CONFIG_FILE])
455 summary_silcd_configfile="$withval"
458 # silcd pid file checking
460 if test "x$localstatedir" != 'x${prefix}/var'; then
461 PIDFILE="$localstatedir/silcd.pid"
463 PIDFILE="$silc_prefix/var/silcd.pid"
466 AC_ARG_WITH(silcd-pid-file,
467 [[ --with-silcd-pid-file=FILE use FILE as default pid file for SILC
468 Server [/var/run/silcd.pid]]],
479 #endif SILC_DIST_SERVER
481 #ifdef SILC_DIST_COMPILER
483 ## With/without checkings
487 # SILC library checking
490 #ifndef SILC_DIST_TOOLKIT
491 AC_ARG_WITH(silc-includes,
492 [ --with-silc-includes=DIR SILC Toolkit includes [search in DIR]],
493 [ac_silc_includes="$withval"], [ac_silc_includes="no"])
494 AC_ARG_WITH(silc-libs,
495 [ --with-silc-libs=DIR SILC Toolkit libraries [search in DIR]],
496 [ac_silc_libs="$withval"], [ac_silc_libs="no"])
498 if test -n "$with_silc_includes" || test -n "$with_silc_libs"; then
500 # Manually provided libs
501 if test "$ac_silc_includes" != "no"; then
503 SILC_LIB_INCLUDES="-I$ac_silc_includes"
505 if test "$ac_silc_libs" != "no"; then
507 LIBS="$LIBS -L$ac_silc_libs"
510 # Check libs to link against
511 f=`$EGREP __SILC_HAVE_PTHREAD $ac_silc_includes/silcincludes.h`
512 if test -n "$f"; then
513 LIBS="$LIBS -lpthread"
515 f=`$EGREP __SILC_HAVE_SIM $ac_silc_includes/silcincludes.h`
516 if test -n "$f"; then
522 PKG_CHECK_MODULES(SILC, silc, compile_libs=false, compile_libs=true)
523 PKG_CHECK_MODULES(SILCCLIENT, silcclient, compile_libs=false, compile_libs=true)
525 LIBS="$LIBS $SILC_LIBS"
526 CFLAGS="$CFLAGS $SILC_CFLAGS"
527 LIBS="$LIBS $SILCCLIENT_LIBS"
528 CFLAGS="$CFLAGS $SILCCLIENT_CFLAGS"
530 #endif SILC_DIST_TOOLKIT
532 # SOCKS4 support checking
535 SAVE_CFLAGS="$CFLAGS"
536 SAVE_LDFLAGS="$LDFLAGS"
537 AC_MSG_CHECKING(whether to support SOCKS4)
539 [[ --with-socks4[=DIR] with SOCKS4 support [search in DIR/lib and DIR/include]]],
549 if test -d "$withval/include"; then
550 CFLAGS="$CFLAGS -I$withval/include"
552 if test -d "$withval/lib"; then
553 LDFLAGS="$LDFLAGS -L$withval/lib"
565 AC_MSG_ERROR(Could not find SOCKS4 library.)
567 CFLAGS="$SAVE_CFLAGS"
568 LDFLAGS="$SAVE_LDFLAGS"
574 # SOCKS5 support checking
577 SAVE_CFLAGS="$CFLAGS"
578 SAVE_LDFLAGS="$LDFLAGS"
579 AC_MSG_CHECKING(whether to support SOCKS5)
581 [[ --with-socks5[=DIR] with SOCKS5 support [search in DIR/lib and DIR/include]]],
591 if test -d "$withval/include"; then
592 CFLAGS="$CFLAGS -I$withval/include"
594 if test -d "$withval/lib"; then
595 LDFLAGS="$LDFLAGS -L$withval/lib"
598 LIBS="-lsocks5 $LIBS"
607 AC_MSG_ERROR(Could not find SOCKS5 library.)
609 CFLAGS="$SAVE_CFLAGS"
610 LDFLAGS="$SAVE_LDFLAGS"
616 if test "x$socks" = "x4"; then
617 AC_DEFINE([SOCKS], [], [Socks])
618 CFLAGS="$CFLAGS -Dconnect=Rconnect -Dgetsockname=Rgetsockname -Dbind=Rbind -Daccept=Raccept -Dlisten=Rlisten -Dselect=Rselect"
621 if test "x$socks" = "x5"; then
622 AC_DEFINE([SOCKS], [], [Socks])
623 AC_DEFINE([SOCKS5], [], [Socks5])
624 AC_DEFINE([Rconnect], [SOCKSconnect], [Socks])
625 AC_DEFINE([Rgetsockname], [SOCKSgetsockname], [Socks])
626 AC_DEFINE([Rgetpeername], [SOCKSgetpeername], [Socks])
627 AC_DEFINE([Rbind], [SOCKSbind], [Socks])
628 AC_DEFINE([Raccept], [SOCKSaccept], [Socks])
629 AC_DEFINE([Rlisten], [SOCKSlisten], [Socks])
630 AC_DEFINE([Rselect], [SOCKSselect], [Socks])
631 AC_DEFINE([Rrecvfrom], [SOCKSrecvfrom], [Socks])
632 AC_DEFINE([Rsendto], [SOCKSsendto], [Socks])
633 AC_DEFINE([Rrecv], [SOCKSrecv], [Socks])
634 AC_DEFINE([Rsend], [SOCKSsend], [Socks])
635 AC_DEFINE([Rread], [SOCKSread], [Socks])
636 AC_DEFINE([Rwrite], [SOCKSwrite], [Socks])
637 AC_DEFINE([Rrresvport], [SOCKSrresvport], [Socks])
638 AC_DEFINE([Rshutdown], [SOCKSshutdown], [Socks])
639 AC_DEFINE([Rlisten], [SOCKSlisten], [Socks])
640 AC_DEFINE([Rclose], [SOCKSclose], [Socks])
641 AC_DEFINE([Rdup], [SOCKSdup], [Socks])
642 AC_DEFINE([Rdup2], [SOCKSdup2], [Socks])
643 AC_DEFINE([Rfclose], [SOCKSfclose], [Socks])
644 AC_DEFINE([Rgethostbyname], [SOCKSgethostbyname], [Socks])
647 #ifdef SILC_DIST_MATH
648 # MP library checking. First check whether user wants to use GMP and use
649 # it if found. If not or not defined then compile the MPI library in the
654 SAVE_CFLAGS="$CFLAGS"
655 SAVE_LDFLAGS="$LDFLAGS"
656 AC_MSG_CHECKING(whether to search for GMP)
658 [[ --with-gmp[=DIR] use GMP instead of MPI [search in DIR/lib and DIR/include]]],
667 if test -d "$withval/include"; then
668 CFLAGS="$CFLAGS -I$withval/include"
670 if test -d "$withval/lib"; then
671 LDFLAGS="$LDFLAGS -L$withval/lib"
678 AC_CHECK_LIB(gmp, __gmpz_init,
681 AC_DEFINE([SILC_MP_GMP], [], [GMP])
682 AC_MSG_RESULT(Using GMP as a MP library.)
686 CFLAGS="$SAVE_CFLAGS"
687 LDFLAGS="$SAVE_LDFLAGS"
693 AM_CONDITIONAL(SILC_MP_GMP, test x$mp_gmp = xtrue)
694 AM_CONDITIONAL(SILC_MP_NSS_MPI, test x$mp_gmp = xfalse)
695 if test x$mp_gmp = xfalse; then
696 AC_DEFINE([SILC_MP_NSS_MPI], [], [MPI])
697 AC_MSG_RESULT(Using NSS MPI as a MP library.)
699 #endif SILC_DIST_MATH
706 SAVE_CFLAGS="$CFLAGS"
707 SAVE_LDFLAGS="$LDFLAGS"
708 SAVE_CPPFLAGS="$CPPFLAGS"
709 AC_MSG_CHECKING(whether to implicit search for libiconv)
711 [[ --with-iconv[=DIR] use libiconv [search in DIR/include and DIR/lib]]],
716 AC_CHECK_HEADERS(iconv.h,
718 AC_CHECK_FUNC(iconv, has_iconv=true)
724 if test -d $withval/include; then
725 CPPFLAGS="$CPPFLAGS -I$withval/include"
726 CFLAGS="$CFLAGS -I$withval/include"
728 if test -d $withval/lib; then
729 LDFLAGS="$LDFLAGS -L$withval/lib"
736 AC_CHECK_HEADERS(iconv.h,
738 AC_CHECK_FUNCS(iconv,
746 if test x$check_iconv = xtrue; then
747 AC_MSG_RESULT(Searching for iconv...)
750 unset ac_cv_header__iconv_h_ ac_cv_header_iconv_h || true
752 AC_CHECK_HEADERS(iconv.h,
755 AC_MSG_CHECKING(for iconv in -liconv)
762 iconv_t cd = iconv_open("", "");
763 iconv(cd, NULL, NULL, NULL, NULL);
768 AC_DEFINE([HAVE_ICONV], [], [Define if you have the iconv() function.])
775 CFLAGS="$SAVE_CFLAGS"
776 LDFLAGS="$SAVE_LDFLAGS"
777 CPPFLAGS="$SAVE_CPPFLAGS"
782 if test x$check_iconv = xtrue; then
783 # search for iconv library..
785 SAVE_CFLAGS="$CFLAGS"
786 SAVE_LDFLAGS="$LDFLAGS"
787 SAVE_CPPFLAGS="$CPPFLAGS"
789 for dir in `echo "/usr/local /usr/pkg /usr/contrib"`; do
790 if test x$has_iconv = xfalse; then
791 AC_MSG_RESULT(searching in $dir...)
793 if test -d $dir/include; then
794 CPPFLAGS="$CPPFLAGS -I$dir/include"
795 CFLAGS="$CFLAGS -I$dir/include"
797 if test -d $dir/lib; then
798 LDFLAGS="$LDFLAGS -L$dir/lib"
802 unset ac_cv_header__iconv_h_ ac_cv_header_iconv_h || true
804 AC_CHECK_HEADERS(iconv.h,
807 AC_MSG_CHECKING(for iconv in -liconv)
814 iconv_t cd = iconv_open("", "");
815 iconv(cd, NULL, NULL, NULL, NULL);
821 AC_DEFINE([HAVE_ICONV], [], [Define if you have the iconv() function.])
828 CFLAGS="$SAVE_CFLAGS"
829 LDFLAGS="$SAVE_LDFLAGS"
830 CPPFLAGS="$SAVE_CPPFLAGS"
834 CFLAGS="$SAVE_CFLAGS"
835 LDFLAGS="$SAVE_LDFLAGS"
836 CPPFLAGS="$SAVE_CPPFLAGS"
842 if test x$has_iconv = xtrue; then
843 # (1) Some implementations of iconv won't convert from UTF-8 to UTF-8.
844 # (2) In glibc-2.1.2 and earlier there is a bug that messes up ob and
845 # obl when args 2 and 3 are 0 (fixed in glibc-2.1.3).
847 AC_CACHE_CHECK([whether this iconv is good enough], ac_iconv_good,
858 ob = buf, obl = sizeof(buf);
859 return ((cd = iconv_open("UTF-8", "UTF-8")) != (iconv_t)(-1) &&
860 (iconv(cd, 0, 0, &ob, &obl) ||
861 !(ob == buf && obl == sizeof(buf)) ||
876 if test x$ac_iconv_good = xno; then
877 AC_MSG_RESULT(Try using libiconv instead.)
881 # POSIX threads support
884 AC_MSG_CHECKING(whether to search for POSIX threads)
885 AC_ARG_WITH(pthreads,
886 [[ --with-pthreads[=DIR] use POSIX threads [search in DIR/include and DIR/lib]]],
893 if test -d $withval/include; then
894 CPPFLAGS="$CPPFLAGS -I$withval/include"
895 CFLAGS="$CFLAGS -I$withval/include"
897 if test -d $withval/lib; then
898 LDFLAGS="$LDFLAGS -L$withval/lib"
906 if test x$check_threads = xtrue; then
908 SAVE_CFLAGS="$CFLAGS"
909 SAVE_LDFLAGS="$LDFLAGS"
910 SAVE_CPPFLAGS="$CPPFLAGS"
913 AC_CHECK_HEADERS(pthread.h,
915 LIBS="$LIBS -lpthread"
916 AC_CHECK_LIB(pthread, pthread_attr_init, has_threads=true,
921 LIBS="$SAVE_LIBS -pthread"
922 AC_CHECK_LIB(c_r, pthread_attr_init, has_threads=true, LIBS="$SAVE_LIBS")
931 # search for pthread library..
932 for dir in `echo "/usr/local /usr/pkg /usr/contrib /usr/pkg/pthreads /usr/local/pthreads"`; do
933 if test x$has_threads = xfalse; then
934 AC_MSG_RESULT(searching in $dir...)
936 if test -d $dir/include; then
937 CPPFLAGS="$CPPFLAGS -I$dir/include"
938 CFLAGS="$CFLAGS -I$dir/include"
940 if test -d $dir/lib; then
941 LDFLAGS="$LDFLAGS -L$dir/lib"
945 unset ac_cv_header__pthread_h_ ac_cv_header_pthread_h || true
947 AC_CHECK_HEADERS(pthread.h,
949 LIBS="$LIBS -lpthread"
950 AC_CHECK_LIB(pthread, pthread_attr_init, has_threads=true,
955 CFLAGS="$SAVE_CFLAGS"
956 LDFLAGS="$SAVE_LDFLAGS"
957 CPPFLAGS="$SAVE_CPPFLAGS"
961 CFLAGS="$SAVE_CFLAGS"
962 LDFLAGS="$SAVE_LDFLAGS"
963 CPPFLAGS="$SAVE_CPPFLAGS"
973 __SILC_HAVE_PTHREAD=""
974 AM_CONDITIONAL(SILC_THREADS, test x$has_threads = xtrue)
975 if test x$has_threads = xtrue; then
976 CFLAGS="$CFLAGS -D_REENTRANT"
978 # XXX possibly incomplete
981 CFLAGS="$CFLAGS -D_THREAD_SAFE"
982 if test x"$GCC" = xyes; then
983 CFLAGS="$CFLAGS -mthreads"
987 CFLAGS="$CFLAGS -D_THREAD_SAFE"
989 *-*-sysv5uw7*) # UnixWare 7
990 if test "$GCC" != "yes"; then
991 CFLAGS="$CFLAGS -Kthread"
993 CFLAGS="$CFLAGS -pthread"
997 CFLAGS="$CFLAGS -D_POSIX4A_DRAFT10_SOURCE"
1001 AC_CHECK_FUNC(pthread_create)
1002 AC_DEFINE([SILC_HAVE_PTHREAD], [], [HAVE_PTHREAD])
1003 AC_DEFINE([SILC_THREADS], [], [HAVE_THREAD])
1004 __SILC_HAVE_PTHREAD="#define __SILC_HAVE_PTHREAD 1"
1007 # Native WIN32 compilation under cygwin
1009 AC_MSG_CHECKING(whether to compile native WIN32 code)
1011 [ --with-win32 compile native WIN32 (MinGW) code (-mno-cygwin)],
1014 AC_DEFINE([SILC_WIN32], [], [SILC_WIN32])
1016 CFLAGS="-mno-cygwin $CFLAGS"
1017 LIBS="$LIBS -lwsock32"
1022 AM_CONDITIONAL(SILC_WIN32, test x$win32_support = xtrue)
1024 # Native EPOC support (disabled by default)
1026 AM_CONDITIONAL(SILC_EPOC, test xfalse = xtrue)
1028 # Native BeOS support (disabled by default)
1030 AM_CONDITIONAL(SILC_BEOS, test xfalse = xtrue)
1032 # Native OS2 support (disabled by default)
1034 AM_CONDITIONAL(SILC_OS2, test xfalse = xtrue)
1036 #ifdef SILC_DIST_TOOLKIT
1041 AC_MSG_CHECKING(whether to compile Irssi SILC Client)
1043 [ --without-irssi compile without Irssi SILC Client],
1055 AC_MSG_CHECKING(whether to compile SILC Server)
1057 [ --without-silcd compile without SILC Server],
1066 #endif SILC_DIST_TOOLKIT
1068 #ifdef SILC_DIST_CLIENT
1069 # Irssi perl support
1072 [[ --with-perl[=yes|no|module] Build with Perl support - also specifies
1073 if it should be built into main silc binary
1074 (static, default) or as a module]])
1075 #endif SILC_DIST_CLIENT
1078 AC_MSG_CHECKING(whether to do libtoolfix)
1079 AC_ARG_WITH(libtoolfix,
1080 [ --without-libtoolfix Do not fix libtool, for package builders],
1090 AC_DEFINE_UNQUOTED([SILC_ETCDIR], "$ETCDIR", [SILC_ETCDIR])
1092 #endif SILC_DIST_COMPILER
1098 # Make enable-shared aware
1099 AM_CONDITIONAL(SILC_ENABLE_SHARED, test "$enable_shared" = yes)
1101 # Other configure scripts
1104 #ifdef SILC_DIST_TOOLKIT
1105 if test x$without_irssi = xfalse; then
1106 #endif SILC_DIST_TOOLKIT
1107 #ifdef SILC_DIST_CLIENT
1108 AC_CONFIG_SUBDIRS(irssi)
1110 #endif SILC_DIST_CLIENT
1111 #ifdef SILC_DIST_TOOLKIT
1113 #endif SILC_DIST_TOOLKIT
1115 SILC_TOP_SRCDIR=`pwd`
1117 # Included configure scripts
1118 AD_INCLUDE_CONFIGURE
1120 #ifdef SILC_DIST_COMPILER
1124 AC_SUBST(SILC_TOP_SRCDIR)
1126 AC_SUBST(SILC_LIB_INCLUDES)
1127 AC_SUBST(__SILC_HAVE_PTHREAD)
1128 AC_SUBST(__SILC_HAVE_SIM)
1129 AC_SUBST(__SILC_ENABLE_DEBUG)
1132 # Fix the libtool to support run-time configuration. This allows us
1133 # to in run-time specify when to compile shared/static libraries without
1134 # need to reconfigure the entire libtool.
1136 if test x$libtoolfix = xtrue; then
1137 ./libtoolfix $SILC_TOP_SRCDIR/ltmain.sh
1139 AM_CONDITIONAL(SILC_LIBTOOLFIX, test x$libtoolfix = xtrue)
1141 INCLUDE_DEFINES_INT="include \$(top_srcdir)/Makefile.defines_int"
1142 AC_SUBST(INCLUDE_DEFINES_INT)
1144 #endif SILC_DIST_COMPILER
1151 #ifdef SILC_DIST_DOC
1153 #endif SILC_DIST_DOC
1154 #ifdef SILC_DIST_COMPILER
1156 Makefile.defines_int
1158 includes/silcversion.h
1159 includes/silcincludes.h
1160 #endif SILC_DIST_COMPILER
1161 #ifdef SILC_DIST_APPS
1163 #endif SILC_DIST_APPS
1166 #ifdef SILC_DIST_TOOLKIT
1167 if test x$without_irssi = xfalse ; then
1168 #endif SILC_DIST_TOOLKIT
1169 #ifdef SILC_DIST_CLIENT
1171 irssi/Makefile.defines
1172 irssi/Makefile.defines_int
1174 #endif SILC_DIST_CLIENT
1175 #ifdef SILC_DIST_TOOLKIT
1177 #endif SILC_DIST_TOOLKIT
1179 #ifdef SILC_DIST_TOOLKIT
1180 if test x$without_silcd = xfalse ; then
1181 #endif SILC_DIST_TOOLKIT
1182 #ifdef SILC_DIST_SERVER
1185 doc/example_silcd.conf
1187 #endif SILC_DIST_SERVER
1188 #ifdef SILC_DIST_TOOLKIT
1190 #endif SILC_DIST_TOOLKIT
1192 #ifdef SILC_DIST_TOOLKIT
1196 win32/libsilc/Makefile
1197 win32/libsilcclient/Makefile
1199 tutorial/Makefile.defines
1200 tutorial/Makefile.defines_int
1202 #endif SILC_DIST_TOOLKIT
1206 #ifdef SILC_DIST_COMPILER
1207 s_bindir=`eval echo $bindir`;s_bindir=`eval echo $s_bindir`
1208 s_sbindir=`eval echo $sbindir`;s_sbindir=`eval echo $s_sbindir`
1209 s_mandir=`eval echo $mandir`;s_mandir=`eval echo $s_mandir`
1210 s_includedir=`eval echo $includedir`;s_includedir=`eval echo $s_includedir`
1213 echo "$PACKAGE Configuration Summary:"
1214 echo "---------------------------"
1215 echo " Target host ...................: $target"
1216 echo " Compiler ......................: $CC"
1217 echo " CFLAGS ........................: $CFLAGS"
1218 echo " CPPFLAGS ......................: $CPPFLAGS"
1219 echo " LDFLAGS .......................: $LDFLAGS"
1220 echo " LIBS ..........................: $LIBS"
1222 echo " Installation prefix ...........: $prefix"
1223 echo " bin directory .................: $s_bindir"
1224 echo " sbin directory ................: $s_sbindir"
1225 echo " etc directory .................: $ETCDIR"
1226 echo " man directory .................: $s_mandir"
1227 echo " doc directory .................: $DOCDIR"
1228 #ifdef SILC_DIST_CLIENT
1229 echo " help directory ................: $HELPDIR"
1230 #endif SILC_DIST_CLIENT
1231 #ifdef SILC_DIST_SERVER
1232 echo " logs directory ................: $LOGSDIR"
1233 #endif SILC_DIST_SERVER
1234 #ifdef SILC_DIST_SIM
1235 echo " SIM directory .................: $MODULESDIR"
1236 #endif SILC_DIST_SIM
1237 #ifdef SILC_DIST_INCLUDES
1238 echo " include directory .............: $s_includedir"
1239 #endif SILC_DIST_INCLUDES
1242 #ifdef SILC_DIST_SERVER
1244 #endif SILC_DIST_SERVER
1246 #ifdef SILC_DIST_TOOLKIT
1247 if test x$without_irssi = xtrue; then
1250 if test x$without_silcd = xtrue; then
1253 #endif SILC_DIST_TOOLKIT
1255 #ifdef SILC_DIST_CLIENT
1256 echo " Compile SILC Client ...........: $irssi"
1257 #endif SILC_DIST_CLIENT
1259 #ifdef SILC_DIST_SERVER
1260 echo " Compile SILC Server ...........: $silcd"
1261 echo " Server configuration file .....: $summary_silcd_configfile"
1262 echo " Server PID file ...............: $PIDFILE"
1263 #endif SILC_DIST_SERVER
1265 #ifdef SILC_DIST_SIM
1266 if test x$sim_support = xfalse; then
1271 echo " SIM support ...................: $sim_support"
1272 #endif SILC_DIST_SIM
1274 echo " IPv6 support ..................: $summary_ipv6"
1276 if test x$has_iconv = xfalse; then
1281 echo " Iconv support .................: $iconv_support"
1283 if test x$want_asm = xfalse; then
1288 echo " Assembler optimizations .......: $summary_asm"
1290 #ifdef SILC_DIST_MATH
1292 if test x$mp_gmp = xtrue; then
1295 echo " Arithmetic library ............: $mp"
1296 #endif SILC_DIST_MATH
1299 if test x$has_threads = xtrue; then
1302 echo " Multi-threads support .........: $threads"
1303 echo " Debugging enabled .............: $summary_debug"
1305 echo "Compile the sources with 'make' or 'gmake' command."
1306 #endif SILC_DIST_COMPILER