Debian Codegraph @

macros/try-link-sdl-mixer.m4

raw
1 # TRY_LINK_SDL_MIXER
2 #
3 # Checks for the -lSDL_mixer library.
4 # See http://www.libsdl.org/projects/SDL_mixer/
5 # Assumes that SDL_CFLAGS and SDL_LIBS are properly defined.
6 #
7 AC_DEFUN([TRY_LINK_SDL_MIXER],
8 [
9 AC_MSG_CHECKING([for SDL_mixer])
10 AC_LANG_SAVE
11 AC_LANG_C
12 old_CFLAGS="$CFLAGS"
13 old_LIBS="$LIBS"
14 CFLAGS="$SDL_CFLAGS"
15 LIBS="$SDL_LIBS -lSDL_mixer"
16
17 # Darwin seems to require main(int, char *[]) instead of main():
18
19 AC_TRY_LINK(
20 [
21 #include <SDL_mixer.h>
22 #define main bad_main
23 ],
24 [
25 return 0; } /* close bad_main() */
26 #undef main
27
28 #ifdef __cplusplus
29 extern "C"
30 #endif
31 int main(int argc, char *argv[]) {
32 (void) Mix_OpenAudio(11025, AUDIO_U8, 1, 512);
33 ],
34 [
35 AC_MSG_RESULT([found])
36 ],
37 [
38 AC_MSG_ERROR([SDL_mixer not found
39
40 SDL_mixer 1.2.4 or later is needed.
41 See http://www.libsdl.org/projects/SDL_mixer/
42 ])
43 ]
44 )
45 CFLAGS="$old_CFLAGS"
46 LIBS="$old_LIBS"
47 AC_LANG_RESTORE
48 ])