annotate acinclude/alsa.m4 @ 4388:1524d3237820 SDL-1.2

Fixed bug #896 John Popplewell 2009-12-08 23:05:50 PST Originally reported by AKFoerster on the mailing list. Error decoding UTF8 Russian text to UTF-16LE on Windows, but specifically on platforms without iconv support (the default on Windows). Valid UTF8 characters are flagged as being overlong and then substituted by the UNKNOWN_UNICODE character. After studying the testiconv.c example program, reading the RFCs and putting some printf statements in SDL_iconv.c the problem is in a test for 'Maximum overlong sequences', specifically 4.2.1, which is carried out by the following code: } else if ( p[0] >= 0xC0 ) { if ( (p[0] & 0xE0) != 0xC0 ) { /* Skip illegal sequences return SDL_ICONV_EILSEQ; */ ch = UNKNOWN_UNICODE; } else { if ( (p[0] & 0xCE) == 0xC0 ) { <<<<<<<< here overlong = SDL_TRUE; } ch = (Uint32)(p[0] & 0x1F); left = 1; } } else { Here is the 2-byte encoding of a character in range 00000080 - 000007FF 110xxxxx 10xxxxxx The line in question is supposed to be checking for an overlong sequence which would be less than 11000001 10111111 which should be represented as a single byte. BUT, the mask value (0xCE) is wrong, it isn't checking the top-most bit: 11000001 value 11001110 mask (incorrect) ^ and should be (0xDE): 11000001 value 11011110 mask (correct) making the above code: } else if ( p[0] >= 0xC0 ) { if ( (p[0] & 0xE0) != 0xC0 ) { /* Skip illegal sequences return SDL_ICONV_EILSEQ; */ ch = UNKNOWN_UNICODE; } else { if ( (p[0] & 0xDE) == 0xC0 ) { <<<<<<<< here overlong = SDL_TRUE; } ch = (Uint32)(p[0] & 0x1F); left = 1; } } else { I can supply a test program and/or a patch if required, best regards, John Popplewell
author Sam Lantinga <slouken@libsdl.org>
date Fri, 11 Dec 2009 08:00:57 +0000
parents b73b5af69f48
children
rev   line source
4275
b73b5af69f48 Split acinclude.m4 into its constituent parts for easy upgrading
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
1 ##############################################################################
b73b5af69f48 Split acinclude.m4 into its constituent parts for easy upgrading
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
2 dnl Configure Paths for Alsa
b73b5af69f48 Split acinclude.m4 into its constituent parts for easy upgrading
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
3 dnl Some modifications by Richard Boulton <richard-alsa@tartarus.org>
b73b5af69f48 Split acinclude.m4 into its constituent parts for easy upgrading
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
4 dnl Christopher Lansdown <lansdoct@cs.alfred.edu>
b73b5af69f48 Split acinclude.m4 into its constituent parts for easy upgrading
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
5 dnl Jaroslav Kysela <perex@suse.cz>
b73b5af69f48 Split acinclude.m4 into its constituent parts for easy upgrading
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
6 dnl Last modification: alsa.m4,v 1.23 2004/01/16 18:14:22 tiwai Exp
b73b5af69f48 Split acinclude.m4 into its constituent parts for easy upgrading
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
7 dnl AM_PATH_ALSA([MINIMUM-VERSION [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
b73b5af69f48 Split acinclude.m4 into its constituent parts for easy upgrading
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
8 dnl Test for libasound, and define ALSA_CFLAGS and ALSA_LIBS as appropriate.
b73b5af69f48 Split acinclude.m4 into its constituent parts for easy upgrading
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
9 dnl enables arguments --with-alsa-prefix=
b73b5af69f48 Split acinclude.m4 into its constituent parts for easy upgrading
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
10 dnl --with-alsa-enc-prefix=
b73b5af69f48 Split acinclude.m4 into its constituent parts for easy upgrading
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
11 dnl --disable-alsatest
b73b5af69f48 Split acinclude.m4 into its constituent parts for easy upgrading
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
12 dnl
b73b5af69f48 Split acinclude.m4 into its constituent parts for easy upgrading
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
13 dnl For backwards compatibility, if ACTION_IF_NOT_FOUND is not specified,
b73b5af69f48 Split acinclude.m4 into its constituent parts for easy upgrading
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
14 dnl and the alsa libraries are not found, a fatal AC_MSG_ERROR() will result.
b73b5af69f48 Split acinclude.m4 into its constituent parts for easy upgrading
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
15 dnl
b73b5af69f48 Split acinclude.m4 into its constituent parts for easy upgrading
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
16 AC_DEFUN([AM_PATH_ALSA],
b73b5af69f48 Split acinclude.m4 into its constituent parts for easy upgrading
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
17 [dnl Save the original CFLAGS, LDFLAGS, and LIBS
b73b5af69f48 Split acinclude.m4 into its constituent parts for easy upgrading
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
18 alsa_save_CFLAGS="$CFLAGS"
b73b5af69f48 Split acinclude.m4 into its constituent parts for easy upgrading
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
19 alsa_save_LDFLAGS="$LDFLAGS"
b73b5af69f48 Split acinclude.m4 into its constituent parts for easy upgrading
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
20 alsa_save_LIBS="$LIBS"
b73b5af69f48 Split acinclude.m4 into its constituent parts for easy upgrading
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
21 alsa_found=yes
b73b5af69f48 Split acinclude.m4 into its constituent parts for easy upgrading
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
22
b73b5af69f48 Split acinclude.m4 into its constituent parts for easy upgrading
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
23 dnl
b73b5af69f48 Split acinclude.m4 into its constituent parts for easy upgrading
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
24 dnl Get the cflags and libraries for alsa
b73b5af69f48 Split acinclude.m4 into its constituent parts for easy upgrading
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
25 dnl
b73b5af69f48 Split acinclude.m4 into its constituent parts for easy upgrading
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
26 AC_ARG_WITH(alsa-prefix,
b73b5af69f48 Split acinclude.m4 into its constituent parts for easy upgrading
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
27 [ --with-alsa-prefix=PFX Prefix where Alsa library is installed(optional)],
b73b5af69f48 Split acinclude.m4 into its constituent parts for easy upgrading
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
28 [alsa_prefix="$withval"], [alsa_prefix=""])
b73b5af69f48 Split acinclude.m4 into its constituent parts for easy upgrading
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
29
b73b5af69f48 Split acinclude.m4 into its constituent parts for easy upgrading
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
30 AC_ARG_WITH(alsa-inc-prefix,
b73b5af69f48 Split acinclude.m4 into its constituent parts for easy upgrading
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
31 [ --with-alsa-inc-prefix=PFX Prefix where include libraries are (optional)],
b73b5af69f48 Split acinclude.m4 into its constituent parts for easy upgrading
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
32 [alsa_inc_prefix="$withval"], [alsa_inc_prefix=""])
b73b5af69f48 Split acinclude.m4 into its constituent parts for easy upgrading
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
33
b73b5af69f48 Split acinclude.m4 into its constituent parts for easy upgrading
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
34 dnl FIXME: this is not yet implemented
b73b5af69f48 Split acinclude.m4 into its constituent parts for easy upgrading
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
35 AC_ARG_ENABLE(alsatest,
b73b5af69f48 Split acinclude.m4 into its constituent parts for easy upgrading
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
36 [ --disable-alsatest Do not try to compile and run a test Alsa program],
b73b5af69f48 Split acinclude.m4 into its constituent parts for easy upgrading
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
37 [enable_alsatest="$enableval"],
b73b5af69f48 Split acinclude.m4 into its constituent parts for easy upgrading
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
38 [enable_alsatest=yes])
b73b5af69f48 Split acinclude.m4 into its constituent parts for easy upgrading
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
39
b73b5af69f48 Split acinclude.m4 into its constituent parts for easy upgrading
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
40 dnl Add any special include directories
b73b5af69f48 Split acinclude.m4 into its constituent parts for easy upgrading
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
41 AC_MSG_CHECKING(for ALSA CFLAGS)
b73b5af69f48 Split acinclude.m4 into its constituent parts for easy upgrading
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
42 if test "$alsa_inc_prefix" != "" ; then
b73b5af69f48 Split acinclude.m4 into its constituent parts for easy upgrading
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
43 ALSA_CFLAGS="$ALSA_CFLAGS -I$alsa_inc_prefix"
b73b5af69f48 Split acinclude.m4 into its constituent parts for easy upgrading
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
44 CFLAGS="$CFLAGS -I$alsa_inc_prefix"
b73b5af69f48 Split acinclude.m4 into its constituent parts for easy upgrading
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
45 fi
b73b5af69f48 Split acinclude.m4 into its constituent parts for easy upgrading
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
46 AC_MSG_RESULT($ALSA_CFLAGS)
b73b5af69f48 Split acinclude.m4 into its constituent parts for easy upgrading
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
47
b73b5af69f48 Split acinclude.m4 into its constituent parts for easy upgrading
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
48 dnl add any special lib dirs
b73b5af69f48 Split acinclude.m4 into its constituent parts for easy upgrading
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
49 AC_MSG_CHECKING(for ALSA LDFLAGS)
b73b5af69f48 Split acinclude.m4 into its constituent parts for easy upgrading
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
50 if test "$alsa_prefix" != "" ; then
b73b5af69f48 Split acinclude.m4 into its constituent parts for easy upgrading
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
51 ALSA_LIBS="$ALSA_LIBS -L$alsa_prefix"
b73b5af69f48 Split acinclude.m4 into its constituent parts for easy upgrading
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
52 LDFLAGS="$LDFLAGS $ALSA_LIBS"
b73b5af69f48 Split acinclude.m4 into its constituent parts for easy upgrading
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
53 fi
b73b5af69f48 Split acinclude.m4 into its constituent parts for easy upgrading
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
54
b73b5af69f48 Split acinclude.m4 into its constituent parts for easy upgrading
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
55 dnl add the alsa library
b73b5af69f48 Split acinclude.m4 into its constituent parts for easy upgrading
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
56 ALSA_LIBS="$ALSA_LIBS -lasound -lm -ldl -lpthread"
b73b5af69f48 Split acinclude.m4 into its constituent parts for easy upgrading
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
57 LIBS=`echo $LIBS | sed 's/-lm//'`
b73b5af69f48 Split acinclude.m4 into its constituent parts for easy upgrading
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
58 LIBS=`echo $LIBS | sed 's/-ldl//'`
b73b5af69f48 Split acinclude.m4 into its constituent parts for easy upgrading
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
59 LIBS=`echo $LIBS | sed 's/-lpthread//'`
b73b5af69f48 Split acinclude.m4 into its constituent parts for easy upgrading
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
60 LIBS=`echo $LIBS | sed 's/ //'`
b73b5af69f48 Split acinclude.m4 into its constituent parts for easy upgrading
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
61 LIBS="$ALSA_LIBS $LIBS"
b73b5af69f48 Split acinclude.m4 into its constituent parts for easy upgrading
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
62 AC_MSG_RESULT($ALSA_LIBS)
b73b5af69f48 Split acinclude.m4 into its constituent parts for easy upgrading
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
63
b73b5af69f48 Split acinclude.m4 into its constituent parts for easy upgrading
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
64 dnl Check for a working version of libasound that is of the right version.
b73b5af69f48 Split acinclude.m4 into its constituent parts for easy upgrading
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
65 min_alsa_version=ifelse([$1], ,0.1.1,$1)
b73b5af69f48 Split acinclude.m4 into its constituent parts for easy upgrading
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
66 AC_MSG_CHECKING(for libasound headers version >= $min_alsa_version)
b73b5af69f48 Split acinclude.m4 into its constituent parts for easy upgrading
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
67 no_alsa=""
b73b5af69f48 Split acinclude.m4 into its constituent parts for easy upgrading
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
68 alsa_min_major_version=`echo $min_alsa_version | \
b73b5af69f48 Split acinclude.m4 into its constituent parts for easy upgrading
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
69 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
b73b5af69f48 Split acinclude.m4 into its constituent parts for easy upgrading
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
70 alsa_min_minor_version=`echo $min_alsa_version | \
b73b5af69f48 Split acinclude.m4 into its constituent parts for easy upgrading
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
71 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
b73b5af69f48 Split acinclude.m4 into its constituent parts for easy upgrading
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
72 alsa_min_micro_version=`echo $min_alsa_version | \
b73b5af69f48 Split acinclude.m4 into its constituent parts for easy upgrading
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
73 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
b73b5af69f48 Split acinclude.m4 into its constituent parts for easy upgrading
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
74
b73b5af69f48 Split acinclude.m4 into its constituent parts for easy upgrading
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
75 AC_LANG_SAVE
b73b5af69f48 Split acinclude.m4 into its constituent parts for easy upgrading
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
76 AC_LANG_C
b73b5af69f48 Split acinclude.m4 into its constituent parts for easy upgrading
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
77 AC_TRY_COMPILE([
b73b5af69f48 Split acinclude.m4 into its constituent parts for easy upgrading
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
78 #include <alsa/asoundlib.h>
b73b5af69f48 Split acinclude.m4 into its constituent parts for easy upgrading
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
79 ], [
b73b5af69f48 Split acinclude.m4 into its constituent parts for easy upgrading
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
80 /* ensure backward compatibility */
b73b5af69f48 Split acinclude.m4 into its constituent parts for easy upgrading
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
81 #if !defined(SND_LIB_MAJOR) && defined(SOUNDLIB_VERSION_MAJOR)
b73b5af69f48 Split acinclude.m4 into its constituent parts for easy upgrading
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
82 #define SND_LIB_MAJOR SOUNDLIB_VERSION_MAJOR
b73b5af69f48 Split acinclude.m4 into its constituent parts for easy upgrading
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
83 #endif
b73b5af69f48 Split acinclude.m4 into its constituent parts for easy upgrading
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
84 #if !defined(SND_LIB_MINOR) && defined(SOUNDLIB_VERSION_MINOR)
b73b5af69f48 Split acinclude.m4 into its constituent parts for easy upgrading
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
85 #define SND_LIB_MINOR SOUNDLIB_VERSION_MINOR
b73b5af69f48 Split acinclude.m4 into its constituent parts for easy upgrading
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
86 #endif
b73b5af69f48 Split acinclude.m4 into its constituent parts for easy upgrading
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
87 #if !defined(SND_LIB_SUBMINOR) && defined(SOUNDLIB_VERSION_SUBMINOR)
b73b5af69f48 Split acinclude.m4 into its constituent parts for easy upgrading
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
88 #define SND_LIB_SUBMINOR SOUNDLIB_VERSION_SUBMINOR
b73b5af69f48 Split acinclude.m4 into its constituent parts for easy upgrading
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
89 #endif
b73b5af69f48 Split acinclude.m4 into its constituent parts for easy upgrading
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
90
b73b5af69f48 Split acinclude.m4 into its constituent parts for easy upgrading
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
91 # if(SND_LIB_MAJOR > $alsa_min_major_version)
b73b5af69f48 Split acinclude.m4 into its constituent parts for easy upgrading
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
92 exit(0);
b73b5af69f48 Split acinclude.m4 into its constituent parts for easy upgrading
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
93 # else
b73b5af69f48 Split acinclude.m4 into its constituent parts for easy upgrading
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
94 # if(SND_LIB_MAJOR < $alsa_min_major_version)
b73b5af69f48 Split acinclude.m4 into its constituent parts for easy upgrading
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
95 # error not present
b73b5af69f48 Split acinclude.m4 into its constituent parts for easy upgrading
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
96 # endif
b73b5af69f48 Split acinclude.m4 into its constituent parts for easy upgrading
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
97
b73b5af69f48 Split acinclude.m4 into its constituent parts for easy upgrading
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
98 # if(SND_LIB_MINOR > $alsa_min_minor_version)
b73b5af69f48 Split acinclude.m4 into its constituent parts for easy upgrading
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
99 exit(0);
b73b5af69f48 Split acinclude.m4 into its constituent parts for easy upgrading
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
100 # else
b73b5af69f48 Split acinclude.m4 into its constituent parts for easy upgrading
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
101 # if(SND_LIB_MINOR < $alsa_min_minor_version)
b73b5af69f48 Split acinclude.m4 into its constituent parts for easy upgrading
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
102 # error not present
b73b5af69f48 Split acinclude.m4 into its constituent parts for easy upgrading
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
103 # endif
b73b5af69f48 Split acinclude.m4 into its constituent parts for easy upgrading
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
104
b73b5af69f48 Split acinclude.m4 into its constituent parts for easy upgrading
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
105 # if(SND_LIB_SUBMINOR < $alsa_min_micro_version)
b73b5af69f48 Split acinclude.m4 into its constituent parts for easy upgrading
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
106 # error not present
b73b5af69f48 Split acinclude.m4 into its constituent parts for easy upgrading
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
107 # endif
b73b5af69f48 Split acinclude.m4 into its constituent parts for easy upgrading
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
108 # endif
b73b5af69f48 Split acinclude.m4 into its constituent parts for easy upgrading
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
109 # endif
b73b5af69f48 Split acinclude.m4 into its constituent parts for easy upgrading
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
110 exit(0);
b73b5af69f48 Split acinclude.m4 into its constituent parts for easy upgrading
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
111 ],
b73b5af69f48 Split acinclude.m4 into its constituent parts for easy upgrading
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
112 [AC_MSG_RESULT(found.)],
b73b5af69f48 Split acinclude.m4 into its constituent parts for easy upgrading
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
113 [AC_MSG_RESULT(not present.)
b73b5af69f48 Split acinclude.m4 into its constituent parts for easy upgrading
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
114 ifelse([$3], , [AC_MSG_ERROR(Sufficiently new version of libasound not found.)])
b73b5af69f48 Split acinclude.m4 into its constituent parts for easy upgrading
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
115 alsa_found=no]
b73b5af69f48 Split acinclude.m4 into its constituent parts for easy upgrading
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
116 )
b73b5af69f48 Split acinclude.m4 into its constituent parts for easy upgrading
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
117 AC_LANG_RESTORE
b73b5af69f48 Split acinclude.m4 into its constituent parts for easy upgrading
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
118
b73b5af69f48 Split acinclude.m4 into its constituent parts for easy upgrading
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
119 dnl Now that we know that we have the right version, let's see if we have the library and not just the headers.
b73b5af69f48 Split acinclude.m4 into its constituent parts for easy upgrading
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
120 if test "x$enable_alsatest" = "xyes"; then
b73b5af69f48 Split acinclude.m4 into its constituent parts for easy upgrading
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
121 AC_CHECK_LIB([asound], [snd_ctl_open],,
b73b5af69f48 Split acinclude.m4 into its constituent parts for easy upgrading
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
122 [ifelse([$3], , [AC_MSG_ERROR(No linkable libasound was found.)])
b73b5af69f48 Split acinclude.m4 into its constituent parts for easy upgrading
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
123 alsa_found=no]
b73b5af69f48 Split acinclude.m4 into its constituent parts for easy upgrading
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
124 )
b73b5af69f48 Split acinclude.m4 into its constituent parts for easy upgrading
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
125 fi
b73b5af69f48 Split acinclude.m4 into its constituent parts for easy upgrading
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
126
b73b5af69f48 Split acinclude.m4 into its constituent parts for easy upgrading
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
127 if test "x$alsa_found" = "xyes" ; then
b73b5af69f48 Split acinclude.m4 into its constituent parts for easy upgrading
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
128 ifelse([$2], , :, [$2])
b73b5af69f48 Split acinclude.m4 into its constituent parts for easy upgrading
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
129 LIBS=`echo $LIBS | sed 's/-lasound//g'`
b73b5af69f48 Split acinclude.m4 into its constituent parts for easy upgrading
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
130 LIBS=`echo $LIBS | sed 's/ //'`
b73b5af69f48 Split acinclude.m4 into its constituent parts for easy upgrading
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
131 LIBS="-lasound $LIBS"
b73b5af69f48 Split acinclude.m4 into its constituent parts for easy upgrading
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
132 fi
b73b5af69f48 Split acinclude.m4 into its constituent parts for easy upgrading
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
133 if test "x$alsa_found" = "xno" ; then
b73b5af69f48 Split acinclude.m4 into its constituent parts for easy upgrading
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
134 ifelse([$3], , :, [$3])
b73b5af69f48 Split acinclude.m4 into its constituent parts for easy upgrading
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
135 CFLAGS="$alsa_save_CFLAGS"
b73b5af69f48 Split acinclude.m4 into its constituent parts for easy upgrading
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
136 LDFLAGS="$alsa_save_LDFLAGS"
b73b5af69f48 Split acinclude.m4 into its constituent parts for easy upgrading
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
137 LIBS="$alsa_save_LIBS"
b73b5af69f48 Split acinclude.m4 into its constituent parts for easy upgrading
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
138 ALSA_CFLAGS=""
b73b5af69f48 Split acinclude.m4 into its constituent parts for easy upgrading
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
139 ALSA_LIBS=""
b73b5af69f48 Split acinclude.m4 into its constituent parts for easy upgrading
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
140 fi
b73b5af69f48 Split acinclude.m4 into its constituent parts for easy upgrading
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
141
b73b5af69f48 Split acinclude.m4 into its constituent parts for easy upgrading
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
142 dnl That should be it. Now just export out symbols:
b73b5af69f48 Split acinclude.m4 into its constituent parts for easy upgrading
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
143 AC_SUBST(ALSA_CFLAGS)
b73b5af69f48 Split acinclude.m4 into its constituent parts for easy upgrading
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
144 AC_SUBST(ALSA_LIBS)
b73b5af69f48 Split acinclude.m4 into its constituent parts for easy upgrading
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
145 ])