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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
|
Description: make use of pkg-config instead of openal-config
From: Reinhard Tartler <siretart@tauware.de>
Date: Sun, 28 Jun 2009 20:04:31 +0200
Subject: openal-pkgconfig
Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=533973
---
configure-al.m4 | 118 ++------------------------------------------------------
1 file changed, 4 insertions(+), 114 deletions(-)
diff --git a/configure-al.m4 b/configure-al.m4
index e37c20b..5250f0d 100644
--- a/configure-al.m4
+++ b/configure-al.m4
@@ -1,118 +1,8 @@
dnl Checking for OpenAL
-AC_ARG_WITH([openal-static],
- AC_HELP_STRING([--with-openal-static],
- [enable static linking for openal (default no)]),
- [use_static_openal=${withval}],,)
-AC_ARG_ENABLE(openaltest,
- [ --disable-openaltest Do not try to compile and run a test OpenAL program],
- , enable_openaltest=yes)
-AC_MSG_CHECKING(for OpenAL support)
-AC_PATH_PROG(OPENAL_CONFIG, openal-config, no)
-if test x$OPENAL_CONFIG = xno; then
- echo "The openal-config script installed by OpenAL could not be found"
- echo "Make sure openal-config is in your path, or set the OPENAL_CONFIG"
- echo "environment variable to the full path to openal-config."
- echo "Trying pkg-config instead."
-
- AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
- if test x$PKG_CONFIG = xno; then
- echo "The pkg-config script could not be found"
- echo "Make sure pkg-config is in your path, or set the PKG_CONFIG"
- echo "environment variable to the full path to pkg-config."
-
- AC_MSG_ERROR([*** Can't find the openal library. Try: http://www.openal.org/])
- else
- OPENAL_CONFIG="$PKG_CONFIG openal";
- fi
-fi
-
-if test x"$use_static_openal" = x"yes"; then
- AL_LIBS="/usr/local/lib/libopenal.a"
-else
- AL_LIBS="`$OPENAL_CONFIG --libs`"
-fi
-
-AL_CFLAGS="`$OPENAL_CONFIG --cflags`"
-
-AC_MSG_RESULT(yes)
-
-AC_MSG_CHECKING(for Freealut support)
-AC_PATH_PROG(FREEALUT_CONFIG, freealut-config, no)
-if test x$FREEALUT_CONFIG = xno; then
- echo "*** Warning: The freealut-config script installed by OpenAL could not be found."
- echo "*** The alut library is required, however some older OpenAL distribitions may include it."
- echo "*** If Scorched3D fails to link check alut is in the link line."
- echo "*** Alternatively, make sure freealut-config is in your path, or set the FREEALUT_CONFIG"
- echo "*** environment variable to the full path to openal-config."
-else
-
- AL_LIBS="$AL_LIBS `$FREEALUT_CONFIG --libs`"
- AL_CFLAGS="$AL_CFLAGS `$FREEALUT_CONFIG --cflags`"
-
- AC_MSG_RESULT(yes)
-fi
-
-AC_MSG_CHECKING(for OpenAL compilation)
-if test "x$enable_openaltest" = "xyes" ; then
-
- ac_save_CFLAGS="$CFLAGS"
- ac_save_LIBS="$LIBS"
- CFLAGS="$CFLAGS $AL_CFLAGS"
- LIBS="$AL_LIBS $LIBS"
-
- AC_TRY_COMPILE([
-#ifdef __APPLE__
- #include <OpenAL/al.h>
- #include <OpenAL/alc.h>
-#else
- #include <AL/al.h>
- #include <AL/alut.h>
- #include <AL/alc.h>
-#endif
-
- ],[
- ],[
- have_openal=yes
- ],[
- echo "*** Failed to compile using the OpenAL library."
- echo "*** CFLAGS = $AL_CFLAGS";
- AC_MSG_ERROR([*** Check the OpenAL library is correctly installed.])
- ])
-
- AC_TRY_LINK([
-#ifdef __APPLE__
- #include <OpenAL/al.h>
- #include <OpenAL/alc.h>
-#else
- #include <AL/al.h>
- #include <AL/alut.h>
- #include <AL/alc.h>
-#endif
-
- int main(int argc, char *argv[])
- {
- alutInit(argc, argv);
- return 0;
- }
-#undef main
-#define main K_and_R_C_main
-
- ],[
- ],[
- have_openal=yes
- ],[
- echo "*** Compiled but failed to link using the OpenAL library."
- echo "*** LIBS = $AL_LIBS";
- echo "*** Check the OpenAL library is on the LD_LIBRARY_PATH";
- AC_MSG_ERROR([*** Check the OpenAL library is correctly installed.])
- ])
-
- CFLAGS="$ac_save_CFLAGS"
- LIBS="$ac_save_LIBS"
-
- AC_MSG_RESULT(yes)
-fi
-
+PKG_CHECK_MODULES([OPENAL], [openal])
+PKG_CHECK_MODULES([FREEALUT], [freealut])
+AL_CFLAGS="$OPENAL_CFLAGS $FREEALUT_CFLAGS"
+AL_LIBS="$OPENAL_LIBS $FREEALUT_LIBS"
AC_SUBST(AL_CFLAGS)
AC_SUBST(AL_LIBS)
|