Commit b8e0d807 authored by Sam Lantinga's avatar Sam Lantinga

Fixed bug #522

 Mike Frysinger      2007-12-10 16:47:36 PST

it's much easier to manage .pc files for cross-compiling setups than it is for
random *-config scripts ... the cross-compiled pkg-config files can all be
easily/tightly controlled and separate from the host pkg-config files.  the
*-config files however are to be found in $PATH and can easily pick the wrong
one.

can we get the sdl.m4 macro updated so that it checks for libsdl.pc first via
the standard PKG_CHECK_MODULES() m4 macro, and if that fails, fall back to the
normal sdl-config voodoo.

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403965
parent 3fcfb40e
......@@ -19,6 +19,17 @@ AC_ARG_WITH(sdl-exec-prefix,[ --with-sdl-exec-prefix=PFX Exec prefix where SDL
AC_ARG_ENABLE(sdltest, [ --disable-sdltest Do not try to compile and run a test SDL program],
, enable_sdltest=yes)
min_sdl_version=ifelse([$1], ,1.2.0,$1)
if test "x$sdl_prefix$sdl_exec_prefix" = x ; then
PKG_CHECK_MODULES(SDL, [sdl >= $min_sdl_version],
[sdl_pc=yes],
[dnl
AC_MSG_RESULT(no)
sdl_pc=no
])
else
sdl_pc=no
if test x$sdl_exec_prefix != x ; then
sdl_config_args="$sdl_config_args --exec-prefix=$sdl_exec_prefix"
if test x${SDL_CONFIG+set} != xset ; then
......@@ -31,16 +42,20 @@ AC_ARG_ENABLE(sdltest, [ --disable-sdltest Do not try to compile and run
SDL_CONFIG=$sdl_prefix/bin/sdl-config
fi
fi
fi
if test "x$sdl_pc" = xyes ; then
no_sdl=""
else
as_save_PATH="$PATH"
if test "x$prefix" != xNONE; then
if test "x$prefix" != xNONE && test "$cross_compiling" != yes; then
PATH="$prefix/bin:$prefix/usr/bin:$PATH"
fi
AC_PATH_PROG(SDL_CONFIG, sdl-config, no, [$PATH])
PATH="$as_save_PATH"
min_sdl_version=ifelse([$1], ,0.11.0,$1)
AC_MSG_CHECKING(for SDL - version >= $min_sdl_version)
no_sdl=""
if test "$SDL_CONFIG" = "no" ; then
no_sdl=yes
else
......@@ -130,9 +145,13 @@ int main (int argc, char *argv[])
fi
if test "x$no_sdl" = x ; then
AC_MSG_RESULT(yes)
ifelse([$2], , :, [$2])
else
AC_MSG_RESULT(no)
fi
fi
if test "x$no_sdl" = x ; then
ifelse([$2], , :, [$2])
else
if test "$SDL_CONFIG" = "no" ; then
echo "*** The sdl-config script installed by SDL could not be found"
echo "*** If SDL was installed in PREFIX, make sure PREFIX/bin is in"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment