svn commit: r207070 - in head/sbin: hastctl hastd
Pawel Jakub Dawidek
pjd at FreeBSD.org
Thu Apr 22 19:18:10 UTC 2010
Author: pjd
Date: Thu Apr 22 19:18:10 2010
New Revision: 207070
URL: http://svn.freebsd.org/changeset/base/207070
Log:
Fix compilation with WITHOUT_CRYPT or WITHOUT_OPENSSL options.
Reported by: Andrei V. Lavreniyuk <andy.lavr at reactor-xg.kiev.ua>
MFC after: 3 days
Modified:
head/sbin/hastctl/Makefile
head/sbin/hastd/Makefile
head/sbin/hastd/hast_proto.c
Modified: head/sbin/hastctl/Makefile
==============================================================================
--- head/sbin/hastctl/Makefile Thu Apr 22 18:47:30 2010 (r207069)
+++ head/sbin/hastctl/Makefile Thu Apr 22 19:18:10 2010 (r207070)
@@ -25,8 +25,13 @@ CFLAGS+=-DINET6
# This is needed to have WARNS > 1.
CFLAGS+=-DYY_NO_UNPUT
-DPADD= ${LIBCRYPTO} ${LIBL}
-LDADD= -lcrypto -ll
+DPADD= ${LIBL}
+LDADD= -ll
+.if ${MK_OPENSSL} != "no"
+DPADD+= ${LIBCRYPTO}
+LDADD+= -lcrypto
+CFLAGS+=-DHAVE_CRYPTO
+.endif
YFLAGS+=-v
Modified: head/sbin/hastd/Makefile
==============================================================================
--- head/sbin/hastd/Makefile Thu Apr 22 18:47:30 2010 (r207069)
+++ head/sbin/hastd/Makefile Thu Apr 22 19:18:10 2010 (r207070)
@@ -26,9 +26,13 @@ CFLAGS+=-DINET6
# This is needed to have WARNS > 1.
CFLAGS+=-DYY_NO_UNPUT
-DPADD= ${LIBCRYPTO} ${LIBGEOM} ${LIBBSDXML} ${LIBSBUF} ${LIBL} \
- ${LIBPTHREAD} ${LIBUTIL}
-LDADD= -lcrypto -lgeom -lbsdxml -lsbuf -ll -lpthread -lutil
+DPADD= ${LIBGEOM} ${LIBBSDXML} ${LIBSBUF} ${LIBL} ${LIBPTHREAD} ${LIBUTIL}
+LDADD= -lgeom -lbsdxml -lsbuf -ll -lpthread -lutil
+.if ${MK_OPENSSL} != "no"
+DPADD+= ${LIBCRYPTO}
+LDADD+= -lcrypto
+CFLAGS+=-DHAVE_CRYPTO
+.endif
YFLAGS+=-v
Modified: head/sbin/hastd/hast_proto.c
==============================================================================
--- head/sbin/hastd/hast_proto.c Thu Apr 22 18:47:30 2010 (r207069)
+++ head/sbin/hastd/hast_proto.c Thu Apr 22 19:18:10 2010 (r207070)
@@ -37,7 +37,9 @@ __FBSDID("$FreeBSD$");
#include <string.h>
#include <strings.h>
+#ifdef HAVE_CRYPTO
#include <openssl/sha.h>
+#endif
#include <hast.h>
#include <ebuf.h>
@@ -67,14 +69,18 @@ static int compression_send(struct hast_
void **datap, size_t *sizep, bool *freedatap);
static int compression_recv(struct hast_resource *res, struct nv *nv,
void **datap, size_t *sizep, bool *freedatap);
+#ifdef HAVE_CRYPTO
static int checksum_send(struct hast_resource *res, struct nv *nv,
void **datap, size_t *sizep, bool *freedatap);
static int checksum_recv(struct hast_resource *res, struct nv *nv,
void **datap, size_t *sizep, bool *freedatap);
+#endif
static struct hast_pipe_stage pipeline[] = {
{ "compression", compression_send, compression_recv },
+#ifdef HAVE_CRYPTO
{ "checksum", checksum_send, checksum_recv }
+#endif
};
static int
@@ -161,6 +167,7 @@ compression_recv(struct hast_resource *r
return (0);
}
+#ifdef HAVE_CRYPTO
static int
checksum_send(struct hast_resource *res, struct nv *nv, void **datap,
size_t *sizep, bool *freedatap __unused)
@@ -221,6 +228,7 @@ checksum_recv(struct hast_resource *res,
return (0);
}
+#endif /* HAVE_CRYPTO */
/*
* Send the given nv structure via conn.
More information about the svn-src-head
mailing list