summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--configure.ac38
-rw-r--r--sdl2/config.scm.in6
2 files changed, 43 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac
index 2aa1696..a91406b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -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
diff --git a/sdl2/config.scm.in b/sdl2/config.scm.in
index 99d8be9..f43a2e7 100644
--- a/sdl2/config.scm.in
+++ b/sdl2/config.scm.in
@@ -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@")