Blame common/m4/orc.m4

Packit Service 963350
dnl pkg-config-based checks for Orc
Packit Service 963350
Packit Service 963350
dnl specific:
Packit Service 963350
dnl ORC_CHECK([REQUIRED_VERSION])
Packit Service 963350
Packit Service 963350
AC_DEFUN([ORC_CHECK],
Packit Service 963350
[
Packit Service 963350
  ORC_REQ=ifelse([$1], , "0.4.6", [$1])
Packit Service 963350
Packit Service 963350
  AC_ARG_ENABLE(orc,
Packit Service 963350
  AC_HELP_STRING([--enable-orc],[use Orc if installed]),
Packit Service 963350
  [case "${enableval}" in
Packit Service 963350
    auto) enable_orc=auto ;;
Packit Service 963350
    yes) enable_orc=yes ;;
Packit Service 963350
    no)  enable_orc=no ;;
Packit Service 963350
    *) AC_MSG_ERROR(bad value ${enableval} for --enable-orc) ;;
Packit Service 963350
  esac
Packit Service 963350
  ],
Packit Service 963350
  [enable_orc=auto]) dnl Default value
Packit Service 963350
Packit Service 963350
  if test "x$enable_orc" != "xno" ; then
Packit Service 963350
    PKG_CHECK_MODULES(ORC, orc-0.4 >= $ORC_REQ, [
Packit Service 963350
      AC_DEFINE(HAVE_ORC, 1, [Use Orc])
Packit Service 963350
      HAVE_ORC=yes
Packit Service 963350
      if test "x$ORCC" = "x" ; then
Packit Service 963350
        AC_MSG_CHECKING(for usable orcc)
Packit Service 963350
        ORCC=`$PKG_CONFIG --variable=orcc orc-0.4`
Packit Service 963350
        dnl check whether the orcc found by pkg-config can be run from the build environment
Packit Service 963350
        dnl if this is not the case (e.g. when cross-compiling) fall back to orcc from PATH
Packit Service 963350
        AS_IF([$ORCC --version 1> /dev/null 2> /dev/null], [], [ORCC=`which orcc`])
Packit Service 963350
        AC_MSG_RESULT($ORCC)
Packit Service 963350
      fi
Packit Service 963350
      AC_SUBST(ORCC)
Packit Service 963350
      ORCC_FLAGS="--compat $ORC_REQ"
Packit Service 963350
      AC_SUBST(ORCC_FLAGS)
Packit Service 963350
      AS_IF([test "x$ORCC" = "x"], [HAVE_ORCC=no], [HAVE_ORCC=yes])
Packit Service 963350
    ], [
Packit Service 963350
      if test "x$enable_orc" = "xyes" ; then
Packit Service 963350
        AC_MSG_ERROR([--enable-orc specified, but Orc >= $ORC_REQ not found])
Packit Service 963350
      fi
Packit Service 963350
      AC_DEFINE(DISABLE_ORC, 1, [Disable Orc])
Packit Service 963350
      HAVE_ORC=no
Packit Service 963350
      HAVE_ORCC=no
Packit Service 963350
    ])
Packit Service 963350
  else
Packit Service 963350
    AC_DEFINE(DISABLE_ORC, 1, [Disable Orc])
Packit Service 963350
    HAVE_ORC=no
Packit Service 963350
    HAVE_ORCC=no
Packit Service 963350
  fi
Packit Service 963350
  AM_CONDITIONAL(HAVE_ORC, [test "x$HAVE_ORC" = "xyes"])
Packit Service 963350
  AM_CONDITIONAL(HAVE_ORCC, [test "x$HAVE_ORCC" = "xyes"])
Packit Service 963350
Packit Service 963350
]))
Packit Service 963350
Packit Service 963350
AC_DEFUN([ORC_OUTPUT],
Packit Service 963350
[
Packit Service 963350
  if test "$HAVE_ORC" = yes ; then
Packit Service 963350
    printf "configure: *** Orc acceleration enabled.\n"
Packit Service 963350
  else
Packit Service 963350
    if test "x$enable_orc" = "xno" ; then
Packit Service 963350
      printf "configure: *** Orc acceleration disabled by --disable-orc.  Slower code paths\n"
Packit Service 963350
      printf "               will be used.\n"
Packit Service 963350
    else
Packit Service 963350
      printf "configure: *** Orc acceleration disabled.  Requires Orc >= $ORC_REQ, which was\n"
Packit Service 963350
      printf "               not found.  Slower code paths will be used.\n"
Packit Service 963350
    fi
Packit Service 963350
  fi
Packit Service 963350
  printf "\n"
Packit Service 963350
])
Packit Service 963350