build: Add SDL2_ttf detection.
authorDavid Thompson <dthompson2@worcester.edu>
Thu, 17 Dec 2015 04:38:52 +0000 (23:38 -0500)
committerDavid Thompson <dthompson2@worcester.edu>
Thu, 17 Dec 2015 04:38:52 +0000 (23:38 -0500)
configure.ac
sdl2/config.scm.in

index 2aa1696..a91406b 100644 (file)
@@ -95,4 +95,42 @@ AC_SUBST([LIBSDL2_IMAGE])
 AC_SUBST([LIBSDL2_IMAGE_PREFIX])
 AC_SUBST([LIBSDL2_IMAGE_LIBDIR])
 
+# SDL2_ttf
+AC_ARG_WITH([libsdl2_ttf],
+  AS_HELP_STRING([--with-libsdl2-ttf],
+                 [Build with the SDL2_ttf library]),
+  [], [with_libsdl2_ttf=yes])
+
+if test "x$with_libsdl2_ttf" = "xyes"; then
+   PKG_CHECK_MODULES([SDL2_ttf], [SDL2_ttf])
+fi
+
+LIBSDL2_TTF="libSDL2_ttf"
+LIBSDL2_TTF_LIBDIR="no"
+LIBSDL2_TTF_PREFIX="no"
+
+AC_ARG_WITH([libsdl2-ttf-prefix],
+  [AS_HELP_STRING([--with-libsdl2-ttf-prefix=DIR],
+                  [search for SDL2_ttf in DIR])],
+  [case "$withval" in
+    yes|no)
+      ;;
+    *)
+      LIBSDL2_TTF="$withval/lib/libSDL2_ttf"
+      LIBSDL2_TTF_PREFIX="$withval"
+      LIBSDL2_TTF_LIBDIR="$withval/lib"
+      ;;
+   esac])
+
+AM_CONDITIONAL([WITH_LIBSDL2_TTF], [test "x$with_libsdl2_ttf" = "xyes"])
+
+if test "x$with_libsdl2_ttf" = "xyes"; then
+   AC_MSG_CHECKING([for libSDL2_ttf shared library name])
+   AC_MSG_RESULT([$LIBSDL2_TTF])
+fi
+
+AC_SUBST([LIBSDL2_TTF])
+AC_SUBST([LIBSDL2_TTF_PREFIX])
+AC_SUBST([LIBSDL2_TTF_LIBDIR])
+
 AC_OUTPUT
index 99d8be9..f43a2e7 100644 (file)
@@ -1,9 +1,13 @@
 (define-module (sdl2 config)
   #:export (%libsdl2
-            %libsdl2-image))
+            %libsdl2-image
+            %libsdl2-ttf))
 
 (define %libsdl2
   "@LIBSDL2@")
 
 (define %libsdl2-image
   "@LIBSDL2_IMAGE@")
+
+(define %libsdl2-ttf
+  "@LIBSDL2_TTF@")