orc.m4 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. dnl pkg-config-based checks for Orc
  2. dnl specific:
  3. dnl ORC_CHECK([REQUIRED_VERSION])
  4. AC_DEFUN([ORC_CHECK],
  5. [
  6. ORC_REQ=ifelse([$1], , "0.4.6", [$1])
  7. AC_ARG_ENABLE(orc,
  8. AC_HELP_STRING([--enable-orc],[use Orc if installed]),
  9. [case "${enableval}" in
  10. auto) enable_orc=auto ;;
  11. yes) enable_orc=yes ;;
  12. no) enable_orc=no ;;
  13. *) AC_MSG_ERROR(bad value ${enableval} for --enable-orc) ;;
  14. esac
  15. ],
  16. [enable_orc=auto]) dnl Default value
  17. if test "x$enable_orc" != "xno" ; then
  18. PKG_CHECK_MODULES(ORC, orc-0.4 >= $ORC_REQ, [
  19. AC_DEFINE(HAVE_ORC, 1, [Use Orc])
  20. HAVE_ORC=yes
  21. if test "x$ORCC" = "x" ; then
  22. AC_MSG_CHECKING(for usable orcc)
  23. ORCC=`$PKG_CONFIG --variable=orcc orc-0.4`
  24. dnl check whether the orcc found by pkg-config can be run from the build environment
  25. dnl if this is not the case (e.g. when cross-compiling) fall back to orcc from PATH
  26. AS_IF([$ORCC --version 1> /dev/null 2> /dev/null], [], [ORCC=`which orcc`])
  27. AC_MSG_RESULT($ORCC)
  28. fi
  29. AC_SUBST(ORCC)
  30. ORCC_FLAGS="--compat $ORC_REQ"
  31. AC_SUBST(ORCC_FLAGS)
  32. AS_IF([test "x$ORCC" = "x"], [HAVE_ORCC=no], [HAVE_ORCC=yes])
  33. ], [
  34. if test "x$enable_orc" = "xyes" ; then
  35. AC_MSG_ERROR([--enable-orc specified, but Orc >= $ORC_REQ not found])
  36. fi
  37. AC_DEFINE(DISABLE_ORC, 1, [Disable Orc])
  38. HAVE_ORC=no
  39. HAVE_ORCC=no
  40. ])
  41. else
  42. AC_DEFINE(DISABLE_ORC, 1, [Disable Orc])
  43. HAVE_ORC=no
  44. HAVE_ORCC=no
  45. fi
  46. AM_CONDITIONAL(HAVE_ORC, [test "x$HAVE_ORC" = "xyes"])
  47. AM_CONDITIONAL(HAVE_ORCC, [test "x$HAVE_ORCC" = "xyes"])
  48. ]))
  49. AC_DEFUN([ORC_OUTPUT],
  50. [
  51. if test "$HAVE_ORC" = yes ; then
  52. printf "configure: *** Orc acceleration enabled.\n"
  53. else
  54. if test "x$enable_orc" = "xno" ; then
  55. printf "configure: *** Orc acceleration disabled by --disable-orc. Slower code paths\n"
  56. printf " will be used.\n"
  57. else
  58. printf "configure: *** Orc acceleration disabled. Requires Orc >= $ORC_REQ, which was\n"
  59. printf " not found. Slower code paths will be used.\n"
  60. fi
  61. fi
  62. printf "\n"
  63. ])