Fix:core:Cleanup configure test for sdl
authorhorwitz <horwitz@ffa7fe5e-494d-0410-b361-a75ebd5db220>
Thu, 1 Oct 2009 09:28:18 +0000 (09:28 +0000)
committerhorwitz <horwitz@ffa7fe5e-494d-0410-b361-a75ebd5db220>
Thu, 1 Oct 2009 09:28:18 +0000 (09:28 +0000)
git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@2622 ffa7fe5e-494d-0410-b361-a75ebd5db220

navit/configure.in

index 01ba7e6..1461b41 100644 (file)
@@ -300,28 +300,15 @@ AC_MSG_CHECKING(for CreateProcess)
 AC_TRY_LINK([#include <windows.h>], [CreateProcess(NULL,NULL,NULL,NULL,0,0,NULL,NULL,NULL,NULL);],AC_MSG_RESULT(yes);AC_DEFINE(HAVE_CREATEPROCESS, 1, [Define to 1 if you have the `CreateProcess' function.]) speech_cmdline=yes; speech_cmdline_reason="CreateProcess exists", AC_MSG_RESULT(no))
 
 AC_ARG_ENABLE(graphics-sdl, [  --disable-graphics-sdl             don't create graphics sdl], graphics_sdl=$enableval;graphics_sdl_reason="configure parameter")
+
 if test "x${graphics_sdl}" = "xyes" ; then
-       if test -z "$SDL_CONFIG"; then
-            AC_PATH_PROG([SDL_CONFIG], [sdl-config], [])
-        fi
-fi
-if test "x${graphics_sdl}" = "xyes" ; then
-        AC_MSG_CHECKING([for SDL libraries with $SDL_CONFIG])
-       if test ! -x "$SDL_CONFIG"; then
-           graphics_sdl = "no"
-           graphics_sdl_reason = "sdl-config not available"
-            AC_MSG_RESULT([no])
-       else
-           SDL_CFLAGS="`$SDL_CONFIG --cflags`"
-           SDL_LIBS="`$SDL_CONFIG --libs`"
-           AC_SUBST(SDL_CFLAGS)
-           AC_SUBST(SDL_LIBS)
-            AC_MSG_RESULT([yes])
-               fi 
+        PKG_CHECK_MODULES(SDL, [sdl], graphics_sdl="yes";graphics_sdl_reason="sdl present" , graphics_sdl="no";graphics_sdl_reason="sdl not available")
+        AC_SUBST(SDL_CFLAGS)
+        AC_SUBST(SDL_LIBS)
 fi
 if test "x${graphics_sdl}" = "xyes" ; then
        save_CPPFLAGS=$CPPFLAGS
-       CPPFLAGS="$($SDL_CONFIG --cflags) $CPPFLAGS"
+       CPPFLAGS="$SDL_CFLAGS $CPPFLAGS"
        AC_CHECK_HEADER(SDL_image.h,SDL_IMAGE_LIBS=-lSDL_image,graphics_sdl="no";graphics_sdl_reason="SDL_image.h missing")
        AC_SUBST(SDL_IMAGE_LIBS)
        CPPFLAGS=$save_CPPFLAGS