]> git.ipfire.org Git - thirdparty/cups.git/blame - config-scripts/cups-threads.m4
Load cups into easysw/current.
[thirdparty/cups.git] / config-scripts / cups-threads.m4
CommitLineData
ef416fc2 1dnl
2dnl "$Id$"
3dnl
4dnl Threading stuff for the Common UNIX Printing System (CUPS).
5dnl
6dnl Copyright 1997-2005 by Easy Software Products, all rights reserved.
7dnl
8dnl These coded instructions, statements, and computer programs are the
9dnl property of Easy Software Products and are protected by Federal
10dnl copyright law. Distribution and use rights are outlined in the file
11dnl "LICENSE.txt" which should have been included with this file. If this
12dnl file is missing or damaged please contact Easy Software Products
13dnl at:
14dnl
15dnl Attn: CUPS Licensing Information
16dnl Easy Software Products
17dnl 44141 Airport View Drive, Suite 204
18dnl Hollywood, Maryland 20636 USA
19dnl
20dnl Voice: (301) 373-9600
21dnl EMail: cups-info@cups.org
22dnl WWW: http://www.cups.org
23dnl
24
25AC_ARG_ENABLE(threads, [ --enable-threads enable multi-threading support])
26
27have_pthread=no
b423cd4c 28PTHREAD_FLAGS=""
ef416fc2 29
30if test "x$enable_threads" != xno; then
31 AC_CHECK_HEADER(pthread.h, AC_DEFINE(HAVE_PTHREAD_H))
ef416fc2 32
b423cd4c 33 if test x$ac_cv_header_pthread_h = xyes; then
34 dnl Check various threading options for the platforms we support
35 for flag in -lpthreads -lpthread -pthread; do
36 AC_MSG_CHECKING([for pthread_create using $flag])
37 SAVELIBS="$LIBS"
38 LIBS="$flag $LIBS"
39 AC_TRY_LINK([#include <pthread.h>],
40 [pthread_create(0, 0, 0, 0);],
41 have_pthread=yes,
42 LIBS="$SAVELIBS")
43 AC_MSG_RESULT([$have_pthread])
44
45 if test $have_pthread = yes; then
46 PTHREAD_FLAGS="-D_THREAD_SAFE -D_REENTRANT"
47 break
48 fi
49 done
ef416fc2 50 fi
51fi
52
b423cd4c 53AC_SUBST(PTHREAD_FLAGS)
ef416fc2 54
55dnl
56dnl End of "$Id$".
57dnl