]> git.ipfire.org Git - thirdparty/cups.git/blob - config-scripts/cups-threads.m4
Load cups into easysw/current.
[thirdparty/cups.git] / config-scripts / cups-threads.m4
1 dnl
2 dnl "$Id: cups-threads.m4 5466 2006-04-26 19:52:27Z mike $"
3 dnl
4 dnl Threading stuff for the Common UNIX Printing System (CUPS).
5 dnl
6 dnl Copyright 1997-2005 by Easy Software Products, all rights reserved.
7 dnl
8 dnl These coded instructions, statements, and computer programs are the
9 dnl property of Easy Software Products and are protected by Federal
10 dnl copyright law. Distribution and use rights are outlined in the file
11 dnl "LICENSE.txt" which should have been included with this file. If this
12 dnl file is missing or damaged please contact Easy Software Products
13 dnl at:
14 dnl
15 dnl Attn: CUPS Licensing Information
16 dnl Easy Software Products
17 dnl 44141 Airport View Drive, Suite 204
18 dnl Hollywood, Maryland 20636 USA
19 dnl
20 dnl Voice: (301) 373-9600
21 dnl EMail: cups-info@cups.org
22 dnl WWW: http://www.cups.org
23 dnl
24
25 AC_ARG_ENABLE(threads, [ --enable-threads enable multi-threading support])
26
27 have_pthread=no
28 PTHREAD_FLAGS=""
29
30 if test "x$enable_threads" != xno; then
31 AC_CHECK_HEADER(pthread.h, AC_DEFINE(HAVE_PTHREAD_H))
32
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
50 fi
51 fi
52
53 AC_SUBST(PTHREAD_FLAGS)
54
55 dnl
56 dnl End of "$Id: cups-threads.m4 5466 2006-04-26 19:52:27Z mike $".
57 dnl