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
47 # Control compiler optimizations
48 CFLAGS=`echo $CFLAGS | sed 's/-O[ 0123456789s]*//g'`
54 __SILC_HAVE_PTHREAD=""
56 __SILC_ENABLE_DEBUG=""
59 #ifndef SILC_DIST_TOOLKIT
61 #endif SILC_DIST_TOOLKIT
62 #ifdef SILC_DIST_INPLACE
64 #endif SILC_DIST_INPLACE
73 # More header checking
75 AC_CHECK_HEADERS(unistd.h string.h getopt.h errno.h fcntl.h assert.h)
76 AC_CHECK_HEADERS(sys/types.h sys/stat.h sys/time.h stddef.h)
77 AC_CHECK_HEADERS(netinet/in.h netinet/tcp.h xti.h netdb.h sys/resource.h)
78 AC_CHECK_HEADERS(pwd.h grp.h termcap.h paths.h)
79 AC_CHECK_HEADERS(ncurses.h signal.h ctype.h utime.h)
80 AC_CHECK_HEADERS(arpa/inet.h sys/mman.h limits.h termios.h locale.h langinfo.h)
90 AC_CHECK_SIZEOF(long long, 0)
91 AC_SUBST(SILC_SIZEOF_LONG_LONG, $ac_cv_sizeof_long_long)
92 AC_CHECK_SIZEOF(long, 0)
93 AC_SUBST(SILC_SIZEOF_LONG, $ac_cv_sizeof_long)
94 AC_CHECK_SIZEOF(int, 0)
95 AC_SUBST(SILC_SIZEOF_INT, $ac_cv_sizeof_int)
96 AC_CHECK_SIZEOF(short, 0)
97 AC_SUBST(SILC_SIZEOF_SHORT, $ac_cv_sizeof_short)
98 AC_CHECK_SIZEOF(char, 0)
99 AC_SUBST(SILC_SIZEOF_CHAR, $ac_cv_sizeof_char)
100 AC_CHECK_SIZEOF(void *, 0)
101 AC_SUBST(SILC_SIZEOF_VOID_P, $ac_cv_sizeof_void_p)
103 # Function and library checking
105 AC_CHECK_FUNC(gethostbyname, [],
107 AC_CHECK_LIB(nsl, gethostbyname, LIBS="$LIBS -lnsl")
108 AC_CHECK_FUNC(res_gethostbyname, [],
109 AC_CHECK_LIB(resolv, res_gethostbyname, LIBS="$LIBS -lresolv")
112 AC_CHECK_FUNC(socket, [],
113 AC_CHECK_LIB(socket, socket, LIBS="$LIBS -lsocket")
115 AC_CHECK_FUNCS(gethostname gethostbyaddr getservbyname getservbyport)
116 AC_CHECK_FUNCS(poll select listen bind shutdown close connect setsockopt)
117 AC_CHECK_FUNCS(setrlimit time ctime utime gettimeofday getrusage)
118 AC_CHECK_FUNCS(chmod fcntl stat fstat getenv putenv strerror)
119 AC_CHECK_FUNCS(getpid getgid getsid getpgid getpgrp getuid)
120 AC_CHECK_FUNCS(setgroups initgroups nl_langinfo)
121 AC_CHECK_FUNCS(strchr strstr strcpy strncpy memcpy memset memmove)
124 # SIM support checking
125 # XXX These needs to be changed as more supported platforms appear.
126 # XXX This probably needs to be made platform dependant check.
129 AC_MSG_CHECKING(for SIM support)
131 AC_CHECK_HEADERS(dlfcn.h,
133 AC_CHECK_LIB(dl, dlopen,
135 AC_DEFINE([SILC_SIM], [], [HAVE_SIM])
140 AC_CHECK_LIB(c, dlopen,
142 AC_DEFINE([SILC_SIM], [], [HAVE_SIM])
148 AM_CONDITIONAL(SILC_SIM, test x$sim_support = xtrue)
149 if test x$sim_support = xtrue; then
150 AC_MSG_RESULT(Enabled SIM support.)
151 __SILC_HAVE_SIM="#define __SILC_HAVE_SIM 1"
153 AC_MSG_RESULT(No SIM support found.)
157 # lib/contrib conditionals
159 AC_CHECK_HEADER(regex.h,
161 AC_DEFINE([HAVE_REGEX_H], [], [HAVE_REGEX_H])
165 AM_CONDITIONAL(HAVE_REGEX, test x$have_regex = x1)
167 AC_CHECK_FUNC(getopt_long,
169 AC_DEFINE([HAVE_GETOPT_LONG], [], [HAVE_GETOPT_LONG])
171 ], have_getopt_long=0
174 AC_CHECK_FUNC(getopt,
176 AC_DEFINE([HAVE_GETOPT], [], [HAVE_GETOPT])
182 ## Enable/disable checking
187 AC_MSG_CHECKING(whether to enable IPv6 support)
189 [ --enable-ipv6 enable IPv6 support],
191 case "${enableval}" in
196 AC_DEFINE([HAVE_IPV6], [], [HAVE_IPV6])
210 if test x$check_ipv6 = xtrue; then
214 #ifdef HAVE_SYS_TYPES_H
215 #include <sys/types.h>
217 #ifdef HAVE_NETINET_TCP_H
218 #include <netinet/tcp.h>
223 #include <sys/socket.h>
224 #ifdef HAVE_NETINET_IN_H
225 #include <netinet/in.h>
229 struct sockaddr_in6 sin6;
230 int family = AF_INET6;
233 AC_DEFINE([HAVE_IPV6], [], [HAVE_IPV6])
243 AC_MSG_CHECKING(whether to enable debugging)
245 __SILC_ENABLE_DEBUG=""
247 [ --enable-debug enable debugging],
249 case "${enableval}" in
252 AC_DEFINE([SILC_DEBUG], [], [enable-debug])
254 __SILC_ENABLE_DEBUG="#define __SILC_ENABLE_DEBUG 1"
265 # Disable all assembler optimizations
267 AC_MSG_CHECKING(whether to enable assembler optimizations)
270 [ --disable-asm do not use assembler optimizations],
281 ## Compiler and compiler flag checks
284 # Function to check if compiler flag works
285 # Usage: SILC_ADD_CFLAGS(FLAGS, [ACTION-IF-FAILED])
286 AC_DEFUN([SILC_ADD_CFLAGS],
287 [ tmp_CFLAGS="$CFLAGS"
289 AC_MSG_CHECKING(whether $CC accepts $1 flag)
290 AC_TRY_LINK([], [], [AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no)
296 # Function to check if compiler flag works, destination specifiable
297 # Usage: SILC_ADD_CC_FLAGS(VAR, FLAGS, [ACTION-IF-FAILED])
298 AC_DEFUN([SILC_ADD_CC_FLAGS],
299 [ tmp_CFLAGS="$1_CFLAGS"
300 $1_CFLAGS="${$1_CFLAGS} $2"
301 AC_MSG_CHECKING(whether $CC accepts $2 flag)
302 AC_TRY_LINK([], [], [AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no)
303 $1_CFLAGS="$tmp_CFLAGS"
309 # GCC specific options
310 if test "x$summary_debug" = "xyes"; then
311 SILC_ADD_CFLAGS(-g -O)
313 SILC_ADD_CFLAGS(-g -O2)
315 SILC_ADD_CFLAGS(-Wall -finline-functions)
316 SILC_ADD_CFLAGS(-Wno-pointer-sign)
321 SILC_ADD_CFLAGS(-g3 -O2, SILC_ADD_CFLAGS(-g3 -O, SILC_ADD_CFLAGS(-O)))
324 SILC_ADD_CFLAGS(-g3 -O2, SILC_ADD_CFLAGS(-g3 -O, SILC_ADD_CFLAGS(-O)))
328 SILC_ADD_CFLAGS(-O2, SILC_ADD_CFLAGS(-O))
332 # Intel C++ Compiler needs -restrict
333 if test "x$CC" = "xicc"; then
334 SILC_ADD_CFLAGS(-restrict)
339 # Workaround a bug in GCC 2.x which causes memory exhaustion
340 # when compiling sha1 with optimizations on UltraSPARC.
343 if test "$GCC" -a "$host_cpu" = "sparc64"; then
344 AC_MSG_CHECKING(whether to enable GCC 2.x workaround for SHA1)
347 #if defined(__sparc64__) && (__GNUC__ == 2)
361 #endif SILC_DIST_COMPILER
367 # Default installation destination
369 #ifdef SILC_DIST_AUTODIST
370 AC_PREFIX_DEFAULT(/usr/local)
371 #else !SILC_DIST_AUTODIST
372 AC_PREFIX_DEFAULT(/usr/local/silc)
373 #endif SILC_DIST_AUTODIST
374 if test "x$prefix" != xNONE; then
375 silc_prefix="$prefix"
377 silc_prefix="$ac_default_prefix"
380 #ifndef SILC_DIST_AUTODIST
383 if test "x$sysconfdir" != 'x${prefix}/etc'; then
386 ETCDIR="$silc_prefix/etc"
390 [[ --with-etcdir=DIR directory for system files [/etc/silc]]],
401 AC_DEFINE_UNQUOTED([SILC_ETCDIR], "$ETCDIR", [SILC_ETCDIR])
405 DOCDIR="$silc_prefix/doc"
407 [[ --with-docdir=DIR directory for SILC documentation [PREFIX/doc]]],
418 AC_DEFINE_UNQUOTED([SILC_DOCDIR], "$DOCDIR", [SILC_DOCDIR])
419 #endif SILC_DIST_AUTODIST
421 #ifdef SILC_DIST_COMPILER
423 ## With/without checkings
427 # SILC library checking
431 #ifndef SILC_DIST_TOOLKIT
432 AC_ARG_WITH(silc-includes,
433 [ --with-silc-includes=DIR SILC Toolkit includes [search in DIR]],
434 [ac_silc_includes="$withval"], [ac_silc_includes="no"])
435 AC_ARG_WITH(silc-libs,
436 [ --with-silc-libs=DIR SILC Toolkit libraries [search in DIR]],
437 [ac_silc_libs="$withval"], [ac_silc_libs="no"])
439 if test -n "$with_silc_includes" || test -n "$with_silc_libs"; then
441 # Manually provided libs
442 if test "$ac_silc_includes" != "no"; then
444 SILC_LIB_INCLUDES="-I$ac_silc_includes"
447 if test "$ac_silc_libs" != "no"; then
450 LIBS="$LIBS -L$ac_silc_libs"
453 # Check libs to link against
454 f=`$EGREP __SILC_HAVE_PTHREAD $ac_silc_includes/silcincludes.h`
455 if test -n "$f"; then
456 LIBS="$LIBS -lpthread"
460 f=`$EGREP __SILC_HAVE_SIM $ac_silc_includes/silcincludes.h`
461 if test -n "$f"; then
467 PKG_CHECK_MODULES(SILC, silc, compile_libs=false, compile_libs=true)
468 #ifdef SILC_DIST_CLIENTLIB
469 PKG_CHECK_MODULES(SILCCLIENT, silcclient, compile_libs=false, compile_libs=true)
470 #endif SILC_DIST_CLIENTLIB
472 if test x$compile_libs = xfalse; then
474 LIBS="$LIBS $SILC_LIBS"
475 CFLAGS="$CFLAGS $SILC_CFLAGS"
476 #ifdef SILC_DIST_CLIENTLIB
477 LIBS="$LIBS $SILCCLIENT_LIBS"
478 CFLAGS="$CFLAGS $SILCCLIENT_CFLAGS"
479 #endif SILC_DIST_CLIENTLIB
482 #endif SILC_DIST_TOOLKIT
486 # SOCKS4 support checking
489 SAVE_CFLAGS="$CFLAGS"
490 SAVE_LDFLAGS="$LDFLAGS"
491 AC_MSG_CHECKING(whether to support SOCKS4)
493 [[ --with-socks4[=DIR] with SOCKS4 support [search in DIR/lib and DIR/include]]],
503 if test -d "$withval/include"; then
504 CFLAGS="$CFLAGS -I$withval/include"
506 if test -d "$withval/lib"; then
507 LDFLAGS="$LDFLAGS -L$withval/lib"
519 AC_MSG_ERROR(Could not find SOCKS4 library.)
521 CFLAGS="$SAVE_CFLAGS"
522 LDFLAGS="$SAVE_LDFLAGS"
528 # SOCKS5 support checking
531 SAVE_CFLAGS="$CFLAGS"
532 SAVE_LDFLAGS="$LDFLAGS"
533 AC_MSG_CHECKING(whether to support SOCKS5)
535 [[ --with-socks5[=DIR] with SOCKS5 support [search in DIR/lib and DIR/include]]],
545 if test -d "$withval/include"; then
546 CFLAGS="$CFLAGS -I$withval/include"
548 if test -d "$withval/lib"; then
549 LDFLAGS="$LDFLAGS -L$withval/lib"
552 LIBS="-lsocks5 $LIBS"
561 AC_MSG_ERROR(Could not find SOCKS5 library.)
563 CFLAGS="$SAVE_CFLAGS"
564 LDFLAGS="$SAVE_LDFLAGS"
570 if test "x$socks" = "x4"; then
571 AC_DEFINE([SOCKS], [], [Socks])
572 CFLAGS="$CFLAGS -Dconnect=Rconnect -Dgetsockname=Rgetsockname -Dbind=Rbind -Daccept=Raccept -Dlisten=Rlisten -Dselect=Rselect"
575 if test "x$socks" = "x5"; then
576 AC_DEFINE([SOCKS], [], [Socks])
577 AC_DEFINE([SOCKS5], [], [Socks5])
578 AC_DEFINE([Rconnect], [SOCKSconnect], [Socks])
579 AC_DEFINE([Rgetsockname], [SOCKSgetsockname], [Socks])
580 AC_DEFINE([Rgetpeername], [SOCKSgetpeername], [Socks])
581 AC_DEFINE([Rbind], [SOCKSbind], [Socks])
582 AC_DEFINE([Raccept], [SOCKSaccept], [Socks])
583 AC_DEFINE([Rlisten], [SOCKSlisten], [Socks])
584 AC_DEFINE([Rselect], [SOCKSselect], [Socks])
585 AC_DEFINE([Rrecvfrom], [SOCKSrecvfrom], [Socks])
586 AC_DEFINE([Rsendto], [SOCKSsendto], [Socks])
587 AC_DEFINE([Rrecv], [SOCKSrecv], [Socks])
588 AC_DEFINE([Rsend], [SOCKSsend], [Socks])
589 AC_DEFINE([Rread], [SOCKSread], [Socks])
590 AC_DEFINE([Rwrite], [SOCKSwrite], [Socks])
591 AC_DEFINE([Rrresvport], [SOCKSrresvport], [Socks])
592 AC_DEFINE([Rshutdown], [SOCKSshutdown], [Socks])
593 AC_DEFINE([Rlisten], [SOCKSlisten], [Socks])
594 AC_DEFINE([Rclose], [SOCKSclose], [Socks])
595 AC_DEFINE([Rdup], [SOCKSdup], [Socks])
596 AC_DEFINE([Rdup2], [SOCKSdup2], [Socks])
597 AC_DEFINE([Rfclose], [SOCKSfclose], [Socks])
598 AC_DEFINE([Rgethostbyname], [SOCKSgethostbyname], [Socks])
601 #ifdef SILC_DIST_MATH
602 # MP library checking. First check whether user wants to use GMP and use
603 # it if found. If not or not defined then compile the default library in the
608 SAVE_CFLAGS="$CFLAGS"
609 SAVE_LDFLAGS="$LDFLAGS"
610 AC_MSG_CHECKING(whether to search for GMP)
612 [[ --with-gmp[=DIR] use GMP instead of SILC Math [search in DIR/lib and DIR/include]]],
621 if test -d "$withval/include"; then
622 CFLAGS="$CFLAGS -I$withval/include"
624 if test -d "$withval/lib"; then
625 LDFLAGS="$LDFLAGS -L$withval/lib"
632 AC_CHECK_LIB(gmp, __gmpz_init,
635 AC_DEFINE([SILC_MP_GMP], [], [GMP])
636 AC_MSG_RESULT(Using GMP as a MP library.)
640 CFLAGS="$SAVE_CFLAGS"
641 LDFLAGS="$SAVE_LDFLAGS"
647 AM_CONDITIONAL(SILC_MP_GMP, test x$mp_gmp = xtrue)
648 AM_CONDITIONAL(SILC_MP_SILCMATH, test x$mp_gmp = xfalse)
649 if test x$mp_gmp = xfalse; then
650 AC_DEFINE([SILC_MP_SILCMATH], [], [SILCMATH])
651 AC_MSG_RESULT(Using SILC Math as a MP library.)
653 #endif SILC_DIST_MATH
660 SAVE_CFLAGS="$CFLAGS"
661 SAVE_LDFLAGS="$LDFLAGS"
662 SAVE_CPPFLAGS="$CPPFLAGS"
663 AC_MSG_CHECKING(whether to implicit search for libiconv)
665 [[ --with-iconv[=DIR] use libiconv [search in DIR/include and DIR/lib]]],
670 AC_CHECK_HEADERS(iconv.h,
672 AC_CHECK_FUNC(iconv, has_iconv=true)
678 if test -d $withval/include; then
679 CPPFLAGS="$CPPFLAGS -I$withval/include"
680 CFLAGS="$CFLAGS -I$withval/include"
682 if test -d $withval/lib; then
683 LDFLAGS="$LDFLAGS -L$withval/lib"
690 AC_CHECK_HEADERS(iconv.h,
692 AC_CHECK_FUNCS(iconv,
700 if test x$check_iconv = xtrue; then
701 AC_MSG_RESULT(Searching for iconv...)
704 unset ac_cv_header__iconv_h_ ac_cv_header_iconv_h || true
706 AC_CHECK_HEADERS(iconv.h,
709 AC_MSG_CHECKING(for iconv in -liconv)
716 iconv_t cd = iconv_open("", "");
717 iconv(cd, NULL, NULL, NULL, NULL);
722 AC_DEFINE([HAVE_ICONV], [], [Define if you have the iconv() function.])
729 CFLAGS="$SAVE_CFLAGS"
730 LDFLAGS="$SAVE_LDFLAGS"
731 CPPFLAGS="$SAVE_CPPFLAGS"
736 if test x$check_iconv = xtrue; then
737 # search for iconv library..
739 SAVE_CFLAGS="$CFLAGS"
740 SAVE_LDFLAGS="$LDFLAGS"
741 SAVE_CPPFLAGS="$CPPFLAGS"
743 for dir in `echo "/usr/local /usr/pkg /usr/contrib"`; do
744 if test x$has_iconv = xfalse; then
745 AC_MSG_RESULT(searching in $dir...)
747 if test -d $dir/include; then
748 CPPFLAGS="$CPPFLAGS -I$dir/include"
749 CFLAGS="$CFLAGS -I$dir/include"
751 if test -d $dir/lib; then
752 LDFLAGS="$LDFLAGS -L$dir/lib"
756 unset ac_cv_header__iconv_h_ ac_cv_header_iconv_h || true
758 AC_CHECK_HEADERS(iconv.h,
761 AC_MSG_CHECKING(for iconv in -liconv)
768 iconv_t cd = iconv_open("", "");
769 iconv(cd, NULL, NULL, NULL, NULL);
775 AC_DEFINE([HAVE_ICONV], [], [Define if you have the iconv() function.])
782 CFLAGS="$SAVE_CFLAGS"
783 LDFLAGS="$SAVE_LDFLAGS"
784 CPPFLAGS="$SAVE_CPPFLAGS"
788 CFLAGS="$SAVE_CFLAGS"
789 LDFLAGS="$SAVE_LDFLAGS"
790 CPPFLAGS="$SAVE_CPPFLAGS"
796 if test x$has_iconv = xtrue; then
797 # (1) Some implementations of iconv won't convert from UTF-8 to UTF-8.
798 # (2) In glibc-2.1.2 and earlier there is a bug that messes up ob and
799 # obl when args 2 and 3 are 0 (fixed in glibc-2.1.3).
801 AC_CACHE_CHECK([whether this iconv is good enough], ac_iconv_good,
812 ob = buf, obl = sizeof(buf);
813 return ((cd = iconv_open("UTF-8", "UTF-8")) != (iconv_t)(-1) &&
814 (iconv(cd, 0, 0, &ob, &obl) ||
815 !(ob == buf && obl == sizeof(buf)) ||
830 if test x$ac_iconv_good = xno; then
831 AC_MSG_RESULT(Try using libiconv instead.)
835 # POSIX threads support
837 AC_MSG_CHECKING(whether to search for POSIX threads)
838 AC_ARG_WITH(pthreads,
839 [[ --with-pthreads[=DIR] use POSIX threads [search in DIR/include and DIR/lib]]],
846 if test -d $withval/include; then
847 CPPFLAGS="$CPPFLAGS -I$withval/include"
848 CFLAGS="$CFLAGS -I$withval/include"
850 if test -d $withval/lib; then
851 LDFLAGS="$LDFLAGS -L$withval/lib"
859 if test x$check_threads = xtrue; then
862 SAVE_CFLAGS="$CFLAGS"
863 SAVE_LDFLAGS="$LDFLAGS"
864 SAVE_CPPFLAGS="$CPPFLAGS"
867 AC_CHECK_HEADERS(pthread.h,
869 LIBS="$LIBS -lpthread"
870 AC_CHECK_LIB(pthread, pthread_attr_init, has_threads=true,
875 LIBS="$SAVE_LIBS -pthread"
876 AC_CHECK_LIB(c_r, pthread_attr_init, has_threads=true, LIBS="$SAVE_LIBS")
885 # search for pthread library..
886 for dir in `echo "/usr/local /usr/pkg /usr/contrib /usr/pkg/pthreads /usr/local/pthreads"`; do
887 if test x$has_threads = xfalse; then
888 AC_MSG_RESULT(searching in $dir...)
890 if test -d $dir/include; then
891 CPPFLAGS="$CPPFLAGS -I$dir/include"
892 CFLAGS="$CFLAGS -I$dir/include"
894 if test -d $dir/lib; then
895 LDFLAGS="$LDFLAGS -L$dir/lib"
899 unset ac_cv_header__pthread_h_ ac_cv_header_pthread_h || true
901 AC_CHECK_HEADERS(pthread.h,
903 LIBS="$LIBS -lpthread"
904 AC_CHECK_LIB(pthread, pthread_attr_init, has_threads=true,
909 CFLAGS="$SAVE_CFLAGS"
910 LDFLAGS="$SAVE_LDFLAGS"
911 CPPFLAGS="$SAVE_CPPFLAGS"
915 CFLAGS="$SAVE_CFLAGS"
916 LDFLAGS="$SAVE_LDFLAGS"
917 CPPFLAGS="$SAVE_CPPFLAGS"
927 __SILC_HAVE_PTHREAD=""
928 AM_CONDITIONAL(SILC_THREADS, test x$has_threads = xtrue)
929 if test x$has_threads = xtrue; then
930 CFLAGS="$CFLAGS -D_REENTRANT"
932 # XXX possibly incomplete
935 CFLAGS="$CFLAGS -D_THREAD_SAFE"
936 if test x"$GCC" = xyes; then
937 CFLAGS="$CFLAGS -mthreads"
941 CFLAGS="$CFLAGS -D_THREAD_SAFE"
943 *-*-sysv5uw7*) # UnixWare 7
944 if test "$GCC" != "yes"; then
945 CFLAGS="$CFLAGS -Kthread"
947 CFLAGS="$CFLAGS -pthread"
951 CFLAGS="$CFLAGS -D_POSIX4A_DRAFT10_SOURCE"
955 AC_CHECK_FUNC(pthread_create)
956 AC_DEFINE([SILC_HAVE_PTHREAD], [], [HAVE_PTHREAD])
957 AC_DEFINE([SILC_THREADS], [], [HAVE_THREAD])
958 __SILC_HAVE_PTHREAD="#define __SILC_HAVE_PTHREAD 1"
961 # Native WIN32 compilation under cygwin
963 AC_MSG_CHECKING(whether to compile native WIN32 code)
965 [ --with-win32 compile native WIN32 (MinGW) code (-mno-cygwin)],
968 AC_DEFINE([SILC_WIN32], [], [SILC_WIN32])
970 CFLAGS="-mno-cygwin $CFLAGS"
971 LIBS="$LIBS -lwsock32"
976 AM_CONDITIONAL(SILC_WIN32, test x$win32_support = xtrue)
978 # Native EPOC support (disabled by default)
980 AM_CONDITIONAL(SILC_EPOC, test xfalse = xtrue)
982 # Native BeOS support (disabled by default)
984 AM_CONDITIONAL(SILC_BEOS, test xfalse = xtrue)
986 # Native OS2 support (disabled by default)
988 AM_CONDITIONAL(SILC_OS2, test xfalse = xtrue)
990 #ifdef SILC_DIST_TOOLKIT
994 AC_MSG_CHECKING(whether to compile Irssi SILC Client)
996 [ --with-irssi compile with Irssi SILC Client],
1005 AM_CONDITIONAL(with_irssi, test xwithout_irssi = xfalse)
1010 AC_MSG_CHECKING(whether to compile SILC Server)
1012 [ --with-silcd compile with SILC Server],
1021 #endif SILC_DIST_TOOLKIT
1022 #ifdef SILC_DIST_INPLACE
1025 #endif SILC_DIST_INPLACE
1028 AC_MSG_CHECKING(whether to do libtoolfix)
1029 AC_ARG_WITH(libtoolfix,
1030 [ --without-libtoolfix Do not fix libtool, for package builders],
1040 AC_DEFINE_UNQUOTED([SILC_ETCDIR], "$ETCDIR", [SILC_ETCDIR])
1041 #endif SILC_DIST_COMPILER
1047 # Make enable-shared aware
1048 AM_CONDITIONAL(SILC_ENABLE_SHARED, test "$enable_shared" = yes)
1050 SILC_TOP_SRCDIR=`pwd`
1052 # Included configure scripts
1053 AD_INCLUDE_CONFIGURE
1055 #ifdef SILC_DIST_COMPILER
1059 AC_SUBST(SILC_TOP_SRCDIR)
1061 AC_SUBST(SILC_LIB_INCLUDES)
1062 AC_SUBST(__SILC_HAVE_PTHREAD)
1063 AC_SUBST(__SILC_HAVE_SIM)
1064 AC_SUBST(__SILC_ENABLE_DEBUG)
1067 # Fix the libtool to support run-time configuration. This allows us
1068 # to in run-time specify when to compile shared/static libraries without
1069 # need to reconfigure the entire libtool.
1071 if test x$libtoolfix = xtrue; then
1072 ./libtoolfix $SILC_TOP_SRCDIR/ltmain.sh
1074 AM_CONDITIONAL(SILC_LIBTOOLFIX, test x$libtoolfix = xtrue)
1076 INCLUDE_DEFINES_INT="include \$(top_srcdir)/Makefile.defines_int"
1077 AC_SUBST(INCLUDE_DEFINES_INT)
1079 #endif SILC_DIST_COMPILER
1086 #ifdef SILC_DIST_DOC
1088 #endif SILC_DIST_DOC
1089 #ifdef SILC_DIST_COMPILER
1091 Makefile.defines_int
1093 includes/silcversion.h
1094 includes/silcincludes.h
1095 #endif SILC_DIST_COMPILER
1096 #ifdef SILC_DIST_APPS
1098 #endif SILC_DIST_APPS
1101 #ifdef SILC_DIST_TOOLKIT
1104 win32/libsilc/Makefile
1105 win32/libsilcclient/Makefile
1107 tutorial/Makefile.defines
1108 tutorial/Makefile.defines_int
1110 #endif SILC_DIST_TOOLKIT
1114 #ifdef SILC_DIST_COMPILER
1115 s_bindir=`eval echo $bindir`;s_bindir=`eval echo $s_bindir`
1116 s_sbindir=`eval echo $sbindir`;s_sbindir=`eval echo $s_sbindir`
1117 s_mandir=`eval echo $mandir`;s_mandir=`eval echo $s_mandir`
1118 s_includedir=`eval echo $includedir`;s_includedir=`eval echo $s_includedir`
1121 echo "$PACKAGE Configuration Summary:"
1122 echo "---------------------------"
1123 echo " Target host ...................: $target"
1124 echo " Compiler ......................: $CC"
1125 echo " CFLAGS ........................: $CFLAGS"
1126 echo " LDFLAGS .......................: $LDFLAGS"
1127 echo " LIBS ..........................: $LIBS"
1129 echo " Installation prefix ...........: $prefix"
1130 echo " bin directory .................: $s_bindir"
1131 echo " sbin directory ................: $s_sbindir"
1132 echo " etc directory .................: $ETCDIR"
1133 echo " man directory .................: $s_mandir"
1134 echo " doc directory .................: $DOCDIR"
1135 #ifdef SILC_DIST_SIM
1136 echo " SIM directory .................: $MODULESDIR"
1137 #endif SILC_DIST_SIM
1138 #ifdef SILC_DIST_INCLUDES
1139 echo " include directory .............: $s_includedir"
1140 #endif SILC_DIST_INCLUDES
1143 #ifdef SILC_DIST_TOOLKIT
1144 if test x$without_irssi = xtrue; then
1147 if test x$without_silcd = xtrue; then
1150 #endif SILC_DIST_TOOLKIT
1152 #ifdef SILC_DIST_CLIENT
1153 echo " Compile SILC Client ...........: $irssi"
1154 #endif SILC_DIST_CLIENT
1156 #ifdef SILC_DIST_SERVER
1157 echo " Compile SILC Server ...........: $silcd"
1158 #endif SILC_DIST_SERVER
1160 #ifdef SILC_DIST_SIM
1161 if test x$sim_support = xfalse; then
1166 echo " SIM support ...................: $sim_support"
1167 #endif SILC_DIST_SIM
1169 echo " IPv6 support ..................: $summary_ipv6"
1171 if test x$has_iconv = xfalse; then
1176 echo " Iconv support .................: $iconv_support"
1178 if test x$want_asm = xfalse; then
1183 echo " Assembler optimizations .......: $summary_asm"
1185 #ifdef SILC_DIST_MATH
1186 if test x$mp_gmp = xtrue; then
1187 echo " Arithmetic library ............: GMP"
1189 #endif SILC_DIST_MATH
1192 if test x$has_threads = xtrue; then
1195 echo " Multi-threads support .........: $threads"
1196 echo " Debugging enabled .............: $summary_debug"
1198 echo "Compile the sources with 'make' or 'gmake' command."
1199 #endif SILC_DIST_COMPILER