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.
18 AC_INIT(includes/silcversion.h)
20 # Put here any platform specific stuff
35 # ./prepare script will automatically put the correct version. Do not edit!
37 AM_INIT_AUTOMAKE(SILC_PACKAGE, SILC_VERSION)
39 AC_CONFIG_HEADERS(includes/silcdefs.h)
50 ## Distribution definition. ./prepare will automatically add here a correct
51 ## value. Do not edit!
53 silc_dist=SILC_PACKAGE
54 SILC_DIST_SUBDIRS="SILC_DISTRIBUTION_SUBDIRS"
55 AC_DEFINE(SILC_DIST_DEFINE)
59 ## Library versioning.
61 # Do the releases and library versioning according to following rules:
63 # - If any code has changed in library, increment [LIB]_REVISION
64 # - If functions were added, set [LIB]_REVISION to 0
65 # - If functions were added, removed or changed, increment [LIB]_CURRENT
66 # - If functions were added, increment [LIB]_AGE
67 # - If functions were removed, set [LIB]_AGE to 0
69 # where [LIB] is LIBSILC and LIBSILCCLIENT, and where "functions" means
70 # functions public interfaces.
72 # The LIB_BASE_VERSION defines the SILC software major.minor version and
73 # it is increment only when these version numbers actually change.
76 # Base version for libraries. Do not change this unless SILC version
85 # libsilcclient versions
86 LIBSILCCLIENT_CURRENT=3
87 LIBSILCCLIENT_REVISION=0
90 # Substitute the version numbers
91 AC_SUBST(LIB_BASE_VERSION)
92 AC_SUBST(LIBSILC_CURRENT)
93 AC_SUBST(LIBSILC_REVISION)
95 AC_SUBST(LIBSILCCLIENT_CURRENT)
96 AC_SUBST(LIBSILCCLIENT_REVISION)
97 AC_SUBST(LIBSILCCLIENT_AGE)
107 AC_PATH_PROG(sedpath, sed)
115 # More header checking
117 AC_CHECK_HEADERS(unistd.h string.h getopt.h errno.h fcntl.h assert.h)
118 AC_CHECK_HEADERS(sys/types.h sys/stat.h sys/time.h stddef.h)
119 AC_CHECK_HEADERS(netinet/in.h netinet/tcp.h xti.h netdb.h)
120 AC_CHECK_HEADERS(pwd.h grp.h termcap.h paths.h)
121 AC_CHECK_HEADERS(ncurses.h signal.h ctype.h utime.h)
122 AC_CHECK_HEADERS(arpa/inet.h sys/mman.h limits.h termios.h locale.h langinfo.h)
132 AC_CHECK_SIZEOF(long long, 0)
133 AC_SUBST(SILC_SIZEOF_LONG_LONG, $ac_cv_sizeof_long_long)
134 AC_CHECK_SIZEOF(long, 0)
135 AC_SUBST(SILC_SIZEOF_LONG, $ac_cv_sizeof_long)
136 AC_CHECK_SIZEOF(int, 0)
137 AC_SUBST(SILC_SIZEOF_INT, $ac_cv_sizeof_int)
138 AC_CHECK_SIZEOF(short, 0)
139 AC_SUBST(SILC_SIZEOF_SHORT, $ac_cv_sizeof_short)
140 AC_CHECK_SIZEOF(char, 0)
141 AC_SUBST(SILC_SIZEOF_CHAR, $ac_cv_sizeof_char)
142 AC_CHECK_SIZEOF(void *, 0)
143 AC_SUBST(SILC_SIZEOF_VOID_P, $ac_cv_sizeof_void_p)
145 # Function and library checking
147 AC_CHECK_FUNC(gethostbyname, [],
149 AC_CHECK_LIB(nsl, gethostbyname, LIBS="$LIBS -lnsl")
150 AC_CHECK_FUNC(res_gethostbyname, [],
151 AC_CHECK_LIB(resolv, res_gethostbyname, LIBS="$LIBS -lresolv")
154 AC_CHECK_FUNC(socket, [],
155 AC_CHECK_LIB(socket, socket, LIBS="$LIBS -lsocket")
157 AC_CHECK_FUNCS(gethostname gethostbyaddr getservbyname getservbyport)
158 AC_CHECK_FUNCS(select listen bind shutdown close connect setsockopt)
159 AC_CHECK_FUNCS(time ctime utime gettimeofday)
160 AC_CHECK_FUNCS(chmod fcntl stat fstat getenv putenv strerror)
161 AC_CHECK_FUNCS(getpid getgid getsid getpgid getpgrp getuid)
162 AC_CHECK_FUNCS(setgroups initgroups nl_langinfo)
163 AC_CHECK_FUNCS(strchr strstr strcpy strncpy memcpy memset memmove)
165 # SIM support checking
166 # XXX These needs to be changed as more supported platforms appear.
167 # XXX This probably needs to be made platform dependant check.
170 AC_MSG_CHECKING(for SIM support)
172 AC_CHECK_HEADERS(dlfcn.h,
174 AC_CHECK_LIB(dl, dlopen,
181 AC_CHECK_LIB(c, dlopen,
190 AM_CONDITIONAL(SILC_SIM, test x$sim_support = xtrue)
191 if test x$sim_support = xtrue; then
192 AC_MSG_RESULT(Enabled SIM support.)
193 __SILC_HAVE_SIM="#define __SILC_HAVE_SIM 1"
195 AC_MSG_RESULT(No SIM support found.)
198 # lib/contrib conditionals
200 AC_CHECK_HEADER(regex.h,
202 AC_DEFINE(HAVE_REGEX)
206 AM_CONDITIONAL(HAVE_REGEX, test x$have_regex = x1)
208 AC_CHECK_FUNC(getopt_long,
210 AC_DEFINE(HAVE_GETOPT_LONG)
212 ], have_getopt_long=0
214 AM_CONDITIONAL(HAVE_GETOPT_LONG, test x$have_getopt_long = x1)
217 ## Enable/disable checking
222 AC_MSG_CHECKING(whether to enable IPv6 support)
224 [ --enable-ipv6 enable IPv6 support],
226 case "${enableval}" in
245 if test x$check_ipv6 = xtrue; then
249 #ifdef HAVE_SYS_TYPES_H
250 #include <sys/types.h>
252 #ifdef HAVE_NETINET_TCP_H
253 #include <netinet/tcp.h>
258 #include <sys/socket.h>
259 #ifdef HAVE_NETINET_IN_H
260 #include <netinet/in.h>
264 struct sockaddr_in6 sin6;
265 int family = AF_INET6;
278 AC_MSG_CHECKING(whether to enable debugging)
280 __SILC_ENABLE_DEBUG=""
282 [ --enable-debug enable debugging],
284 case "${enableval}" in
287 AC_DEFINE(SILC_DEBUG)
289 __SILC_ENABLE_DEBUG="#define __SILC_ENABLE_DEBUG 1"
300 # Stack trace checking
302 AC_MSG_CHECKING(whether to enable stack tracing)
303 summary_stacktrace="no"
304 AC_ARG_ENABLE(stack-trace,
305 [ --enable-stack-trace enable memory stack trace],
307 case "${enableval}" in
310 AC_DEFINE(SILC_STACKTRACE)
311 summary_stacktrace="yes"
321 # Disable all assembler optimizations
323 AC_MSG_CHECKING(whether to enable assembler optimizations)
326 [ --disable-asm do not use assembler optimizations],
338 ## Compiler and compiler flag checks
341 # Function to check if compiler flag works
342 # Usage: SILC_ADD_CFLAGS(FLAGS, [ACTION-IF-FAILED])
343 AC_DEFUN([SILC_ADD_CFLAGS],
344 [ tmp_CFLAGS="$CFLAGS"
346 AC_MSG_CHECKING(whether $CC accepts $1 flag)
347 AC_TRY_LINK([], [], [AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no)
354 # GCC specific options
355 if test "x$summary_debug" = "xyes"; then
356 SILC_ADD_CFLAGS(-g -O)
358 SILC_ADD_CFLAGS(-g -O2)
360 SILC_ADD_CFLAGS(-Wall -finline-functions)
365 SILC_ADD_CFLAGS(-g3 -O2, SILC_ADD_CFLAGS(-g3 -O, SILC_ADD_CFLAGS(-O)))
369 SILC_ADD_CFLAGS(-O2, SILC_ADD_CFLAGS(-O))
373 # Intel C++ Compiler needs -restrict
374 if test "x$CC" = "xicc"; then
375 SILC_ADD_CFLAGS(-restrict)
380 # Workaround a bug in GCC 2.x which causes memory exhaustion
381 # when compiling sha1 with optimizations on UltraSPARC.
384 if test "$GCC" -a "$host_cpu" = "sparc64"; then
385 AC_MSG_CHECKING(whether to enable GCC 2.x workaround for SHA1)
388 #if defined(__sparc64__) && (__GNUC__ == 2)
407 # Default installation destination
409 AC_PREFIX_DEFAULT(/usr/local/silc)
410 if test "x$prefix" != xNONE; then
411 silc_prefix="$prefix"
413 silc_prefix="$ac_default_prefix"
418 if test "x$sysconfdir" != 'x${prefix}/etc'; then
421 ETCDIR="$silc_prefix/etc"
425 [[ --with-etcdir=DIR directory for system files [/etc/silc]]],
436 AC_DEFINE_UNQUOTED(SILC_ETCDIR, "$ETCDIR")
440 HELPDIR="$silc_prefix/help"
442 [[ --with-helpdir=DIR directory for SILC help files [PREFIX/help]]],
453 AC_DEFINE_UNQUOTED(SILC_HELPDIR, "$HELPDIR")
457 DOCDIR="$silc_prefix/doc"
459 [[ --with-docdir=DIR directory for SILC documentation [PREFIX/doc]]],
470 AC_DEFINE_UNQUOTED(SILC_DOCDIR, "$DOCDIR")
472 # SIM modules directory
474 MODULESDIR="$silc_prefix/modules"
476 [[ --with-simdir=DIR directory for SIM modules [PREFIX/modules]]],
482 MODULESDIR="$withval"
487 AC_DEFINE_UNQUOTED(SILC_MODULESDIR, "$MODULESDIR")
491 LOGSDIR="$silc_prefix/logs"
493 [[ --with-logsdir=DIR directory for SILC Server logs [PREFIX/logs]]],
504 AC_DEFINE_UNQUOTED(SILC_LOGSDIR, "$LOGSDIR")
506 # silcd config file checking
508 summary_silcd_configfile="/etc/silc/silcd.conf"
509 AC_ARG_WITH(silcd-config-file,
510 [[ --with-silcd-config-file=FILE use FILE as default configuration file
511 for SILC Server [/etc/silc/silcd.conf]]],
512 AC_DEFINE_UNQUOTED(SILC_SERVER_CONFIG_FILE, "$withval")
513 summary_silcd_configfile="$withval"
516 # silcd pid file checking
518 if test "x$localstatedir" != 'x${prefix}/var'; then
519 PIDFILE="$localstatedir/silcd.pid"
521 PIDFILE="$silc_prefix/var/silcd.pid"
524 AC_ARG_WITH(silcd-pid-file,
525 [[ --with-silcd-pid-file=FILE use FILE as default pid file for SILC
526 Server [/var/run/silcd.pid]]],
540 ## With/without checkings
543 # SOCKS4 support checking
546 SAVE_CFLAGS="$CFLAGS"
547 SAVE_LDFLAGS="$LDFLAGS"
548 AC_MSG_CHECKING(whether to support SOCKS4)
550 [[ --with-socks4[=DIR] with SOCKS4 support [search in DIR/lib and DIR/include]]],
560 if test -d "$withval/include"; then
561 CFLAGS="$CFLAGS -I$withval/include"
563 if test -d "$withval/lib"; then
564 LDFLAGS="$LDFLAGS -L$withval/lib"
576 AC_MSG_ERROR(Could not find SOCKS4 library.)
578 CFLAGS="$SAVE_CFLAGS"
579 LDFLAGS="$SAVE_LDFLAGS"
585 # SOCKS5 support checking
588 SAVE_CFLAGS="$CFLAGS"
589 SAVE_LDFLAGS="$LDFLAGS"
590 AC_MSG_CHECKING(whether to support SOCKS5)
592 [[ --with-socks5[=DIR] with SOCKS5 support [search in DIR/lib and DIR/include]]],
602 if test -d "$withval/include"; then
603 CFLAGS="$CFLAGS -I$withval/include"
605 if test -d "$withval/lib"; then
606 LDFLAGS="$LDFLAGS -L$withval/lib"
609 LIBS="-lsocks5 $LIBS"
618 AC_MSG_ERROR(Could not find SOCKS5 library.)
620 CFLAGS="$SAVE_CFLAGS"
621 LDFLAGS="$SAVE_LDFLAGS"
627 if test "x$socks" = "x4"; then
629 CFLAGS="$CFLAGS -Dconnect=Rconnect -Dgetsockname=Rgetsockname -Dbind=Rbind -Daccept=Raccept -Dlisten=Rlisten -Dselect=Rselect"
632 if test "x$socks" = "x5"; then
635 AC_DEFINE(Rconnect, SOCKSconnect)
636 AC_DEFINE(Rgetsockname, SOCKSgetsockname)
637 AC_DEFINE(Rgetpeername, SOCKSgetpeername)
638 AC_DEFINE(Rbind, SOCKSbind)
639 AC_DEFINE(Raccept, SOCKSaccept)
640 AC_DEFINE(Rlisten, SOCKSlisten)
641 AC_DEFINE(Rselect, SOCKSselect)
642 AC_DEFINE(Rrecvfrom, SOCKSrecvfrom)
643 AC_DEFINE(Rsendto, SOCKSsendto)
644 AC_DEFINE(Rrecv, SOCKSrecv)
645 AC_DEFINE(Rsend, SOCKSsend)
646 AC_DEFINE(Rread, SOCKSread)
647 AC_DEFINE(Rwrite, SOCKSwrite)
648 AC_DEFINE(Rrresvport, SOCKSrresvport)
649 AC_DEFINE(Rshutdown, SOCKSshutdown)
650 AC_DEFINE(Rlisten, SOCKSlisten)
651 AC_DEFINE(Rclose, SOCKSclose)
652 AC_DEFINE(Rdup, SOCKSdup)
653 AC_DEFINE(Rdup2, SOCKSdup2)
654 AC_DEFINE(Rfclose, SOCKSfclose)
655 AC_DEFINE(Rgethostbyname, SOCKSgethostbyname)
658 # MP library checking. First check whether user wants to use GMP and use
659 # it if found. If not or not defined then compile the MPI library in the
664 SAVE_CFLAGS="$CFLAGS"
665 SAVE_LDFLAGS="$LDFLAGS"
666 AC_MSG_CHECKING(whether to search for GMP)
668 [[ --with-gmp[=DIR] use GMP instead of MPI [search in DIR/lib and DIR/include]]],
677 if test -d "$withval/include"; then
678 CFLAGS="$CFLAGS -I$withval/include"
680 if test -d "$withval/lib"; then
681 LDFLAGS="$LDFLAGS -L$withval/lib"
688 AC_CHECK_LIB(gmp, __gmpz_init,
691 AC_DEFINE(SILC_MP_GMP)
692 AC_MSG_RESULT(Using GMP as a MP library.)
696 CFLAGS="$SAVE_CFLAGS"
697 LDFLAGS="$SAVE_LDFLAGS"
703 AM_CONDITIONAL(SILC_MP_GMP, test x$mp_gmp = xtrue)
704 AM_CONDITIONAL(SILC_MP_NSS_MPI, test x$mp_gmp = xfalse)
705 if test x$mp_gmp = xfalse; then
706 AC_DEFINE(SILC_MP_NSS_MPI)
707 AC_MSG_RESULT(Using NSS MPI as a MP library.)
710 # GNU Libidn (for stringprep) support
715 SAVE_CFLAGS="$CFLAGS"
716 SAVE_LDFLAGS="$LDFLAGS"
717 SAVE_CPPFLAGS="$CPPFLAGS"
718 AC_MSG_CHECKING(whether to implicit search for libidn)
720 [[ --with-libidn[=DIR] use libidn [search in DIR/include and DIR/lib]]],
725 AC_CHECK_HEADERS(stringprep.h,
727 AC_CHECK_FUNC(stringprep, has_libidn=true)
733 if test -d $withval/include; then
734 CPPFLAGS="$CPPFLAGS -I$withval/include"
735 CFLAGS="$CFLAGS -I$withval/include"
737 if test -d $withval/lib; then
738 LDFLAGS="$LDFLAGS -L$withval/lib"
745 AC_CHECK_HEADERS(stringprep.h,
747 AC_CHECK_FUNCS(stringprep,
755 if test x$check_libidn = xtrue; then
756 AC_MSG_RESULT(Searching for libidn...)
758 AC_CHECK_HEADERS(stringprep.h,
761 AC_MSG_CHECKING(for stringprep in -lidn)
765 #include <stringprep.h>
768 (void)stringprep_locale_charset();
772 AC_DEFINE(HAVE_LIBIDN, 1, [Define if you have the stringprep() function.])
779 CFLAGS="$SAVE_CFLAGS"
780 LDFLAGS="$SAVE_LDFLAGS"
781 CPPFLAGS="$SAVE_CPPFLAGS"
786 if test x$check_libidn = xtrue; then
787 # search for idn library..
789 SAVE_CFLAGS="$CFLAGS"
790 SAVE_LDFLAGS="$LDFLAGS"
791 SAVE_CPPFLAGS="$CPPFLAGS"
793 for dir in `echo "/usr/local /usr/pkg /usr/contrib"`; do
794 if test x$has_libidn = xfalse; then
795 AC_MSG_RESULT(searching in $dir...)
797 if test -d $dir/include; then
798 CPPFLAGS="$CPPFLAGS -I$dir/include"
799 CFLAGS="$CFLAGS -I$dir/include"
801 if test -d $dir/lib; then
802 LDFLAGS="$LDFLAGS -L$dir/lib"
806 unset ac_cv_header__stringprep_h_ ac_cv_header_stringprep_h || true
808 AC_CHECK_HEADERS(stringprep.h,
811 AC_MSG_CHECKING(for stringprep in -lidn)
815 #include <stringprep.h>
818 (void)stringprep_locale_charset();
823 AC_DEFINE(HAVE_LIBIDN, 1, [Define if you have the stringprep() function.])
830 CFLAGS="$SAVE_CFLAGS"
831 LDFLAGS="$SAVE_LDFLAGS"
832 CPPFLAGS="$SAVE_CPPFLAGS"
836 CFLAGS="$SAVE_CFLAGS"
837 LDFLAGS="$SAVE_LDFLAGS"
838 CPPFLAGS="$SAVE_CPPFLAGS"
844 __SILC_HAVE_LIBIDN=""
845 if test x$has_libidn = xtrue; then
846 __SILC_HAVE_LIBIDN="#define __SILC_HAVE_LIBIDN 1"
854 SAVE_CFLAGS="$CFLAGS"
855 SAVE_LDFLAGS="$LDFLAGS"
856 SAVE_CPPFLAGS="$CPPFLAGS"
857 AC_MSG_CHECKING(whether to implicit search for libiconv)
859 [[ --with-iconv[=DIR] use libiconv [search in DIR/include and DIR/lib]]],
864 AC_CHECK_HEADERS(iconv.h,
866 AC_CHECK_FUNC(iconv, has_iconv=true)
872 if test -d $withval/include; then
873 CPPFLAGS="$CPPFLAGS -I$withval/include"
874 CFLAGS="$CFLAGS -I$withval/include"
876 if test -d $withval/lib; then
877 LDFLAGS="$LDFLAGS -L$withval/lib"
884 AC_CHECK_HEADERS(iconv.h,
886 AC_CHECK_FUNCS(iconv,
894 if test x$check_iconv = xtrue; then
895 AC_MSG_RESULT(Searching for iconv...)
898 unset ac_cv_header__iconv_h_ ac_cv_header_iconv_h || true
900 AC_CHECK_HEADERS(iconv.h,
903 AC_MSG_CHECKING(for iconv in -liconv)
910 iconv_t cd = iconv_open("", "");
911 iconv(cd, NULL, NULL, NULL, NULL);
916 AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.])
923 CFLAGS="$SAVE_CFLAGS"
924 LDFLAGS="$SAVE_LDFLAGS"
925 CPPFLAGS="$SAVE_CPPFLAGS"
930 if test x$check_iconv = xtrue; then
931 # search for iconv library..
933 SAVE_CFLAGS="$CFLAGS"
934 SAVE_LDFLAGS="$LDFLAGS"
935 SAVE_CPPFLAGS="$CPPFLAGS"
937 for dir in `echo "/usr/local /usr/pkg /usr/contrib"`; do
938 if test x$has_iconv = xfalse; then
939 AC_MSG_RESULT(searching in $dir...)
941 if test -d $dir/include; then
942 CPPFLAGS="$CPPFLAGS -I$dir/include"
943 CFLAGS="$CFLAGS -I$dir/include"
945 if test -d $dir/lib; then
946 LDFLAGS="$LDFLAGS -L$dir/lib"
950 unset ac_cv_header__iconv_h_ ac_cv_header_iconv_h || true
952 AC_CHECK_HEADERS(iconv.h,
955 AC_MSG_CHECKING(for iconv in -liconv)
962 iconv_t cd = iconv_open("", "");
963 iconv(cd, NULL, NULL, NULL, NULL);
969 AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.])
976 CFLAGS="$SAVE_CFLAGS"
977 LDFLAGS="$SAVE_LDFLAGS"
978 CPPFLAGS="$SAVE_CPPFLAGS"
982 CFLAGS="$SAVE_CFLAGS"
983 LDFLAGS="$SAVE_LDFLAGS"
984 CPPFLAGS="$SAVE_CPPFLAGS"
990 if test x$has_iconv = xtrue; then
991 # (1) Some implementations of iconv won't convert from UTF-8 to UTF-8.
992 # (2) In glibc-2.1.2 and earlier there is a bug that messes up ob and
993 # obl when args 2 and 3 are 0 (fixed in glibc-2.1.3).
995 AC_CACHE_CHECK([whether this iconv is good enough], ac_iconv_good,
1003 changequote([, ])dnl
1006 ob = buf, obl = sizeof(buf);
1007 return ((cd = iconv_open("UTF-8", "UTF-8")) != (iconv_t)(-1) &&
1008 (iconv(cd, 0, 0, &ob, &obl) ||
1009 !(ob == buf && obl == sizeof(buf)) ||
1024 if test x$ac_iconv_good = xno; then
1025 AC_MSG_RESULT(Try using libiconv instead.)
1030 # POSIX threads support
1033 AC_MSG_CHECKING(whether to search for POSIX threads)
1034 AC_ARG_WITH(pthreads,
1035 [[ --with-pthreads[=DIR] use POSIX threads [search in DIR/include and DIR/lib]]],
1037 case "${withval}" in
1042 if test -d $withval/include; then
1043 CPPFLAGS="$CPPFLAGS -I$withval/include"
1044 CFLAGS="$CFLAGS -I$withval/include"
1046 if test -d $withval/lib; then
1047 LDFLAGS="$LDFLAGS -L$withval/lib"
1055 if test x$check_threads = xtrue; then
1057 SAVE_CFLAGS="$CFLAGS"
1058 SAVE_LDFLAGS="$LDFLAGS"
1059 SAVE_CPPFLAGS="$CPPFLAGS"
1062 AC_CHECK_HEADERS(pthread.h,
1064 LIBS="$LIBS -lpthread"
1065 AC_CHECK_LIB(pthread, pthread_attr_init, has_threads=true,
1070 LIBS="$SAVE_LIBS -pthread"
1071 AC_CHECK_LIB(c_r, pthread_attr_init, has_threads=true, LIBS="$SAVE_LIBS")
1080 # search for pthread library..
1081 for dir in `echo "/usr/local /usr/pkg /usr/contrib /usr/pkg/pthreads /usr/local/pthreads"`; do
1082 if test x$has_threads = xfalse; then
1083 AC_MSG_RESULT(searching in $dir...)
1085 if test -d $dir/include; then
1086 CPPFLAGS="$CPPFLAGS -I$dir/include"
1087 CFLAGS="$CFLAGS -I$dir/include"
1089 if test -d $dir/lib; then
1090 LDFLAGS="$LDFLAGS -L$dir/lib"
1094 unset ac_cv_header__pthread_h_ ac_cv_header_pthread_h || true
1096 AC_CHECK_HEADERS(pthread.h,
1098 LIBS="$LIBS -lpthread"
1099 AC_CHECK_LIB(pthread, pthread_attr_init, has_threads=true,
1104 CFLAGS="$SAVE_CFLAGS"
1105 LDFLAGS="$SAVE_LDFLAGS"
1106 CPPFLAGS="$SAVE_CPPFLAGS"
1110 CFLAGS="$SAVE_CFLAGS"
1111 LDFLAGS="$SAVE_LDFLAGS"
1112 CPPFLAGS="$SAVE_CPPFLAGS"
1122 __SILC_HAVE_PTHREAD=""
1123 AM_CONDITIONAL(SILC_THREADS, test x$has_threads = xtrue)
1124 if test x$has_threads = xtrue; then
1125 CFLAGS="$CFLAGS -D_REENTRANT"
1127 # XXX possibly incomplete
1130 CFLAGS="$CFLAGS -D_THREAD_SAFE"
1131 if test x"$GCC" = xyes; then
1132 CFLAGS="$CFLAGS -mthreads"
1136 CFLAGS="$CFLAGS -D_THREAD_SAFE"
1138 *-*-sysv5uw7*) # UnixWare 7
1139 if test "$GCC" != "yes"; then
1140 CFLAGS="$CFLAGS -Kthread"
1142 CFLAGS="$CFLAGS -pthread"
1146 CFLAGS="$CFLAGS -D_POSIX4A_DRAFT10_SOURCE"
1150 AC_CHECK_FUNC(pthread_create)
1151 AC_DEFINE(SILC_HAVE_PTHREAD)
1152 AC_DEFINE(SILC_THREADS)
1153 __SILC_HAVE_PTHREAD="#define __SILC_HAVE_PTHEAD 1"
1156 # Native WIN32 compilation under cygwin
1158 AC_MSG_CHECKING(whether to compile native WIN32 code)
1160 [ --with-win32 compile native WIN32 (MinGW) code (-mno-cygwin)],
1163 AC_DEFINE(SILC_WIN32)
1165 CFLAGS="-mno-cygwin $CFLAGS"
1166 LIBS="$LIBS -lwsock32"
1171 AM_CONDITIONAL(SILC_WIN32, test x$win32_support = xtrue)
1173 # Native EPOC support (disabled by default)
1175 AM_CONDITIONAL(SILC_EPOC, test xfalse = xtrue)
1177 # Native BeOS support (disabled by default)
1179 AM_CONDITIONAL(SILC_BEOS, test xfalse = xtrue)
1181 # Native OS2 support (disabled by default)
1183 AM_CONDITIONAL(SILC_OS2, test xfalse = xtrue)
1188 AC_MSG_CHECKING(whether to compile Irssi SILC Client)
1190 [ --without-irssi compile without Irssi SILC Client],
1194 SILC_DIST_SUBDIRS=`echo $SILC_DIST_SUBDIRS | $sedpath -e 's/irssi//'`
1203 AC_MSG_CHECKING(whether to compile SILC Server)
1205 [ --without-silcd compile without SILC Server],
1209 SILC_DIST_SUBDIRS=`echo $SILC_DIST_SUBDIRS | $sedpath -e 's/silcd//'`
1215 # Irssi perl support
1218 [[ --with-perl[=yes|no|module] Build with Perl support - also specifies
1219 if it should be built into main silc binary
1220 (static, default) or as a module]])
1223 AC_MSG_CHECKING(whether to do libtoolfix)
1224 AC_ARG_WITH(libtoolfix,
1225 [ --without-libtoolfix Do not fix libtool, for package builders],
1235 AC_DEFINE_UNQUOTED(SILC_ETCDIR, "$ETCDIR")
1243 # Other configure scripts
1245 if test x$without_irssi = xfalse; then
1246 if test "x$silc_dist" = "xsilc-client" ||
1247 test "x$silc_dist" = "xsilc-toolkit"; then
1248 AC_CONFIG_SUBDIRS(irssi)
1252 SILC_TOP_SRCDIR=`pwd`
1253 AC_SUBST(SILC_TOP_SRCDIR)
1254 #SILC_INSTALL_PREFIX=$ac_default_prefix
1255 #AC_SUBST(SILC_INSTALL_PREFIX)
1257 INCLUDE_DEFINES_INT="include \$(top_srcdir)/Makefile.defines_int"
1258 AC_SUBST(INCLUDE_DEFINES_INT)
1259 AC_SUBST(SILC_DIST_SUBDIRS)
1262 # Fix the libtool to support run-time configuration. This allows us
1263 # to in run-time specify when to compile shared/static libraries without
1264 # need to reconfigure the entire libtool.
1266 if test x$libtoolfix = xtrue; then
1267 ./libtoolfix $SILC_TOP_SRCDIR/ltmain.sh
1269 AM_CONDITIONAL(SILC_LIBTOOLFIX, test x$libtoolfix = xtrue)
1271 # Included configure scripts
1272 AD_INCLUDE_CONFIGURE
1274 AC_SUBST(__SILC_HAVE_PTHREAD)
1275 AC_SUBST(__SILC_HAVE_SIM)
1276 AC_SUBST(__SILC_HAVE_LIBIDN)
1277 AC_SUBST(__SILC_ENABLE_DEBUG)
1285 Makefile.defines_int
1289 lib/contrib/Makefile
1290 lib/silccore/Makefile
1291 lib/silccore/tests/Makefile
1292 lib/silccrypt/Makefile
1293 lib/silccrypt/tests/Makefile
1294 lib/silcsim/Makefile
1295 lib/silcske/Makefile
1296 lib/silcutil/Makefile
1297 lib/silcutil/unix/Makefile
1298 lib/silcutil/win32/Makefile
1299 lib/silcutil/beos/Makefile
1300 lib/silcutil/os2/Makefile
1301 lib/silcutil/epoc/Makefile
1302 lib/silcutil/tests/Makefile
1303 lib/silcmath/Makefile
1304 lib/silcsftp/Makefile
1305 lib/silcsftp/tests/Makefile
1306 doc/example_silcd.conf
1307 includes/silcincludes.h
1310 if test "x$silc_dist" = "xsilc-client" ||
1311 test "x$silc_dist" = "xsilc-toolkit"; then
1312 AC_CONFIG_FILES(lib/silcclient/Makefile)
1315 if test x$without_irssi = xfalse ; then
1316 if test "x$silc_dist" = "xsilc-client" ||
1317 test "x$silc_dist" = "xsilc-toolkit"; then
1319 irssi/Makefile.defines
1320 irssi/Makefile.defines_int
1325 if test x$without_silcd = xfalse ; then
1326 if test "x$silc_dist" = "xsilc-server" ||
1327 test "x$silc_dist" = "xsilc-toolkit"; then
1334 if test "x$silc_dist" = "xsilc-toolkit"; then
1338 win32/libsilc/Makefile
1339 win32/libsilcclient/Makefile
1341 tutorial/Makefile.defines
1342 tutorial/Makefile.defines_int
1348 s_bindir=`eval echo $bindir`;s_bindir=`eval echo $s_bindir`
1349 s_sbindir=`eval echo $sbindir`;s_sbindir=`eval echo $s_sbindir`
1350 s_mandir=`eval echo $mandir`;s_mandir=`eval echo $s_mandir`
1351 s_includedir=`eval echo $includedir`;s_includedir=`eval echo $s_includedir`
1354 echo "SILC Configuration Summary:"
1355 echo "---------------------------"
1356 echo " Target host ...................: $target"
1357 echo " Compiler ......................: $CC"
1358 echo " CFLAGS ........................: $CFLAGS"
1359 echo " CPPFLAGS ......................: $CPPFLAGS"
1360 echo " LDFLAGS .......................: $LDFLAGS"
1361 echo " LIBS ..........................: $LIBS"
1363 echo " Installation prefix ...........: $prefix"
1364 echo " bin directory .................: $s_bindir"
1365 echo " sbin directory ................: $s_sbindir"
1366 echo " etc directory .................: $ETCDIR"
1367 echo " man directory .................: $s_mandir"
1368 echo " help directory ................: $HELPDIR"
1369 echo " doc directory .................: $DOCDIR"
1370 echo " logs directory ................: $LOGSDIR"
1371 echo " SIM directory .................: $MODULESDIR"
1372 echo " include directory .............: $s_includedir"
1375 if test "x$silc_dist" = "xsilc-client" ||
1376 test "x$silc_dist" = "xsilc-toolkit"; then
1378 if test x$without_irssi = xtrue; then
1381 echo " Compile SILC Client ...........: $irssi"
1384 if test "x$silc_dist" = "xsilc-server" ||
1385 test "x$silc_dist" = "xsilc-toolkit"; then
1387 if test x$without_silcd = xtrue; then
1390 echo " Compile SILC Server ...........: $silcd"
1391 echo " Server configuration file .....: $summary_silcd_configfile"
1392 echo " Server PID file ...............: $PIDFILE"
1395 if test x$sim_support = xfalse; then
1400 if test x$has_iconv = xfalse; then
1405 if test x$has_libidn = xfalse; then
1408 libidn_support="yes"
1410 echo " SIM support ...................: $sim_support"
1411 echo " IPv6 support ..................: $summary_ipv6"
1412 echo " Iconv support .................: $iconv_support"
1413 echo " Idn support ...................: $libidn_support"
1414 if test x$want_asm = xfalse; then
1419 echo " Assembler optimizations .......: $summary_asm"
1422 if test x$mp_gmp = xtrue; then
1425 echo " Arithmetic library ............: $mp"
1428 if test x$has_threads = xtrue; then
1431 echo " Multi-threads support .........: $threads"
1432 echo " Debugging enabled .............: $summary_debug"
1433 echo " Stack-trace enabled ...........: $summary_stacktrace"
1435 if test "x$silc_dist" = "xsilc-client"; then
1436 echo "Compile the sources with 'make' or 'gmake' command (GNU make is required)."
1438 echo "Compile the sources with 'make' or 'gmake' command."