X-Git-Url: http://git.silcnet.org/gitweb/?p=silc.git;a=blobdiff_plain;f=configure.ad;h=61260822670d8ecd779f0b13d937ca6fce15ffcc;hp=2b2313d53a56b0fa75c4f73a421a010b09c0a94e;hb=bb570fe79cc2ca72001c161a87bf43c1f93b0b60;hpb=e5406021cea627f9cafb16e9949fcffa93710194 diff --git a/configure.ad b/configure.ad index 2b2313d5..61260822 100644 --- a/configure.ad +++ b/configure.ad @@ -36,6 +36,9 @@ case "$target" in *-*-freebsd*) check_threads=true ;; + *-*-netbsd*) + check_threads=true + ;; *-*-*bsd*) check_threads=false ;; @@ -1121,7 +1124,35 @@ if test x$has_threads = xtrue; then ;; esac + # Check for threads AC_CHECK_FUNC(pthread_create) + + # Check for read/write locks + AC_CHECK_FUNC(pthread_rwlock_init, + [ + AC_RUN_IFELSE( + [ + #include + int main() + { + pthread_rwlock_t rwlock; + pthread_rwlock_init(&rwlock, NULL); + pthread_rwlock_destroy(&rwlock); + return 0; + } + ], + [], + [ + # Rwlock not defined + CFLAGS="$CFLAGS -D_XOPEN_SOURCE=600" + ] + ) + ], + [ + # Rwlock not defined + CFLAGS="$CFLAGS -D_XOPEN_SOURCE=600" + ]) + AC_DEFINE([SILC_HAVE_PTHREAD], [], [HAVE_PTHREAD]) AC_DEFINE([SILC_THREADS], [], [HAVE_THREAD]) __SILC_HAVE_PTHREAD="#define __SILC_HAVE_PTHREAD 1"