configure.ac

changeset 410
e3f8a51b566a
parent 409
cdf68044adaf
child 411
ae85e91dcc58
--- a/configure.ac	Sat Nov 07 22:04:17 2015 +0100
+++ b/configure.ac	Sat Nov 07 22:34:28 2015 +0100
@@ -82,43 +82,44 @@
 fi
 
 # Check for SDL
+SDL_CFLAGS=""
+SDL_LIBS=""
 AC_MSG_CHECKING(SDL library)
 pkg-config --exists sdl
 if test "$?" = "0"; then
   AC_MSG_RESULT(yes)
+  AC_MSG_CHECKING(sdl library v1.2.0 or newer)
+  pkg-config --atleast-version=1.2.0 sdl
+  if test "$?" = "0"; then
+    AC_MSG_RESULT(found)
+  else
+    AC_MSG_ERROR(not found)
+  fi
+  SDL_CFLAGS="$(pkg-config --cflags sdl)"
+  SDL_LIBS="$(pkg-config --libs sdl)"
+  AC_CHECK_HEADERS(SDL/SDL.h)
 else
-  AC_MSG_ERROR(no)
+  AC_MSG_RESULT(no)
 fi
-AC_MSG_CHECKING(sdl library v1.2.0 or newer)
-pkg-config --atleast-version=1.2.0 sdl
-if test "$?" = "0"; then
-  AC_MSG_RESULT(found)
-else
-  AC_MSG_ERROR(not found)
-fi
-SDL_CFLAGS="$(pkg-config --cflags sdl)"
-SDL_LIBS="$(pkg-config --libs sdl)"
-AC_CHECK_HEADERS(SDL/SDL.h)
 
 # Check for SDL_ttf
 AC_MSG_CHECKING(SDL_ttf library)
 pkg-config --exists SDL_ttf
 if test "$?" = "0"; then
   AC_MSG_RESULT(yes)
+  AC_MSG_CHECKING(sdl library v2.0.0 or newer)
+  pkg-config --atleast-version=2.0.0 SDL_ttf
+  if test "$?" = "0"; then
+    AC_MSG_RESULT(found)
+  else
+    AC_MSG_ERROR(not found)
+  fi
+  # Override flags
+  SDL_CFLAGS="$(pkg-config --cflags SDL_ttf)"
+  SDL_LIBS="$(pkg-config --libs SDL_ttf)"
 else
-  AC_MSG_ERROR(no)
+  AC_MSG_RESULT(no)
 fi
-AC_MSG_CHECKING(sdl library v2.0.0 or newer)
-pkg-config --atleast-version=2.0.0 SDL_ttf
-if test "$?" = "0"; then
-  AC_MSG_RESULT(found)
-else
-  AC_MSG_ERROR(not found)
-fi
-# Override flags
-SDL_CFLAGS="$(pkg-config --cflags SDL_ttf)"
-SDL_LIBS="$(pkg-config --libs SDL_ttf)"
-
 
 dnl Checks for header files.
 AC_HEADER_STDC

mercurial