4 # Author: Pekka Riikonen <priikone@silcnet.org>
6 # Copyright (C) 2000 - 2006 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
50 AC_DEFINE([SILC_I386], [], [SILC_I386])
53 AC_DEFINE([SILC_I486], [], [SILC_I486])
56 AC_DEFINE([SILC_X86_64], [], [SILC_X86_64])
59 AC_DEFINE([SILC_POWERPC], [], [SILC_POWERPC])
62 AC_DEFINE([SILC_IA64], [], [SILC_IA64])
66 # Control compiler optimizations
67 CFLAGS=`echo $CFLAGS | sed 's/-O[ 0123456789s]*//g'`
73 __SILC_HAVE_PTHREAD=""
75 __SILC_ENABLE_DEBUG=""
78 #ifndef SILC_DIST_TOOLKIT
80 #endif SILC_DIST_TOOLKIT
81 #ifdef SILC_DIST_INPLACE
83 #endif SILC_DIST_INPLACE
92 # More header checking
94 AC_CHECK_HEADERS(unistd.h string.h getopt.h errno.h fcntl.h assert.h)
95 AC_CHECK_HEADERS(sys/types.h sys/stat.h sys/time.h stddef.h)
96 AC_CHECK_HEADERS(netinet/in.h netinet/tcp.h xti.h netdb.h sys/resource.h)
97 AC_CHECK_HEADERS(pwd.h grp.h termcap.h paths.h)
98 AC_CHECK_HEADERS(ncurses.h signal.h ctype.h utime.h)
99 AC_CHECK_HEADERS(arpa/inet.h sys/mman.h limits.h termios.h locale.h langinfo.h)
109 AC_CHECK_SIZEOF(long long, 0)
110 AC_SUBST(SILC_SIZEOF_LONG_LONG, $ac_cv_sizeof_long_long)
111 AC_CHECK_SIZEOF(long, 0)
112 AC_SUBST(SILC_SIZEOF_LONG, $ac_cv_sizeof_long)
113 AC_CHECK_SIZEOF(int, 0)
114 AC_SUBST(SILC_SIZEOF_INT, $ac_cv_sizeof_int)
115 AC_CHECK_SIZEOF(short, 0)
116 AC_SUBST(SILC_SIZEOF_SHORT, $ac_cv_sizeof_short)
117 AC_CHECK_SIZEOF(char, 0)
118 AC_SUBST(SILC_SIZEOF_CHAR, $ac_cv_sizeof_char)
119 AC_CHECK_SIZEOF(void *, 0)
120 AC_SUBST(SILC_SIZEOF_VOID_P, $ac_cv_sizeof_void_p)
122 # Function and library checking
124 AC_CHECK_FUNC(gethostbyname, [],
126 AC_CHECK_LIB(nsl, gethostbyname, LIBS="$LIBS -lnsl")
127 AC_CHECK_FUNC(res_gethostbyname, [],
128 AC_CHECK_LIB(resolv, res_gethostbyname, LIBS="$LIBS -lresolv")
131 AC_CHECK_FUNC(socket, [],
132 AC_CHECK_LIB(socket, socket, LIBS="$LIBS -lsocket")
134 AC_CHECK_FUNCS(gethostname gethostbyaddr getservbyname getservbyport)
135 AC_CHECK_FUNCS(poll select listen bind shutdown close connect setsockopt)
136 AC_CHECK_FUNCS(setrlimit time ctime utime gettimeofday getrusage)
137 AC_CHECK_FUNCS(chmod fcntl stat fstat getenv putenv strerror)
138 AC_CHECK_FUNCS(getpid getgid getsid getpgid getpgrp getuid)
139 AC_CHECK_FUNCS(setgroups initgroups nl_langinfo)
140 AC_CHECK_FUNCS(strchr strstr strcpy strncpy memcpy memset memmove)
143 # SIM support checking
144 # XXX These needs to be changed as more supported platforms appear.
145 # XXX This probably needs to be made platform dependant check.
148 AC_MSG_CHECKING(for SIM support)
150 AC_CHECK_HEADERS(dlfcn.h,
152 AC_CHECK_LIB(dl, dlopen,
154 AC_DEFINE([SILC_SIM], [], [HAVE_SIM])
159 AC_CHECK_LIB(c, dlopen,
161 AC_DEFINE([SILC_SIM], [], [HAVE_SIM])
167 AM_CONDITIONAL(SILC_SIM, test x$sim_support = xtrue)
168 if test x$sim_support = xtrue; then
169 AC_MSG_RESULT(Enabled SIM support.)
170 __SILC_HAVE_SIM="#define __SILC_HAVE_SIM 1"
172 AC_MSG_RESULT(No SIM support found.)
176 # lib/contrib conditionals
178 AC_CHECK_HEADER(regex.h,
180 AC_DEFINE([HAVE_REGEX_H], [], [HAVE_REGEX_H])
184 AM_CONDITIONAL(HAVE_REGEX, test x$have_regex = x1)
186 AC_CHECK_FUNC(getopt_long,
188 AC_DEFINE([HAVE_GETOPT_LONG], [], [HAVE_GETOPT_LONG])
190 ], have_getopt_long=0
193 AC_CHECK_FUNC(getopt,
195 AC_DEFINE([HAVE_GETOPT], [], [HAVE_GETOPT])
201 ## Enable/disable checking
206 AC_MSG_CHECKING(whether to enable IPv6 support)
208 [ --enable-ipv6 enable IPv6 support],
210 case "${enableval}" in
215 AC_DEFINE([HAVE_IPV6], [], [HAVE_IPV6])
229 if test x$check_ipv6 = xtrue; then
233 #ifdef HAVE_SYS_TYPES_H
234 #include <sys/types.h>
236 #ifdef HAVE_NETINET_TCP_H
237 #include <netinet/tcp.h>
242 #include <sys/socket.h>
243 #ifdef HAVE_NETINET_IN_H
244 #include <netinet/in.h>
248 struct sockaddr_in6 sin6;
249 int family = AF_INET6;
252 AC_DEFINE([HAVE_IPV6], [], [HAVE_IPV6])
262 AC_MSG_CHECKING(whether to enable debugging)
264 __SILC_ENABLE_DEBUG=""
266 [ --enable-debug enable debugging],
268 case "${enableval}" in
271 AC_DEFINE([SILC_DEBUG], [], [enable-debug])
273 __SILC_ENABLE_DEBUG="#define __SILC_ENABLE_DEBUG 1"
284 # Disable all assembler optimizations
286 AC_MSG_CHECKING(whether to enable assembler optimizations)
289 [ --disable-asm do not use assembler optimizations],
303 AC_MSG_CHECKING(for va_copy)
315 if (va_arg(cp, int) != 0xff11)
327 AC_DEFINE([HAVE_VA_COPY], [], [HAVE_VA_COPY])
337 if test x$va_copy = xfalse; then
338 AC_MSG_CHECKING(for __va_copy)
350 if (va_arg(cp, int) != 0xff11)
362 AC_DEFINE([HAVE___VA_COPY], [], [HAVE___VA_COPY])
373 if test x$va_copy = xfalse; then
383 if (va_arg(cp, int) != 0xff11)
396 AC_DEFINE([SILC_VA_COPY_ARRAY], [], [SILC_VA_COPY_ARRAY])
403 ## Compiler and compiler flag checks
406 # Function to check if compiler flag works
407 # Usage: SILC_ADD_CFLAGS(FLAGS, [ACTION-IF-FAILED])
408 AC_DEFUN([SILC_ADD_CFLAGS],
409 [ tmp_CFLAGS="$CFLAGS"
411 AC_MSG_CHECKING(whether $CC accepts $1 flag)
412 AC_TRY_LINK([], [], [AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no)
418 # Function to check if compiler flag works, destination specifiable
419 # Usage: SILC_ADD_CC_FLAGS(VAR, FLAGS, [ACTION-IF-FAILED])
420 AC_DEFUN([SILC_ADD_CC_FLAGS],
421 [ tmp_CFLAGS="$1_CFLAGS"
422 $1_CFLAGS="${$1_CFLAGS} $2"
423 AC_MSG_CHECKING(whether $CC accepts $2 flag)
424 AC_TRY_LINK([], [], [AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no)
425 $1_CFLAGS="$tmp_CFLAGS"
431 # GCC specific options
432 if test "x$summary_debug" = "xyes"; then
433 SILC_ADD_CFLAGS(-g -O)
435 SILC_ADD_CFLAGS(-g -O2)
437 SILC_ADD_CFLAGS(-Wall -finline-functions)
438 SILC_ADD_CFLAGS(-Wno-pointer-sign)
443 SILC_ADD_CFLAGS(-g3 -O2, SILC_ADD_CFLAGS(-g3 -O, SILC_ADD_CFLAGS(-O)))
446 SILC_ADD_CFLAGS(-g3 -O2, SILC_ADD_CFLAGS(-g3 -O, SILC_ADD_CFLAGS(-O)))
450 SILC_ADD_CFLAGS(-O2, SILC_ADD_CFLAGS(-O))
454 # Intel C++ Compiler needs -restrict
455 if test "x$CC" = "xicc"; then
456 SILC_ADD_CFLAGS(-restrict)
461 # Workaround a bug in GCC 2.x which causes memory exhaustion
462 # when compiling sha1 with optimizations on UltraSPARC.
465 if test "$GCC" -a "$host_cpu" = "sparc64"; then
466 AC_MSG_CHECKING(whether to enable GCC 2.x workaround for SHA1)
469 #if defined(__sparc64__) && (__GNUC__ == 2)
483 #endif SILC_DIST_COMPILER
489 # Default installation destination
491 #ifdef SILC_DIST_AUTODIST
492 AC_PREFIX_DEFAULT(/usr/local)
493 #else !SILC_DIST_AUTODIST
494 AC_PREFIX_DEFAULT(/usr/local/silc)
495 #endif SILC_DIST_AUTODIST
496 if test "x$prefix" != xNONE; then
497 silc_prefix="$prefix"
499 silc_prefix="$ac_default_prefix"
502 #ifndef SILC_DIST_AUTODIST
505 if test "x$sysconfdir" != 'x${prefix}/etc'; then
508 ETCDIR="$silc_prefix/etc"
512 [[ --with-etcdir=DIR directory for system files [/etc/silc]]],
523 AC_DEFINE_UNQUOTED([SILC_ETCDIR], "$ETCDIR", [SILC_ETCDIR])
527 DOCDIR="$silc_prefix/doc"
529 [[ --with-docdir=DIR directory for SILC documentation [PREFIX/doc]]],
540 AC_DEFINE_UNQUOTED([SILC_DOCDIR], "$DOCDIR", [SILC_DOCDIR])
541 #endif SILC_DIST_AUTODIST
543 #ifdef SILC_DIST_COMPILER
545 ## With/without checkings
549 # SILC library checking
553 #ifndef SILC_DIST_TOOLKIT
554 AC_ARG_WITH(silc-includes,
555 [ --with-silc-includes=DIR SILC Toolkit includes [search in DIR]],
556 [ac_silc_includes="$withval"], [ac_silc_includes="no"])
557 AC_ARG_WITH(silc-libs,
558 [ --with-silc-libs=DIR SILC Toolkit libraries [search in DIR]],
559 [ac_silc_libs="$withval"], [ac_silc_libs="no"])
561 if test -n "$with_silc_includes" || test -n "$with_silc_libs"; then
563 # Manually provided libs
564 if test "$ac_silc_includes" != "no"; then
566 SILC_LIB_INCLUDES="-I$ac_silc_includes"
569 if test "$ac_silc_libs" != "no"; then
572 LIBS="$LIBS -L$ac_silc_libs"
575 # Check libs to link against
576 f=`$EGREP __SILC_HAVE_PTHREAD $ac_silc_includes/silc.h`
577 if test -n "$f"; then
578 LIBS="$LIBS -lpthread"
582 f=`$EGREP __SILC_HAVE_SIM $ac_silc_includes/silc.h`
583 if test -n "$f"; then
589 PKG_CHECK_MODULES(SILC, silc, compile_libs=false, compile_libs=true)
590 #ifdef SILC_DIST_CLIENTLIB
591 PKG_CHECK_MODULES(SILCCLIENT, silcclient, compile_libs=false, compile_libs=true)
592 #endif SILC_DIST_CLIENTLIB
593 #ifdef SILC_DIST_SERVERLIB
594 PKG_CHECK_MODULES(SILCSERVER, silcserver, compile_libs=false, compile_libs=true)
595 #endif SILC_DIST_SERVERLIB
597 if test x$compile_libs = xfalse; then
599 LIBS="$LIBS $SILC_LIBS"
600 CFLAGS="$CFLAGS $SILC_CFLAGS"
601 #ifdef SILC_DIST_CLIENTLIB
602 LIBS="$LIBS $SILCCLIENT_LIBS"
603 CFLAGS="$CFLAGS $SILCCLIENT_CFLAGS"
604 #endif SILC_DIST_CLIENTLIB
605 #ifdef SILC_DIST_SERVERLIB
606 LIBS="$LIBS $SILCSERVER_LIBS"
607 CFLAGS="$CFLAGS $SILCSERVER_CFLAGS"
608 #endif SILC_DIST_SERVERLIB
611 #endif SILC_DIST_TOOLKIT
615 # SOCKS4 support checking
618 SAVE_CFLAGS="$CFLAGS"
619 SAVE_LDFLAGS="$LDFLAGS"
620 AC_MSG_CHECKING(whether to support SOCKS4)
622 [[ --with-socks4[=DIR] with SOCKS4 support [search in DIR/lib and DIR/include]]],
632 if test -d "$withval/include"; then
633 CFLAGS="$CFLAGS -I$withval/include"
635 if test -d "$withval/lib"; then
636 LDFLAGS="$LDFLAGS -L$withval/lib"
648 AC_MSG_ERROR(Could not find SOCKS4 library.)
650 CFLAGS="$SAVE_CFLAGS"
651 LDFLAGS="$SAVE_LDFLAGS"
657 # SOCKS5 support checking
660 SAVE_CFLAGS="$CFLAGS"
661 SAVE_LDFLAGS="$LDFLAGS"
662 AC_MSG_CHECKING(whether to support SOCKS5)
664 [[ --with-socks5[=DIR] with SOCKS5 support [search in DIR/lib and DIR/include]]],
674 if test -d "$withval/include"; then
675 CFLAGS="$CFLAGS -I$withval/include"
677 if test -d "$withval/lib"; then
678 LDFLAGS="$LDFLAGS -L$withval/lib"
681 LIBS="-lsocks5 $LIBS"
690 AC_MSG_ERROR(Could not find SOCKS5 library.)
692 CFLAGS="$SAVE_CFLAGS"
693 LDFLAGS="$SAVE_LDFLAGS"
699 if test "x$socks" = "x4"; then
700 AC_DEFINE([SOCKS], [], [Socks])
701 CFLAGS="$CFLAGS -Dconnect=Rconnect -Dgetsockname=Rgetsockname -Dbind=Rbind -Daccept=Raccept -Dlisten=Rlisten -Dselect=Rselect"
704 if test "x$socks" = "x5"; then
705 AC_DEFINE([SOCKS], [], [Socks])
706 AC_DEFINE([SOCKS5], [], [Socks5])
707 AC_DEFINE([Rconnect], [SOCKSconnect], [Socks])
708 AC_DEFINE([Rgetsockname], [SOCKSgetsockname], [Socks])
709 AC_DEFINE([Rgetpeername], [SOCKSgetpeername], [Socks])
710 AC_DEFINE([Rbind], [SOCKSbind], [Socks])
711 AC_DEFINE([Raccept], [SOCKSaccept], [Socks])
712 AC_DEFINE([Rlisten], [SOCKSlisten], [Socks])
713 AC_DEFINE([Rselect], [SOCKSselect], [Socks])
714 AC_DEFINE([Rrecvfrom], [SOCKSrecvfrom], [Socks])
715 AC_DEFINE([Rsendto], [SOCKSsendto], [Socks])
716 AC_DEFINE([Rrecv], [SOCKSrecv], [Socks])
717 AC_DEFINE([Rsend], [SOCKSsend], [Socks])
718 AC_DEFINE([Rread], [SOCKSread], [Socks])
719 AC_DEFINE([Rwrite], [SOCKSwrite], [Socks])
720 AC_DEFINE([Rrresvport], [SOCKSrresvport], [Socks])
721 AC_DEFINE([Rshutdown], [SOCKSshutdown], [Socks])
722 AC_DEFINE([Rlisten], [SOCKSlisten], [Socks])
723 AC_DEFINE([Rclose], [SOCKSclose], [Socks])
724 AC_DEFINE([Rdup], [SOCKSdup], [Socks])
725 AC_DEFINE([Rdup2], [SOCKSdup2], [Socks])
726 AC_DEFINE([Rfclose], [SOCKSfclose], [Socks])
727 AC_DEFINE([Rgethostbyname], [SOCKSgethostbyname], [Socks])
730 #ifdef SILC_DIST_MATH
731 # MP library checking. First check whether user wants to use GMP and use
732 # it if found. If not or not defined then compile the default library in the
737 SAVE_CFLAGS="$CFLAGS"
738 SAVE_LDFLAGS="$LDFLAGS"
739 AC_MSG_CHECKING(whether to search for GMP)
741 [[ --with-gmp[=DIR] use GMP instead of SILC Math [search in DIR/lib and DIR/include]]],
750 if test -d "$withval/include"; then
751 CFLAGS="$CFLAGS -I$withval/include"
753 if test -d "$withval/lib"; then
754 LDFLAGS="$LDFLAGS -L$withval/lib"
761 AC_CHECK_LIB(gmp, __gmpz_init,
764 AC_DEFINE([SILC_MP_GMP], [], [GMP])
765 AC_MSG_RESULT(Using GMP as a MP library.)
769 CFLAGS="$SAVE_CFLAGS"
770 LDFLAGS="$SAVE_LDFLAGS"
776 AM_CONDITIONAL(SILC_MP_GMP, test x$mp_gmp = xtrue)
777 AM_CONDITIONAL(SILC_MP_SILCMATH, test x$mp_gmp = xfalse)
778 if test x$mp_gmp = xfalse; then
779 AC_DEFINE([SILC_MP_SILCMATH], [], [SILCMATH])
780 AC_MSG_RESULT(Using SILC Math as a MP library.)
782 #endif SILC_DIST_MATH
789 SAVE_CFLAGS="$CFLAGS"
790 SAVE_LDFLAGS="$LDFLAGS"
791 SAVE_CPPFLAGS="$CPPFLAGS"
792 AC_MSG_CHECKING(whether to implicit search for libiconv)
794 [[ --with-iconv[=DIR] use libiconv [search in DIR/include and DIR/lib]]],
799 AC_CHECK_HEADERS(iconv.h,
801 AC_CHECK_FUNC(iconv, has_iconv=true)
807 if test -d $withval/include; then
808 CPPFLAGS="$CPPFLAGS -I$withval/include"
809 CFLAGS="$CFLAGS -I$withval/include"
811 if test -d $withval/lib; then
812 LDFLAGS="$LDFLAGS -L$withval/lib"
819 AC_CHECK_HEADERS(iconv.h,
821 AC_CHECK_FUNCS(iconv,
829 if test x$check_iconv = xtrue; then
830 AC_MSG_RESULT(Searching for iconv...)
833 unset ac_cv_header__iconv_h_ ac_cv_header_iconv_h || true
835 AC_CHECK_HEADERS(iconv.h,
838 AC_MSG_CHECKING(for iconv in -liconv)
845 iconv_t cd = iconv_open("", "");
846 iconv(cd, NULL, NULL, NULL, NULL);
851 AC_DEFINE([HAVE_ICONV], [], [Define if you have the iconv() function.])
858 CFLAGS="$SAVE_CFLAGS"
859 LDFLAGS="$SAVE_LDFLAGS"
860 CPPFLAGS="$SAVE_CPPFLAGS"
865 if test x$check_iconv = xtrue; then
866 # search for iconv library..
868 SAVE_CFLAGS="$CFLAGS"
869 SAVE_LDFLAGS="$LDFLAGS"
870 SAVE_CPPFLAGS="$CPPFLAGS"
872 for dir in `echo "/usr/local /usr/pkg /usr/contrib"`; do
873 if test x$has_iconv = xfalse; then
874 AC_MSG_RESULT(searching in $dir...)
876 if test -d $dir/include; then
877 CPPFLAGS="$CPPFLAGS -I$dir/include"
878 CFLAGS="$CFLAGS -I$dir/include"
880 if test -d $dir/lib; then
881 LDFLAGS="$LDFLAGS -L$dir/lib"
885 unset ac_cv_header__iconv_h_ ac_cv_header_iconv_h || true
887 AC_CHECK_HEADERS(iconv.h,
890 AC_MSG_CHECKING(for iconv in -liconv)
897 iconv_t cd = iconv_open("", "");
898 iconv(cd, NULL, NULL, NULL, NULL);
904 AC_DEFINE([HAVE_ICONV], [], [Define if you have the iconv() function.])
911 CFLAGS="$SAVE_CFLAGS"
912 LDFLAGS="$SAVE_LDFLAGS"
913 CPPFLAGS="$SAVE_CPPFLAGS"
917 CFLAGS="$SAVE_CFLAGS"
918 LDFLAGS="$SAVE_LDFLAGS"
919 CPPFLAGS="$SAVE_CPPFLAGS"
925 if test x$has_iconv = xtrue; then
926 # (1) Some implementations of iconv won't convert from UTF-8 to UTF-8.
927 # (2) In glibc-2.1.2 and earlier there is a bug that messes up ob and
928 # obl when args 2 and 3 are 0 (fixed in glibc-2.1.3).
930 AC_CACHE_CHECK([whether this iconv is good enough], ac_iconv_good,
941 ob = buf, obl = sizeof(buf);
942 return ((cd = iconv_open("UTF-8", "UTF-8")) != (iconv_t)(-1) &&
943 (iconv(cd, 0, 0, &ob, &obl) ||
944 !(ob == buf && obl == sizeof(buf)) ||
959 if test x$ac_iconv_good = xno; then
960 AC_MSG_RESULT(Try using libiconv instead.)
964 # POSIX threads support
966 AC_MSG_CHECKING(whether to search for POSIX threads)
967 AC_ARG_WITH(pthreads,
968 [[ --with-pthreads[=DIR] use POSIX threads [search in DIR/include and DIR/lib]]],
975 if test -d $withval/include; then
976 CPPFLAGS="$CPPFLAGS -I$withval/include"
977 CFLAGS="$CFLAGS -I$withval/include"
979 if test -d $withval/lib; then
980 LDFLAGS="$LDFLAGS -L$withval/lib"
988 if test x$check_threads = xtrue; then
991 SAVE_CFLAGS="$CFLAGS"
992 SAVE_LDFLAGS="$LDFLAGS"
993 SAVE_CPPFLAGS="$CPPFLAGS"
996 AC_CHECK_HEADERS(pthread.h,
998 LIBS="$LIBS -lpthread"
999 AC_CHECK_LIB(pthread, pthread_attr_init, has_threads=true,
1004 LIBS="$SAVE_LIBS -pthread"
1005 AC_CHECK_LIB(c_r, pthread_attr_init, has_threads=true, LIBS="$SAVE_LIBS")
1014 # search for pthread library..
1015 for dir in `echo "/usr/local /usr/pkg /usr/contrib /usr/pkg/pthreads /usr/local/pthreads"`; do
1016 if test x$has_threads = xfalse; then
1017 AC_MSG_RESULT(searching in $dir...)
1019 if test -d $dir/include; then
1020 CPPFLAGS="$CPPFLAGS -I$dir/include"
1021 CFLAGS="$CFLAGS -I$dir/include"
1023 if test -d $dir/lib; then
1024 LDFLAGS="$LDFLAGS -L$dir/lib"
1028 unset ac_cv_header__pthread_h_ ac_cv_header_pthread_h || true
1030 AC_CHECK_HEADERS(pthread.h,
1032 LIBS="$LIBS -lpthread"
1033 AC_CHECK_LIB(pthread, pthread_attr_init, has_threads=true,
1038 CFLAGS="$SAVE_CFLAGS"
1039 LDFLAGS="$SAVE_LDFLAGS"
1040 CPPFLAGS="$SAVE_CPPFLAGS"
1044 CFLAGS="$SAVE_CFLAGS"
1045 LDFLAGS="$SAVE_LDFLAGS"
1046 CPPFLAGS="$SAVE_CPPFLAGS"
1056 __SILC_HAVE_PTHREAD=""
1057 AM_CONDITIONAL(SILC_THREADS, test x$has_threads = xtrue)
1058 if test x$has_threads = xtrue; then
1059 CFLAGS="$CFLAGS -D_REENTRANT"
1061 # XXX possibly incomplete
1064 CFLAGS="$CFLAGS -D_THREAD_SAFE"
1065 if test x"$GCC" = xyes; then
1066 CFLAGS="$CFLAGS -mthreads"
1070 CFLAGS="$CFLAGS -D_THREAD_SAFE"
1072 *-*-sysv5uw7*) # UnixWare 7
1073 if test "$GCC" != "yes"; then
1074 CFLAGS="$CFLAGS -Kthread"
1076 CFLAGS="$CFLAGS -pthread"
1080 CFLAGS="$CFLAGS -D_POSIX4A_DRAFT10_SOURCE"
1084 AC_CHECK_FUNC(pthread_create)
1085 AC_DEFINE([SILC_HAVE_PTHREAD], [], [HAVE_PTHREAD])
1086 AC_DEFINE([SILC_THREADS], [], [HAVE_THREAD])
1087 __SILC_HAVE_PTHREAD="#define __SILC_HAVE_PTHREAD 1"
1090 # Native WIN32 compilation under cygwin
1092 AC_MSG_CHECKING(whether to compile native WIN32 code)
1094 [ --with-win32 compile native WIN32 (MinGW) code (-mno-cygwin)],
1097 AC_DEFINE([SILC_WIN32], [], [SILC_WIN32])
1099 CFLAGS="-mno-cygwin $CFLAGS"
1100 LIBS="$LIBS -lwsock32"
1105 AM_CONDITIONAL(SILC_WIN32, test x$win32_support = xtrue)
1107 # Native EPOC support (disabled by default)
1109 AM_CONDITIONAL(SILC_EPOC, test xfalse = xtrue)
1111 # Native BeOS support (disabled by default)
1113 AM_CONDITIONAL(SILC_BEOS, test xfalse = xtrue)
1115 # Native OS2 support (disabled by default)
1117 AM_CONDITIONAL(SILC_OS2, test xfalse = xtrue)
1119 #ifdef SILC_DIST_TOOLKIT
1123 AC_MSG_CHECKING(whether to compile Irssi SILC Client)
1125 [ --with-irssi compile with Irssi SILC Client],
1134 AM_CONDITIONAL(with_irssi, test xwithout_irssi = xfalse)
1139 AC_MSG_CHECKING(whether to compile SILC Server)
1141 [ --with-silcd compile with SILC Server],
1150 #endif SILC_DIST_TOOLKIT
1151 #ifdef SILC_DIST_INPLACE
1154 #endif SILC_DIST_INPLACE
1157 AC_MSG_CHECKING(whether to do libtoolfix)
1158 AC_ARG_WITH(libtoolfix,
1159 [ --without-libtoolfix Do not fix libtool, for package builders],
1169 AC_DEFINE_UNQUOTED([SILC_ETCDIR], "$ETCDIR", [SILC_ETCDIR])
1170 #endif SILC_DIST_COMPILER
1176 # Make enable-shared aware
1177 AM_CONDITIONAL(SILC_ENABLE_SHARED, test "$enable_shared" = yes)
1179 SILC_TOP_SRCDIR=`pwd`
1181 # Included configure scripts
1182 AD_INCLUDE_CONFIGURE
1184 #ifdef SILC_DIST_COMPILER
1188 AC_SUBST(SILC_TOP_SRCDIR)
1190 AC_SUBST(SILC_LIB_INCLUDES)
1191 AC_SUBST(__SILC_HAVE_PTHREAD)
1192 AC_SUBST(__SILC_HAVE_SIM)
1193 AC_SUBST(__SILC_ENABLE_DEBUG)
1196 # Fix the libtool to support run-time configuration. This allows us
1197 # to in run-time specify when to compile shared/static libraries without
1198 # need to reconfigure the entire libtool.
1200 if test x$libtoolfix = xtrue; then
1201 ./libtoolfix $SILC_TOP_SRCDIR/ltmain.sh
1203 AM_CONDITIONAL(SILC_LIBTOOLFIX, test x$libtoolfix = xtrue)
1205 INCLUDE_DEFINES_INT="include \$(top_srcdir)/Makefile.defines_int"
1206 AC_SUBST(INCLUDE_DEFINES_INT)
1208 #endif SILC_DIST_COMPILER
1215 #ifdef SILC_DIST_DOC
1217 #endif SILC_DIST_DOC
1218 #ifdef SILC_DIST_COMPILER
1220 Makefile.defines_int
1222 includes/silcversion.h
1224 #endif SILC_DIST_COMPILER
1225 #ifdef SILC_DIST_APPS
1227 #endif SILC_DIST_APPS
1230 #ifdef SILC_DIST_TOOLKIT
1233 win32/libsilc/Makefile
1234 win32/libsilcclient/Makefile
1236 tutorial/Makefile.defines
1237 tutorial/Makefile.defines_int
1239 #endif SILC_DIST_TOOLKIT
1243 #ifdef SILC_DIST_COMPILER
1244 s_bindir=`eval echo $bindir`;s_bindir=`eval echo $s_bindir`
1245 s_sbindir=`eval echo $sbindir`;s_sbindir=`eval echo $s_sbindir`
1246 s_mandir=`eval echo $mandir`;s_mandir=`eval echo $s_mandir`
1247 s_includedir=`eval echo $includedir`;s_includedir=`eval echo $s_includedir`
1250 echo "$PACKAGE Configuration Summary:"
1251 echo "---------------------------"
1252 echo " Target host ...................: $target"
1253 echo " Compiler ......................: $CC"
1254 echo " CFLAGS ........................: $CFLAGS"
1255 echo " LDFLAGS .......................: $LDFLAGS"
1256 echo " LIBS ..........................: $LIBS"
1258 echo " Installation prefix ...........: $prefix"
1259 echo " bin directory .................: $s_bindir"
1260 echo " sbin directory ................: $s_sbindir"
1261 echo " etc directory .................: $ETCDIR"
1262 echo " man directory .................: $s_mandir"
1263 echo " doc directory .................: $DOCDIR"
1264 #ifdef SILC_DIST_SIM
1265 echo " SIM directory .................: $MODULESDIR"
1266 #endif SILC_DIST_SIM
1267 #ifdef SILC_DIST_INCLUDES
1268 echo " include directory .............: $s_includedir"
1269 #endif SILC_DIST_INCLUDES
1272 #ifdef SILC_DIST_TOOLKIT
1273 if test x$without_irssi = xtrue; then
1276 if test x$without_silcd = xtrue; then
1279 #endif SILC_DIST_TOOLKIT
1281 #ifdef SILC_DIST_CLIENT
1282 echo " Compile SILC Client ...........: $irssi"
1283 #endif SILC_DIST_CLIENT
1285 #ifdef SILC_DIST_SERVER
1286 echo " Compile SILC Server ...........: $silcd"
1287 #endif SILC_DIST_SERVER
1289 #ifdef SILC_DIST_SIM
1290 if test x$sim_support = xfalse; then
1295 echo " SIM support ...................: $sim_support"
1296 #endif SILC_DIST_SIM
1298 echo " IPv6 support ..................: $summary_ipv6"
1300 if test x$has_iconv = xfalse; then
1305 echo " Iconv support .................: $iconv_support"
1307 if test x$want_asm = xfalse; then
1312 echo " Assembler optimizations .......: $summary_asm"
1314 #ifdef SILC_DIST_MATH
1315 if test x$mp_gmp = xtrue; then
1316 echo " Arithmetic library ............: GMP"
1318 #endif SILC_DIST_MATH
1321 if test x$has_threads = xtrue; then
1324 echo " Multi-threads support .........: $threads"
1325 echo " Debugging enabled .............: $summary_debug"
1327 echo "Compile the sources with 'make' or 'gmake' command."
1328 #endif SILC_DIST_COMPILER