diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/crypto/md5.h | 16 | ||||
-rw-r--r-- | lib/crypto/wscript_build | 4 | ||||
-rw-r--r-- | lib/crypto/wscript_configure | 8 |
3 files changed, 19 insertions, 9 deletions
diff --git a/lib/crypto/md5.h b/lib/crypto/md5.h index 388cdf83f0..edae27f65b 100644 --- a/lib/crypto/md5.h +++ b/lib/crypto/md5.h @@ -6,12 +6,16 @@ #define HEADER_MD5_H #endif -#ifdef HAVE_BSD_MD5_H -/* Try to avoid clashes with BSD MD5 implementation */ +#if defined(HAVE_BSD_MD5_H) +/* Try to avoid clashes with BSD MD5 implementation (on linux) */ #include <bsd/md5.h> -#else + +#elif defined(HAVE_SYS_MD5_H) +/* Try to avoid clashes with BSD MD5 implementation (on BSD) */ +#include <sys/md5.h> + /* Try to use CommonCrypto on Mac as otherwise we can get MD5Final twice */ -#ifdef HAVE_COMMONCRYPTO_COMMONDIGEST_H +#elif defined(HAVE_COMMONCRYPTO_COMMONDIGEST_H) #include <CommonCrypto/CommonDigest.h> #define MD5Init(c) CC_MD5_Init(c) @@ -32,8 +36,6 @@ void MD5Init(MD5_CTX *context); void MD5Update(MD5_CTX *context, const uint8_t *buf, size_t len); void MD5Final(uint8_t digest[MD5_DIGEST_LENGTH], MD5_CTX *context); -#endif /* HAVE_COMMONCRYPTO_COMMONDIGEST_H */ - -#endif /* HAVE_BSD_MD5_H */ +#endif /* HAVE_*MD5_H */ #endif /* !MD5_H */ diff --git a/lib/crypto/wscript_build b/lib/crypto/wscript_build index cd7a466a15..e056f653fb 100644 --- a/lib/crypto/wscript_build +++ b/lib/crypto/wscript_build @@ -4,6 +4,10 @@ extra_source = '' extra_deps = '' if bld.CONFIG_SET('HAVE_BSD_MD5_H'): extra_deps += ' bsd' +elif bld.CONFIG_SET('HAVE_SYS_MD5_H') and bld.CONFIG_SET('HAVE_LIBMD5'): + extra_deps += ' md5' +elif bld.CONFIG_SET('HAVE_SYS_MD5_H') and bld.CONFIG_SET('HAVE_LIBMD'): + extra_deps += ' md' elif not bld.CONFIG_SET('HAVE_COMMONCRYPTO_COMMONDIGEST_H'): extra_source += ' md5.c' diff --git a/lib/crypto/wscript_configure b/lib/crypto/wscript_configure index 5fc00fb22c..21ec566b6b 100644 --- a/lib/crypto/wscript_configure +++ b/lib/crypto/wscript_configure @@ -1,4 +1,8 @@ -conf.CHECK_FUNCS_IN('MD5Init', 'bsd', headers='bsd/md5.h', - checklibc=True) +if not conf.CHECK_FUNCS_IN('MD5Init', 'bsd', headers='bsd/md5.h', + checklibc=True): + conf.CHECK_FUNCS_IN('MD5Init', 'md5', headers='sys/md5.h', + checklibc=True) + conf.CHECK_FUNCS_IN('MD5Init', 'md', headers='sys/md5.h', + checklibc=True) conf.CHECK_FUNCS_IN('CC_MD5_Init', '', headers='CommonCrypto/CommonDigest.h', checklibc=True) |