Mercurial > sdl-ios-xcode
annotate acinclude/alsa.m4 @ 4384:6800e2560310 SDL-1.2
Fixed bugs #882 and 865, re-opening bug #634
Ronald Lamprecht to SDL
Hi,
Sam Lantinga wrote:
The problem with that fix is that it breaks IME events again. Maybe
we can handle keyboard events differently to prevent this issue?
Spending an hour reading MSDN, analysing SDL and another hour testing the reality on XP I am really wondering how patch r4990 could have ever worked in any situation. It's main effect is to break the unicode translation and causing spurious activation events!
Why does TranslateMessage(&msg) nothing useful? Simply because it does not affect "msg" at all! All keyboard events are dispatched without the slightest change (see MSDN). TranslateMessage() just appends additional WM_CHAR, WM_DEADCHAR, WM_SYSCHAR, WM_SYSDEADCHAR event messages to the queue. But I could not find any SDL event handling routine that catches these events and transforms them to proper SDL keyevents while eliminating the corresponding WM_KEYDOWN, etc. events. Thus any IME input like the '@' generated by "Alt + 6(Numpad) + 4(Numpad)" is simply lost.
But the situation is even worse! Up to r4990 the TranslateKey()/ToUnicode() calls did evaluate dead keys and did deliver proper key events for subsequent key strokes like '´' + 'e' resulting in 'é'. ToUnicode() needs proper key state informations to be able to handle these substitutions. But unfortunatly TranslateMessage() needs the same state information and eats it up while generating the WM_CHAR messages :-( Thus the current 1.2.14 breakes the partial IME support of previous releases, too.
The key state race condition between ToUnicode() and TranslateMessage() requires to avoid any ToUnicode() usage for receiving proper WM_CHAR, etc. messages generated by TranslateMessage(). (Yes - the '@' and 'é' appear as WM_CHAR messages when unicode is switched off).
The spurious SDL activation events are *not* caused by additional WM_ACTIVATE Windows messages! Besides DIB_HandleMessage() SDL_PrivateAppActive() is called by another source which I am not yet aware of - any hints?
Thus I do strongly recommend the deletion of the TranslateMessage(&msg) call as a quick fix.
A proper support of unicode and IME requires a clean SDL keyboard input concept first. Which SDL keyboards events should be transmitted to the app when the user presses '´' + 'e' ? Within the current unicode handling the first key stroke is hidden. Even though ToUnicode() delivers the proper key SDL does ignore it in TranslateKey(). Just the composed key event is transmitted to the app. That is what you expect for text input, but the app can no longer use keys like '^' as a key button because it will never receive a key event for it!
With a given concept it seems to be necessary to regenerate SDL key events out of the WM_CHAR, etc. events and to drop all related direct WM_KEYDOWN, etc. events while the remaining basic WM_KEYDOWN, etc. events would still have to result in SDL key events.
Anyway the source of the spurious WM_ACTIVATE should be located to avoid future trouble.
Greets,
Ronald
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Tue, 17 Nov 2009 04:59:13 +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 ]) |