X-Git-Url: http://git.silcnet.org/gitweb/?p=runtime.git;a=blobdiff_plain;f=configure.ad;h=fd047ab08a69e5fdf278853ede6571c0b51cb83e;hp=7d76b9a4c89476c0206a409366828a3bd145cfa2;hb=HEAD;hpb=afcd9ed820b767d8b6676a9156fa561b24ac2363 diff --git a/configure.ad b/configure.ad index 7d76b9a4..fd047ab0 100644 --- a/configure.ad +++ b/configure.ad @@ -210,15 +210,27 @@ if test x$want_cpu_optimizations = xtrue; then # Other compilers if test x$x_have_cpu_sse2 = xtrue; then SILC_ADD_CFLAGS(-msse2) + SILC_ADD_CFLAGS(-ftree-vectorize) fi if test x$x_have_cpu_pni = xtrue; then SILC_ADD_CFLAGS(-msse3) + SILC_ADD_CFLAGS(-ftree-vectorize) fi if test x$x_have_cpu_ssse3 = xtrue; then SILC_ADD_CFLAGS(-mssse3) + SILC_ADD_CFLAGS(-ftree-vectorize) fi if test x$x_have_cpu_sse4_1 = xtrue; then SILC_ADD_CFLAGS(-msse4) + SILC_ADD_CFLAGS(-ftree-vectorize) + fi + if test x$x_have_cpu_sse4_2 = xtrue; then + SILC_ADD_CFLAGS(-msse4) + SILC_ADD_CFLAGS(-ftree-vectorize) + fi + if test x$x_have_cpu_sse5 = xtrue; then + SILC_ADD_CFLAGS(-msse5) + SILC_ADD_CFLAGS(-ftree-vectorize) fi fi fi @@ -242,6 +254,9 @@ case "$target" in *-*-*bsd*) check_threads=false ;; + *-*-*darwin*) + check_threads=true + ;; *) check_threads=true ;; @@ -414,7 +429,7 @@ AC_CHECK_FUNC(clock_gettime, [], # Check for epoll_wait and verify that epoll_create works AC_CHECK_FUNC(epoll_wait, [ - AC_RUN_IFELSE( + AC_RUN_IFELSE([AC_LANG_SOURCE( [ #include int main() @@ -425,7 +440,7 @@ AC_CHECK_FUNC(epoll_wait, close(ret); return 0; } - ], + ])], [ AC_DEFINE([HAVE_EPOLL_WAIT], [1], [HAVE_EPOLL_WAIT]) ], @@ -506,7 +521,7 @@ if test x$va_copy = xfalse; then fi if test x$va_copy = xfalse; then - AC_RUN_IFELSE( + AC_RUN_IFELSE([AC_LANG_SOURCE( [ #include #include @@ -525,7 +540,7 @@ if test x$va_copy = xfalse; then { return t(0, 0xff11); } - ], + ])], [va_copy=false], [ AC_DEFINE([SILC_VA_COPY_ARRAY], [], [SILC_VA_COPY_ARRAY]) @@ -538,7 +553,7 @@ AC_SUBST(__SILC_VA_COPY) # Check for timezone and tm_gmtoff for timezone information AC_MSG_CHECKING(whether system has timezone) -AC_RUN_IFELSE( +AC_RUN_IFELSE([AC_LANG_SOURCE( [ #include #include @@ -547,14 +562,14 @@ AC_RUN_IFELSE( 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( +AC_RUN_IFELSE([AC_LANG_SOURCE( [ #include #include @@ -564,14 +579,14 @@ AC_RUN_IFELSE( 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( +AC_RUN_IFELSE([AC_LANG_SOURCE( [ #include #include @@ -581,14 +596,14 @@ AC_RUN_IFELSE( 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( +AC_RUN_IFELSE([AC_LANG_SOURCE( [ #include #include @@ -598,7 +613,7 @@ AC_RUN_IFELSE( tm.__tm_gmtoff__ = 0; return 0; } - ], + ])], [ AC_MSG_RESULT(yes) AC_DEFINE([HAVE___TM_GMTOFF__], [], [HAVE___TM_GMTOFF__]) ], [ AC_MSG_RESULT(no) ], @@ -716,17 +731,17 @@ AC_ARG_WITH(alignment, AC_DEFINE([SILC_ALIGNMENT], SILC_SIZEOF_VOID_P, [SILC_ALIGNMENT]) ]) -# Stack trace checking -__SILC_ENABLE_STACKTRACE="" -AC_MSG_CHECKING(whether to enable stack tracing) -AC_ARG_ENABLE(stack-trace, - [ --enable-stack-trace enable memory stack trace], +# Memory trace checking +__SILC_ENABLE_MEMTRACE="" +AC_MSG_CHECKING(whether to enable memory tracing) +AC_ARG_ENABLE(mem-trace, + [ --enable-mem-trace enable memory tracing], [ case "${enableval}" in yes) AC_MSG_RESULT(yes) - AC_DEFINE([SILC_STACKTRACE], [], [SILC_STACKTRACE]) - __SILC_ENABLE_STACKTRACE="#define __SILC_ENABLE_STACKTRACE 1" + AC_DEFINE([SILC_MEMTRACE], [], [SILC_MEMTRACE]) + __SILC_ENABLE_MEMTRACE="#define __SILC_ENABLE_MEMTRACE 1" CFLAGS="$CFLAGS -rdynamic" PC_CFLAGS="$PC_CFLAGS -rdynamic" ;; @@ -779,6 +794,26 @@ AC_ARG_ENABLE(gcov, [ AC_MSG_RESULT(no) ]) + +AC_MSG_CHECKING(whether to have verbose compilation) +AC_ARG_ENABLE(verbose, + [ --enable-verbose have verbose compilation], + [ + case "${enableval}" in + yes) + AC_MSG_RESULT(yes) + + # Add here any options to give verbose compilation output + SILC_ADD_CFLAGS(-ftree-vectorizer-verbose=2) + ;; + *) + AC_MSG_RESULT(no) + ;; + esac + ], + [ + AC_MSG_RESULT(no) + ]) #endif SILC_DIST_INPLACE # Debug checking @@ -856,6 +891,7 @@ LDFLAGS="-L\$(silc_top_srcdir)/lib $LDFLAGS" SILC_LIB_INCLUDES="$SILC_LIB_INCLUDES -I$SILC_TOP_SRCDIR/lib/contrib" SILC_LIB_INCLUDES="$SILC_LIB_INCLUDES -I$SILC_TOP_SRCDIR/lib/silcutil" +SILC_LIB_INCLUDES="$SILC_LIB_INCLUDES -I$SILC_TOP_SRCDIR/lib/silchttp" # Check for iconv support @@ -894,7 +930,8 @@ AC_ARG_WITH(iconv, AC_MSG_RESULT(no) AC_CHECK_HEADERS(iconv.h, [ - AC_CHECK_FUNCS(iconv, + # Default check for iconv in C-library + AC_CHECK_FUNCS(iconv iconv_open iconv_close, [ has_iconv=true check_iconv=false @@ -903,6 +940,7 @@ AC_ARG_WITH(iconv, ]) if test x$check_iconv = xtrue; then + # Check for iconv in libiconv installed under /usr AC_MSG_RESULT(Searching for iconv...) # XXX @@ -911,6 +949,10 @@ if test x$check_iconv = xtrue; then AC_CHECK_HEADERS(iconv.h, [ LIBS="$LIBS -liconv" + LDFLAGS="$LDFLAGS -L/usr/lib" + CFLAGS="$CFLAGS -I/usr/include" + CPPLAGS="$CPPFLAGS -I/usr/include" + AC_MSG_CHECKING(for iconv in -liconv) AC_TRY_LINK( [ @@ -945,7 +987,7 @@ if test x$check_iconv = xtrue; then SAVE_LDFLAGS="$LDFLAGS" SAVE_CPPFLAGS="$CPPFLAGS" - for dir in `echo "/usr/local /usr/pkg /usr/contrib"`; do + for dir in `echo "/usr/local /usr/pkg /usr/contrib /opt/local"`; do if test x$has_iconv = xfalse; then AC_MSG_RESULT(searching in $dir...) @@ -1003,7 +1045,7 @@ if test x$has_iconv = xtrue; then # (2) In glibc-2.1.2 and earlier there is a bug that messes up ob and # obl when args 2 and 3 are 0 (fixed in glibc-2.1.3). # - AC_CACHE_CHECK([whether this iconv is good enough], ac_iconv_good, + AC_CACHE_CHECK([whether this iconv is good enough], ac_cv_iconv_good, AC_TRY_RUN( [ #include @@ -1022,17 +1064,17 @@ if test x$has_iconv = xtrue; then } ], [ - ac_iconv_good=yes + ac_cv_iconv_good=yes ], [ - ac_iconv_good=no + ac_cv_iconv_good=no ], [ - ac_iconv_good=yes + ac_cv_iconv_good=yes ]) ) - if test x$ac_iconv_good = xno; then + if test x$ac_cv_iconv_good = xno; then AC_MSG_RESULT(Try using libiconv instead.) fi fi @@ -1162,7 +1204,7 @@ if test x$has_threads = xtrue; then # Check for read/write locks AC_CHECK_FUNC(pthread_rwlock_init, [ - AC_RUN_IFELSE( + AC_RUN_IFELSE([AC_LANG_SOURCE( [ #include int main() @@ -1172,7 +1214,7 @@ if test x$has_threads = xtrue; then pthread_rwlock_destroy(&rwlock); return 0; } - ], + ])], [], [ # Rwlock not defined @@ -1192,6 +1234,30 @@ if test x$has_threads = xtrue; then fi +# Check for Expat +AC_ARG_WITH(expat, + [[ --with-expat[=DIR] use Expat XML [search in DIR/include and DIR/lib]]], + [ + case "${withval}" in + no) + ;; + *) + if test -d $withval/include; then + CPPFLAGS="$CPPFLAGS -I$withval/include" + CFLAGS="$CFLAGS -I$withval/include" + fi + if test -d $withval/lib; then + LDFLAGS="$LDFLAGS -L$withval/lib" + fi + ;; + esac + ]) + +AC_CHECK_HEADERS(expat.h, + [ LIBS="$LIBS -lexpat" ], + [ AC_MSG_ERROR(Expat XML Library is required to compile SRT) ]) + + ## ## Native WIN32 compilation under cygwin ## @@ -1223,7 +1289,7 @@ AC_SUBST(LIBS) AC_SUBST(SILC_LIB_INCLUDES) AC_SUBST(PC_CFLAGS) AC_SUBST(__SILC_ENABLE_DEBUG) -AC_SUBST(__SILC_ENABLE_STACKTRACE) +AC_SUBST(__SILC_ENABLE_MEMTRACE) AC_SUBST(__SILC_HAVE_PTHREAD) AC_SUBST(__RUNTIME_PACKAGE_VERSION) @@ -1272,6 +1338,8 @@ lib/silcutil/tests/Makefile lib/silcutil/unix/Makefile lib/silcutil/win32/Makefile lib/silcutil/symbian/Makefile +lib/silchttp/Makefile +lib/silchttp/tests/Makefile lib/srt.pc )