AC_PROG_CC_C_O
AC_PROG_RANLIB
-AC_CHECK_LIB(pthread, pthread_create, [
- AC_DEFINE(PTHREADS)
- LIBS="$LIBS -lpthread"
-],[
+AC_CHECK_LIB(c_r, pthread_create)
+AC_CHECK_LIB(pthread, pthread_create)
+
+AC_CHECK_FUNCS(pthread_create)
+
+if test "$ac_cv_func_pthread_create" != "yes"; then
AC_MSG_ERROR(You need pthreads to build TSRM.)
-])
+fi
+
+AC_DEFINE(PTHREADS)
AC_CHECK_HEADERS(stdarg.h)
#undef PTHREADS
+/* Define if you have the pthread_create function. */
+#undef HAVE_PTHREAD_CREATE
+
/* Define if you have the <stdarg.h> header file. */
#undef HAVE_STDARG_H
-#ifdef DEFINE_TSRM_VERSION
-# undef PACKAGE
-# undef VERSION
-#endif
+/* Define if you have the c_r library (-lc_r). */
+#undef HAVE_LIBC_R
+
+/* Define if you have the pthread library (-lpthread). */
+#undef HAVE_LIBPTHREAD
+
+/* Name of package */
+#undef PACKAGE
+
+/* Version number of package */
+#undef VERSION