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)
57 __SILC_HAVE_PTHREAD=""
60 __SILC_ENABLE_DEBUG=""
70 AC_PATH_PROG(sedpath, sed)
78 # More header checking
80 AC_CHECK_HEADERS(unistd.h string.h getopt.h errno.h fcntl.h assert.h)
81 AC_CHECK_HEADERS(sys/types.h sys/stat.h sys/time.h stddef.h)
82 AC_CHECK_HEADERS(netinet/in.h netinet/tcp.h xti.h netdb.h sys/resource.h)
83 AC_CHECK_HEADERS(pwd.h grp.h termcap.h paths.h)
84 AC_CHECK_HEADERS(ncurses.h signal.h ctype.h utime.h)
85 AC_CHECK_HEADERS(arpa/inet.h sys/mman.h limits.h termios.h locale.h langinfo.h)
95 AC_CHECK_SIZEOF(long long, 0)
96 AC_SUBST(SILC_SIZEOF_LONG_LONG, $ac_cv_sizeof_long_long)
97 AC_CHECK_SIZEOF(long, 0)
98 AC_SUBST(SILC_SIZEOF_LONG, $ac_cv_sizeof_long)
99 AC_CHECK_SIZEOF(int, 0)
100 AC_SUBST(SILC_SIZEOF_INT, $ac_cv_sizeof_int)
101 AC_CHECK_SIZEOF(short, 0)
102 AC_SUBST(SILC_SIZEOF_SHORT, $ac_cv_sizeof_short)
103 AC_CHECK_SIZEOF(char, 0)
104 AC_SUBST(SILC_SIZEOF_CHAR, $ac_cv_sizeof_char)
105 AC_CHECK_SIZEOF(void *, 0)
106 AC_SUBST(SILC_SIZEOF_VOID_P, $ac_cv_sizeof_void_p)
108 # Function and library checking
110 AC_CHECK_FUNC(gethostbyname, [],
112 AC_CHECK_LIB(nsl, gethostbyname, LIBS="$LIBS -lnsl")
113 AC_CHECK_FUNC(res_gethostbyname, [],
114 AC_CHECK_LIB(resolv, res_gethostbyname, LIBS="$LIBS -lresolv")
117 AC_CHECK_FUNC(socket, [],
118 AC_CHECK_LIB(socket, socket, LIBS="$LIBS -lsocket")
120 AC_CHECK_FUNCS(gethostname gethostbyaddr getservbyname getservbyport)
121 AC_CHECK_FUNCS(select listen bind shutdown close connect setsockopt)
122 AC_CHECK_FUNCS(time ctime utime gettimeofday getrusage)
123 AC_CHECK_FUNCS(chmod fcntl stat fstat getenv putenv strerror)
124 AC_CHECK_FUNCS(getpid getgid getsid getpgid getpgrp getuid)
125 AC_CHECK_FUNCS(setgroups initgroups nl_langinfo)
126 AC_CHECK_FUNCS(strchr strstr strcpy strncpy memcpy memset memmove)
128 # SIM support checking
129 # XXX These needs to be changed as more supported platforms appear.
130 # XXX This probably needs to be made platform dependant check.
133 AC_MSG_CHECKING(for SIM support)
135 AC_CHECK_HEADERS(dlfcn.h,
137 AC_CHECK_LIB(dl, dlopen,
144 AC_CHECK_LIB(c, dlopen,
152 AM_CONDITIONAL(SILC_SIM, test x$sim_support = xtrue)
153 if test x$sim_support = xtrue; then
154 AC_MSG_RESULT(Enabled SIM support.)
155 __SILC_HAVE_SIM="#define __SILC_HAVE_SIM 1"
157 AC_MSG_RESULT(No SIM support found.)
160 # lib/contrib conditionals
162 AC_CHECK_HEADER(regex.h,
164 AC_DEFINE(HAVE_REGEX)
168 AM_CONDITIONAL(HAVE_REGEX, test x$have_regex = x1)
170 AC_CHECK_FUNC(getopt_long,
172 AC_DEFINE(HAVE_GETOPT_LONG)
174 ], have_getopt_long=0
176 AM_CONDITIONAL(HAVE_GETOPT_LONG, test x$have_getopt_long = x1)
179 ## Enable/disable checking
184 AC_MSG_CHECKING(whether to enable IPv6 support)
186 [ --enable-ipv6 enable IPv6 support],
188 case "${enableval}" in
207 if test x$check_ipv6 = xtrue; then
211 #ifdef HAVE_SYS_TYPES_H
212 #include <sys/types.h>
214 #ifdef HAVE_NETINET_TCP_H
215 #include <netinet/tcp.h>
220 #include <sys/socket.h>
221 #ifdef HAVE_NETINET_IN_H
222 #include <netinet/in.h>
226 struct sockaddr_in6 sin6;
227 int family = AF_INET6;
240 AC_MSG_CHECKING(whether to enable debugging)
242 __SILC_ENABLE_DEBUG=""
244 [ --enable-debug enable debugging],
246 case "${enableval}" in
249 AC_DEFINE(SILC_DEBUG)
251 __SILC_ENABLE_DEBUG="#define __SILC_ENABLE_DEBUG 1"
262 # Disable all assembler optimizations
264 AC_MSG_CHECKING(whether to enable assembler optimizations)
267 [ --disable-asm do not use assembler optimizations],
279 ## Compiler and compiler flag checks
282 # Function to check if compiler flag works
283 # Usage: SILC_ADD_CFLAGS(FLAGS, [ACTION-IF-FAILED])
284 AC_DEFUN([SILC_ADD_CFLAGS],
285 [ tmp_CFLAGS="$CFLAGS"
287 AC_MSG_CHECKING(whether $CC accepts $1 flag)
288 AC_TRY_LINK([], [], [AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no)
295 # GCC specific options
296 if test "x$summary_debug" = "xyes"; then
297 SILC_ADD_CFLAGS(-g -O)
299 SILC_ADD_CFLAGS(-g -O2)
301 SILC_ADD_CFLAGS(-Wall -finline-functions)
306 SILC_ADD_CFLAGS(-g3 -O2, SILC_ADD_CFLAGS(-g3 -O, SILC_ADD_CFLAGS(-O)))
310 SILC_ADD_CFLAGS(-O2, SILC_ADD_CFLAGS(-O))
314 # Intel C++ Compiler needs -restrict
315 if test "x$CC" = "xicc"; then
316 SILC_ADD_CFLAGS(-restrict)
321 # Workaround a bug in GCC 2.x which causes memory exhaustion
322 # when compiling sha1 with optimizations on UltraSPARC.
325 if test "$GCC" -a "$host_cpu" = "sparc64"; then
326 AC_MSG_CHECKING(whether to enable GCC 2.x workaround for SHA1)
329 #if defined(__sparc64__) && (__GNUC__ == 2)
348 # Default installation destination
350 AC_PREFIX_DEFAULT(/usr/local/silc)
351 if test "x$prefix" != xNONE; then
352 silc_prefix="$prefix"
354 silc_prefix="$ac_default_prefix"
359 if test "x$sysconfdir" != 'x${prefix}/etc'; then
362 ETCDIR="$silc_prefix/etc"
366 [[ --with-etcdir=DIR directory for system files [/etc/silc]]],
377 AC_DEFINE_UNQUOTED(SILC_ETCDIR, "$ETCDIR")
381 HELPDIR="$silc_prefix/help"
383 [[ --with-helpdir=DIR directory for SILC help files [PREFIX/help]]],
394 AC_DEFINE_UNQUOTED(SILC_HELPDIR, "$HELPDIR")
398 DOCDIR="$silc_prefix/doc"
400 [[ --with-docdir=DIR directory for SILC documentation [PREFIX/doc]]],
411 AC_DEFINE_UNQUOTED(SILC_DOCDIR, "$DOCDIR")
413 # SIM modules directory
415 MODULESDIR="$silc_prefix/modules"
417 [[ --with-simdir=DIR directory for SIM modules [PREFIX/modules]]],
423 MODULESDIR="$withval"
428 AC_DEFINE_UNQUOTED(SILC_MODULESDIR, "$MODULESDIR")
432 LOGSDIR="$silc_prefix/logs"
434 [[ --with-logsdir=DIR directory for SILC Server logs [PREFIX/logs]]],
445 AC_DEFINE_UNQUOTED(SILC_LOGSDIR, "$LOGSDIR")
447 # silcd config file checking
449 summary_silcd_configfile="/etc/silc/silcd.conf"
450 AC_ARG_WITH(silcd-config-file,
451 [[ --with-silcd-config-file=FILE use FILE as default configuration file
452 for SILC Server [/etc/silc/silcd.conf]]],
453 AC_DEFINE_UNQUOTED(SILC_SERVER_CONFIG_FILE, "$withval")
454 summary_silcd_configfile="$withval"
457 # silcd pid file checking
459 if test "x$localstatedir" != 'x${prefix}/var'; then
460 PIDFILE="$localstatedir/silcd.pid"
462 PIDFILE="$silc_prefix/var/silcd.pid"
465 AC_ARG_WITH(silcd-pid-file,
466 [[ --with-silcd-pid-file=FILE use FILE as default pid file for SILC
467 Server [/var/run/silcd.pid]]],
481 ## With/without checkings
485 # SILC library checking
487 AC_ARG_WITH(silc-includes,
488 [ --with-silc-includes=DIR SILC Toolkit includes [search in DIR]],
489 [ac_silc_includes="$withval"], [ac_silc_includes="no"])
490 AC_ARG_WITH(silc-libs,
491 [ --with-silc-libs=DIR SILC Toolkit libraries [search in DIR]],
492 [ac_silc_libs="$withval"], [ac_silc_libs="no"])
495 # XXX missing checking the __SILC_WITH_XXX defines from the provided libs
496 # in order to determine correct libs to link.
499 # XXX missing pkg-config check.
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"
511 # SOCKS4 support checking
514 SAVE_CFLAGS="$CFLAGS"
515 SAVE_LDFLAGS="$LDFLAGS"
516 AC_MSG_CHECKING(whether to support SOCKS4)
518 [[ --with-socks4[=DIR] with SOCKS4 support [search in DIR/lib and DIR/include]]],
528 if test -d "$withval/include"; then
529 CFLAGS="$CFLAGS -I$withval/include"
531 if test -d "$withval/lib"; then
532 LDFLAGS="$LDFLAGS -L$withval/lib"
544 AC_MSG_ERROR(Could not find SOCKS4 library.)
546 CFLAGS="$SAVE_CFLAGS"
547 LDFLAGS="$SAVE_LDFLAGS"
553 # SOCKS5 support checking
556 SAVE_CFLAGS="$CFLAGS"
557 SAVE_LDFLAGS="$LDFLAGS"
558 AC_MSG_CHECKING(whether to support SOCKS5)
560 [[ --with-socks5[=DIR] with SOCKS5 support [search in DIR/lib and DIR/include]]],
570 if test -d "$withval/include"; then
571 CFLAGS="$CFLAGS -I$withval/include"
573 if test -d "$withval/lib"; then
574 LDFLAGS="$LDFLAGS -L$withval/lib"
577 LIBS="-lsocks5 $LIBS"
586 AC_MSG_ERROR(Could not find SOCKS5 library.)
588 CFLAGS="$SAVE_CFLAGS"
589 LDFLAGS="$SAVE_LDFLAGS"
595 if test "x$socks" = "x4"; then
597 CFLAGS="$CFLAGS -Dconnect=Rconnect -Dgetsockname=Rgetsockname -Dbind=Rbind -Daccept=Raccept -Dlisten=Rlisten -Dselect=Rselect"
600 if test "x$socks" = "x5"; then
603 AC_DEFINE(Rconnect, SOCKSconnect)
604 AC_DEFINE(Rgetsockname, SOCKSgetsockname)
605 AC_DEFINE(Rgetpeername, SOCKSgetpeername)
606 AC_DEFINE(Rbind, SOCKSbind)
607 AC_DEFINE(Raccept, SOCKSaccept)
608 AC_DEFINE(Rlisten, SOCKSlisten)
609 AC_DEFINE(Rselect, SOCKSselect)
610 AC_DEFINE(Rrecvfrom, SOCKSrecvfrom)
611 AC_DEFINE(Rsendto, SOCKSsendto)
612 AC_DEFINE(Rrecv, SOCKSrecv)
613 AC_DEFINE(Rsend, SOCKSsend)
614 AC_DEFINE(Rread, SOCKSread)
615 AC_DEFINE(Rwrite, SOCKSwrite)
616 AC_DEFINE(Rrresvport, SOCKSrresvport)
617 AC_DEFINE(Rshutdown, SOCKSshutdown)
618 AC_DEFINE(Rlisten, SOCKSlisten)
619 AC_DEFINE(Rclose, SOCKSclose)
620 AC_DEFINE(Rdup, SOCKSdup)
621 AC_DEFINE(Rdup2, SOCKSdup2)
622 AC_DEFINE(Rfclose, SOCKSfclose)
623 AC_DEFINE(Rgethostbyname, SOCKSgethostbyname)
626 # MP library checking. First check whether user wants to use GMP and use
627 # it if found. If not or not defined then compile the MPI library in the
632 SAVE_CFLAGS="$CFLAGS"
633 SAVE_LDFLAGS="$LDFLAGS"
634 AC_MSG_CHECKING(whether to search for GMP)
636 [[ --with-gmp[=DIR] use GMP instead of MPI [search in DIR/lib and DIR/include]]],
645 if test -d "$withval/include"; then
646 CFLAGS="$CFLAGS -I$withval/include"
648 if test -d "$withval/lib"; then
649 LDFLAGS="$LDFLAGS -L$withval/lib"
656 AC_CHECK_LIB(gmp, __gmpz_init,
659 AC_DEFINE(SILC_MP_GMP)
660 AC_MSG_RESULT(Using GMP as a MP library.)
664 CFLAGS="$SAVE_CFLAGS"
665 LDFLAGS="$SAVE_LDFLAGS"
671 AM_CONDITIONAL(SILC_MP_GMP, test x$mp_gmp = xtrue)
672 AM_CONDITIONAL(SILC_MP_NSS_MPI, test x$mp_gmp = xfalse)
673 if test x$mp_gmp = xfalse; then
674 AC_DEFINE(SILC_MP_NSS_MPI)
675 AC_MSG_RESULT(Using NSS MPI as a MP library.)
679 # GNU Libidn (for stringprep) support
684 SAVE_CFLAGS="$CFLAGS"
685 SAVE_LDFLAGS="$LDFLAGS"
686 SAVE_CPPFLAGS="$CPPFLAGS"
687 AC_MSG_CHECKING(whether to implicit search for libidn)
689 [[ --with-libidn[=DIR] use libidn [search in DIR/include and DIR/lib]]],
694 AC_CHECK_HEADERS(stringprep.h,
696 AC_CHECK_FUNC(stringprep, has_libidn=true)
702 if test -d $withval/include; then
703 CPPFLAGS="$CPPFLAGS -I$withval/include"
704 CFLAGS="$CFLAGS -I$withval/include"
706 if test -d $withval/lib; then
707 LDFLAGS="$LDFLAGS -L$withval/lib"
714 AC_CHECK_HEADERS(stringprep.h,
716 AC_CHECK_FUNCS(stringprep,
724 if test x$check_libidn = xtrue; then
725 AC_MSG_RESULT(Searching for libidn...)
727 AC_CHECK_HEADERS(stringprep.h,
730 AC_MSG_CHECKING(for stringprep in -lidn)
734 #include <stringprep.h>
737 (void)stringprep_locale_charset();
741 AC_DEFINE(HAVE_LIBIDN, 1, [Define if you have the stringprep() function.])
748 CFLAGS="$SAVE_CFLAGS"
749 LDFLAGS="$SAVE_LDFLAGS"
750 CPPFLAGS="$SAVE_CPPFLAGS"
755 if test x$check_libidn = xtrue; then
756 # search for idn library..
758 SAVE_CFLAGS="$CFLAGS"
759 SAVE_LDFLAGS="$LDFLAGS"
760 SAVE_CPPFLAGS="$CPPFLAGS"
762 for dir in `echo "/usr/local /usr/pkg /usr/contrib"`; do
763 if test x$has_libidn = xfalse; then
764 AC_MSG_RESULT(searching in $dir...)
766 if test -d $dir/include; then
767 CPPFLAGS="$CPPFLAGS -I$dir/include"
768 CFLAGS="$CFLAGS -I$dir/include"
770 if test -d $dir/lib; then
771 LDFLAGS="$LDFLAGS -L$dir/lib"
775 unset ac_cv_header__stringprep_h_ ac_cv_header_stringprep_h || true
777 AC_CHECK_HEADERS(stringprep.h,
780 AC_MSG_CHECKING(for stringprep in -lidn)
784 #include <stringprep.h>
787 (void)stringprep_locale_charset();
792 AC_DEFINE(HAVE_LIBIDN, 1, [Define if you have the stringprep() function.])
799 CFLAGS="$SAVE_CFLAGS"
800 LDFLAGS="$SAVE_LDFLAGS"
801 CPPFLAGS="$SAVE_CPPFLAGS"
805 CFLAGS="$SAVE_CFLAGS"
806 LDFLAGS="$SAVE_LDFLAGS"
807 CPPFLAGS="$SAVE_CPPFLAGS"
813 if test x$has_libidn = xtrue; then
814 __SILC_HAVE_LIBIDN="#define __SILC_HAVE_LIBIDN 1"
816 AC_MSG_ERROR(Could not locate libidn. GNU Libidn is required to compile SILC)
824 SAVE_CFLAGS="$CFLAGS"
825 SAVE_LDFLAGS="$LDFLAGS"
826 SAVE_CPPFLAGS="$CPPFLAGS"
827 AC_MSG_CHECKING(whether to implicit search for libiconv)
829 [[ --with-iconv[=DIR] use libiconv [search in DIR/include and DIR/lib]]],
834 AC_CHECK_HEADERS(iconv.h,
836 AC_CHECK_FUNC(iconv, has_iconv=true)
842 if test -d $withval/include; then
843 CPPFLAGS="$CPPFLAGS -I$withval/include"
844 CFLAGS="$CFLAGS -I$withval/include"
846 if test -d $withval/lib; then
847 LDFLAGS="$LDFLAGS -L$withval/lib"
854 AC_CHECK_HEADERS(iconv.h,
856 AC_CHECK_FUNCS(iconv,
864 if test x$check_iconv = xtrue; then
865 AC_MSG_RESULT(Searching for iconv...)
868 unset ac_cv_header__iconv_h_ ac_cv_header_iconv_h || true
870 AC_CHECK_HEADERS(iconv.h,
873 AC_MSG_CHECKING(for iconv in -liconv)
880 iconv_t cd = iconv_open("", "");
881 iconv(cd, NULL, NULL, NULL, NULL);
886 AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.])
893 CFLAGS="$SAVE_CFLAGS"
894 LDFLAGS="$SAVE_LDFLAGS"
895 CPPFLAGS="$SAVE_CPPFLAGS"
900 if test x$check_iconv = xtrue; then
901 # search for iconv library..
903 SAVE_CFLAGS="$CFLAGS"
904 SAVE_LDFLAGS="$LDFLAGS"
905 SAVE_CPPFLAGS="$CPPFLAGS"
907 for dir in `echo "/usr/local /usr/pkg /usr/contrib"`; do
908 if test x$has_iconv = xfalse; then
909 AC_MSG_RESULT(searching in $dir...)
911 if test -d $dir/include; then
912 CPPFLAGS="$CPPFLAGS -I$dir/include"
913 CFLAGS="$CFLAGS -I$dir/include"
915 if test -d $dir/lib; then
916 LDFLAGS="$LDFLAGS -L$dir/lib"
920 unset ac_cv_header__iconv_h_ ac_cv_header_iconv_h || true
922 AC_CHECK_HEADERS(iconv.h,
925 AC_MSG_CHECKING(for iconv in -liconv)
932 iconv_t cd = iconv_open("", "");
933 iconv(cd, NULL, NULL, NULL, NULL);
939 AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.])
946 CFLAGS="$SAVE_CFLAGS"
947 LDFLAGS="$SAVE_LDFLAGS"
948 CPPFLAGS="$SAVE_CPPFLAGS"
952 CFLAGS="$SAVE_CFLAGS"
953 LDFLAGS="$SAVE_LDFLAGS"
954 CPPFLAGS="$SAVE_CPPFLAGS"
960 if test x$has_iconv = xtrue; then
961 # (1) Some implementations of iconv won't convert from UTF-8 to UTF-8.
962 # (2) In glibc-2.1.2 and earlier there is a bug that messes up ob and
963 # obl when args 2 and 3 are 0 (fixed in glibc-2.1.3).
965 AC_CACHE_CHECK([whether this iconv is good enough], ac_iconv_good,
976 ob = buf, obl = sizeof(buf);
977 return ((cd = iconv_open("UTF-8", "UTF-8")) != (iconv_t)(-1) &&
978 (iconv(cd, 0, 0, &ob, &obl) ||
979 !(ob == buf && obl == sizeof(buf)) ||
994 if test x$ac_iconv_good = xno; then
995 AC_MSG_RESULT(Try using libiconv instead.)
1000 # POSIX threads support
1003 AC_MSG_CHECKING(whether to search for POSIX threads)
1004 AC_ARG_WITH(pthreads,
1005 [[ --with-pthreads[=DIR] use POSIX threads [search in DIR/include and DIR/lib]]],
1007 case "${withval}" in
1012 if test -d $withval/include; then
1013 CPPFLAGS="$CPPFLAGS -I$withval/include"
1014 CFLAGS="$CFLAGS -I$withval/include"
1016 if test -d $withval/lib; then
1017 LDFLAGS="$LDFLAGS -L$withval/lib"
1025 if test x$check_threads = xtrue; then
1027 SAVE_CFLAGS="$CFLAGS"
1028 SAVE_LDFLAGS="$LDFLAGS"
1029 SAVE_CPPFLAGS="$CPPFLAGS"
1032 AC_CHECK_HEADERS(pthread.h,
1034 LIBS="$LIBS -lpthread"
1035 AC_CHECK_LIB(pthread, pthread_attr_init, has_threads=true,
1040 LIBS="$SAVE_LIBS -pthread"
1041 AC_CHECK_LIB(c_r, pthread_attr_init, has_threads=true, LIBS="$SAVE_LIBS")
1050 # search for pthread library..
1051 for dir in `echo "/usr/local /usr/pkg /usr/contrib /usr/pkg/pthreads /usr/local/pthreads"`; do
1052 if test x$has_threads = xfalse; then
1053 AC_MSG_RESULT(searching in $dir...)
1055 if test -d $dir/include; then
1056 CPPFLAGS="$CPPFLAGS -I$dir/include"
1057 CFLAGS="$CFLAGS -I$dir/include"
1059 if test -d $dir/lib; then
1060 LDFLAGS="$LDFLAGS -L$dir/lib"
1064 unset ac_cv_header__pthread_h_ ac_cv_header_pthread_h || true
1066 AC_CHECK_HEADERS(pthread.h,
1068 LIBS="$LIBS -lpthread"
1069 AC_CHECK_LIB(pthread, pthread_attr_init, has_threads=true,
1074 CFLAGS="$SAVE_CFLAGS"
1075 LDFLAGS="$SAVE_LDFLAGS"
1076 CPPFLAGS="$SAVE_CPPFLAGS"
1080 CFLAGS="$SAVE_CFLAGS"
1081 LDFLAGS="$SAVE_LDFLAGS"
1082 CPPFLAGS="$SAVE_CPPFLAGS"
1092 __SILC_HAVE_PTHREAD=""
1093 AM_CONDITIONAL(SILC_THREADS, test x$has_threads = xtrue)
1094 if test x$has_threads = xtrue; then
1095 CFLAGS="$CFLAGS -D_REENTRANT"
1097 # XXX possibly incomplete
1100 CFLAGS="$CFLAGS -D_THREAD_SAFE"
1101 if test x"$GCC" = xyes; then
1102 CFLAGS="$CFLAGS -mthreads"
1106 CFLAGS="$CFLAGS -D_THREAD_SAFE"
1108 *-*-sysv5uw7*) # UnixWare 7
1109 if test "$GCC" != "yes"; then
1110 CFLAGS="$CFLAGS -Kthread"
1112 CFLAGS="$CFLAGS -pthread"
1116 CFLAGS="$CFLAGS -D_POSIX4A_DRAFT10_SOURCE"
1120 AC_CHECK_FUNC(pthread_create)
1121 AC_DEFINE(SILC_HAVE_PTHREAD)
1122 AC_DEFINE(SILC_THREADS)
1123 __SILC_HAVE_PTHREAD="#define __SILC_HAVE_PTHEAD 1"
1126 # Native WIN32 compilation under cygwin
1128 AC_MSG_CHECKING(whether to compile native WIN32 code)
1130 [ --with-win32 compile native WIN32 (MinGW) code (-mno-cygwin)],
1133 AC_DEFINE(SILC_WIN32)
1135 CFLAGS="-mno-cygwin $CFLAGS"
1136 LIBS="$LIBS -lwsock32"
1141 AM_CONDITIONAL(SILC_WIN32, test x$win32_support = xtrue)
1143 # Native EPOC support (disabled by default)
1145 AM_CONDITIONAL(SILC_EPOC, test xfalse = xtrue)
1147 # Native BeOS support (disabled by default)
1149 AM_CONDITIONAL(SILC_BEOS, test xfalse = xtrue)
1151 # Native OS2 support (disabled by default)
1153 AM_CONDITIONAL(SILC_OS2, test xfalse = xtrue)
1158 AC_MSG_CHECKING(whether to compile Irssi SILC Client)
1160 [ --without-irssi compile without Irssi SILC Client],
1164 SILC_DIST_SUBDIRS=`echo $SILC_DIST_SUBDIRS | $sedpath -e 's/irssi//'`
1173 AC_MSG_CHECKING(whether to compile SILC Server)
1175 [ --without-silcd compile without SILC Server],
1179 SILC_DIST_SUBDIRS=`echo $SILC_DIST_SUBDIRS | $sedpath -e 's/silcd//'`
1185 # Irssi perl support
1188 [[ --with-perl[=yes|no|module] Build with Perl support - also specifies
1189 if it should be built into main silc binary
1190 (static, default) or as a module]])
1193 AC_MSG_CHECKING(whether to do libtoolfix)
1194 AC_ARG_WITH(libtoolfix,
1195 [ --without-libtoolfix Do not fix libtool, for package builders],
1205 AC_DEFINE_UNQUOTED(SILC_ETCDIR, "$ETCDIR")
1213 # Other configure scripts
1215 if test x$without_irssi = xfalse; then
1216 if test "x$silc_dist" = "xsilc-client" ||
1217 test "x$silc_dist" = "xsilc-toolkit"; then
1218 AC_CONFIG_SUBDIRS(irssi)
1222 SILC_TOP_SRCDIR=`pwd`
1224 # Included configure scripts
1225 AD_INCLUDE_CONFIGURE
1230 AC_SUBST(SILC_TOP_SRCDIR)
1232 INCLUDE_DEFINES_INT="include \$(top_srcdir)/Makefile.defines_int"
1233 AC_SUBST(INCLUDE_DEFINES_INT)
1234 AC_SUBST(SILC_DIST_SUBDIRS)
1235 AC_SUBST(SILC_LIB_INCLUDES)
1238 # Fix the libtool to support run-time configuration. This allows us
1239 # to in run-time specify when to compile shared/static libraries without
1240 # need to reconfigure the entire libtool.
1242 if test x$libtoolfix = xtrue; then
1243 ./libtoolfix $SILC_TOP_SRCDIR/ltmain.sh
1245 AM_CONDITIONAL(SILC_LIBTOOLFIX, test x$libtoolfix = xtrue)
1247 AC_SUBST(__SILC_HAVE_PTHREAD)
1248 AC_SUBST(__SILC_HAVE_SIM)
1249 AC_SUBST(__SILC_HAVE_LIBIDN)
1250 AC_SUBST(__SILC_ENABLE_DEBUG)
1258 Makefile.defines_int
1261 doc/example_silcd.conf
1262 includes/silcincludes.h
1265 if test x$without_irssi = xfalse ; then
1266 if test "x$silc_dist" = "xsilc-client" ||
1267 test "x$silc_dist" = "xsilc-toolkit"; then
1269 irssi/Makefile.defines
1270 irssi/Makefile.defines_int
1275 if test x$without_silcd = xfalse ; then
1276 if test "x$silc_dist" = "xsilc-server" ||
1277 test "x$silc_dist" = "xsilc-toolkit"; then
1284 if test "x$silc_dist" = "xsilc-toolkit"; then
1288 win32/libsilc/Makefile
1289 win32/libsilcclient/Makefile
1291 tutorial/Makefile.defines
1292 tutorial/Makefile.defines_int
1298 s_bindir=`eval echo $bindir`;s_bindir=`eval echo $s_bindir`
1299 s_sbindir=`eval echo $sbindir`;s_sbindir=`eval echo $s_sbindir`
1300 s_mandir=`eval echo $mandir`;s_mandir=`eval echo $s_mandir`
1301 s_includedir=`eval echo $includedir`;s_includedir=`eval echo $s_includedir`
1304 echo "SILC Configuration Summary:"
1305 echo "---------------------------"
1306 echo " Target host ...................: $target"
1307 echo " Compiler ......................: $CC"
1308 echo " CFLAGS ........................: $CFLAGS"
1309 echo " CPPFLAGS ......................: $CPPFLAGS"
1310 echo " LDFLAGS .......................: $LDFLAGS"
1311 echo " LIBS ..........................: $LIBS"
1313 echo " Installation prefix ...........: $prefix"
1314 echo " bin directory .................: $s_bindir"
1315 echo " sbin directory ................: $s_sbindir"
1316 echo " etc directory .................: $ETCDIR"
1317 echo " man directory .................: $s_mandir"
1318 echo " help directory ................: $HELPDIR"
1319 echo " doc directory .................: $DOCDIR"
1320 echo " logs directory ................: $LOGSDIR"
1321 echo " SIM directory .................: $MODULESDIR"
1322 echo " include directory .............: $s_includedir"
1325 if test "x$silc_dist" = "xsilc-client" ||
1326 test "x$silc_dist" = "xsilc-toolkit"; then
1328 if test x$without_irssi = xtrue; then
1331 echo " Compile SILC Client ...........: $irssi"
1334 if test "x$silc_dist" = "xsilc-server" ||
1335 test "x$silc_dist" = "xsilc-toolkit"; then
1337 if test x$without_silcd = xtrue; then
1340 echo " Compile SILC Server ...........: $silcd"
1341 echo " Server configuration file .....: $summary_silcd_configfile"
1342 echo " Server PID file ...............: $PIDFILE"
1345 if test x$sim_support = xfalse; then
1350 if test x$has_iconv = xfalse; then
1355 if test x$has_libidn = xfalse; then
1358 libidn_support="yes"
1360 echo " SIM support ...................: $sim_support"
1361 echo " IPv6 support ..................: $summary_ipv6"
1362 echo " Iconv support .................: $iconv_support"
1363 echo " Idn support ...................: $libidn_support"
1364 if test x$want_asm = xfalse; then
1369 echo " Assembler optimizations .......: $summary_asm"
1372 if test x$mp_gmp = xtrue; then
1375 echo " Arithmetic library ............: $mp"
1378 if test x$has_threads = xtrue; then
1381 echo " Multi-threads support .........: $threads"
1382 echo " Debugging enabled .............: $summary_debug"
1384 if test "x$silc_dist" = "xsilc-client"; then
1385 echo "Compile the sources with 'make' or 'gmake' command (GNU make is required)."
1387 echo "Compile the sources with 'make' or 'gmake' command."