]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
Add LINK_TO_MODPLUG option
authorSimon McVittie <smcv@debian.org>
Wed, 6 Jul 2011 08:50:54 +0000 (09:50 +0100)
committernyov <nyov@nexnode.net>
Thu, 27 Nov 2014 09:41:33 +0000 (09:41 +0000)
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

makefile
makefile.inc
snd_modplug.c

index 9afb12e7fdd5d6b75d95906c83bfe4c75005fb0b..e24aa4817d6df47db5ab858704735b4dee1ef8e3 100644 (file)
--- 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
index 78448f72750c4ea6c9c486dd6c0a7ad52ad70e2f..35ae3c411d7895a5c1cecc4fb05c175c1d5a26aa 100644 (file)
@@ -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
index 6dc3fce277d922737191a481ba5ba167a7836be9..ca389e3e19732ed412d339ca474833359d058d0f 100644 (file)
@@ -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 <libmodplug/modplug.h>
 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!