From 0ecd3895a89945fcc44975126b6e58c21c9b47df Mon Sep 17 00:00:00 2001 From: pjd Date: Thu, 22 Apr 2010 19:18:10 +0000 Subject: Fix compilation with WITHOUT_CRYPT or WITHOUT_OPENSSL options. Reported by: Andrei V. Lavreniyuk MFC after: 3 days --- sbin/hastctl/Makefile | 9 +++++++-- sbin/hastd/Makefile | 10 +++++++--- sbin/hastd/hast_proto.c | 8 ++++++++ 3 files changed, 22 insertions(+), 5 deletions(-) (limited to 'sbin') diff --git a/sbin/hastctl/Makefile b/sbin/hastctl/Makefile index e0d6b5b..301493c 100644 --- a/sbin/hastctl/Makefile +++ b/sbin/hastctl/Makefile @@ -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 diff --git a/sbin/hastd/Makefile b/sbin/hastd/Makefile index 8153c3a..bfb62f4 100644 --- a/sbin/hastd/Makefile +++ b/sbin/hastd/Makefile @@ -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 diff --git a/sbin/hastd/hast_proto.c b/sbin/hastd/hast_proto.c index 6e66006..348dfc8 100644 --- a/sbin/hastd/hast_proto.c +++ b/sbin/hastd/hast_proto.c @@ -37,7 +37,9 @@ __FBSDID("$FreeBSD$"); #include #include +#ifdef HAVE_CRYPTO #include +#endif #include #include @@ -67,14 +69,18 @@ static int compression_send(struct hast_resource *res, struct nv *nv, 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 *res, struct nv *nv, void **datap, 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, struct nv *nv, void **datap, return (0); } +#endif /* HAVE_CRYPTO */ /* * Send the given nv structure via conn. -- cgit v1.1