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
64
65
66
67
68
69
|
From: Robert Schwebel <r.schwebel@pengutronix.de>
Subject: libtheora: fix configure.ac to work with cross scenario for libvorbis
This is https://trac.xiph.org/ticket/1465
The current test in configure.ac mixes up two different methods (hand
written plus pkg-config). This patch changes the mechanics towards
proper pkg-config usage. In return, we get a cleaned up cross scenario
with no build-system leakage.
This patch fixes the vorbis test.
Signed-off-by: Robert Schwebel <r.schwebel@pengutronix.de>
---
configure.ac | 39 ++++++++++++++++++++++-----------------
1 file changed, 22 insertions(+), 17 deletions(-)
Index: libtheora-1.0/configure.ac
===================================================================
--- libtheora-1.0.orig/configure.ac
+++ libtheora-1.0/configure.ac
@@ -288,23 +288,28 @@ fi
dnl check for Vorbis
-HAVE_VORBIS=no
-
-dnl first check through pkg-config since it's more flexible
-
-if test "x$HAVE_PKG_CONFIG" = "xyes"
-then
- PKG_CHECK_MODULES(VORBIS, vorbis >= 1.0.1, HAVE_VORBIS=yes, HAVE_VORBIS=no)
- dnl also set VORBISENC_LIBS since an examples needs it
- dnl the old .m4 sets this to a value to use on top of VORBIS_LIBS,
- dnl so we do the same here.
- VORBISENC_LIBS="-lvorbisenc"
- AC_SUBST(VORBISENC_LIBS)
-fi
-if test "x$HAVE_VORBIS" = "xno"
-then
- dnl fall back to the old school test
- XIPH_PATH_VORBIS(HAVE_VORBIS=yes, HAVE_VORBIS=no)
+AC_MSG_CHECKING([for vorbis])
+AC_ARG_ENABLE(vorbis,
+ AS_HELP_STRING([--enable-vorbis], [enable vorbis @<:@default=yes@:>@]),
+ [case "$enableval" in
+ y | yes) HAVE_VORBIS=yes ;;
+ *) HAVE_VORBIS=no ;;
+ esac],
+ [HAVE_VORBIS=yes])
+AC_MSG_RESULT([${HAVE_VORBIS}])
+AM_CONDITIONAL(HAVE_VORBIS, [test "$HAVE_VORBIS" = "yes"])
+if test "${HAVE_VORBIS}" = "yes"; then
+ AC_DEFINE(HAVE_VORBIS, 1, [vorbis])
+
+ REQUIRES_VORBIS="vorbis >= 1.0.1"
+ AC_SUBST(REQUIRES_VORBIS)
+ PKG_CHECK_MODULES([VORBIS],
+ [${REQUIRES_VORBIS}],
+ [],
+ [AC_MSG_ERROR([*** ${REQUIRES_VORBIS} not found by pkg-config on your system])]
+ )
+ AC_SUBST(VORBIS_CFLAGS)
+ AC_SUBST(VORBIS_LIBS)
fi
dnl check for SDL
|