summaryrefslogtreecommitdiff
path: root/volk/config/orc.m4
blob: d17160a9a0a06de6973da7dc4d36e6a7a6d4d646 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
dnl pkg-config-based checks for Orc

dnl specific:
dnl ORC_CHECK([REQUIRED_VERSION])

AC_DEFUN([ORC_CHECK],
[
  ORC_REQ=ifelse([$1], , "0.4.10", [$1])
  
  if test "x$enable_orc" != "xno" ; then
    PKG_CHECK_MODULES(ORC, orc-0.4 >= $ORC_REQ, [
      AC_DEFINE(LV_HAVE_ORC, 1, [Use Orc])
      if test "x$ORCC" = "x" ; then
        ORCC=`$PKG_CONFIG --variable=orcc orc-0.4`
      fi
      AC_SUBST(ORCC)
      ORCC_FLAGS="--compat $ORC_REQ"
      ORC_LDFLAGS=`$PKG_CONFIG --libs orc-0.4`
      ORC_CFLAGS=`$PKG_CONFIG --cflags orc-0.4`
      AC_SUBST(ORCC_FLAGS)
      AC_SUBST(ORC_LDFLAGS)
      AC_SUBST(ORC_CFLAGS)
      LV_HAVE_ORC=yes
      LV_HAVE_ORCC=yes
      LV_ORC_PKGCONFIG="-lvolk_orc"
      if test "x$cross_compiling" = "xyes" ; then
        LV_HAVE_ORCC=no
      fi
    ], [
      if test "x$enable_orc" = "xyes" ; then
        AC_MSG_ERROR([--enable-orc specified, but Orc >= $ORC_REQ not found])
      fi
      AC_DEFINE(DISABLE_ORC, 1, [Disable Orc])
      LV_HAVE_ORC=no
      LV_HAVE_ORCC=no
      LV_ORC_PKGCONFIG=""
    ])
  else
    AC_DEFINE(DISABLE_ORC, 1, [Disable Orc])
    LV_HAVE_ORC=no
    LV_HAVE_ORCC=no
    LV_ORC_PKGCONFIG=""
  fi
  AM_CONDITIONAL(LV_HAVE_ORC, [test "x$LV_HAVE_ORC" = "xyes"])
  AM_CONDITIONAL(LV_HAVE_ORCC, [test "x$LV_HAVE_ORCC" = "xyes"])
  AC_SUBST(LV_ORC_PKGCONFIG)
]))

AC_DEFUN([ORC_OUTPUT],
[
  if test "$LV_HAVE_ORC" = yes ; then
    printf "configure: *** Orc acceleration enabled.\n"
  else
    if test "x$enable_orc" = "xno" ; then
      printf "configure: *** Orc acceleration disabled by --disable-orc.\n"
    else
      printf "configure: *** Orc acceleration disabled.  Requires Orc >= $ORC_REQ, which was\n"
      printf "               not found.\n"
    fi
  fi
  printf "\n"
])