- int family = AF_INET6;
- ],
- [
- AC_DEFINE([HAVE_IPV6], [], [HAVE_IPV6])
- AC_MSG_RESULT(yes)
- summary_ipv6="yes"
- ],
- AC_MSG_RESULT(no)
- )
-fi
-
-# Debug checking
-#
-AC_MSG_CHECKING(whether to enable debugging)
-summary_debug="no"
-__SILC_ENABLE_DEBUG=""
-AC_ARG_ENABLE(debug,
- [ --enable-debug enable debugging],
- [
- case "${enableval}" in
- yes)
- AC_MSG_RESULT(yes)
- AC_DEFINE([SILC_DEBUG], [], [enable-debug])
- summary_debug="yes"
- __SILC_ENABLE_DEBUG="#define __SILC_ENABLE_DEBUG 1"
- ;;
- *)
- AC_MSG_RESULT(no)
- ;;
- esac
- ],
- [
- AC_MSG_RESULT(no)
- ])
-
-# Disable all assembler optimizations
-#
-AC_MSG_CHECKING(whether to enable assembler optimizations)
-want_asm=true
-AC_ARG_ENABLE(asm,
- [ --disable-asm do not use assembler optimizations],
- [
- AC_MSG_RESULT(no)
- want_asm=false
- ],
- [
- AC_MSG_RESULT(yes)
- want_asm=true
- ])
-
-##
-## 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
-])
-
-# Function to check if compiler flag works, destination specifiable
-# Usage: SILC_ADD_CC_FLAGS(VAR, FLAGS, [ACTION-IF-FAILED])
-AC_DEFUN([SILC_ADD_CC_FLAGS],
-[ tmp_CFLAGS="$1_CFLAGS"
- $1_CFLAGS="${$1_CFLAGS} $2"
- AC_MSG_CHECKING(whether $CC accepts $2 flag)
- AC_TRY_LINK([], [], [AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no)
- $1_CFLAGS="$tmp_CFLAGS"
- $3])
- 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)
- SILC_ADD_CFLAGS(-Wno-pointer-sign)
-else
- # Other compilers
- case "$target" in
- alpha*-dec-osf*)
- SILC_ADD_CFLAGS(-g3 -O2, SILC_ADD_CFLAGS(-g3 -O, SILC_ADD_CFLAGS(-O)))
- ;;
- mips*-sgi-irix*)
- 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)
-#endif SILC_DIST_COMPILER
-
-##
-## Installation
-##
-
-# Default installation destination
-#
-#ifdef SILC_DIST_AUTODIST
-AC_PREFIX_DEFAULT(/usr/local)
-#else !SILC_DIST_AUTODIST
-AC_PREFIX_DEFAULT(/usr/local/silc)
-#endif SILC_DIST_AUTODIST
-if test "x$prefix" != xNONE; then
- silc_prefix="$prefix"
-else
- silc_prefix="$ac_default_prefix"