AC_PROG_MAKE_SET
AC_PROG_LN_S
+AC_PROG_EGREP
AC_SUBST(LN_S)
AC_PATH_PROG(sedpath, sed)
;;
esac
-CFLAGS=
+# Control compiler optimizations
+CFLAGS=`echo $CFLAGS | sed 's/-O[ 0123456789s]*//g'`
+
AC_PROG_CC
AC_C_INLINE
AC_C_CONST
SILC_ADD_CFLAGS(-g -O2)
fi
SILC_ADD_CFLAGS(-Wall -finline-functions)
+ SILC_ADD_CFLAGS(-Wno-pointer-sign)
else
# Other compilers
case "$target" in
AC_DEFINE_UNQUOTED([SILC_MODULESDIR], "$MODULESDIR", [SILC_MODULESDIR])
#endif SILC_DIST_SIM
-#ifdef SILC_DIST_SERVER
-# Logs directory
-#
-LOGSDIR="$silc_prefix/logs"
-AC_ARG_WITH(logsdir,
- [[ --with-logsdir=DIR directory for SILC Server logs [PREFIX/logs]]],
- [
- case "$withval" in
- no|yes)
- ;;
- *)
- LOGSDIR="$withval"
- ;;
- esac
- ])
-AC_SUBST(LOGSDIR)
-AC_DEFINE_UNQUOTED([SILC_LOGSDIR], "$LOGSDIR", [SILC_LOGSDIR])
-
-# silcd config file checking
-#
-summary_silcd_configfile="/etc/silc/silcd.conf"
-AC_ARG_WITH(silcd-config-file,
- [[ --with-silcd-config-file=FILE use FILE as default configuration file
- for SILC Server [/etc/silc/silcd.conf]]],
- AC_DEFINE_UNQUOTED([SILC_SERVER_CONFIG_FILE], "$withval", [SILC_SERVER_CONFIG_FILE])
- summary_silcd_configfile="$withval"
- )
-
-# silcd pid file checking
-#
-if test "x$localstatedir" != 'x${prefix}/var'; then
- PIDFILE="$localstatedir/silcd.pid"
-else
- PIDFILE="$silc_prefix/var/silcd.pid"
-fi
-
-AC_ARG_WITH(silcd-pid-file,
- [[ --with-silcd-pid-file=FILE use FILE as default pid file for SILC
- Server [/var/run/silcd.pid]]],
- [
- case "$withval" in
- no|yes)
- ;;
- *)
- PIDFILE="$withval"
- ;;
- esac
- ])
-AC_SUBST(PIDFILE)
-#endif SILC_DIST_SERVER
-
#ifdef SILC_DIST_COMPILER
##
## With/without checkings
compile_libs=true
#ifndef SILC_DIST_TOOLKIT
-
AC_ARG_WITH(silc-includes,
[ --with-silc-includes=DIR SILC Toolkit includes [search in DIR]],
[ac_silc_includes="$withval"], [ac_silc_includes="no"])
[ --with-silc-libs=DIR SILC Toolkit libraries [search in DIR]],
[ac_silc_libs="$withval"], [ac_silc_libs="no"])
-#
-# XXX missing checking the __SILC_WITH_XXX defines from the provided libs
-# in order to determine correct libs to link.
+if test -n "$with_silc_includes" || test -n "$with_silc_libs"; then
-#
-# XXX missing pkg-config check.
+ # Manually provided libs
+ if test "$ac_silc_includes" != "no"; then
+ compile_libs=false
+ SILC_LIB_INCLUDES="-I$ac_silc_includes"
+ fi
+ if test "$ac_silc_libs" != "no"; then
+ compile_libs=false
+ LIBS="$LIBS -L$ac_silc_libs"
+ fi
-if test "$ac_silc_includes" != "no"; then
- compile_libs=false
- SILC_LIB_INCLUDES="-I$ac_silc_includes"
-fi
-if test "$ac_silc_libs" != "no"; then
- compile_libs=false
- LIBS="$LIBS -L$ac_silc_libs"
-fi
+ # Check libs to link against
+ f=`$EGREP __SILC_HAVE_PTHREAD $ac_silc_includes/silcincludes.h`
+ if test -n "$f"; then
+ LIBS="$LIBS -lpthread"
+ check_threads=false
+ has_threads=true
+ fi
+ f=`$EGREP __SILC_HAVE_SIM $ac_silc_includes/silcincludes.h`
+ if test -n "$f"; then
+ LIBS="$LIBS -ldl"
+ fi
+else
+ # pkg-config check
+ PKG_CHECK_MODULES(SILC, silc, compile_libs=false, compile_libs=true)
+ PKG_CHECK_MODULES(SILCCLIENT, silcclient, compile_libs=false, compile_libs=true)
+
+ if test x$compile_libs = xfalse; then
+ LIBS="$LIBS $SILC_LIBS"
+ CFLAGS="$CFLAGS $SILC_CFLAGS"
+ LIBS="$LIBS $SILCCLIENT_LIBS"
+ CFLAGS="$CFLAGS $SILCCLIENT_CFLAGS"
+ fi
+fi
#endif SILC_DIST_TOOLKIT
-
# SOCKS4 support checking
#
SAVE_LIBS="$LIBS"
# POSIX threads support
#
-has_threads=false
AC_MSG_CHECKING(whether to search for POSIX threads)
AC_ARG_WITH(pthreads,
[[ --with-pthreads[=DIR] use POSIX threads [search in DIR/include and DIR/lib]]],
])
if test x$check_threads = xtrue; then
+ has_threads=false
SAVE_LIBS="$LIBS"
SAVE_CFLAGS="$CFLAGS"
SAVE_LDFLAGS="$LDFLAGS"
AM_CONDITIONAL(SILC_OS2, test xfalse = xtrue)
#ifdef SILC_DIST_TOOLKIT
-
# --without-irssi
#
without_irssi=false
[
AC_MSG_RESULT(yes)
])
-
#endif SILC_DIST_TOOLKIT
#ifdef SILC_DIST_CLIENT
## Misc
##
+# Make enable-shared aware
+AM_CONDITIONAL(SILC_ENABLE_SHARED, test "$enable_shared" = yes)
+
# Other configure scripts
#
fi
#endif SILC_DIST_TOOLKIT
-#ifdef SILC_DIST_TOOLKIT
-if test x$without_silcd = xfalse ; then
-#endif SILC_DIST_TOOLKIT
-#ifdef SILC_DIST_SERVER
- AC_CONFIG_FILES(
-silcd/Makefile
-doc/example_silcd.conf
-)
-#endif SILC_DIST_SERVER
-#ifdef SILC_DIST_TOOLKIT
-fi
-#endif SILC_DIST_TOOLKIT
-
#ifdef SILC_DIST_TOOLKIT
AC_CONFIG_FILES(
silc/Makefile
echo " Target host ...................: $target"
echo " Compiler ......................: $CC"
echo " CFLAGS ........................: $CFLAGS"
-echo " CPPFLAGS ......................: $CPPFLAGS"
echo " LDFLAGS .......................: $LDFLAGS"
echo " LIBS ..........................: $LIBS"
echo ""
#endif SILC_DIST_INCLUDES
echo ""
-#ifdef SILC_DIST_SERVER
-silcd="yes"
-#endif SILC_DIST_SERVER
-
#ifdef SILC_DIST_TOOLKIT
if test x$without_irssi = xtrue; then
irssi="no"