X-Git-Url: http://git.silcnet.org/gitweb/?p=silc.git;a=blobdiff_plain;f=configure.ad;h=b7affd6fd5e0548da9729d5ff96d46a9224554e7;hp=410d19f23c4205d405c4eba874ac7a3c1693220e;hb=816a5b080c797c0db47b7b274a85646343c3466e;hpb=c257b555225193e54d85daf541d29578b3c93882 diff --git a/configure.ad b/configure.ad index 410d19f2..b7affd6f 100644 --- a/configure.ad +++ b/configure.ad @@ -25,6 +25,7 @@ AC_PROG_INSTALL AC_PROG_MAKE_SET AC_PROG_LN_S +AC_PROG_EGREP AC_SUBST(LN_S) AC_PATH_PROG(sedpath, sed) @@ -43,7 +44,9 @@ case "$target" in ;; esac -CFLAGS= +# Control compiler optimizations +CFLAGS=`echo $CFLAGS | sed 's/-O[ 0123456789s]*//g'` + AC_PROG_CC AC_C_INLINE AC_C_CONST @@ -287,6 +290,7 @@ if test "$GCC"; then SILC_ADD_CFLAGS(-g -O2) fi SILC_ADD_CFLAGS(-Wall -finline-functions) + SILC_ADD_CFLAGS(-Wno-pointer-sign) else # Other compilers case "$target" in @@ -426,57 +430,6 @@ AC_SUBST(MODULESDIR) 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 @@ -487,7 +440,6 @@ AC_SUBST(PIDFILE) 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"]) @@ -495,25 +447,44 @@ AC_ARG_WITH(silc-libs, [ --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" @@ -865,7 +836,6 @@ fi # 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]]], @@ -889,6 +859,7 @@ AC_ARG_WITH(pthreads, ]) if test x$check_threads = xtrue; then + has_threads=false SAVE_LIBS="$LIBS" SAVE_CFLAGS="$CFLAGS" SAVE_LDFLAGS="$LDFLAGS" @@ -1019,7 +990,6 @@ AM_CONDITIONAL(SILC_BEOS, test xfalse = xtrue) AM_CONDITIONAL(SILC_OS2, test xfalse = xtrue) #ifdef SILC_DIST_TOOLKIT - # --without-irssi # without_irssi=false @@ -1047,7 +1017,6 @@ AC_ARG_WITH(silcd, [ AC_MSG_RESULT(yes) ]) - #endif SILC_DIST_TOOLKIT #ifdef SILC_DIST_CLIENT @@ -1080,6 +1049,9 @@ AC_DEFINE_UNQUOTED([SILC_ETCDIR], "$ETCDIR", [SILC_ETCDIR]) ## Misc ## +# Make enable-shared aware +AM_CONDITIONAL(SILC_ENABLE_SHARED, test "$enable_shared" = yes) + # Other configure scripts # @@ -1158,19 +1130,6 @@ irssi/Makefile.defines_int 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 @@ -1197,7 +1156,6 @@ echo "---------------------------" echo " Target host ...................: $target" echo " Compiler ......................: $CC" echo " CFLAGS ........................: $CFLAGS" -echo " CPPFLAGS ......................: $CPPFLAGS" echo " LDFLAGS .......................: $LDFLAGS" echo " LIBS ..........................: $LIBS" echo "" @@ -1221,10 +1179,6 @@ echo " include directory .............: $s_includedir" #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"