From: Simon McVittie Date: Wed, 6 Jul 2011 08:50:54 +0000 (+0100) Subject: Add LINK_TO_MODPLUG option X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=46e8cfc8d41379932e39fb77cc8ad9a4afb622fd;p=xonotic%2Fdarkplaces.git Add LINK_TO_MODPLUG option In Debian we want library dependencies to work in the conventional way, since many tools expect that and use it to generate package dependencies. Origin: vendor, Debian --- diff --git a/makefile b/makefile index 9afb12e7..e24aa481 100644 --- a/makefile +++ b/makefile @@ -312,6 +312,11 @@ CFLAGS_LIBVORBIS=-DLINK_TO_LIBVORBIS `pkg-config --cflags vorbisfile` LIB_LIBVORBIS=`pkg-config --libs vorbisfile` endif +ifdef LINK_TO_MODPLUG +CFLAGS_SND_MODPLUG=-DLINK_TO_MODPLUG `pkg-config --cflags libmodplug` +LIB_SND_MODPLUG=`pkg-config --libs libmodplug` +endif + ifdef LINK_TO_ZLIB CFLAGS_ZLIB=-DLINK_TO_ZLIB LIB_ZLIB=-lz diff --git a/makefile.inc b/makefile.inc index 78448f72..35ae3c41 100644 --- a/makefile.inc +++ b/makefile.inc @@ -55,8 +55,8 @@ LIB_CRYPTO_RIJNDAEL=`[ -n "$(DP_CRYPTO_RIJNDAEL_STATIC_LIBDIR)" ] && echo \ $(DP CFLAGS_CRYPTO_RIJNDAEL=`[ -n "$(DP_CRYPTO_RIJNDAEL_STATIC_LIBDIR)" ] && echo \ -I$(DP_CRYPTO_RIJNDAEL_STATIC_LIBDIR)/../include\ -DCRYPTO_RIJNDAEL_STATIC` # Additional stuff for libmodplug -LIB_SND_MODPLUG=`[ -n "$(DP_MODPLUG_STATIC_LIBDIR)" ] && echo \ $(DP_MODPLUG_STATIC_LIBDIR)/libmodplug.a\ -lstdc++` -CFLAGS_SND_MODPLUG=`[ -n "$(DP_MODPLUG_STATIC_LIBDIR)" ] && echo \ -I$(DP_MODPLUG_STATIC_LIBDIR)/../include\ -DSND_MODPLUG_STATIC` +LIB_SND_MODPLUG?=`[ -n "$(DP_MODPLUG_STATIC_LIBDIR)" ] && echo \ $(DP_MODPLUG_STATIC_LIBDIR)/libmodplug.a\ -lstdc++` +CFLAGS_SND_MODPLUG?=`[ -n "$(DP_MODPLUG_STATIC_LIBDIR)" ] && echo \ -I$(DP_MODPLUG_STATIC_LIBDIR)/../include\ -DSND_MODPLUG_STATIC` # No sound OBJ_SND_NULL=snd_null.o diff --git a/snd_modplug.c b/snd_modplug.c index 6dc3fce2..ca389e3e 100644 --- a/snd_modplug.c +++ b/snd_modplug.c @@ -26,7 +26,7 @@ #include "snd_main.h" #include "snd_modplug.h" -#ifdef SND_MODPLUG_STATIC +#if defined(SND_MODPLUG_STATIC) || defined(LINK_TO_MODPLUG) #include qboolean ModPlug_OpenLibrary (void) @@ -247,7 +247,7 @@ static void ModPlug_GetSamplesFloat(channel_t *ch, sfx_t *sfx, int firstsamplefr return; } -#ifndef SND_MODPLUG_STATIC +#if !(defined(SND_MODPLUG_STATIC) || defined(LINK_TO_MODPLUG)) if(qModPlug_SetMasterVolume) #endif qModPlug_SetMasterVolume(per_ch->mf, 512); // max volume, DP scales down! @@ -407,7 +407,7 @@ qboolean ModPlug_LoadModPlugFile (const char *filename, sfx_t *sfx) return false; } -#ifndef SND_MODPLUG_STATIC +#if !(defined(SND_MODPLUG_STATIC) || defined(LINK_TO_MODPLUG)) if(qModPlug_SetMasterVolume) #endif qModPlug_SetMasterVolume(mf, 512); // max volume, DP scales down!