Commit a090e8de authored by Mike Hibler's avatar Mike Hibler

Fix build when WITH_CRYPTO==0 and openssl is not installed.

Previously, openssl had to be installed even with WITH_CRYPTO==0.
parent f46bf180
......@@ -75,6 +75,8 @@ WITH_EXTFS = 1
WITH_EXT4FS = 0
WITH_NTFS = @WINSUPPORT@
WITH_FAT = @WINSUPPORT@
# Note: requires WITH_CRYPTO
WITH_HASH = 0
include $(OBJDIR)/Makeconf
......@@ -98,6 +100,7 @@ endif
# Necessary sometimes.
#PTHREADCFLAGS += -DCONDVARS_WORK
PROGS = imagezip imageunzip imagedump
CFLAGS = $(SUBDIRCFLAGS) -I$(SRCDIR) $(LDSTATIC)
LIBS = -lz
ZIPCFLAGS = $(CFLAGS) -Wall
......@@ -109,6 +112,7 @@ HASHLIBS = $(LIBS) -lcrypto $(PTHREADLIBS)
# Secure images
ifeq ($(WITH_CRYPTO),1)
PROGS += imagehash
CFLAGS += -DWITH_CRYPTO
ifeq ($(WITH_SIGNING),1)
CFLAGS += -DSIGN_CHECKSUM
......@@ -175,7 +179,7 @@ ZIPLIBS += hashmap/libhashmap.a
LIBS += -lcrypto $(PTHREADLIBS)
endif
all: imagezip imageunzip imagedump imagehash
all: $(PROGS)
whoami:
@echo "SYSTEM is $(SYSTEM)"
......@@ -217,7 +221,7 @@ imagehash.o: imagehdr.h imagehash.h
version.c: imagezip.c imageunzip.c imagedump.c
echo >$@ "char build_info[] = \"Built `date +%d-%b-%Y` by `id -nu`@`hostname | sed 's/\..*//'`:`pwd`\";"
install: $(INSTALL_BINDIR)/imagezip $(INSTALL_BINDIR)/imageunzip $(INSTALL_BINDIR)/imagedump $(INSTALL_BINDIR)/imagehash
install: $(addprefix $(INSTALL_BINDIR)/, $(PROGS))
boss-install: install
......
/*
* EMULAB-COPYRIGHT
* Copyright (c) 2000-2011 University of Utah and the Flux Group.
* Copyright (c) 2000-2012 University of Utah and the Flux Group.
* All rights reserved.
*/
......@@ -10,7 +10,7 @@
* Prints out information about an image.
*/
#ifdef WITH_HASH
#if defined(WITH_HASH) && defined(WITH_CRYPTO)
/*
* This enables a very specific command line option (-H) for printing out
* an MD5 hash for every chunk of an image. I put this in just to get a
......@@ -21,8 +21,10 @@
#define WITH_HASHCMD
#endif
#ifdef WITH_CRYPTO
#include <openssl/evp.h>
#include <openssl/sha.h>
#endif
#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment