You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

71 lines
1.9 KiB

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