]> git.ipfire.org Git - thirdparty/cups.git/blame - config-scripts/cups-threads.m4
Remove all of the Subversion keywords from various source files.
[thirdparty/cups.git] / config-scripts / cups-threads.m4
CommitLineData
ef416fc2 1dnl
503b54c9 2dnl Threading stuff for CUPS.
ef416fc2 3dnl
503b54c9
MS
4dnl Copyright 2007-2011 by Apple Inc.
5dnl Copyright 1997-2005 by Easy Software Products, all rights reserved.
ef416fc2 6dnl
503b54c9
MS
7dnl These coded instructions, statements, and computer programs are the
8dnl property of Apple Inc. and are protected by Federal copyright
9dnl law. Distribution and use rights are outlined in the file "LICENSE.txt"
10dnl which should have been included with this file. If this file is
11dnl file is missing or damaged, see the license at "http://www.cups.org/".
ef416fc2 12dnl
13
bf3816c7 14AC_ARG_ENABLE(threads, [ --disable-threads disable multi-threading support])
ef416fc2 15
16have_pthread=no
b423cd4c 17PTHREAD_FLAGS=""
ef416fc2 18
19if test "x$enable_threads" != xno; then
20 AC_CHECK_HEADER(pthread.h, AC_DEFINE(HAVE_PTHREAD_H))
ef416fc2 21
b423cd4c 22 if test x$ac_cv_header_pthread_h = xyes; then
23 dnl Check various threading options for the platforms we support
24 for flag in -lpthreads -lpthread -pthread; do
25 AC_MSG_CHECKING([for pthread_create using $flag])
26 SAVELIBS="$LIBS"
27 LIBS="$flag $LIBS"
28 AC_TRY_LINK([#include <pthread.h>],
29 [pthread_create(0, 0, 0, 0);],
30 have_pthread=yes,
31 LIBS="$SAVELIBS")
32 AC_MSG_RESULT([$have_pthread])
33
34 if test $have_pthread = yes; then
35 PTHREAD_FLAGS="-D_THREAD_SAFE -D_REENTRANT"
2abf387c 36
26d47ec6 37 # Solaris requires -D_POSIX_PTHREAD_SEMANTICS to
2abf387c 38 # be POSIX-compliant... :(
39 if test $uname = SunOS; then
26d47ec6 40 PTHREAD_FLAGS="$PTHREAD_FLAGS -D_POSIX_PTHREAD_SEMANTICS"
2abf387c 41 fi
b423cd4c 42 break
43 fi
44 done
ef416fc2 45 fi
46fi
47
b423cd4c 48AC_SUBST(PTHREAD_FLAGS)