[configure.in] Support --disable-pthread

Also allows for --enable-pthread=yes which will make configure abort
if pthread is not found (as opposed to silently disabling it).
This commit is contained in:
Behdad Esfahbod 2007-04-19 16:49:35 -04:00
parent 6d01e89988
commit 813cdd7150

View file

@ -506,8 +506,19 @@ fi
dnl ===========================================================================
AC_CHECK_HEADERS([pthread.h], have_pthread=yes, have_pthread=no)
AC_ARG_ENABLE(pthread,
AS_HELP_STRING([--disable-pthread],
[Do not use pthread]),
[use_pthread=$enableval], [use_pthread=auto])
have_pthread=no
if test "x$use_pthread" != "xno"; then
AC_CHECK_HEADERS([pthread.h], have_pthread=yes, have_pthread=no)
fi
AM_CONDITIONAL(HAVE_PTHREAD, test "x$have_pthread" = "xyes")
if test "x$have_pthread" = xno -a "x$use_pthread" = xyes; then
AC_MSG_ERROR([pthread requested but not found])
fi
dnl ===========================================================================