Use libmd if and only if OpenSSL is not available.

PR:		bin/171402
MFC after:	3 days
This commit is contained in:
Dag-Erling Smørgrav 2012-09-14 13:00:43 +00:00
parent 42415fcb52
commit 0e50a83330
3 changed files with 14 additions and 5 deletions

View File

@ -16,8 +16,8 @@ CFLAGS+= -DINET6
.if ${MK_OPENSSL} != "no"
CFLAGS+= -DWITH_SSL
DPADD= ${LIBSSL} ${LIBCRYPTO} ${LIBMD}
LDADD= -lssl -lcrypto -lmd
DPADD= ${LIBSSL} ${LIBCRYPTO}
LDADD= -lssl -lcrypto
.else
DPADD= ${LIBMD}
LDADD= -lmd

View File

@ -76,7 +76,15 @@ __FBSDID("$FreeBSD$");
#include <string.h>
#include <time.h>
#include <unistd.h>
#ifdef WITH_SSL
#include <openssl/md5.h>
#define MD5Init(c) MD5_Init(c)
#define MD5Update(c, data, len) MD5_Update(c, data, len)
#define MD5Final(md, c) MD5_Final(md, c)
#else
#include <md5.h>
#endif
#include <netinet/in.h>
#include <netinet/tcp.h>

View File

@ -4,11 +4,12 @@
PROG= fetch
CSTD?= c99
.if ${MK_OPENSSL} != "no"
DPADD= ${LIBFETCH} ${LIBSSL} ${LIBCRYPTO}
LDADD= -lfetch -lssl -lcrypto
.else
DPADD= ${LIBFETCH} ${LIBMD}
LDADD= -lfetch -lmd
.if ${MK_OPENSSL} != "no"
DPADD+= ${LIBSSL} ${LIBCRYPTO}
LDADD+= -lssl -lcrypto
.endif
.include <bsd.prog.mk>