]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
modplug improvement: DP_MODPLUG_STATIC_PREFIX=/usr/local makes it use the modplug...
authordivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Thu, 13 Dec 2007 22:02:38 +0000 (22:02 +0000)
committerdivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Thu, 13 Dec 2007 22:02:38 +0000 (22:02 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@7796 d7cf8633-e32d-0410-b094-e92efae38249

makefile
makefile.inc

index 4423d411dc2a0cbc39c8615fb5b2dcfddd42d732..45b2d97f666b7f08004d331141799d3bde69430f 100644 (file)
--- a/makefile
+++ b/makefile
@@ -199,18 +199,12 @@ endif
 ifeq ($(DP_SOUND_API), OSS)
        OBJ_SOUND=$(OBJ_SND_OSS)
        LIB_SOUND=$(LIB_SND_OSS)
-       ifneq ($(shell [ -e /usr/lib64/libmodplug.a ] || [ -e /usr/lib/libmodplug.a ]), false)
-               LIB_SOUND+=-lmodplug -lstdc++
-       endif
 endif
 
 # ALSA: Advanced Linux Sound Architecture
 ifeq ($(DP_SOUND_API), ALSA)
        OBJ_SOUND=$(OBJ_SND_ALSA)
        LIB_SOUND=$(LIB_SND_ALSA)
-       ifneq ($(shell [ -e /usr/lib64/libmodplug.a ] || [ -e /usr/lib/libmodplug.a ]), false)
-               LIB_SOUND+=-lmodplug -lstdc++
-       endif
 endif
 
 # COREAUDIO: Core Audio
index 1ba224baf7543579ee55e8d4327259f1914db986..47cbc8e116f6b2a11baff55674d9bb995fca32d3 100644 (file)
@@ -30,29 +30,33 @@ STRIP?=strip
 
 OBJ_SND_COMMON=snd_main.o snd_mem.o snd_mix.o snd_ogg.o snd_wav.o snd_modplug.o
 
+# Additional stuff for libmodplug
+LIB_SND_MODPLUG=`if [ -n "$(DP_MODPLUG_STATIC_PREFIX)" ]; then echo " $(DP_MODPLUG_STATIC_PREFIX)/lib/libmodplug.a -lstdc++"; fi`
+CFLAGS_SND_MODPLUG=`if [ -n "$(DP_MODPLUG_STATIC_PREFIX)" ]; then echo " -I$(DP_MODPLUG_STATIC_PREFIX)/include -DSND_MODPLUG_STATIC"; fi`
+
 # No sound
 OBJ_SND_NULL=snd_null.o
 LIB_SND_NULL=
 
 # Open Sound System (Linux, FreeBSD and Solaris)
 OBJ_SND_OSS=$(OBJ_SND_COMMON) snd_oss.o
-LIB_SND_OSS=
+LIB_SND_OSS=$(LIB_SND_MODPLUG)
 
 # Advanced Linux Sound Architecture (Linux)
 OBJ_SND_ALSA=$(OBJ_SND_COMMON) snd_alsa.o
-LIB_SND_ALSA=-lasound
+LIB_SND_ALSA=-lasound $(LIB_SND_MODPLUG)
 
 # Core Audio (Mac OS X)
 OBJ_SND_COREAUDIO=$(OBJ_SND_COMMON) snd_coreaudio.c
-LIB_SND_COREAUDIO=-framework CoreAudio
+LIB_SND_COREAUDIO=-framework CoreAudio $(LIB_SND_MODPLUG)
 
 # BSD / Sun audio API (NetBSD and OpenBSD)
 OBJ_SND_BSD=$(OBJ_SND_COMMON) snd_bsd.o
-LIB_SND_BSD=
+LIB_SND_BSD=$(LIB_SND_MODPLUG)
 
 # DirectX and Win32 WAVE output (Win32)
 OBJ_SND_WIN=$(OBJ_SND_COMMON) snd_win.o
-LIB_SND_WIN=
+LIB_SND_WIN=$(LIB_SND_MODPLUG)
 
 
 # CD objects
@@ -178,7 +182,7 @@ LDFLAGS_UNIXSV_PRELOAD=-lz -lcurl
 LDFLAGS_UNIXSDL_PRELOAD=-lz -ljpeg -lpng -lvorbis -lvorbisfile -lcurl -lmodplug
 CFLAGS_UNIX_PRELOAD=-DPREFER_PRELOAD
 
-LDFLAGS_UNIXSDL=$(SDLCONFIG_LIBS)
+LDFLAGS_UNIXSDL=$(SDLCONFIG_LIBS) $(LIB_SND_MODPLUG)
 EXE_UNIXCL=darkplaces-glx
 EXE_UNIXSV=darkplaces-dedicated
 EXE_UNIXSDL=darkplaces-sdl
@@ -259,7 +263,7 @@ OBJ_WGL= builddate.c sys_win.o vid_wgl.o conproc.o $(OBJ_SND_WIN) $(OBJ_WINCD) $
 LDFLAGS_WINCOMMON=-lws2_32 -Wl,--large-address-aware
 LDFLAGS_WINCL=$(LDFLAGS_WINCOMMON) -mwindows -lwinmm -luser32 -lgdi32 -ldxguid -ldinput -lcomctl32
 LDFLAGS_WINSV=$(LDFLAGS_WINCOMMON) -mconsole -lwinmm
-LDFLAGS_WINSDL=$(LDFLAGS_WINCOMMON) $(SDLCONFIG_LIBS)
+LDFLAGS_WINSDL=$(LDFLAGS_WINCOMMON) $(SDLCONFIG_LIBS) $(LIB_SND_MODPLUG)
 EXE_WINCL=darkplaces.exe
 EXE_WINSV=darkplaces-dedicated.exe
 EXE_WINSDL=darkplaces-sdl.exe
@@ -397,7 +401,7 @@ bin-release :
        $(STRIP) $(EXE)
 
 snd_modplug.o: snd_modplug.c
-       if [ -e /usr/lib64/libmodplug.a ] || [ -e /usr/lib/libmodplug.a ] ; then $(DO_CC) -DSND_MODPLUG_STATIC ; else $(DO_CC) ; fi
+       $(DO_CC) $(CFLAGS_SND_MODPLUG)
 
 vid_glx.o: vid_glx.c
        $(DO_CC) -I/usr/X11R6/include