1From abf3a1b9c9cdacb574c2b9cdbf3f2a5e18c39ab9 Mon Sep 17 00:00:00 2001
2From: Rodrigo Rebello <rprebello@gmail.com>
3Date: Mon, 29 Feb 2016 22:53:49 -0300
4Subject: [PATCH 1/1] Add 'Libs.private' field to pkg-config file
5
6In order to support static linking, SDL_mixer.pc should include a
7'Libs.private' field listing all the libraries that SDL_mixer requires.
8
9This patch adds such a field and also modifies configure.ac so that
10EXTRA_LDFLAGS (which is now also used as the value of 'Libs.private')
11no longer includes SDL_LIBS. This is done so as to prevent libraries
12required by SDL from being listed twice when 'pkg-config --libs --static
13SDL_mixer' is run (they're already shown because of the 'Requires: sdl'
14line in SDL_mixer.pc). Makefile.in is also adjusted accordingly.
15
16Upstream status: submitted
17https://bugzilla.libsdl.org/show_bug.cgi?id=3278
18
19Signed-off-by: Rodrigo Rebello <rprebello@gmail.com>
20---
21 Makefile.in     | 2 +-
22 SDL_mixer.pc.in | 1 +
23 configure.ac    | 1 -
24 3 files changed, 2 insertions(+), 2 deletions(-)
25
26diff --git a/Makefile.in b/Makefile.in
27index 027a99b..18015a2 100644
28--- a/Makefile.in
29+++ b/Makefile.in
30@@ -61,7 +61,7 @@ $(objects):
31 .PHONY: all install install-hdrs install-lib install-bin uninstall uninstall-hdrs uninstall-lib uninstall-bin clean distclean dist
32
33 $(objects)/$(TARGET): $(OBJECTS) $(VERSION_OBJECTS)
34-	$(LIBTOOL) --mode=link $(CC) -o $@ $(OBJECTS) $(VERSION_OBJECTS) $(LDFLAGS) $(EXTRA_LDFLAGS) $(LT_LDFLAGS)
35+	$(LIBTOOL) --mode=link $(CC) -o $@ $(OBJECTS) $(VERSION_OBJECTS) $(LDFLAGS) $(SDL_LIBS) $(EXTRA_LDFLAGS) $(LT_LDFLAGS)
36
37 $(objects)/playwave$(EXE): $(objects)/playwave.lo $(objects)/$(TARGET)
38 	$(LIBTOOL) --mode=link $(CC) -o $@ $(objects)/playwave.lo $(SDL_CFLAGS) $(SDL_LIBS) $(LDFLAGS) $(objects)/$(TARGET)
39diff --git a/SDL_mixer.pc.in b/SDL_mixer.pc.in
40index 1c4965d..d793521 100644
41--- a/SDL_mixer.pc.in
42+++ b/SDL_mixer.pc.in
43@@ -8,5 +8,6 @@ Description: mixer library for Simple DirectMedia Layer
44 Version: @VERSION@
45 Requires: sdl >= @SDL_VERSION@
46 Libs: -L${libdir} -lSDL_mixer
47+Libs.private: @EXTRA_LDFLAGS@
48 Cflags: -I${includedir}/SDL
49
50diff --git a/configure.ac b/configure.ac
51index 01a3d83..3ad3b4f 100644
52--- a/configure.ac
53+++ b/configure.ac
54@@ -200,7 +200,6 @@ AM_PATH_SDL($SDL_VERSION,
55             AC_MSG_ERROR([*** SDL version $SDL_VERSION not found!])
56 )
57 EXTRA_CFLAGS="$EXTRA_CFLAGS $SDL_CFLAGS"
58-EXTRA_LDFLAGS="$EXTRA_LDFLAGS $SDL_LIBS"
59
60 dnl Check for math library
61 AC_CHECK_LIB(m, pow, [LIBM="-lm"])
62--
632.27.0
64