]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
Add support for linking to system d0_blind_id and d0_rijndael
authorSimon McVittie <smcv@debian.org>
Wed, 6 Jul 2011 17:03:34 +0000 (18:03 +0100)
committernyov <nyov@nexnode.net>
Thu, 27 Nov 2014 09:51:04 +0000 (09:51 +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.

(These libraries aren't currently in Debian, but if they were, we'd want
to link them like this.)

Origin: vendor, Debian

crypto.c
makefile
makefile.inc

index cf7cc5f2f1a959b151f4cb3c63b09ec4826f90eb..30f8554593991bbe6b6fa1cfc1a4b0a5e3d1c6e7 100644 (file)
--- a/crypto.c
+++ b/crypto.c
@@ -102,7 +102,7 @@ static size_t Crypto_UnParsePack(char *buf, size_t len, unsigned long header, co
 
 #define USE_AES
 
-#ifdef CRYPTO_STATIC
+#if defined(CRYPTO_STATIC) || defined(LINK_TO_D0_BLIND_ID)
 
 #include <d0_blind_id/d0_blind_id.h>
 
@@ -285,7 +285,7 @@ static void Crypto_CloseLibrary (void)
 
 #endif
 
-#ifdef CRYPTO_RIJNDAEL_STATIC
+#if defined(CRYPTO_RIJNDAEL_STATIC) || defined(LINK_TO_D0_RIJNDAEL)
 
 #include <d0_blind_id/d0_rijndael.h>
 
index 967c4873ebb4ff009d6117e62ffe72aca303cf56..7a4d33b0d562d76f2251e080f4d6b5f941d37245 100644 (file)
--- a/makefile
+++ b/makefile
@@ -307,6 +307,16 @@ CFLAGS_CURL=-DLINK_TO_CURL `pkg-config --cflags libcurl`
 LIB_CURL=`pkg-config --libs libcurl`
 endif
 
+ifdef LINK_TO_D0_BLIND_ID
+CFLAGS_CRYPTO=-DLINK_TO_D0_BLIND_ID `pkg-config --cflags d0_blind_id`
+LIB_CRYPTO=`pkg-config --libs d0_blind_id`
+endif
+
+ifdef LINK_TO_D0_RIJNDAEL
+CFLAGS_CRYPTO_RIJNDAEL=-DLINK_TO_D0_RIJNDAEL `pkg-config --cflags d0_rijndael`
+LIB_CRYPTO_RIJNDAEL=`pkg-config --libs d0_rijndael`
+endif
+
 ifdef LINK_TO_FREETYPE2
 CFLAGS_FREETYPE2=-DLINK_TO_FREETYPE2 `pkg-config --cflags freetype2`
 LIB_FREETYPE2=`pkg-config --libs freetype2`
index 7b8023f7743774427b84480af2d8a1495542b2c9..cf611d7ae1f52c407c9288639ca33d908769a890 100644 (file)
@@ -48,11 +48,11 @@ STRIP?=strip
 OBJ_SND_COMMON=snd_main.o snd_mem.o snd_mix.o snd_ogg.o snd_wav.o snd_modplug.o
 
 # statically loading d0_blind_id
-LIB_CRYPTO=`[ -n "$(DP_CRYPTO_STATIC_LIBDIR)" ] && echo \ $(DP_CRYPTO_STATIC_LIBDIR)/libd0_blind_id.a`
-LIB_GMP=`[ -n "$(DP_CRYPTO_STATIC_LIBDIR)" ] && { [ -n "$(DP_GMP_STATIC_LIBDIR)" ] && echo \ $(DP_GMP_STATIC_LIBDIR)/libgmp.a || echo \ -lgmp; }`
-CFLAGS_CRYPTO=`[ -n "$(DP_CRYPTO_STATIC_LIBDIR)" ] && echo \ -I$(DP_CRYPTO_STATIC_LIBDIR)/../include\ -DCRYPTO_STATIC`
-LIB_CRYPTO_RIJNDAEL=`[ -n "$(DP_CRYPTO_RIJNDAEL_STATIC_LIBDIR)" ] && echo \ $(DP_CRYPTO_RIJNDAEL_STATIC_LIBDIR)/libd0_rijndael.a`
-CFLAGS_CRYPTO_RIJNDAEL=`[ -n "$(DP_CRYPTO_RIJNDAEL_STATIC_LIBDIR)" ] && echo \ -I$(DP_CRYPTO_RIJNDAEL_STATIC_LIBDIR)/../include\ -DCRYPTO_RIJNDAEL_STATIC`
+LIB_CRYPTO?=`[ -n "$(DP_CRYPTO_STATIC_LIBDIR)" ] && echo \ $(DP_CRYPTO_STATIC_LIBDIR)/libd0_blind_id.a`
+LIB_GMP?=`[ -n "$(DP_CRYPTO_STATIC_LIBDIR)" ] && { [ -n "$(DP_GMP_STATIC_LIBDIR)" ] && echo \ $(DP_GMP_STATIC_LIBDIR)/libgmp.a || echo \ -lgmp; }`
+CFLAGS_CRYPTO?=`[ -n "$(DP_CRYPTO_STATIC_LIBDIR)" ] && echo \ -I$(DP_CRYPTO_STATIC_LIBDIR)/../include\ -DCRYPTO_STATIC`
+LIB_CRYPTO_RIJNDAEL?=`[ -n "$(DP_CRYPTO_RIJNDAEL_STATIC_LIBDIR)" ] && echo \ $(DP_CRYPTO_RIJNDAEL_STATIC_LIBDIR)/libd0_rijndael.a`
+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++`