diff options
author | Christophe Fergeau <cfergeau@redhat.com> | 2014-12-02 11:31:47 +0100 |
---|---|---|
committer | Christophe Fergeau <cfergeau@redhat.com> | 2014-12-09 16:40:25 +0100 |
commit | f9e0a644aebb6cb6caa2c624f9afd2835ab6834f (patch) | |
tree | 41a78cb80af098c4b6971957796060b2cd08b6df | |
parent | dd57d05a523746af54557e4cf5a9768ebe029d77 (diff) |
build-sys: Move opus check to m4 macro
-rw-r--r-- | common/Makefile.am | 3 | ||||
-rw-r--r-- | configure.ac | 5 | ||||
-rw-r--r-- | m4/spice-deps.m4 | 18 |
3 files changed, 20 insertions, 6 deletions
diff --git a/common/Makefile.am b/common/Makefile.am index 362fce6..c5e2e2a 100644 --- a/common/Makefile.am +++ b/common/Makefile.am @@ -94,13 +94,12 @@ AM_CPPFLAGS = \ $(SPICE_COMMON_CFLAGS) \ $(GL_CFLAGS) \ $(PIXMAN_CFLAGS) \ - $(OPUS_CFLAGS) \ $(PROTOCOL_CFLAGS) \ $(NULL) libspice_common_la_LIBADD = \ $(SPICE_COMMON_LIBS) \ - $(OPUS_LIBS) + $(NULL) MARSHALLERS_DEPS = \ $(top_srcdir)/python_modules/__init__.py \ diff --git a/configure.ac b/configure.ac index 93ffc76..d3c318a 100644 --- a/configure.ac +++ b/configure.ac @@ -41,13 +41,10 @@ AC_SUBST(PIXMAN_CFLAGS) SPICE_CHECK_SMARTCARD(SPICE_COMMON) SPICE_CHECK_CELT051(SPICE_COMMON) +SPICE_CHECK_OPUS(SPICE_COMMON) AC_SUBST(SPICE_COMMON_CFLAGS) AC_SUBST(SPICE_COMMON_LIBS) -PKG_CHECK_MODULES([OPUS], [opus >= 0.9.14], have_opus=yes, have_opus=no) -AM_CONDITIONAL([HAVE_OPUS], [test "x$have_opus" = "xyes"]) -AM_COND_IF([HAVE_OPUS], AC_DEFINE([HAVE_OPUS], 1, [Define if we have Opus])) - AC_ARG_ENABLE([opengl], AS_HELP_STRING([--enable-opengl=@<:@yes/no@:>@], [Enable opengl support (not recommended) @<:@default=no@:>@]), diff --git a/m4/spice-deps.m4 b/m4/spice-deps.m4 index 443718b..6816e23 100644 --- a/m4/spice-deps.m4 +++ b/m4/spice-deps.m4 @@ -80,3 +80,21 @@ AC_DEFUN([SPICE_CHECK_CELT051], [ AS_VAR_APPEND([$1_CFLAGS], [" $CELT051_CFLAGS"]) AS_VAR_APPEND([$1_LIBS], [" $CELT051_LIBS"]) ]) + + +# SPICE_CHECK_OPUS(PREFIX) +# ------------------------ +# Check for the availability of Opus. If found, it will append the flags to use +# to the $PREFIX_CFLAGS and $PREFIX_LIBS variables, and it will define a +# HAVE_OPUS preprocessor symbol as well as a HAVE_OPUS Makefile conditional. +#------------------------- +AC_DEFUN([SPICE_CHECK_OPUS], [ + PKG_CHECK_MODULES([OPUS], [opus >= 0.9.14], [have_opus=yes], [have_opus=no]) + + AM_CONDITIONAL([HAVE_OPUS], [test "x$have_opus" = "xyes"]) + if test "x$have_opus" = "xyes" ; then + AC_DEFINE([HAVE_OPUS], [1], [Define if we have OPUS]) + fi + AS_VAR_APPEND([$1_CFLAGS], [" $OPUS_CFLAGS"]) + AS_VAR_APPEND([$1_LIBS], [" $OPUS_LIBS"]) +]) |