X-Git-Url: http://git.silcnet.org/gitweb/?p=silc.git;a=blobdiff_plain;f=configure.in.pre;h=4bb362c80a9c18ec25db05ff880927b44369a7a1;hp=03da59674eccae12f9578575a7fcd06fc4c54e10;hb=413da0f8686910f5e627393157566ae729ca99c4;hpb=ebd96aefd7c4259e7a214bbefef76c3179a890d5 diff --git a/configure.in.pre b/configure.in.pre index 03da5967..4bb362c8 100644 --- a/configure.in.pre +++ b/configure.in.pre @@ -39,6 +39,7 @@ AM_INIT_AUTOMAKE(SILC_PACKAGE, SILC_VERSION) AC_PREREQ(2.52) AC_CONFIG_HEADERS(includes/silcdefs.h) +CFLAGS= AC_PROG_CC AC_C_INLINE AC_C_CONST @@ -46,25 +47,63 @@ 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 + +## +## Library versioning. +## +# Do the releases and library versioning according to following rules: # -if test "$GCC"; then - CFLAGS="-Wall -finline-functions $CFLAGS" -fi +# - If any code has changed in library, increment [LIB]_REVISION +# - If functions were added, set [LIB]_REVISION to 0 +# - If functions were added, removed or changed, increment [LIB]_CURRENT +# - If functions were added, increment [LIB]_AGE +# - If functions were removed, set [LIB]_AGE to 0 +# +# where [LIB] is LIBSILC and LIBSILCCLIENT, and where "functions" means +# functions public interfaces. +# +# The LIB_BASE_VERSION defines the SILC software major.minor version and +# it is increment only when these version numbers actually change. +# + +# Base version for libraries. Do not change this unless SILC version +# changes too. +LIB_BASE_VERSION=1.0 + +# libsilc versions +LIBSILC_CURRENT=2 +LIBSILC_REVISION=0 +LIBSILC_AGE=0 + +# libsilcclient versions +LIBSILCCLIENT_CURRENT=2 +LIBSILCCLIENT_REVISION=0 +LIBSILCCLIENT_AGE=0 + +# Substitute the version numbers +AC_SUBST(LIB_BASE_VERSION) +AC_SUBST(LIBSILC_CURRENT) +AC_SUBST(LIBSILC_REVISION) +AC_SUBST(LIBSILC_AGE) +AC_SUBST(LIBSILCCLIENT_CURRENT) +AC_SUBST(LIBSILCCLIENT_REVISION) +AC_SUBST(LIBSILCCLIENT_AGE) +# # Program checking # AC_PROG_INSTALL AC_PROG_RANLIB AC_PROG_MAKE_SET +AC_DISABLE_SHARED AC_PROG_LIBTOOL AC_PATH_PROG(sedpath, sed) @@ -132,20 +171,21 @@ sim_support=false AC_MSG_CHECKING(for SIM support) AC_MSG_RESULT() AC_CHECK_HEADERS(dlfcn.h, - AC_CHECK_LIB(dl, dlopen, - [ - AC_DEFINE(SILC_SIM) - sim_support=true - LIBS="$LIBS -ldl" - ], - [ - AC_CHECK_LIB(c, dlopen, - [ - AC_DEFINE(SILC_SIM) - sim_support=true - ]) - ]) - ) + [ + AC_CHECK_LIB(dl, dlopen, + [ + AC_DEFINE(SILC_SIM) + sim_support=true + LIBS="$LIBS -ldl" + ], + [ + AC_CHECK_LIB(c, dlopen, + [ + AC_DEFINE(SILC_SIM) + sim_support=true + ]) + ]) + ]) AM_CONDITIONAL(SILC_SIM, test x$sim_support = xtrue) if test x$sim_support = xtrue; then @@ -161,7 +201,6 @@ AM_CONDITIONAL(HAVE_REGEX, test x$have_regex = x1) 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 ## @@ -233,17 +272,14 @@ AC_ARG_ENABLE(debug, 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) ]) @@ -283,6 +319,72 @@ AC_ARG_ENABLE(asm, ]) +## +## 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 ## @@ -386,23 +488,6 @@ AC_ARG_WITH(logsdir, AC_SUBST(LOGSDIR) AC_DEFINE_UNQUOTED(SILC_LOGSDIR, "$LOGSDIR") -# Manual directory -# -MANDIR="$silc_prefix/man" -AC_ARG_WITH(mandir, - [[ --with-mandir=DIR directory for SILC manual pages [PREFIX/man]]], - [ - case "$withval" in - no|yes) - ;; - *) - MANDIR="$withval" - ;; - esac - ]) -AC_SUBST(MANDIR) -AC_DEFINE_UNQUOTED(SILC_MANDIR, "$MANDIR") - # silcd config file checking # summary_silcd_configfile="/etc/silc/silcd.conf" @@ -622,13 +707,14 @@ AC_ARG_WITH(iconv, case "${withval}" in no) AC_MSG_RESULT(no) - - AC_CHECK_HEADERS(iconv.h, AC_CHECK_FUNC(iconv, has_iconv=true)) + AC_CHECK_HEADERS(iconv.h, + [ + AC_CHECK_FUNC(iconv, has_iconv=true) + ]) check_iconv=false ;; *) AC_MSG_RESULT(yes) - if test -d $withval/include; then CPPFLAGS="$CPPFLAGS -I$withval/include" CFLAGS="$CFLAGS -I$withval/include" @@ -636,16 +722,19 @@ AC_ARG_WITH(iconv, if test -d $withval/lib; then LDFLAGS="$LDFLAGS -L$withval/lib" fi + ;; esac ], [ AC_MSG_RESULT(no) - - AC_CHECK_HEADERS(iconv.h, AC_CHECK_FUNCS(iconv, - [ - has_iconv=true - check_iconv=false - ])) + AC_CHECK_HEADERS(iconv.h, + [ + AC_CHECK_FUNCS(iconv, + [ + has_iconv=true + check_iconv=false + ]) + ]) ]) if test x$check_iconv = xtrue; then @@ -911,7 +1000,7 @@ fi # 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) @@ -966,6 +1055,29 @@ AC_ARG_WITH(silcd, 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, + [ --without-libtoolfix Do not fix libtool, for package builders], + [ + AC_MSG_RESULT(no) + libtoolfix=false + ], + [ + AC_MSG_RESULT(yes) + ]) + +AC_SUBST(ETCDIR) +AC_DEFINE_UNQUOTED(SILC_ETCDIR, "$ETCDIR") + + ## ## Misc @@ -995,6 +1107,18 @@ INCLUDE_DEFINES_INT="include \$(top_srcdir)/Makefile.defines_int" AC_SUBST(INCLUDE_DEFINES_INT) AC_SUBST(SILC_DIST_SUBDIRS) +# +# Fix the libtool to support run-time configuration. This allows us +# to in run-time specify when to compile shared/static libraries without +# need to reconfigure the entire libtool. +# +if test x$libtoolfix = xtrue; then + ./libtoolfix $SILC_TOP_SRCDIR/ltmain.sh +fi +AM_CONDITIONAL(SILC_LIBTOOLFIX, test x$libtoolfix = xtrue) + + +# # Makefile outputs # AC_CONFIG_FILES( @@ -1006,7 +1130,9 @@ includes/Makefile lib/Makefile lib/contrib/Makefile lib/silccore/Makefile +lib/silccore/tests/Makefile lib/silccrypt/Makefile +lib/silccrypt/tests/Makefile lib/silcmath/Makefile lib/silcmath/mpi/Makefile.defines lib/silcmath/mpi/Makefile.defines_int @@ -1064,6 +1190,7 @@ AC_OUTPUT s_bindir=`eval echo $bindir`;s_bindir=`eval echo $s_bindir` s_sbindir=`eval echo $sbindir`;s_sbindir=`eval echo $s_sbindir` +s_mandir=`eval echo $mandir`;s_mandir=`eval echo $s_mandir` s_includedir=`eval echo $includedir`;s_includedir=`eval echo $s_includedir` echo "" @@ -1079,7 +1206,8 @@ echo "" echo " Installation prefix ...........: $prefix" echo " bin directory .................: $s_bindir" echo " sbin directory ................: $s_sbindir" -echo " man directory .................: $MANDIR" +echo " etc directory .................: $ETCDIR" +echo " man directory .................: $s_mandir" echo " help directory ................: $HELPDIR" echo " doc directory .................: $DOCDIR" echo " logs directory ................: $LOGSDIR" @@ -1100,7 +1228,7 @@ if test "x$silc_dist" = "xsilc-server" || test "x$silc_dist" = "xsilc-toolkit"; then silcd="yes" if test x$without_silcd = xtrue; then - without_silcd="no" + silcd="no" fi echo " Compile SILC Server ...........: $silcd" echo " Server configuration file .....: $summary_silcd_configfile" @@ -1112,8 +1240,14 @@ if test x$sim_support = xfalse; then 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"