2
dnl Copyright (C) 2005, 2006 Free Software Foundation, Inc.
2
dnl Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc.
4
4
dnl This program is free software; you can redistribute it and/or modify
5
5
dnl it under the terms of the GNU General Public License as published by
14
14
dnl along with this program; if not, write to the Free Software
15
15
dnl Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
17
dnl $Id: sdl.m4,v 1.41 2007/07/01 10:54:14 bjacques Exp $
17
dnl $Id: sdl.m4,v 1.46 2007/11/24 16:47:11 rsavoye Exp $
19
19
AC_DEFUN([GNASH_PATH_SDL], [
23
23
AC_CACHE_VAL(ac_cv_path_sdl_incl, [
24
24
if test x"${with_sdl_incl}" != x ; then
25
25
if test -f ${with_sdl_incl}/SDL.h ; then
26
ac_cv_path_sdl_incl=-I`(cd ${with_sdl_incl}; pwd)`
26
ac_cv_path_sdl_incl="-I`(cd ${with_sdl_incl}; pwd)`"
28
28
AC_MSG_ERROR([${with_sdl_incl} directory doesn't contain SDL.h])
39
39
dnl version number attached. At least on Debain based systems, this
40
40
dnl doesn't seem to get a directory that is unversioned.
42
AC_MSG_CHECKING([for the SDL Version])
43
42
if test x${cross_compiling} = xno; then
44
43
if test x"$PKG_CONFIG" != x; then
45
$PKG_CONFIG --exists sdl && gnash_sdl_version=`$PKG_CONFIG --modversion sdl`
44
dnl What's the point of checking for SDL version here if we wipe out that info below ?? .. dropping the check
45
dnl AC_MSG_CHECKING([for the SDL Version])
46
dnl $PKG_CONFIG --exists sdl && gnash_sdl_version=`$PKG_CONFIG --modversion sdl`
46
47
$PKG_CONFIG --exists sdl && ac_cv_path_sdl_incl=`$PKG_CONFIG --cflags sdl`
48
dnl AC_MSG_RESULT(${gnash_sdl_version})
49
AC_MSG_RESULT(${gnash_sdl_version})
51
52
AC_PATH_PROG(SDL_CONFIG, sdl-config, , ,[${pathlist}])
52
53
if test "x$SDL_CONFIG" != "x" ; then
53
54
if test "x$SDL_CFLAGS" = "x" ; then
54
55
SDL_CFLAGS=`$SDL_CONFIG --cflags`
56
if test x${cross_compiling} = xno; then
57
ac_cv_path_sdl_incl=$SDL_CFLAGS
56
60
if test "x$SDL_LIBS" = "x" ; then
57
SDL_LIBS=`$SDL_CONFIG --libs | sed -e 's:-L/usr/lib::'`
61
SDL_LIBS=`$SDL_CONFIG --libs | sed -e 's:-L/usr/lib\>::'`
62
if test x${cross_compiling} = xno; then
63
ac_cv_path_sdl_lib=$SDL_LIBS
63
68
gnash_sdl_topdir=""
64
69
gnash_sdl_version=""
65
AC_MSG_CHECKING([for SDL header])
66
70
if test x"${ac_cv_path_sdl_incl}" = x; then
71
AC_MSG_CHECKING([for SDL header])
67
72
for i in ${incllist}; do
68
73
for j in `ls -dr $i/SDL* 2>/dev/null`; do
69
if test -f $j/SDL.h; then
74
if test -f $j/SDL.h; then
70
75
gnash_sdl_topdir=`basename $j`
71
76
gnash_sdl_version=`echo ${gnash_sdl_topdir} | sed -e 's:SDL::' -e 's:-::'`
72
77
ac_cv_path_sdl_incl="-I$j"
81
if test x"${ac_cv_path_sdl_incl}" != x; then
85
if test x"${ac_cv_path_sdl_incl}" != x; then
86
AC_MSG_RESULT(${ac_cv_path_sdl_incl})
88
AC_MSG_RESULT([not found in incllist])
92
dnl This is sorta bogus atm.
80
94
if test x"${ac_cv_path_sdl_incl}" = x ; then
81
95
AC_CHECK_HEADERS(SDL.h, [ac_cv_path_sdl_incl=""])
118
131
if test x"${ac_cv_path_sdl_lib}" = x ; then
119
132
for i in $libslist; do
120
133
if test -f $i/libSDL.a -o -f $i/libSDL.${shlibext}; then
121
if test x"$i" != x"/usr/lib"; then
134
if test ! x"$i" = x"/usr/lib" -o x"$i" = x"/usr/lib64"; then
122
135
ac_cv_path_sdl_lib="-L$i -lSDL"
123
136
dnl AC_MSG_RESULT(${ac_cv_path_sdl_lib})
132
145
if test -f $i/libSDL-1.1.a -o -f $i/libSDL-1.1.${shlibext}; then
133
if test x"$i" != x"/usr/lib"; then
146
if test ! x"$i" = x"/usr/lib" -o x"$i" = x"/usr/lib64"; then
134
147
ac_cv_path_sdl_lib="-L$i -lSDL-1.1"
135
148
dnl AC_MSG_RESULT(${ac_cv_path_sdl_lib})
147
160
if test x"${ac_cv_path_sdl_lib}" = x ; then
148
161
AC_CHECK_LIB(SDL, SDL_Init, [ac_cv_path_sdl_lib="-lSDL"])
150
AC_MSG_CHECKING([for SDL library])
151
AC_MSG_RESULT(${ac_cv_path_sdl_lib})
163
dnl AC_MSG_CHECKING([for SDL library])
164
dnl AC_MSG_RESULT(${ac_cv_path_sdl_lib})
152
165
if test x"${ac_cv_path_sdl_incl}" != x ; then
153
166
SDL_CFLAGS="${ac_cv_path_sdl_incl}"