]> code.delx.au - pulseaudio/commitdiff
build-sys: Update orc.m4 to latest upstream version
authorMaarten Bosmans <mkbosmans@gmail.com>
Thu, 23 Jun 2011 20:21:06 +0000 (22:21 +0200)
committerColin Guthrie <colin@mageia.org>
Fri, 24 Jun 2011 09:08:11 +0000 (10:08 +0100)
ORCC is now correctly set to orcc on build system instead of host for cross-compiling

m4/orc.m4

index 92bf21e9bcb7fdb33650f8a13c075caa40dbdef6..983d46247c800b396ae9850a74230ccee1681260 100644 (file)
--- a/m4/orc.m4
+++ b/m4/orc.m4
@@ -5,7 +5,7 @@ dnl ORC_CHECK([REQUIRED_VERSION])
 
 AC_DEFUN([ORC_CHECK],
 [
-  ORC_REQ=ifelse([$1], , "0.4.5", [$1])
+  ORC_REQ=ifelse([$1], , "0.4.6", [$1])
 
   AC_ARG_ENABLE(orc,
   AC_HELP_STRING([--enable-orc],[use Orc if installed]),
@@ -21,21 +21,34 @@ AC_DEFUN([ORC_CHECK],
   if test "x$enable_orc" != "xno" ; then
     PKG_CHECK_MODULES(ORC, orc-0.4 >= $ORC_REQ, [
       AC_DEFINE(HAVE_ORC, 1, [Use Orc])
-      ORCC=`$PKG_CONFIG --variable=orcc orc-0.4`
-      AC_SUBST(ORCC)
       HAVE_ORC=yes
+      if test "x$ORCC" = "x" ; then
+        AC_MSG_CHECKING(for usable orcc)
+        ORCC=`$PKG_CONFIG --variable=orcc orc-0.4`
+        dnl check whether the orcc found by pkg-config can be run from the build environment
+        dnl if this is not the case (e.g. when cross-compiling) fall back to orcc from PATH
+        AS_IF([$ORCC --version 1> /dev/null 2> /dev/null], [], [ORCC=`which orcc`])
+        AC_MSG_RESULT($ORCC)
+      fi
+      AC_SUBST(ORCC)
+      ORCC_FLAGS="--compat $ORC_REQ"
+      AC_SUBST(ORCC_FLAGS)
+      AS_IF([test "x$ORCC" = "x"], [HAVE_ORCC=no], [HAVE_ORCC=yes])
     ], [
       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])
       HAVE_ORC=no
+      HAVE_ORCC=no
     ])
   else
     AC_DEFINE(DISABLE_ORC, 1, [Disable Orc])
     HAVE_ORC=no
+    HAVE_ORCC=no
   fi
-  AM_CONDITIONAL(HAVE_ORC, test "x$HAVE_ORC" = "xyes")
+  AM_CONDITIONAL(HAVE_ORC, [test "x$HAVE_ORC" = "xyes"])
+  AM_CONDITIONAL(HAVE_ORCC, [test "x$HAVE_ORCC" = "xyes"])
 
 ]))