comparison m4/sdl.m4 @ 0:13389e613d67 trunk

[svn] - initial import of audacious-plugins tree (lots to do)
author nenolod
date Mon, 18 Sep 2006 01:11:49 -0700
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:13389e613d67
1 # Configure paths for SDL
2 # Sam Lantinga 9/21/99
3 # stolen from Manish Singh
4 # stolen back from Frank Belew
5 # stolen from Manish Singh
6 # Shamelessly stolen from Owen Taylor
7
8 dnl AM_PATH_SDL([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
9 dnl Test for SDL, and define SDL_CFLAGS and SDL_LIBS
10 dnl
11 AC_DEFUN([AM_PATH_SDL],
12 [dnl
13 dnl Get the cflags and libraries from the sdl-config script
14 dnl
15 AC_ARG_WITH(sdl-prefix,[ --with-sdl-prefix=PFX Prefix where SDL is installed (optional)],
16 sdl_prefix="$withval", sdl_prefix="")
17 AC_ARG_WITH(sdl-exec-prefix,[ --with-sdl-exec-prefix=PFX Exec prefix where SDL is installed (optional)],
18 sdl_exec_prefix="$withval", sdl_exec_prefix="")
19
20 if test x$sdl_exec_prefix != x ; then
21 sdl_args="$sdl_args --exec-prefix=$sdl_exec_prefix"
22 if test x${SDL_CONFIG+set} != xset ; then
23 SDL_CONFIG=$sdl_exec_prefix/bin/sdl-config
24 fi
25 fi
26 if test x$sdl_prefix != x ; then
27 sdl_args="$sdl_args --prefix=$sdl_prefix"
28 if test x${SDL_CONFIG+set} != xset ; then
29 SDL_CONFIG=$sdl_prefix/bin/sdl-config
30 fi
31 fi
32
33 AC_REQUIRE([AC_CANONICAL_TARGET])
34 PATH="$prefix/bin:$prefix/usr/bin:$PATH"
35 AC_PATH_PROG(SDL_CONFIG, sdl-config, no, [$PATH])
36 min_sdl_version=ifelse([$1], ,0.11.0,$1)
37 AC_MSG_CHECKING(for SDL - version >= $min_sdl_version)
38 no_sdl=""
39 if test "$SDL_CONFIG" = "no" ; then
40 no_sdl=yes
41 else
42 SDL_CFLAGS=`$SDL_CONFIG $sdlconf_args --cflags`
43 SDL_LIBS=`$SDL_CONFIG $sdlconf_args --libs`
44
45 sdl_major_version=`$SDL_CONFIG $sdl_args --version | \
46 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
47 sdl_minor_version=`$SDL_CONFIG $sdl_args --version | \
48 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
49 sdl_micro_version=`$SDL_CONFIG $sdl_config_args --version | \
50 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
51 fi
52 if test "x$no_sdl" = x ; then
53 AC_MSG_RESULT(yes)
54 ifelse([$2], , :, [$2])
55 else
56 AC_MSG_RESULT(no)
57 if test "$SDL_CONFIG" = "no" ; then
58 echo "*** The sdl-config script installed by SDL could not be found"
59 echo "*** If SDL was installed in PREFIX, make sure PREFIX/bin is in"
60 echo "*** your path, or set the SDL_CONFIG environment variable to the"
61 echo "*** full path to sdl-config."
62 fi
63 SDL_CFLAGS=""
64 SDL_LIBS=""
65 ifelse([$3], , :, [$3])
66 fi
67 AC_SUBST(SDL_CFLAGS)
68 AC_SUBST(SDL_LIBS)
69 rm -f conf.sdltest
70 ])