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 ...@@ -75,6 +75,8 @@ WITH_EXTFS = 1
WITH_EXT4FS = 0 WITH_EXT4FS = 0
WITH_NTFS = @WINSUPPORT@ WITH_NTFS = @WINSUPPORT@
WITH_FAT = @WINSUPPORT@ WITH_FAT = @WINSUPPORT@
# Note: requires WITH_CRYPTO
WITH_HASH = 0 WITH_HASH = 0
include $(OBJDIR)/Makeconf include $(OBJDIR)/Makeconf
...@@ -98,6 +100,7 @@ endif ...@@ -98,6 +100,7 @@ endif
# Necessary sometimes. # Necessary sometimes.
#PTHREADCFLAGS += -DCONDVARS_WORK #PTHREADCFLAGS += -DCONDVARS_WORK
PROGS = imagezip imageunzip imagedump
CFLAGS = $(SUBDIRCFLAGS) -I$(SRCDIR) $(LDSTATIC) CFLAGS = $(SUBDIRCFLAGS) -I$(SRCDIR) $(LDSTATIC)
LIBS = -lz LIBS = -lz
ZIPCFLAGS = $(CFLAGS) -Wall ZIPCFLAGS = $(CFLAGS) -Wall
...@@ -109,6 +112,7 @@ HASHLIBS = $(LIBS) -lcrypto $(PTHREADLIBS) ...@@ -109,6 +112,7 @@ HASHLIBS = $(LIBS) -lcrypto $(PTHREADLIBS)
# Secure images # Secure images
ifeq ($(WITH_CRYPTO),1) ifeq ($(WITH_CRYPTO),1)
PROGS += imagehash
CFLAGS += -DWITH_CRYPTO CFLAGS += -DWITH_CRYPTO
ifeq ($(WITH_SIGNING),1) ifeq ($(WITH_SIGNING),1)
CFLAGS += -DSIGN_CHECKSUM CFLAGS += -DSIGN_CHECKSUM
...@@ -175,7 +179,7 @@ ZIPLIBS += hashmap/libhashmap.a ...@@ -175,7 +179,7 @@ ZIPLIBS += hashmap/libhashmap.a
LIBS += -lcrypto $(PTHREADLIBS) LIBS += -lcrypto $(PTHREADLIBS)
endif endif
all: imagezip imageunzip imagedump imagehash all: $(PROGS)
whoami: whoami:
@echo "SYSTEM is $(SYSTEM)" @echo "SYSTEM is $(SYSTEM)"
...@@ -217,7 +221,7 @@ imagehash.o: imagehdr.h imagehash.h ...@@ -217,7 +221,7 @@ imagehash.o: imagehdr.h imagehash.h
version.c: imagezip.c imageunzip.c imagedump.c version.c: imagezip.c imageunzip.c imagedump.c
echo >$@ "char build_info[] = \"Built `date +%d-%b-%Y` by `id -nu`@`hostname | sed 's/\..*//'`:`pwd`\";" 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 boss-install: install
......
/* /*
* EMULAB-COPYRIGHT * 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. * All rights reserved.
*/ */
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
* Prints out information about an image. * 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 * 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 * an MD5 hash for every chunk of an image. I put this in just to get a
...@@ -21,8 +21,10 @@ ...@@ -21,8 +21,10 @@
#define WITH_HASHCMD #define WITH_HASHCMD
#endif #endif
#ifdef WITH_CRYPTO
#include <openssl/evp.h> #include <openssl/evp.h>
#include <openssl/sha.h> #include <openssl/sha.h>
#endif
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <fcntl.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