]>
Commit | Line | Data |
---|---|---|
ef416fc2 | 1 | dnl |
2abf387c | 2 | dnl "$Id: cups-threads.m4 6012 2006-10-03 22:35:12Z mike $" |
ef416fc2 | 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 | |
b423cd4c | 28 | PTHREAD_FLAGS="" |
ef416fc2 | 29 | |
30 | if 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" | |
2abf387c | 47 | |
48 | # Solaris requires _POSIX_PTHREAD_SEMANTICS to | |
49 | # be POSIX-compliant... :( | |
50 | if test $uname = SunOS; then | |
51 | PTHREAD_FLAGS="$PTHREAD_FLAGS _POSIX_PTHREAD_SEMANTICS" | |
52 | fi | |
b423cd4c | 53 | break |
54 | fi | |
55 | done | |
ef416fc2 | 56 | fi |
57 | fi | |
58 | ||
b423cd4c | 59 | AC_SUBST(PTHREAD_FLAGS) |
ef416fc2 | 60 | |
61 | dnl | |
2abf387c | 62 | dnl End of "$Id: cups-threads.m4 6012 2006-10-03 22:35:12Z mike $". |
ef416fc2 | 63 | dnl |