source: icXML/icXML-devel/m4/xerces_mutexmgr_selection.m4 @ 2723

Last change on this file since 2723 was 2723, checked in by cameron, 6 years ago

Add Xerces build system scripts

File size: 1.9 KB
Line 
1dnl @synopsis XERCES_MUTEXMGR_SELECTION
2dnl
3dnl Determines the which XMLMutexMgr to use
4dnl
5dnl @category C
6dnl @author James Berry
7dnl @version 2005-05-25
8dnl @license AllPermissive
9dnl
10dnl $Id: xerces_mutexmgr_selection.m4 467302 2006-10-24 10:45:35Z amassari $
11
12AC_DEFUN([XERCES_MUTEXMGR_SELECTION],
13        [
14        AC_REQUIRE([XERCES_NO_THREADS])
15        AC_REQUIRE([ACX_PTHREAD])
16       
17        AC_MSG_CHECKING([for which Mutex Manager to use])
18        mutexmgr=
19       
20        # If no threads is specified, use the NoThread Mutex Mgr
21        AS_IF([test x$xerces_cv_no_threads = xyes],
22                [
23                        mutexmgr=NoThreads
24                        AC_DEFINE([XERCES_USE_MUTEXMGR_NOTHREAD], 1, [Define to use the NoThread mutex mgr])
25                ])
26       
27        # Platform specific checks
28        AS_IF([test -z "$mutexmgr"],
29                [
30                        case $host_os in
31                        windows* | cygwin* | mingw*)
32                                mutexmgr=Windows;
33                                AC_DEFINE([XERCES_USE_MUTEXMGR_WINDOWS], 1, [Define to use the Windows mutex mgr])
34                               
35                                case $host_os in
36                                mingw*)
37                                        CXXFLAGS="${CXXFLAGS} -mthreads"
38                                        ;;
39                                esac
40                               
41                                ;;
42                        esac
43                ])
44       
45        # Fall back to using posix mutex id we can
46        AS_IF([test -z "$mutexmgr" && test x$acx_pthread_ok = xyes],
47                [
48                        mutexmgr=POSIX;
49                        AC_DEFINE([XERCES_USE_MUTEXMGR_POSIX], 1, [Define to use the POSIX mutex mgr])
50                       
51                        # Set additional flags for link and compile
52                        LIBS="${LIBS} ${PTHREAD_LIBS}"
53                        CXXFLAGS="${CXXFLAGS} ${PTHREAD_CFLAGS}"
54                ])
55               
56        # If we still didn't find a mutex package, bail
57        AS_IF([test -z "$mutexmgr"],
58                [AC_MSG_ERROR([Xerces cannot function without mutex support. You may want to --disable-threads.])])
59
60        AC_MSG_RESULT($mutexmgr)
61       
62        # Define the auto-make conditionals which determine what actually gets compiled
63        # Note that these macros can't be executed conditionally, which is why they're here, not above.
64        AM_CONDITIONAL([XERCES_USE_MUTEXMGR_NOTHREAD],  [test x"$mutexmgr" = xNoThreads])
65        AM_CONDITIONAL([XERCES_USE_MUTEXMGR_POSIX],     [test x"$mutexmgr" = xPOSIX])
66        AM_CONDITIONAL([XERCES_USE_MUTEXMGR_WINDOWS],   [test x"$mutexmgr" = xWindows])
67       
68        ]
69)
70
71
Note: See TracBrowser for help on using the repository browser.