From d1aca7263998bf8ad45a089501b5008e6cecc7b2 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Sat, 19 Sep 2009 14:31:34 +0000 Subject: [PATCH] Hi, I'm attaching a patche to add pkg-config support to SDL_mixer. pkg-config is used to retrieve information about installed libraries and it's well integrated with build configurators (for instance PKG_CHECK_MODULES autoconf macro). Thank you, Luca --- Makefile.in | 7 ++++++- SDL_mixer.pc.in | 12 ++++++++++++ configure.in | 3 ++- 3 files changed, 20 insertions(+), 2 deletions(-) create mode 100644 SDL_mixer.pc.in diff --git a/Makefile.in b/Makefile.in index 7bcb5e3e..3023fed6 100644 --- a/Makefile.in +++ b/Makefile.in @@ -36,7 +36,7 @@ TARGET = libSDL_mixer.la SOURCES = @SOURCES@ OBJECTS = @OBJECTS@ -DIST = CHANGES COPYING CWProjects.sea.bin MPWmake.sea.bin Makefile.in README SDL_mixer.h SDL_mixer.qpg.in SDL_mixer.spec SDL_mixer.spec.in VisualC.zip Watcom-OS2.zip Xcode.tar.gz acinclude autogen.sh build-scripts configure configure.in dynamic_mp3.c dynamic_mp3.h dynamic_ogg.c dynamic_ogg.h effect_position.c effect_stereoreverse.c effects_internal.c effects_internal.h gcc-fat.sh load_aiff.c load_aiff.h load_ogg.c load_ogg.h load_voc.c load_voc.h mikmod mixer.c music.c music_cmd.c music_cmd.h music_mad.c music_mad.h music_ogg.c music_ogg.h native_midi native_midi_gpl playmus.c playwave.c timidity wavestream.c wavestream.h version.rc +DIST = CHANGES COPYING CWProjects.sea.bin MPWmake.sea.bin Makefile.in SDL_mixer.pc.in README SDL_mixer.h SDL_mixer.qpg.in SDL_mixer.spec SDL_mixer.spec.in VisualC.zip Watcom-OS2.zip Xcode.tar.gz acinclude autogen.sh build-scripts configure configure.in dynamic_mp3.c dynamic_mp3.h dynamic_ogg.c dynamic_ogg.h effect_position.c effect_stereoreverse.c effects_internal.c effects_internal.h gcc-fat.sh load_aiff.c load_aiff.h load_ogg.c load_ogg.h load_voc.c load_voc.h mikmod mixer.c music.c music_cmd.c music_cmd.h music_mad.c music_mad.h music_ogg.c music_ogg.h native_midi native_midi_gpl playmus.c playwave.c timidity wavestream.c wavestream.h version.rc LT_AGE = @LT_AGE@ LT_CURRENT = @LT_CURRENT@ @@ -86,6 +86,8 @@ install-hdrs: file=`echo $$src | sed -e 's|^.*/||'`; \ $(INSTALL) -m 644 $$src $(includedir)/SDL/$$file; \ done + $(SHELL) $(auxdir)/mkinstalldirs $(libdir)/pkgconfig + $(INSTALL) -m 644 SDL_mixer.pc $(libdir)/pkgconfig/ install-lib: $(objects) $(objects)/$(TARGET) $(SHELL) $(auxdir)/mkinstalldirs $(libdir) $(LIBTOOL) --mode=install $(INSTALL) $(objects)/$(TARGET) $(libdir)/$(TARGET) @@ -101,6 +103,8 @@ uninstall-hdrs: rm -f $(includedir)/SDL/$$file; \ done -rmdir $(includedir)/SDL + rm -f $(libdir)/pkgconfig/SDL_mixer.pc + -rmdir $(libdir)/pkgconfig uninstall-lib: $(LIBTOOL) --mode=uninstall rm -f $(libdir)/$(TARGET) uninstall-bin: @@ -114,6 +118,7 @@ distclean: clean rm -f Makefile rm -f SDL_mixer.qpg rm -f config.status config.cache config.log libtool $(depend) + rm -f SDL_mixer.pc rm -rf $(srcdir)/autom4te* find $(srcdir) \( \ -name '*~' -o \ diff --git a/SDL_mixer.pc.in b/SDL_mixer.pc.in new file mode 100644 index 00000000..1c4965d8 --- /dev/null +++ b/SDL_mixer.pc.in @@ -0,0 +1,12 @@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@ + +Name: SDL_mixer +Description: mixer library for Simple DirectMedia Layer +Version: @VERSION@ +Requires: sdl >= @SDL_VERSION@ +Libs: -L${libdir} -lSDL_mixer +Cflags: -I${includedir}/SDL + diff --git a/configure.in b/configure.in index ed7d522e..39db5e30 100644 --- a/configure.in +++ b/configure.in @@ -420,11 +420,12 @@ AC_SUBST(BUILD_LDFLAGS) AC_SUBST(EXTRA_LDFLAGS) AC_SUBST(EXE) AC_SUBST(WINDRES) +AC_SUBST(SDL_VERSION) AC_SUBST(SDL_CFLAGS) AC_SUBST(SDL_LIBS) AC_OUTPUT([ - Makefile SDL_mixer.spec SDL_mixer.qpg + Makefile SDL_mixer.spec SDL_mixer.qpg SDL_mixer.pc ], [ : >build-deps if test x"$MAKE" = x; then MAKE=make; fi; $MAKE depend