annotate linux.m4 @ 0:223b71206888

Initial import
author thib
date Fri, 01 Aug 2008 16:32:45 +0000
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
223b71206888 Initial import
thib
parents:
diff changeset
1 dnl aclocal.m4 generated automatically by aclocal 1.4
223b71206888 Initial import
thib
parents:
diff changeset
2
223b71206888 Initial import
thib
parents:
diff changeset
3 dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
223b71206888 Initial import
thib
parents:
diff changeset
4 dnl This file is free software; the Free Software Foundation
223b71206888 Initial import
thib
parents:
diff changeset
5 dnl gives unlimited permission to copy and/or distribute it,
223b71206888 Initial import
thib
parents:
diff changeset
6 dnl with or without modifications, as long as this notice is preserved.
223b71206888 Initial import
thib
parents:
diff changeset
7
223b71206888 Initial import
thib
parents:
diff changeset
8 dnl This program is distributed in the hope that it will be useful,
223b71206888 Initial import
thib
parents:
diff changeset
9 dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
223b71206888 Initial import
thib
parents:
diff changeset
10 dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
223b71206888 Initial import
thib
parents:
diff changeset
11 dnl PARTICULAR PURPOSE.
223b71206888 Initial import
thib
parents:
diff changeset
12
223b71206888 Initial import
thib
parents:
diff changeset
13 dnl Configure Paths for Alsa
223b71206888 Initial import
thib
parents:
diff changeset
14 dnl Some modifications by Richard Boulton <richard-alsa@tartarus.org>
223b71206888 Initial import
thib
parents:
diff changeset
15 dnl Christopher Lansdown <lansdoct@cs.alfred.edu>
223b71206888 Initial import
thib
parents:
diff changeset
16 dnl Jaroslav Kysela <perex@suse.cz>
223b71206888 Initial import
thib
parents:
diff changeset
17 dnl Last modification: $Id: alsa.m4,v 1.24 2004/09/15 18:48:07 tiwai Exp $
223b71206888 Initial import
thib
parents:
diff changeset
18 dnl AM_PATH_ALSA([MINIMUM-VERSION [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
223b71206888 Initial import
thib
parents:
diff changeset
19 dnl Test for libasound, and define ALSA_CFLAGS and ALSA_LIBS as appropriate.
223b71206888 Initial import
thib
parents:
diff changeset
20 dnl enables arguments --with-alsa-prefix=
223b71206888 Initial import
thib
parents:
diff changeset
21 dnl --with-alsa-enc-prefix=
223b71206888 Initial import
thib
parents:
diff changeset
22 dnl --disable-alsatest
223b71206888 Initial import
thib
parents:
diff changeset
23 dnl
223b71206888 Initial import
thib
parents:
diff changeset
24 dnl For backwards compatibility, if ACTION_IF_NOT_FOUND is not specified,
223b71206888 Initial import
thib
parents:
diff changeset
25 dnl and the alsa libraries are not found, a fatal AC_MSG_ERROR() will result.
223b71206888 Initial import
thib
parents:
diff changeset
26 dnl
223b71206888 Initial import
thib
parents:
diff changeset
27 AC_DEFUN([AM_PATH_ALSA],
223b71206888 Initial import
thib
parents:
diff changeset
28 [dnl Save the original CFLAGS, LDFLAGS, and LIBS
223b71206888 Initial import
thib
parents:
diff changeset
29 alsa_save_CFLAGS="$CFLAGS"
223b71206888 Initial import
thib
parents:
diff changeset
30 alsa_save_LDFLAGS="$LDFLAGS"
223b71206888 Initial import
thib
parents:
diff changeset
31 alsa_save_LIBS="$LIBS"
223b71206888 Initial import
thib
parents:
diff changeset
32 alsa_found=yes
223b71206888 Initial import
thib
parents:
diff changeset
33
223b71206888 Initial import
thib
parents:
diff changeset
34 dnl
223b71206888 Initial import
thib
parents:
diff changeset
35 dnl Get the cflags and libraries for alsa
223b71206888 Initial import
thib
parents:
diff changeset
36 dnl
223b71206888 Initial import
thib
parents:
diff changeset
37 AC_ARG_WITH(alsa-prefix,
223b71206888 Initial import
thib
parents:
diff changeset
38 [ --with-alsa-prefix=PFX Prefix where Alsa library is installed(optional)],
223b71206888 Initial import
thib
parents:
diff changeset
39 [alsa_prefix="$withval"], [alsa_prefix=""])
223b71206888 Initial import
thib
parents:
diff changeset
40
223b71206888 Initial import
thib
parents:
diff changeset
41 AC_ARG_WITH(alsa-inc-prefix,
223b71206888 Initial import
thib
parents:
diff changeset
42 [ --with-alsa-inc-prefix=PFX Prefix where include libraries are (optional)],
223b71206888 Initial import
thib
parents:
diff changeset
43 [alsa_inc_prefix="$withval"], [alsa_inc_prefix=""])
223b71206888 Initial import
thib
parents:
diff changeset
44
223b71206888 Initial import
thib
parents:
diff changeset
45 dnl FIXME: this is not yet implemented
223b71206888 Initial import
thib
parents:
diff changeset
46 AC_ARG_ENABLE(alsatest,
223b71206888 Initial import
thib
parents:
diff changeset
47 [ --disable-alsatest Do not try to compile and run a test Alsa program],
223b71206888 Initial import
thib
parents:
diff changeset
48 [enable_alsatest="$enableval"],
223b71206888 Initial import
thib
parents:
diff changeset
49 [enable_alsatest=yes])
223b71206888 Initial import
thib
parents:
diff changeset
50
223b71206888 Initial import
thib
parents:
diff changeset
51 dnl Add any special include directories
223b71206888 Initial import
thib
parents:
diff changeset
52 AC_MSG_CHECKING(for ALSA CFLAGS)
223b71206888 Initial import
thib
parents:
diff changeset
53 if test "$alsa_inc_prefix" != "" ; then
223b71206888 Initial import
thib
parents:
diff changeset
54 ALSA_CFLAGS="$ALSA_CFLAGS -I$alsa_inc_prefix"
223b71206888 Initial import
thib
parents:
diff changeset
55 CFLAGS="$CFLAGS -I$alsa_inc_prefix"
223b71206888 Initial import
thib
parents:
diff changeset
56 fi
223b71206888 Initial import
thib
parents:
diff changeset
57 AC_MSG_RESULT($ALSA_CFLAGS)
223b71206888 Initial import
thib
parents:
diff changeset
58 CFLAGS="$alsa_save_CFLAGS"
223b71206888 Initial import
thib
parents:
diff changeset
59
223b71206888 Initial import
thib
parents:
diff changeset
60 dnl add any special lib dirs
223b71206888 Initial import
thib
parents:
diff changeset
61 AC_MSG_CHECKING(for ALSA LDFLAGS)
223b71206888 Initial import
thib
parents:
diff changeset
62 if test "$alsa_prefix" != "" ; then
223b71206888 Initial import
thib
parents:
diff changeset
63 ALSA_LIBS="$ALSA_LIBS -L$alsa_prefix"
223b71206888 Initial import
thib
parents:
diff changeset
64 LDFLAGS="$LDFLAGS $ALSA_LIBS"
223b71206888 Initial import
thib
parents:
diff changeset
65 fi
223b71206888 Initial import
thib
parents:
diff changeset
66
223b71206888 Initial import
thib
parents:
diff changeset
67 dnl add the alsa library
223b71206888 Initial import
thib
parents:
diff changeset
68 ALSA_LIBS="$ALSA_LIBS -lasound -lm -ldl -lpthread"
223b71206888 Initial import
thib
parents:
diff changeset
69 LIBS="$ALSA_LIBS $LIBS"
223b71206888 Initial import
thib
parents:
diff changeset
70 AC_MSG_RESULT($ALSA_LIBS)
223b71206888 Initial import
thib
parents:
diff changeset
71
223b71206888 Initial import
thib
parents:
diff changeset
72 dnl Check for a working version of libasound that is of the right version.
223b71206888 Initial import
thib
parents:
diff changeset
73 min_alsa_version=ifelse([$1], ,0.1.1,$1)
223b71206888 Initial import
thib
parents:
diff changeset
74 AC_MSG_CHECKING(for libasound headers version >= $min_alsa_version)
223b71206888 Initial import
thib
parents:
diff changeset
75 no_alsa=""
223b71206888 Initial import
thib
parents:
diff changeset
76 alsa_min_major_version=`echo $min_alsa_version | \
223b71206888 Initial import
thib
parents:
diff changeset
77 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
223b71206888 Initial import
thib
parents:
diff changeset
78 alsa_min_minor_version=`echo $min_alsa_version | \
223b71206888 Initial import
thib
parents:
diff changeset
79 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
223b71206888 Initial import
thib
parents:
diff changeset
80 alsa_min_micro_version=`echo $min_alsa_version | \
223b71206888 Initial import
thib
parents:
diff changeset
81 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
223b71206888 Initial import
thib
parents:
diff changeset
82
223b71206888 Initial import
thib
parents:
diff changeset
83 AC_LANG_SAVE
223b71206888 Initial import
thib
parents:
diff changeset
84 AC_LANG_C
223b71206888 Initial import
thib
parents:
diff changeset
85 AC_TRY_COMPILE([
223b71206888 Initial import
thib
parents:
diff changeset
86 #include <alsa/asoundlib.h>
223b71206888 Initial import
thib
parents:
diff changeset
87 ], [
223b71206888 Initial import
thib
parents:
diff changeset
88 /* ensure backward compatibility */
223b71206888 Initial import
thib
parents:
diff changeset
89 #if !defined(SND_LIB_MAJOR) && defined(SOUNDLIB_VERSION_MAJOR)
223b71206888 Initial import
thib
parents:
diff changeset
90 #define SND_LIB_MAJOR SOUNDLIB_VERSION_MAJOR
223b71206888 Initial import
thib
parents:
diff changeset
91 #endif
223b71206888 Initial import
thib
parents:
diff changeset
92 #if !defined(SND_LIB_MINOR) && defined(SOUNDLIB_VERSION_MINOR)
223b71206888 Initial import
thib
parents:
diff changeset
93 #define SND_LIB_MINOR SOUNDLIB_VERSION_MINOR
223b71206888 Initial import
thib
parents:
diff changeset
94 #endif
223b71206888 Initial import
thib
parents:
diff changeset
95 #if !defined(SND_LIB_SUBMINOR) && defined(SOUNDLIB_VERSION_SUBMINOR)
223b71206888 Initial import
thib
parents:
diff changeset
96 #define SND_LIB_SUBMINOR SOUNDLIB_VERSION_SUBMINOR
223b71206888 Initial import
thib
parents:
diff changeset
97 #endif
223b71206888 Initial import
thib
parents:
diff changeset
98
223b71206888 Initial import
thib
parents:
diff changeset
99 # if(SND_LIB_MAJOR > $alsa_min_major_version)
223b71206888 Initial import
thib
parents:
diff changeset
100 exit(0);
223b71206888 Initial import
thib
parents:
diff changeset
101 # else
223b71206888 Initial import
thib
parents:
diff changeset
102 # if(SND_LIB_MAJOR < $alsa_min_major_version)
223b71206888 Initial import
thib
parents:
diff changeset
103 # error not present
223b71206888 Initial import
thib
parents:
diff changeset
104 # endif
223b71206888 Initial import
thib
parents:
diff changeset
105
223b71206888 Initial import
thib
parents:
diff changeset
106 # if(SND_LIB_MINOR > $alsa_min_minor_version)
223b71206888 Initial import
thib
parents:
diff changeset
107 exit(0);
223b71206888 Initial import
thib
parents:
diff changeset
108 # else
223b71206888 Initial import
thib
parents:
diff changeset
109 # if(SND_LIB_MINOR < $alsa_min_minor_version)
223b71206888 Initial import
thib
parents:
diff changeset
110 # error not present
223b71206888 Initial import
thib
parents:
diff changeset
111 # endif
223b71206888 Initial import
thib
parents:
diff changeset
112
223b71206888 Initial import
thib
parents:
diff changeset
113 # if(SND_LIB_SUBMINOR < $alsa_min_micro_version)
223b71206888 Initial import
thib
parents:
diff changeset
114 # error not present
223b71206888 Initial import
thib
parents:
diff changeset
115 # endif
223b71206888 Initial import
thib
parents:
diff changeset
116 # endif
223b71206888 Initial import
thib
parents:
diff changeset
117 # endif
223b71206888 Initial import
thib
parents:
diff changeset
118 exit(0);
223b71206888 Initial import
thib
parents:
diff changeset
119 ],
223b71206888 Initial import
thib
parents:
diff changeset
120 [AC_MSG_RESULT(found.)],
223b71206888 Initial import
thib
parents:
diff changeset
121 [AC_MSG_RESULT(not present.)
223b71206888 Initial import
thib
parents:
diff changeset
122 ifelse([$3], , [AC_MSG_ERROR(Sufficiently new version of libasound not found.)])
223b71206888 Initial import
thib
parents:
diff changeset
123 alsa_found=no]
223b71206888 Initial import
thib
parents:
diff changeset
124 )
223b71206888 Initial import
thib
parents:
diff changeset
125 AC_LANG_RESTORE
223b71206888 Initial import
thib
parents:
diff changeset
126
223b71206888 Initial import
thib
parents:
diff changeset
127 dnl Now that we know that we have the right version, let's see if we have the library and not just the headers.
223b71206888 Initial import
thib
parents:
diff changeset
128 if test "x$enable_alsatest" = "xyes"; then
223b71206888 Initial import
thib
parents:
diff changeset
129 AC_CHECK_LIB([asound], [snd_ctl_open],,
223b71206888 Initial import
thib
parents:
diff changeset
130 [ifelse([$3], , [AC_MSG_ERROR(No linkable libasound was found.)])
223b71206888 Initial import
thib
parents:
diff changeset
131 alsa_found=no]
223b71206888 Initial import
thib
parents:
diff changeset
132 )
223b71206888 Initial import
thib
parents:
diff changeset
133 fi
223b71206888 Initial import
thib
parents:
diff changeset
134
223b71206888 Initial import
thib
parents:
diff changeset
135 LDFLAGS="$alsa_save_LDFLAGS"
223b71206888 Initial import
thib
parents:
diff changeset
136 LIBS="$alsa_save_LIBS"
223b71206888 Initial import
thib
parents:
diff changeset
137
223b71206888 Initial import
thib
parents:
diff changeset
138 if test "x$alsa_found" = "xyes" ; then
223b71206888 Initial import
thib
parents:
diff changeset
139 ifelse([$2], , :, [$2])
223b71206888 Initial import
thib
parents:
diff changeset
140 else
223b71206888 Initial import
thib
parents:
diff changeset
141 ALSA_CFLAGS=""
223b71206888 Initial import
thib
parents:
diff changeset
142 ALSA_LIBS=""
223b71206888 Initial import
thib
parents:
diff changeset
143 ifelse([$3], , :, [$3])
223b71206888 Initial import
thib
parents:
diff changeset
144 fi
223b71206888 Initial import
thib
parents:
diff changeset
145
223b71206888 Initial import
thib
parents:
diff changeset
146 dnl That should be it. Now just export out symbols:
223b71206888 Initial import
thib
parents:
diff changeset
147 AC_SUBST(ALSA_CFLAGS)
223b71206888 Initial import
thib
parents:
diff changeset
148 AC_SUBST(ALSA_LIBS)
223b71206888 Initial import
thib
parents:
diff changeset
149 ])
223b71206888 Initial import
thib
parents:
diff changeset
150
223b71206888 Initial import
thib
parents:
diff changeset
151 # Configure paths for ESD
223b71206888 Initial import
thib
parents:
diff changeset
152 # Manish Singh 98-9-30
223b71206888 Initial import
thib
parents:
diff changeset
153 # stolen back from Frank Belew
223b71206888 Initial import
thib
parents:
diff changeset
154 # stolen from Manish Singh
223b71206888 Initial import
thib
parents:
diff changeset
155 # Shamelessly stolen from Owen Taylor
223b71206888 Initial import
thib
parents:
diff changeset
156
223b71206888 Initial import
thib
parents:
diff changeset
157 dnl AM_PATH_ESD([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
223b71206888 Initial import
thib
parents:
diff changeset
158 dnl Test for ESD, and define ESD_CFLAGS and ESD_LIBS
223b71206888 Initial import
thib
parents:
diff changeset
159 dnl
223b71206888 Initial import
thib
parents:
diff changeset
160 AC_DEFUN([AM_PATH_ESD],
223b71206888 Initial import
thib
parents:
diff changeset
161 [dnl
223b71206888 Initial import
thib
parents:
diff changeset
162 dnl Get the cflags and libraries from the esd-config script
223b71206888 Initial import
thib
parents:
diff changeset
163 dnl
223b71206888 Initial import
thib
parents:
diff changeset
164 AC_ARG_WITH(esd-prefix,[ --with-esd-prefix=PFX Prefix where ESD is installed (optional)],
223b71206888 Initial import
thib
parents:
diff changeset
165 esd_prefix="$withval", esd_prefix="")
223b71206888 Initial import
thib
parents:
diff changeset
166 AC_ARG_WITH(esd-exec-prefix,[ --with-esd-exec-prefix=PFX Exec prefix where ESD is installed (optional)],
223b71206888 Initial import
thib
parents:
diff changeset
167 esd_exec_prefix="$withval", esd_exec_prefix="")
223b71206888 Initial import
thib
parents:
diff changeset
168 AC_ARG_ENABLE(esdtest, [ --disable-esdtest Do not try to compile and run a test ESD program],
223b71206888 Initial import
thib
parents:
diff changeset
169 , enable_esdtest=yes)
223b71206888 Initial import
thib
parents:
diff changeset
170
223b71206888 Initial import
thib
parents:
diff changeset
171 if test x$esd_exec_prefix != x ; then
223b71206888 Initial import
thib
parents:
diff changeset
172 esd_args="$esd_args --exec-prefix=$esd_exec_prefix"
223b71206888 Initial import
thib
parents:
diff changeset
173 if test x${ESD_CONFIG+set} != xset ; then
223b71206888 Initial import
thib
parents:
diff changeset
174 ESD_CONFIG=$esd_exec_prefix/bin/esd-config
223b71206888 Initial import
thib
parents:
diff changeset
175 fi
223b71206888 Initial import
thib
parents:
diff changeset
176 fi
223b71206888 Initial import
thib
parents:
diff changeset
177 if test x$esd_prefix != x ; then
223b71206888 Initial import
thib
parents:
diff changeset
178 esd_args="$esd_args --prefix=$esd_prefix"
223b71206888 Initial import
thib
parents:
diff changeset
179 if test x${ESD_CONFIG+set} != xset ; then
223b71206888 Initial import
thib
parents:
diff changeset
180 ESD_CONFIG=$esd_prefix/bin/esd-config
223b71206888 Initial import
thib
parents:
diff changeset
181 fi
223b71206888 Initial import
thib
parents:
diff changeset
182 fi
223b71206888 Initial import
thib
parents:
diff changeset
183
223b71206888 Initial import
thib
parents:
diff changeset
184 AC_PATH_PROG(ESD_CONFIG, esd-config, no)
223b71206888 Initial import
thib
parents:
diff changeset
185 min_esd_version=ifelse([$1], ,0.2.7,$1)
223b71206888 Initial import
thib
parents:
diff changeset
186 AC_MSG_CHECKING(for ESD - version >= $min_esd_version)
223b71206888 Initial import
thib
parents:
diff changeset
187 no_esd=""
223b71206888 Initial import
thib
parents:
diff changeset
188 if test "$ESD_CONFIG" = "no" ; then
223b71206888 Initial import
thib
parents:
diff changeset
189 no_esd=yes
223b71206888 Initial import
thib
parents:
diff changeset
190 else
223b71206888 Initial import
thib
parents:
diff changeset
191 AC_LANG_SAVE
223b71206888 Initial import
thib
parents:
diff changeset
192 AC_LANG_C
223b71206888 Initial import
thib
parents:
diff changeset
193 ESD_CFLAGS=`$ESD_CONFIG $esdconf_args --cflags`
223b71206888 Initial import
thib
parents:
diff changeset
194 ESD_LIBS=`$ESD_CONFIG $esdconf_args --libs`
223b71206888 Initial import
thib
parents:
diff changeset
195
223b71206888 Initial import
thib
parents:
diff changeset
196 esd_major_version=`$ESD_CONFIG $esd_args --version | \
223b71206888 Initial import
thib
parents:
diff changeset
197 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
223b71206888 Initial import
thib
parents:
diff changeset
198 esd_minor_version=`$ESD_CONFIG $esd_args --version | \
223b71206888 Initial import
thib
parents:
diff changeset
199 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
223b71206888 Initial import
thib
parents:
diff changeset
200 esd_micro_version=`$ESD_CONFIG $esd_config_args --version | \
223b71206888 Initial import
thib
parents:
diff changeset
201 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
223b71206888 Initial import
thib
parents:
diff changeset
202 if test "x$enable_esdtest" = "xyes" ; then
223b71206888 Initial import
thib
parents:
diff changeset
203 ac_save_CFLAGS="$CFLAGS"
223b71206888 Initial import
thib
parents:
diff changeset
204 ac_save_LIBS="$LIBS"
223b71206888 Initial import
thib
parents:
diff changeset
205 CFLAGS="$CFLAGS $ESD_CFLAGS"
223b71206888 Initial import
thib
parents:
diff changeset
206 LIBS="$LIBS $ESD_LIBS"
223b71206888 Initial import
thib
parents:
diff changeset
207 dnl
223b71206888 Initial import
thib
parents:
diff changeset
208 dnl Now check if the installed ESD is sufficiently new. (Also sanity
223b71206888 Initial import
thib
parents:
diff changeset
209 dnl checks the results of esd-config to some extent
223b71206888 Initial import
thib
parents:
diff changeset
210 dnl
223b71206888 Initial import
thib
parents:
diff changeset
211 rm -f conf.esdtest
223b71206888 Initial import
thib
parents:
diff changeset
212 AC_TRY_RUN([
223b71206888 Initial import
thib
parents:
diff changeset
213 #include <stdio.h>
223b71206888 Initial import
thib
parents:
diff changeset
214 #include <stdlib.h>
223b71206888 Initial import
thib
parents:
diff changeset
215 #include <string.h>
223b71206888 Initial import
thib
parents:
diff changeset
216 #include <esd.h>
223b71206888 Initial import
thib
parents:
diff changeset
217
223b71206888 Initial import
thib
parents:
diff changeset
218 char*
223b71206888 Initial import
thib
parents:
diff changeset
219 my_strdup (char *str)
223b71206888 Initial import
thib
parents:
diff changeset
220 {
223b71206888 Initial import
thib
parents:
diff changeset
221 char *new_str;
223b71206888 Initial import
thib
parents:
diff changeset
222
223b71206888 Initial import
thib
parents:
diff changeset
223 if (str)
223b71206888 Initial import
thib
parents:
diff changeset
224 {
223b71206888 Initial import
thib
parents:
diff changeset
225 new_str = malloc ((strlen (str) + 1) * sizeof(char));
223b71206888 Initial import
thib
parents:
diff changeset
226 strcpy (new_str, str);
223b71206888 Initial import
thib
parents:
diff changeset
227 }
223b71206888 Initial import
thib
parents:
diff changeset
228 else
223b71206888 Initial import
thib
parents:
diff changeset
229 new_str = NULL;
223b71206888 Initial import
thib
parents:
diff changeset
230
223b71206888 Initial import
thib
parents:
diff changeset
231 return new_str;
223b71206888 Initial import
thib
parents:
diff changeset
232 }
223b71206888 Initial import
thib
parents:
diff changeset
233
223b71206888 Initial import
thib
parents:
diff changeset
234 int main ()
223b71206888 Initial import
thib
parents:
diff changeset
235 {
223b71206888 Initial import
thib
parents:
diff changeset
236 int major, minor, micro;
223b71206888 Initial import
thib
parents:
diff changeset
237 char *tmp_version;
223b71206888 Initial import
thib
parents:
diff changeset
238
223b71206888 Initial import
thib
parents:
diff changeset
239 system ("touch conf.esdtest");
223b71206888 Initial import
thib
parents:
diff changeset
240
223b71206888 Initial import
thib
parents:
diff changeset
241 /* HP/UX 9 (%@#!) writes to sscanf strings */
223b71206888 Initial import
thib
parents:
diff changeset
242 tmp_version = my_strdup("$min_esd_version");
223b71206888 Initial import
thib
parents:
diff changeset
243 if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
223b71206888 Initial import
thib
parents:
diff changeset
244 printf("%s, bad version string\n", "$min_esd_version");
223b71206888 Initial import
thib
parents:
diff changeset
245 exit(1);
223b71206888 Initial import
thib
parents:
diff changeset
246 }
223b71206888 Initial import
thib
parents:
diff changeset
247
223b71206888 Initial import
thib
parents:
diff changeset
248 if (($esd_major_version > major) ||
223b71206888 Initial import
thib
parents:
diff changeset
249 (($esd_major_version == major) && ($esd_minor_version > minor)) ||
223b71206888 Initial import
thib
parents:
diff changeset
250 (($esd_major_version == major) && ($esd_minor_version == minor) && ($esd_micro_version >= micro)))
223b71206888 Initial import
thib
parents:
diff changeset
251 {
223b71206888 Initial import
thib
parents:
diff changeset
252 return 0;
223b71206888 Initial import
thib
parents:
diff changeset
253 }
223b71206888 Initial import
thib
parents:
diff changeset
254 else
223b71206888 Initial import
thib
parents:
diff changeset
255 {
223b71206888 Initial import
thib
parents:
diff changeset
256 printf("\n*** 'esd-config --version' returned %d.%d.%d, but the minimum version\n", $esd_major_version, $esd_minor_version, $esd_micro_version);
223b71206888 Initial import
thib
parents:
diff changeset
257 printf("*** of ESD required is %d.%d.%d. If esd-config is correct, then it is\n", major, minor, micro);
223b71206888 Initial import
thib
parents:
diff changeset
258 printf("*** best to upgrade to the required version.\n");
223b71206888 Initial import
thib
parents:
diff changeset
259 printf("*** If esd-config was wrong, set the environment variable ESD_CONFIG\n");
223b71206888 Initial import
thib
parents:
diff changeset
260 printf("*** to point to the correct copy of esd-config, and remove the file\n");
223b71206888 Initial import
thib
parents:
diff changeset
261 printf("*** config.cache before re-running configure\n");
223b71206888 Initial import
thib
parents:
diff changeset
262 return 1;
223b71206888 Initial import
thib
parents:
diff changeset
263 }
223b71206888 Initial import
thib
parents:
diff changeset
264 }
223b71206888 Initial import
thib
parents:
diff changeset
265
223b71206888 Initial import
thib
parents:
diff changeset
266 ],, no_esd=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
223b71206888 Initial import
thib
parents:
diff changeset
267 CFLAGS="$ac_save_CFLAGS"
223b71206888 Initial import
thib
parents:
diff changeset
268 LIBS="$ac_save_LIBS"
223b71206888 Initial import
thib
parents:
diff changeset
269 AC_LANG_RESTORE
223b71206888 Initial import
thib
parents:
diff changeset
270 fi
223b71206888 Initial import
thib
parents:
diff changeset
271 fi
223b71206888 Initial import
thib
parents:
diff changeset
272 if test "x$no_esd" = x ; then
223b71206888 Initial import
thib
parents:
diff changeset
273 AC_MSG_RESULT(yes)
223b71206888 Initial import
thib
parents:
diff changeset
274 ifelse([$2], , :, [$2])
223b71206888 Initial import
thib
parents:
diff changeset
275 else
223b71206888 Initial import
thib
parents:
diff changeset
276 AC_MSG_RESULT(no)
223b71206888 Initial import
thib
parents:
diff changeset
277 if test "$ESD_CONFIG" = "no" ; then
223b71206888 Initial import
thib
parents:
diff changeset
278 echo "*** The esd-config script installed by ESD could not be found"
223b71206888 Initial import
thib
parents:
diff changeset
279 echo "*** If ESD was installed in PREFIX, make sure PREFIX/bin is in"
223b71206888 Initial import
thib
parents:
diff changeset
280 echo "*** your path, or set the ESD_CONFIG environment variable to the"
223b71206888 Initial import
thib
parents:
diff changeset
281 echo "*** full path to esd-config."
223b71206888 Initial import
thib
parents:
diff changeset
282 else
223b71206888 Initial import
thib
parents:
diff changeset
283 if test -f conf.esdtest ; then
223b71206888 Initial import
thib
parents:
diff changeset
284 :
223b71206888 Initial import
thib
parents:
diff changeset
285 else
223b71206888 Initial import
thib
parents:
diff changeset
286 echo "*** Could not run ESD test program, checking why..."
223b71206888 Initial import
thib
parents:
diff changeset
287 CFLAGS="$CFLAGS $ESD_CFLAGS"
223b71206888 Initial import
thib
parents:
diff changeset
288 LIBS="$LIBS $ESD_LIBS"
223b71206888 Initial import
thib
parents:
diff changeset
289 AC_LANG_SAVE
223b71206888 Initial import
thib
parents:
diff changeset
290 AC_LANG_C
223b71206888 Initial import
thib
parents:
diff changeset
291 AC_TRY_LINK([
223b71206888 Initial import
thib
parents:
diff changeset
292 #include <stdio.h>
223b71206888 Initial import
thib
parents:
diff changeset
293 #include <esd.h>
223b71206888 Initial import
thib
parents:
diff changeset
294 ], [ return 0; ],
223b71206888 Initial import
thib
parents:
diff changeset
295 [ echo "*** The test program compiled, but did not run. This usually means"
223b71206888 Initial import
thib
parents:
diff changeset
296 echo "*** that the run-time linker is not finding ESD or finding the wrong"
223b71206888 Initial import
thib
parents:
diff changeset
297 echo "*** version of ESD. If it is not finding ESD, you'll need to set your"
223b71206888 Initial import
thib
parents:
diff changeset
298 echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
223b71206888 Initial import
thib
parents:
diff changeset
299 echo "*** to the installed location Also, make sure you have run ldconfig if that"
223b71206888 Initial import
thib
parents:
diff changeset
300 echo "*** is required on your system"
223b71206888 Initial import
thib
parents:
diff changeset
301 echo "***"
223b71206888 Initial import
thib
parents:
diff changeset
302 echo "*** If you have an old version installed, it is best to remove it, although"
223b71206888 Initial import
thib
parents:
diff changeset
303 echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"],
223b71206888 Initial import
thib
parents:
diff changeset
304 [ echo "*** The test program failed to compile or link. See the file config.log for the"
223b71206888 Initial import
thib
parents:
diff changeset
305 echo "*** exact error that occured. This usually means ESD was incorrectly installed"
223b71206888 Initial import
thib
parents:
diff changeset
306 echo "*** or that you have moved ESD since it was installed. In the latter case, you"
223b71206888 Initial import
thib
parents:
diff changeset
307 echo "*** may want to edit the esd-config script: $ESD_CONFIG" ])
223b71206888 Initial import
thib
parents:
diff changeset
308 CFLAGS="$ac_save_CFLAGS"
223b71206888 Initial import
thib
parents:
diff changeset
309 LIBS="$ac_save_LIBS"
223b71206888 Initial import
thib
parents:
diff changeset
310 AC_LANG_RESTORE
223b71206888 Initial import
thib
parents:
diff changeset
311 fi
223b71206888 Initial import
thib
parents:
diff changeset
312 fi
223b71206888 Initial import
thib
parents:
diff changeset
313 ESD_CFLAGS=""
223b71206888 Initial import
thib
parents:
diff changeset
314 ESD_LIBS=""
223b71206888 Initial import
thib
parents:
diff changeset
315 ifelse([$3], , :, [$3])
223b71206888 Initial import
thib
parents:
diff changeset
316 fi
223b71206888 Initial import
thib
parents:
diff changeset
317 AC_SUBST(ESD_CFLAGS)
223b71206888 Initial import
thib
parents:
diff changeset
318 AC_SUBST(ESD_LIBS)
223b71206888 Initial import
thib
parents:
diff changeset
319 rm -f conf.esdtest
223b71206888 Initial import
thib
parents:
diff changeset
320 ])
223b71206888 Initial import
thib
parents:
diff changeset
321
223b71206888 Initial import
thib
parents:
diff changeset
322 dnl AM_ESD_SUPPORTS_MULTIPLE_RECORD([ACTION-IF-SUPPORTS [, ACTION-IF-NOT-SUPPORTS]])
223b71206888 Initial import
thib
parents:
diff changeset
323 dnl Test, whether esd supports multiple recording clients (version >=0.2.21)
223b71206888 Initial import
thib
parents:
diff changeset
324 dnl
223b71206888 Initial import
thib
parents:
diff changeset
325 AC_DEFUN([AM_ESD_SUPPORTS_MULTIPLE_RECORD],
223b71206888 Initial import
thib
parents:
diff changeset
326 [dnl
223b71206888 Initial import
thib
parents:
diff changeset
327 AC_MSG_NOTICE([whether installed esd version supports multiple recording clients])
223b71206888 Initial import
thib
parents:
diff changeset
328 ac_save_ESD_CFLAGS="$ESD_CFLAGS"
223b71206888 Initial import
thib
parents:
diff changeset
329 ac_save_ESD_LIBS="$ESD_LIBS"
223b71206888 Initial import
thib
parents:
diff changeset
330 AM_PATH_ESD(0.2.21,
223b71206888 Initial import
thib
parents:
diff changeset
331 ifelse([$1], , [
223b71206888 Initial import
thib
parents:
diff changeset
332 AM_CONDITIONAL(ESD_SUPPORTS_MULTIPLE_RECORD, true)
223b71206888 Initial import
thib
parents:
diff changeset
333 AC_DEFINE(ESD_SUPPORTS_MULTIPLE_RECORD, 1,
223b71206888 Initial import
thib
parents:
diff changeset
334 [Define if you have esound with support of multiple recording clients.])],
223b71206888 Initial import
thib
parents:
diff changeset
335 [$1]),
223b71206888 Initial import
thib
parents:
diff changeset
336 ifelse([$2], , [AM_CONDITIONAL(ESD_SUPPORTS_MULTIPLE_RECORD, false)], [$2])
223b71206888 Initial import
thib
parents:
diff changeset
337 if test "x$ac_save_ESD_CFLAGS" != x ; then
223b71206888 Initial import
thib
parents:
diff changeset
338 ESD_CFLAGS="$ac_save_ESD_CFLAGS"
223b71206888 Initial import
thib
parents:
diff changeset
339 fi
223b71206888 Initial import
thib
parents:
diff changeset
340 if test "x$ac_save_ESD_LIBS" != x ; then
223b71206888 Initial import
thib
parents:
diff changeset
341 ESD_LIBS="$ac_save_ESD_LIBS"
223b71206888 Initial import
thib
parents:
diff changeset
342 fi
223b71206888 Initial import
thib
parents:
diff changeset
343 )
223b71206888 Initial import
thib
parents:
diff changeset
344 ])