From 07084f62c40d3197f3a11ac4e5fbe3b923e9ae1e Mon Sep 17 00:00:00 2001 From: Solomon Peachy Date: Thu, 24 Jan 2019 07:31:07 -0500 Subject: Fix host build of mkimxboot, mknwzboot, nwztools, and rbutil with crypto++ Necessary to get working builds on my Fedora 29 system. Change-Id: Ia6232427c959629ade9a85fc412738f688facedb --- utils/nwztools/upgtools/Makefile | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) (limited to 'utils/nwztools/upgtools/Makefile') diff --git a/utils/nwztools/upgtools/Makefile b/utils/nwztools/upgtools/Makefile index fcfc889ae6..046eb1a1a9 100644 --- a/utils/nwztools/upgtools/Makefile +++ b/utils/nwztools/upgtools/Makefile @@ -3,9 +3,23 @@ CC=gcc CXX=g++ LD=g++ PROFILE= -CFLAGS=-g $(PROFILE) -std=c99 -Wall $(DEFINES) `pkg-config --cflags libcrypto++` -CXXFLAGS=-g $(PROFILE) -Wall $(DEFINES) `pkg-config --cflags libcrypto++` -LDFLAGS=$(PROFILE) `pkg-config --libs libcrypto++` -lpthread +PKGCONFIG := $(CROSS)pkg-config + +# Distros could use different names for the crypto library. We try a list +# of candidate names, only one of them should be the valid one. +LIBCRYPTO_NAMES = libcryptopp libcrypto++ cryptopp crypto++ + +$(foreach l,$(LIBCRYPTO_NAMES),\ + $(eval LDOPTS += $(shell $(PKGCONFIG) --silence-errors --libs $(l)))) +$(foreach l,$(LIBCRYPTO_NAMES),\ + $(eval CFLAGS += $(shell $(PKGCONFIG) --silence-errors --cflags $(l)))) +$(foreach l,$(LIBCRYPTO_NAMES),\ + $(eval CXXFLAGS += $(shell $(PKGCONFIG) --silence-errors --cflags $(l)))) + +CXXFLAGS=-g $(PROFILE) -Wall $(DEFINES) +CFLAGS=-g $(PROFILE) -Wall -std=c99 $(DEFINES) +LDFLAGS=$(PROFILE) $(LDOPTS) -lpthread + BINS=upgtool all: $(BINS) -- cgit v1.2.3