0001-Add-Libs.private-field-to-pkg-config-file.patch 2.4 KB

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