X-Git-Url: http://git.silcnet.org/gitweb/?a=blobdiff_plain;f=configure.ad;h=5bd10618dee4039f3cd4e6a8cbcda134f4cae371;hb=9a66a4329902cbcc34e15f2839017808d62f23f2;hp=61260822670d8ecd779f0b13d937ca6fce15ffcc;hpb=bb570fe79cc2ca72001c161a87bf43c1f93b0b60;p=silc.git diff --git a/configure.ad b/configure.ad index 61260822..5bd10618 100644 --- a/configure.ad +++ b/configure.ad @@ -181,44 +181,10 @@ AC_CHECK_FUNCS(gethostname gethostbyaddr getservbyname getservbyport) AC_CHECK_FUNCS(poll select listen bind shutdown close connect setsockopt) AC_CHECK_FUNCS(setrlimit time ctime utime gettimeofday getrusage) AC_CHECK_FUNCS(chmod fcntl stat fstat getenv putenv strerror) -AC_CHECK_FUNCS(getpid getgid getsid getpgid getpgrp getuid) -AC_CHECK_FUNCS(setgroups initgroups nl_langinfo nanosleep) +AC_CHECK_FUNCS(getpid getgid getsid getpgid getpgrp getuid sched_yield) +AC_CHECK_FUNCS(setgroups initgroups nl_langinfo nanosleep gmtime) AC_CHECK_FUNCS(strchr snprintf strstr strcpy strncpy memcpy memset memmove) -#ifdef SILC_DIST_SIM -# SIM support checking -# XXX These needs to be changed as more supported platforms appear. -# XXX This probably needs to be made platform dependant check. -# -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], [], [HAVE_SIM]) - sim_support=true - LIBS="$LIBS -ldl" - ], - [ - AC_CHECK_LIB(c, dlopen, - [ - AC_DEFINE([SILC_SIM], [], [HAVE_SIM]) - sim_support=true - ]) - ]) - ]) - -AM_CONDITIONAL(SILC_SIM, test x$sim_support = xtrue) -if test x$sim_support = xtrue; then - AC_MSG_RESULT(Enabled SIM support.) - __SILC_HAVE_SIM="#define __SILC_HAVE_SIM 1" -else - AC_MSG_RESULT(No SIM support found.) -fi -#endif SILC_DIST_SIM - # lib/contrib conditionals # AC_CHECK_HEADER(regex.h, @@ -612,7 +578,9 @@ if test -n "$with_silc_includes" || test -n "$with_silc_libs"; then if test "$ac_silc_libs" != "no"; then compile_libs=false LIBSUBDIR= - LIBS="$LIBS -L$ac_silc_libs" + LDFLAGS="-L$ac_silc_libs $LDFLAGS" + else + LDFLAGS="-L\$(silc_top_srcdir)/lib $LDFLAGS" fi # Check libs to link against @@ -629,9 +597,9 @@ if test -n "$with_silc_includes" || test -n "$with_silc_libs"; then else # pkg-config check - PKG_CHECK_MODULES(SILC, silc, compile_libs=false, compile_libs=true) + PKG_CHECK_MODULES(SILC, [silc >= 1.1], compile_libs=false, compile_libs=true) #ifdef SILC_DIST_CLIENTLIB - PKG_CHECK_MODULES(SILCCLIENT, silcclient, compile_libs=false, compile_libs=true) + PKG_CHECK_MODULES(SILCCLIENT, [silcclient >= 1.1], compile_libs=false, compile_libs=true) #endif SILC_DIST_CLIENTLIB #ifdef SILC_DIST_SERVERLIB PKG_CHECK_MODULES(SILCSERVER, silcserver, compile_libs=false, compile_libs=true) @@ -639,21 +607,57 @@ else if test x$compile_libs = xfalse; then LIBSUBDIR= - LIBS="$LIBS $SILC_LIBS" + LIBS="$SILC_LIBS $LIBS" CFLAGS="$CFLAGS $SILC_CFLAGS" #ifdef SILC_DIST_CLIENTLIB - LIBS="$LIBS $SILCCLIENT_LIBS" + LIBS="$SILCCLIENT_LIBS $LIBS" CFLAGS="$CFLAGS $SILCCLIENT_CFLAGS" #endif SILC_DIST_CLIENTLIB #ifdef SILC_DIST_SERVERLIB LIBS="$LIBS $SILCSERVER_LIBS" CFLAGS="$CFLAGS $SILCSERVER_CFLAGS" #endif SILC_DIST_SERVERLIB + else + LDFLAGS="-L\$(silc_top_srcdir)/lib $LDFLAGS" fi fi +#else SILC_DIST_TOOLKIT +LDFLAGS="-L\$(silc_top_srcdir)/lib $LDFLAGS" #endif SILC_DIST_TOOLKIT -AC_SUBST(LIBSUBDIR) +#ifdef SILC_DIST_SIM +# SIM support checking +# XXX These needs to be changed as more supported platforms appear. +# XXX This probably needs to be made platform dependant check. +# +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], [], [HAVE_SIM]) + sim_support=true + LIBS="$LIBS -ldl" + ], + [ + AC_CHECK_LIB(c, dlopen, + [ + AC_DEFINE([SILC_SIM], [], [HAVE_SIM]) + sim_support=true + ]) + ]) + ]) + +AM_CONDITIONAL(SILC_SIM, test x$sim_support = xtrue) +if test x$sim_support = xtrue; then + AC_MSG_RESULT(Enabled SIM support.) + __SILC_HAVE_SIM="#define __SILC_HAVE_SIM 1" +else + AC_MSG_RESULT(No SIM support found.) +fi +#endif SILC_DIST_SIM # SOCKS4 support checking # @@ -1158,6 +1162,77 @@ if test x$has_threads = xtrue; then __SILC_HAVE_PTHREAD="#define __SILC_HAVE_PTHREAD 1" fi +# +# Check for timezone and tm_gmtoff for timezone information +# +AC_MSG_CHECKING(whether system has timezone) +AC_RUN_IFELSE( + [ + #include + #include + int main() + { + timezone = 0; + return 0; + } + ], + [ AC_MSG_RESULT(yes) + AC_DEFINE([HAVE_TIMEZONE], [], [HAVE_TIMEZONE]) ], + [ AC_MSG_RESULT(no) ], + [ AC_MSG_RESULT(no) ] +) +AC_MSG_CHECKING(whether system has tm_gmtoff) +AC_RUN_IFELSE( + [ + #include + #include + int main() + { + struct tm tm; + tm.tm_gmtoff = 0; + return 0; + } + ], + [ AC_MSG_RESULT(yes) + AC_DEFINE([HAVE_TM_GMTOFF], [], [HAVE_TM_GMTOFF]) ], + [ AC_MSG_RESULT(no) ], + [ AC_MSG_RESULT(no) ] +) +AC_MSG_CHECKING(whether system has __tm_gmtoff) +AC_RUN_IFELSE( + [ + #include + #include + int main() + { + struct tm tm; + tm.__tm_gmtoff = 0; + return 0; + } + ], + [ AC_MSG_RESULT(yes) + AC_DEFINE([HAVE___TM_GMTOFF], [], [HAVE___TM_GMTOFF]) ], + [ AC_MSG_RESULT(no) ], + [ AC_MSG_RESULT(no) ] +) +AC_MSG_CHECKING(whether system has __tm_gmtoff__) +AC_RUN_IFELSE( + [ + #include + #include + int main() + { + struct tm tm; + tm.__tm_gmtoff__ = 0; + return 0; + } + ], + [ AC_MSG_RESULT(yes) + AC_DEFINE([HAVE___TM_GMTOFF__], [], [HAVE___TM_GMTOFF__]) ], + [ AC_MSG_RESULT(no) ], + [ AC_MSG_RESULT(no) ] +) + # Native WIN32 compilation under cygwin # AC_MSG_CHECKING(whether to compile native WIN32 code) @@ -1187,38 +1262,9 @@ AM_CONDITIONAL(SILC_BEOS, test xfalse = xtrue) # AM_CONDITIONAL(SILC_OS2, test xfalse = xtrue) -#ifdef SILC_DIST_TOOLKIT -# --with-irssi -# -without_irssi=true -AC_MSG_CHECKING(whether to compile Irssi SILC Client) -AC_ARG_WITH(irssi, - [ --with-irssi compile with Irssi SILC Client], - [ - AC_MSG_RESULT(yes) - without_irssi=false - ], - [ - AC_MSG_RESULT(no) - without_irssi=true - ]) -AM_CONDITIONAL(with_irssi, test xwithout_irssi = xfalse) - -# --with-silcd -# -without_silcd=true -AC_MSG_CHECKING(whether to compile SILC Server) -AC_ARG_WITH(silcd, - [ --with-silcd compile with SILC Server], - [ - AC_MSG_RESULT(yes) - without_silcd=false - ], - [ - AC_MSG_RESULT(no) - without_silcd=true - ]) -#endif SILC_DIST_TOOLKIT +#ifdef SILC_DIST_SERVER +without_silcd=false +#endif SILC_DIST_SERVER #ifdef SILC_DIST_CLIENT AM_CONDITIONAL(with_irssi, true) #endif SILC_DIST_CLIENT @@ -1259,7 +1305,9 @@ AD_INCLUDE_CONFIGURE # # Substitutions # +AC_SUBST(LIBSUBDIR) AC_SUBST(SILC_TOP_SRCDIR) +AC_SUBST(LDFLAGS) AC_SUBST(LIBS) AC_SUBST(SILC_LIB_INCLUDES) AC_SUBST(__SILC_HAVE_PTHREAD) @@ -1343,20 +1391,17 @@ echo " include directory .............: $s_includedir" #endif SILC_DIST_INCLUDES echo "" -#ifdef SILC_DIST_TOOLKIT +#ifdef SILC_DIST_CLIENT if test x$without_irssi = xtrue; then irssi="no" fi -if test x$without_silcd = xtrue; then - silcd="no" -fi -#endif SILC_DIST_TOOLKIT - -#ifdef SILC_DIST_CLIENT echo " Compile SILC Client ...........: $irssi" #endif SILC_DIST_CLIENT #ifdef SILC_DIST_SERVER +if test x$without_silcd = xtrue; then + silcd="no" +fi echo " Compile SILC Server ...........: $silcd" #endif SILC_DIST_SERVER