comparison acinclude.m4 @ 948:ac488ad4ef1d

Don't fail if we don't have ALSA available
author Sam Lantinga <slouken@libsdl.org>
date Tue, 24 Aug 2004 06:32:50 +0000
parents 3bb035750537
children ce64900b4a47
comparison
equal deleted inserted replaced
947:3bb035750537 948:ac488ad4ef1d
17 */ 17 */
18 __EOF__ 18 __EOF__
19 cat >>$new <$old 19 cat >>$new <$old
20 ]) 20 ])
21 21
22 # 22 ##############################################################################
23 # --- alsa.m4 ---
24 #
25 dnl Configure Paths for Alsa 23 dnl Configure Paths for Alsa
26 dnl Some modifications by Richard Boulton <richard-alsa@tartarus.org> 24 dnl Some modifications by Richard Boulton <richard-alsa@tartarus.org>
27 dnl Christopher Lansdown <lansdoct@cs.alfred.edu> 25 dnl Christopher Lansdown <lansdoct@cs.alfred.edu>
28 dnl Jaroslav Kysela <perex@suse.cz> 26 dnl Jaroslav Kysela <perex@suse.cz>
29 dnl Last modification: alsa.m4,v 1.22 2002/05/27 11:14:20 tiwai Exp 27 dnl Last modification: alsa.m4,v 1.23 2004/01/16 18:14:22 tiwai Exp
30 dnl AM_PATH_ALSA([MINIMUM-VERSION [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]]) 28 dnl AM_PATH_ALSA([MINIMUM-VERSION [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
31 dnl Test for libasound, and define ALSA_CFLAGS and ALSA_LIBS as appropriate. 29 dnl Test for libasound, and define ALSA_CFLAGS and ALSA_LIBS as appropriate.
32 dnl enables arguments --with-alsa-prefix= 30 dnl enables arguments --with-alsa-prefix=
33 dnl --with-alsa-enc-prefix= 31 dnl --with-alsa-enc-prefix=
34 dnl --disable-alsatest (this has no effect, as yet) 32 dnl --disable-alsatest
35 dnl 33 dnl
36 dnl For backwards compatibility, if ACTION_IF_NOT_FOUND is not specified, 34 dnl For backwards compatibility, if ACTION_IF_NOT_FOUND is not specified,
37 dnl and the alsa libraries are not found, a fatal AC_MSG_ERROR() will result. 35 dnl and the alsa libraries are not found, a fatal AC_MSG_ERROR() will result.
38 dnl 36 dnl
39 AC_DEFUN(AM_PATH_ALSA, 37 AC_DEFUN([AM_PATH_ALSA],
40 [dnl Save the original CFLAGS, LDFLAGS, and LIBS 38 [dnl Save the original CFLAGS, LDFLAGS, and LIBS
41 alsa_save_CFLAGS="$CFLAGS" 39 alsa_save_CFLAGS="$CFLAGS"
42 alsa_save_LDFLAGS="$LDFLAGS" 40 alsa_save_LDFLAGS="$LDFLAGS"
43 alsa_save_LIBS="$LIBS" 41 alsa_save_LIBS="$LIBS"
44 alsa_found=yes 42 alsa_found=yes
55 [alsa_inc_prefix="$withval"], [alsa_inc_prefix=""]) 53 [alsa_inc_prefix="$withval"], [alsa_inc_prefix=""])
56 54
57 dnl FIXME: this is not yet implemented 55 dnl FIXME: this is not yet implemented
58 AC_ARG_ENABLE(alsatest, 56 AC_ARG_ENABLE(alsatest,
59 [ --disable-alsatest Do not try to compile and run a test Alsa program], 57 [ --disable-alsatest Do not try to compile and run a test Alsa program],
60 [enable_alsatest=no], 58 [enable_alsatest="$enableval"],
61 [enable_alsatest=yes]) 59 [enable_alsatest=yes])
62 60
63 dnl Add any special include directories 61 dnl Add any special include directories
64 AC_MSG_CHECKING(for ALSA CFLAGS) 62 AC_MSG_CHECKING(for ALSA CFLAGS)
65 if test "$alsa_inc_prefix" != "" ; then 63 if test "$alsa_inc_prefix" != "" ; then
138 alsa_found=no] 136 alsa_found=no]
139 ) 137 )
140 AC_LANG_RESTORE 138 AC_LANG_RESTORE
141 139
142 dnl Now that we know that we have the right version, let's see if we have the library and not just the headers. 140 dnl Now that we know that we have the right version, let's see if we have the library and not just the headers.
141 if test "x$enable_alsatest" = "xyes"; then
143 AC_CHECK_LIB([asound], [snd_ctl_open],, 142 AC_CHECK_LIB([asound], [snd_ctl_open],,
144 [ifelse([$3], , [AC_MSG_ERROR(No linkable libasound was found.)]) 143 [ifelse([$3], , [AC_MSG_ERROR(No linkable libasound was found.)])
145 alsa_found=no] 144 alsa_found=no]
146 ) 145 )
147 146 fi
148 CFLAGS="$alsa_save_CFLAGS" 147
149 LDFLAGS="$alsa_save_LDFLAGS"
150 LIBS="$alsa_save_LIBS"
151 if test "x$alsa_found" = "xyes" ; then 148 if test "x$alsa_found" = "xyes" ; then
152 ifelse([$2], , :, [$2]) 149 ifelse([$2], , :, [$2])
153 else 150 LIBS=`echo $LIBS | sed 's/-lasound//g'`
151 LIBS=`echo $LIBS | sed 's/ //'`
152 LIBS="-lasound $LIBS"
153 fi
154 if test "x$alsa_found" = "xno" ; then
154 ifelse([$3], , :, [$3]) 155 ifelse([$3], , :, [$3])
155 CFLAGS="$alsa_save_CFLAGS" 156 CFLAGS="$alsa_save_CFLAGS"
156 LDFLAGS="$alsa_save_LDFLAGS" 157 LDFLAGS="$alsa_save_LDFLAGS"
157 LIBS="$alsa_save_LIBS" 158 LIBS="$alsa_save_LIBS"
158 ALSA_CFLAGS="" 159 ALSA_CFLAGS=""
162 dnl That should be it. Now just export out symbols: 163 dnl That should be it. Now just export out symbols:
163 AC_SUBST(ALSA_CFLAGS) 164 AC_SUBST(ALSA_CFLAGS)
164 AC_SUBST(ALSA_LIBS) 165 AC_SUBST(ALSA_LIBS)
165 ]) 166 ])
166 167
167 168 ##############################################################################
168
169 # 169 #
170 # --- esd.m4 --- 170 # --- esd.m4 ---
171 # 171 #
172 # Configure paths for ESD 172 # Configure paths for ESD
173 # Manish Singh 98-9-30 173 # Manish Singh 98-9-30
332 AC_SUBST(ESD_CFLAGS) 332 AC_SUBST(ESD_CFLAGS)
333 AC_SUBST(ESD_LIBS) 333 AC_SUBST(ESD_LIBS)
334 rm -f conf.esdtest 334 rm -f conf.esdtest
335 ]) 335 ])
336 336
337 ##############################################################################
337 # Based on libtool-1.5.8 338 # Based on libtool-1.5.8
338 # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- 339 # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
339 ## Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004 340 ## Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004
340 ## Free Software Foundation, Inc. 341 ## Free Software Foundation, Inc.
341 ## Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996 342 ## Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996