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