DP_LINK_XMP?=dlopen
endif
-# set these to "" if you want to use dynamic loading instead
-# zlib
+
+##### Library linking #####
+# SDL2
ifeq ($(DP_LINK_SDL), shared)
SDL_LIBS=$(SDLCONFIG_LIBS)
-endif
-ifeq ($(DP_LINK_SDL), static)
+else ifeq ($(DP_LINK_SDL), static)
SDL_LIBS=$(SDLCONFIG_STATICLIBS)
+else ifeq ($(DP_LINK_SDL), dlopen)
+ $(error libSDL2 can only be used with shared or static linking)
endif
+# zlib
ifeq ($(DP_LINK_ZLIB), shared)
CFLAGS_LIBZ=-DLINK_TO_ZLIB
LIB_Z=-lz
-endif
-ifeq ($(DP_LINK_ZLIB), dlopen)
+else ifeq ($(DP_LINK_ZLIB), static)
+ CFLAGS_LIBZ=-DLINK_TO_ZLIB
+ LIB_Z=-l:libz.a
+else ifeq ($(DP_LINK_ZLIB), dlopen)
CFLAGS_LIBZ=
LIB_Z=
endif
ifeq ($(DP_LINK_JPEG), shared)
CFLAGS_LIBJPEG=-DLINK_TO_LIBJPEG
LIB_JPEG=-ljpeg
-endif
-ifeq ($(DP_LINK_JPEG), dlopen)
+else ifeq ($(DP_LINK_JPEG), static)
+ CFLAGS_LIBJPEG=-DLINK_TO_LIBJPEG
+ LIB_JPEG=-l:libjpeg.a
+else ifeq ($(DP_LINK_JPEG), dlopen)
CFLAGS_LIBJPEG=
LIB_JPEG=
endif
ODE_CONFIG?=ode-config
LIB_ODE=`$(ODE_CONFIG) --libs`
CFLAGS_ODE=`$(ODE_CONFIG) --cflags` -DUSEODE -DLINK_TO_LIBODE
-endif
-ifeq ($(DP_LINK_ODE), dlopen)
+else ifeq ($(DP_LINK_ODE), static)
+ # This is the configuration from Xonotic
+ ODE_CONFIG?=ode-config
+ LIB_ODE=-l:libode.a -lstdc++ -pthread
+ CFLAGS_ODE=-DUSEODE -DLINK_TO_LIBODE -DdDOUBLE
+else ifeq ($(DP_LINK_ODE), dlopen)
LIB_ODE=
CFLAGS_ODE=-DUSEODE
endif
# d0_blind_id
-ifeq ($(DP_LINK_CRYPTO), static)
- LIB_CRYPTO=-ld0_blind_id -lgmp
- CFLAGS_CRYPTO=-DLINK_TO_CRYPTO
-else ifeq ($(DP_LINK_CRYPTO), shared)
+ifeq ($(DP_LINK_CRYPTO), shared)
LIB_CRYPTO=-ld0_blind_id
CFLAGS_CRYPTO=-DLINK_TO_CRYPTO
+else ifeq ($(DP_LINK_CRYPTO), static)
+ LIB_CRYPTO=-l:libd0_blind_id.a -lgmp
+ CFLAGS_CRYPTO=-DLINK_TO_CRYPTO
+else ifeq ($(DP_LINK_CRYPTO), static_inc_gmp)
+ LIB_CRYPTO=-l:libd0_blind_id.a -l:libgmp.a
+ CFLAGS_CRYPTO=-DLINK_TO_CRYPTO
else ifeq ($(DP_LINK_CRYPTO), dlopen)
LIB_CRYPTO=
CFLAGS_CRYPTO=
endif
-ifeq ($(DP_LINK_CRYPTO_RIJNDAEL), static)
- DP_LINK_CRYPTO_RIJNDAEL=shared
-endif
+
+# d0_rijndael
ifeq ($(DP_LINK_CRYPTO_RIJNDAEL), shared)
LIB_CRYPTO_RIJNDAEL=-ld0_rijndael
CFLAGS_CRYPTO_RIJNDAEL=-DLINK_TO_CRYPTO_RIJNDAEL
+else ifeq ($(DP_LINK_CRYPTO_RIJNDAEL), static)
+ LIB_CRYPTO_RIJNDAEL=-l:libd0_rijndael.a
+ CFLAGS_CRYPTO_RIJNDAEL=-DLINK_TO_CRYPTO_RIJNDAEL
else ifeq ($(DP_LINK_CRYPTO_RIJNDAEL), dlopen)
LIB_CRYPTO_RIJNDAEL=
CFLAGS_CRYPTO_RIJNDAEL=
OBJ_SND_XMP=snd_xmp.o
LIB_SND_XMP=-lxmp
CFLAGS_SND_XMP=-DUSEXMP -DLINK_TO_LIBXMP
-endif
-ifeq ($(DP_LINK_XMP), dlopen)
+else ifeq ($(DP_LINK_XMP), static)
+ OBJ_SND_XMP=snd_xmp.o
+ LIB_SND_XMP=-l:libxmp.a
+ CFLAGS_SND_XMP=-DUSEXMP -DLINK_TO_LIBXMP
+else ifeq ($(DP_LINK_XMP), dlopen)
OBJ_SND_XMP=snd_xmp.o
LIB_SND_XMP=
CFLAGS_SND_XMP=-DUSEXMP