configure.ac

changeset 642
5cb83127d285
parent 641
000d40511c92
child 649
64cfc01ec024
--- a/configure.ac	Sat Mar 16 11:09:43 2024 +0100
+++ b/configure.ac	Sat Mar 16 11:54:46 2024 +0100
@@ -106,42 +106,45 @@
 SDL_CFLAGS=""
 SDL_LIBS=""
 SDL="No"
-AC_MSG_CHECKING(SDL2 library)
+AC_MSG_CHECKING(SDL library)
 pkg-config --exists sdl
 if test "$?" = "0"; then
   AC_MSG_RESULT(yes)
-  AC_MSG_CHECKING(sdl2 library v2.0.0 or newer)
+  AC_MSG_CHECKING(sdl library v2.0.0 or newer)
   pkg-config --atleast-version=2.0.0 sdl2
   if test "$?" = "0"; then
     AC_MSG_RESULT(found)
+    SDL_CFLAGS="$(pkg-config --cflags sdl2)"
+    SDL_LIBS="$(pkg-config --libs sdl2)"
+    AC_CHECK_HEADERS(SDL2/SDL.h)
+    SDL="Yes"
   else
-    AC_MSG_ERROR(not found)
+    AC_MSG_RESULT(not found)
   fi
-  SDL_CFLAGS="$(pkg-config --cflags sdl2)"
-  SDL_LIBS="$(pkg-config --libs sdl2)"
-  AC_CHECK_HEADERS(SDL2/SDL.h)
-  SDL="Yes"
 else
   AC_MSG_RESULT(no)
 fi
 
-# Check for SDL_ttf
-AC_MSG_CHECKING(SDL2_ttf library)
-pkg-config --exists SDL2_ttf
-if test "$?" = "0"; then
-  AC_MSG_RESULT(yes)
-  AC_MSG_CHECKING(sdl2 library v2.0.0 or newer)
-  pkg-config --atleast-version=2.0.0 SDL2_ttf
+# Check for SDL_ttf if base SDL2 is found.
+if test "$SDL" = "Yes"; then
+  AC_MSG_CHECKING(SDL2_ttf library)
+  pkg-config --exists SDL2_ttf
   if test "$?" = "0"; then
-    AC_MSG_RESULT(found)
+    AC_MSG_RESULT(yes)
+    AC_MSG_CHECKING(sdl2 library v2.0.0 or newer)
+    pkg-config --atleast-version=2.0.0 SDL2_ttf
+    if test "$?" = "0"; then
+      AC_MSG_RESULT(found)
+      # Override flags
+      SDL_CFLAGS="$(pkg-config --cflags SDL2_ttf)"
+      SDL_LIBS="$(pkg-config --libs SDL2_ttf)"
+    else
+      AC_MSG_ERROR(not found)
+      SDL="No"
+    fi
   else
-    AC_MSG_ERROR(not found)
+    AC_MSG_RESULT(no)
   fi
-  # Override flags
-  SDL_CFLAGS="$(pkg-config --cflags SDL2_ttf)"
-  SDL_LIBS="$(pkg-config --libs SDL2_ttf)"
-else
-  AC_MSG_RESULT(no)
 fi
 
 dnl Checks for header files.

mercurial