AC_PREREQ(2.52)
AC_CONFIG_HEADERS(includes/silcdefs.h)
+CFLAGS=
AC_PROG_CC
AC_C_INLINE
AC_C_CONST
AC_PROG_LN_S
AC_SUBST(LN_S)
-# Distribution definition. ./prepare will automatically add here a correct
-# value. Do not edit!
-#
+##
+## Distribution definition. ./prepare will automatically add here a correct
+## value. Do not edit!
+##
silc_dist=SILC_PACKAGE
SILC_DIST_SUBDIRS="SILC_DISTRIBUTION_SUBDIRS"
AC_DEFINE(SILC_DIST_DEFINE)
-# XXX
-# Compiler flags
-#
-if test "$GCC"; then
- CFLAGS="-Wall -finline-functions $CFLAGS"
-fi
-#
-# Library versioning.
-#
+##
+## Library versioning.
+##
# Do the releases and library versioning according to following rules:
#
# - If any code has changed in library, increment [LIB]_REVISION
LIB_BASE_VERSION=1.0
# libsilc versions
-LIBSILC_CURRENT=1
+LIBSILC_CURRENT=2
LIBSILC_REVISION=0
-LIBSILC_AGE=1
+LIBSILC_AGE=0
# libsilcclient versions
-LIBSILCCLIENT_CURRENT=1
-LIBSILCCLIENT_REVISION=1
+LIBSILCCLIENT_CURRENT=2
+LIBSILCCLIENT_REVISION=0
LIBSILCCLIENT_AGE=0
# Substitute the version numbers
AC_CHECK_FUNC(getopt_long, have_getopt_long=1, have_getopt_long=0)
AM_CONDITIONAL(HAVE_GETOPT_LONG, test x$have_getopt_long = x1)
-
##
## Enable/disable checking
##
yes)
AC_MSG_RESULT(yes)
AC_DEFINE(SILC_DEBUG)
- CFLAGS="-O -g $CFLAGS"
summary_debug="yes"
;;
*)
AC_MSG_RESULT(no)
- CFLAGS="-O2 -g $CFLAGS"
;;
esac
],
[
- CFLAGS="-O2 -g $CFLAGS"
AC_MSG_RESULT(no)
])
])
+##
+## Compiler and compiler flag checks
+##
+
+# Function to check if compiler flag works
+# Usage: SILC_ADD_CFLAGS(FLAGS, [ACTION-IF-FAILED])
+AC_DEFUN(SILC_ADD_CFLAGS,
+[ tmp_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS $1"
+ AC_MSG_CHECKING(whether $CC accepts $1 flag)
+ AC_TRY_LINK(, , AC_MSG_RESULT(yes), [AC_MSG_RESULT(no)
+ CFLAGS="$tmp_CFLAGS"
+ $2])
+ unset tmp_CFLAGS
+])
+
+if test "$GCC"; then
+ # GCC specific options
+ if test "x$summary_debug" = "xyes"; then
+ SILC_ADD_CFLAGS(-g -O)
+ else
+ SILC_ADD_CFLAGS(-g -O2)
+ fi
+ SILC_ADD_CFLAGS(-Wall -finline-functions)
+else
+ # Other compilers
+ case "$target" in
+ alpha*-dec-osf*)
+ SILC_ADD_CFLAGS(-g3 -O2, SILC_ADD_CFLAGS(-g3 -O, SILC_ADD_CFLAGS(-O)))
+ ;;
+ *)
+ SILC_ADD_CFLAGS(-g)
+ SILC_ADD_CFLAGS(-O2, SILC_ADD_CFLAGS(-O))
+ ;;
+ esac
+
+ # Intel C++ Compiler needs -restrict
+ if test "x$CC" = "xicc"; then
+ SILC_ADD_CFLAGS(-restrict)
+ fi
+fi
+
+#
+# Workaround a bug in GCC 2.x which causes memory exhaustion
+# when compiling sha1 with optimizations on UltraSPARC.
+#
+FIX_SHA1='#'
+if test "$GCC" -a "$host_cpu" = "sparc64"; then
+ AC_MSG_CHECKING(whether to enable GCC 2.x workaround for SHA1)
+ AC_TRY_COMPILE(
+ [
+ #if defined(__sparc64__) && (__GNUC__ == 2)
+ #else
+ choke me
+ #endif
+ ],
+ [],
+ [
+ FIX_SHA1=''
+ AC_MSG_RESULT(yes)
+ ],
+ AC_MSG_RESULT(no)
+ )
+fi
+AC_SUBST(FIX_SHA1)
+
##
## Installation
##
#
AC_MSG_CHECKING(whether to compile native WIN32 code)
AC_ARG_WITH(win32,
- [ --with-win32 compile native WIN32 code (-mno-cygwin)],
+ [ --with-win32 compile native WIN32 (MinGW) code (-mno-cygwin)],
[
AC_MSG_RESULT(yes)
AC_DEFINE(SILC_WIN32)
AC_MSG_RESULT(yes)
])
+# Irssi perl support
+#
+AC_ARG_WITH(perl,
+ [[ --with-perl[=yes|no|module] Build with Perl support - also specifies
+ if it should be built into main silc binary
+ (static, default) or as a module]])
+
libtoolfix=true
AC_MSG_CHECKING(whether to do libtoolfix)
AC_ARG_WITH(libtoolfix,
echo " Installation prefix ...........: $prefix"
echo " bin directory .................: $s_bindir"
echo " sbin directory ................: $s_sbindir"
+echo " etc directory .................: $ETCDIR"
echo " man directory .................: $s_mandir"
echo " help directory ................: $HELPDIR"
echo " doc directory .................: $DOCDIR"
else
sim_support="yes"
fi
+if test x$has_iconv = xfalse; then
+ iconv_support="no"
+else
+ iconv_support="yes"
+fi
echo " SIM support ...................: $sim_support"
echo " IPv6 support ..................: $summary_ipv6"
+echo " Iconv support .................: $iconv_support"
echo " Assembler optimizations .......: $summary_asm"
mp="MPI"