configure: add pthread detection

adds a --disable-threading option to prevent the check.
uses AX_PTHREAD from:
git://git.savannah.gnu.org/autoconf-archive.git
100644 blob d90de34d14    ax_pthread.m4

Change-Id: Icf3ad1ebcf052748bc341706effcc9ba02a259e4
This commit is contained in:
James Zern
2012-07-12 15:56:41 -07:00
parent b5e9067a28
commit 1d40a8bce8
3 changed files with 329 additions and 0 deletions

View File

@ -34,6 +34,23 @@ AC_SEARCH_LIBS([log2], [m],,
[AC_DEFINE([NOT_HAVE_LOG2], [1],
[Undefine this if you have log2().])])
dnl === Check for pthread support
AC_ARG_ENABLE([threading],
AS_HELP_STRING([--disable-threading],
[Disable detection of thread support]),,
[enable_threading=yes])
if test "$enable_threading" = "yes"; then
AC_MSG_NOTICE([checking for threading support...])
AX_PTHREAD([AC_DEFINE([WEBP_USE_THREAD], [1],
[Undefine this to disable thread support.])
LIBS="$PTHREAD_LIBS $LIBS"
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
CC="$PTHREAD_CC"
],
[enable_threading=no])
fi
AC_MSG_NOTICE([checking if threading is enabled... ${enable_threading-no}])
dnl === check for PNG support ===
PNG_INCLUDES=""