SDL_ttf: Add the required libraries to SDL_ttf.pc

From c08ccd9dfab44050d2d332993a4ab15826e74bf0 Mon Sep 17 00:00:00 2001
From: Cameron Cawley <[EMAIL REDACTED]>
Date: Tue, 11 Jan 2022 21:07:39 +0000
Subject: [PATCH] Add the required libraries to SDL_ttf.pc

---
 SDL_ttf.pc.in | 3 ++-
 configure.ac  | 7 ++++++-
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/SDL_ttf.pc.in b/SDL_ttf.pc.in
index c4ef4ed..3a9b6b5 100644
--- a/SDL_ttf.pc.in
+++ b/SDL_ttf.pc.in
@@ -9,4 +9,5 @@ Version: @VERSION@
 Requires: sdl >= @SDL_VERSION@
 Libs: -L${libdir} -lSDL_ttf
 Cflags: -I${includedir}/SDL
-
+Requires.private: @PC_REQUIRES@
+Libs.private: @PC_LIBS@
diff --git a/configure.ac b/configure.ac
index e3d132a..5338b77 100644
--- a/configure.ac
+++ b/configure.ac
@@ -93,10 +93,13 @@ esac
 AM_CONDITIONAL(USE_VERSION_RC, test x$use_version_rc = xtrue)
 
 dnl Check for the FreeType 2 library
-PKG_CHECK_MODULES([FT2], [freetype2 >= 7.0.1], [], [dnl
+PKG_CHECK_MODULES([FT2], [freetype2 >= 7.0.1], [
+    PC_REQUIRES="freetype2 $PC_REQUIRES"
+], [dnl
     AC_CHECK_FT2(,,[AC_MSG_ERROR([dnl
 *** Unable to find FreeType2 library (http://www.freetype.org/)])]
     )
+    PC_LIBS="$FT2_LIBS $PC_LIBS"
 ])
 CFLAGS="$CFLAGS $FT2_CFLAGS"
 LIBS="$LIBS $FT2_LIBS"
@@ -165,6 +168,8 @@ AC_SUBST([GL_LIBS])
 AC_SUBST([ICONV_LIBS])
 AC_SUBST([MATHLIB])
 AC_SUBST([WINDRES])
+AC_SUBST([PC_REQUIRES])
+AC_SUBST([PC_LIBS])
 
 # Finally create all the generated files
 AC_CONFIG_FILES([