-#AC_ARG_WITH(pth, [AS_HELP_STRING([--with-pth=@<:@=PREFIX@:>@], [Path to pth (experimental).]),
-#[ if test "x$withval" != "xno" && test "x$withval" != "xyes"
-# then
-# LDFLAGS="$LDFLAGS -L$withval/lib"
-# CPPFLAGS="$CPPFLAGS -I$withval/include"
-# with_pth="yes"
-# fi
-#], [with_pth="no"])
-#if test "x$with_pth" = "xyes"
-#then
-# AC_CHECK_LIB(pth, pth_init,, [with_pth="no (libpth not found)"], [])
-#fi
-#if test "x$with_pth" = "xyes"
-#then
-# AC_CHECK_HEADERS(pth.h,, [with_pth="no (pth.h not found)"])
-#fi
-#if test "x$with_pth" = "xyes"
-#then
-# collect_pth=1
-#else
-# collect_pth=0
-#fi
-#AC_DEFINE_UNQUOTED(COLLECT_PTH, [$collect_pth],
-# [Wether or not to use pth (portable threads) library])
-#AM_CONDITIONAL(BUILD_WITH_PTH, test "x$with_pth" = "xyes")
+AC_ARG_WITH(libpthread, [AS_HELP_STRING([--with-libpthread=@<:@=PREFIX@:>@], [Path to libpthread.])],
+[ if test "x$withval" != "xno" -a "x$withval" != "xyes"
+ then
+ LDFLAGS="$LDFLAGS -L$withval/lib"
+ CPPFLAGS="$CPPFLAGS -I$withval/include"
+ with_libpthread="yes"
+ else
+ if test "x$withval" = "xno"
+ then
+ with_libpthread="no (disabled)"
+ fi
+ fi
+], [with_libpthread="yes"])
+if test "x$with_libpthread" = "xyes"
+then
+ AC_CHECK_LIB(pthread, pthread_create, [with_libpthread="yes"], [with_libpthread="no (libpthread not found)"], [])
+fi
+if test "x$with_libpthread" = "xyes"
+then
+ AC_CHECK_HEADERS(pthread.h,, [with_libpthread="no (pthread.h not found)"])
+fi
+if test "x$with_libpthread" = "xyes"
+then
+ collect_pthread=1
+else
+ collect_pthread=0
+fi
+AC_DEFINE_UNQUOTED(HAVE_LIBPTHREAD, [$collect_pthread],
+ [Wether or not to use pthread (POSIX threads) library])
+AM_CONDITIONAL(BUILD_WITH_LIBPTHREAD, test "x$with_libpthread" = "xyes")