blob: cdabd1b70ef00f33b734d257726ebce11a113a8a [file] [log] [blame]
Brad Bishopbec4ebc2022-08-03 09:55:16 -04001fiptool: respect OPENSSL_DIR
2
3fiptool links to libcrypto, so as with the other tools it should respect
4OPENSSL_DIR for include/library paths.
5
6Upstream-Status: Submitted
7Signed-off-by: Ross Burton <ross.burton@arm.com>
8
9diff --git a/Makefile b/Makefile
10index ec6f88585..2d3b9fc26 100644
11--- a/Makefile
12+++ b/Makefile
13@@ -1388,7 +1388,7 @@ fwu_fip: ${BUILD_PLAT}/${FWU_FIP_NAME}
14
15 ${FIPTOOL}: FORCE
16 ifdef UNIX_MK
17- ${Q}${MAKE} CPPFLAGS="-DVERSION='\"${VERSION_STRING}\"'" FIPTOOL=${FIPTOOL} --no-print-directory -C ${FIPTOOLPATH}
18+ ${Q}${MAKE} CPPFLAGS="-DVERSION='\"${VERSION_STRING}\"'" FIPTOOL=${FIPTOOL} OPENSSL_DIR=${OPENSSL_DIR} --no-print-directory -C ${FIPTOOLPATH}
19 else
20 # Clear the MAKEFLAGS as we do not want
21 # to pass the gnumake flags to nmake.
22diff --git a/tools/fiptool/Makefile b/tools/fiptool/Makefile
23index 11d2e7b0b..7c2a08379 100644
24--- a/tools/fiptool/Makefile
25+++ b/tools/fiptool/Makefile
26@@ -12,6 +12,8 @@ FIPTOOL ?= fiptool${BIN_EXT}
27 PROJECT := $(notdir ${FIPTOOL})
28 OBJECTS := fiptool.o tbbr_config.o
29 V ?= 0
30+OPENSSL_DIR := /usr
31+
32
33 override CPPFLAGS += -D_GNU_SOURCE -D_XOPEN_SOURCE=700
34 HOSTCCFLAGS := -Wall -Werror -pedantic -std=c99
35@@ -20,7 +22,7 @@ ifeq (${DEBUG},1)
36 else
37 HOSTCCFLAGS += -O2
38 endif
39-LDLIBS := -lcrypto
40+LDLIBS := -L${OPENSSL_DIR}/lib -lcrypto
41
42 ifeq (${V},0)
43 Q := @
44@@ -28,7 +30,7 @@ else
45 Q :=
46 endif
47
48-INCLUDE_PATHS := -I../../include/tools_share
49+INCLUDE_PATHS := -I../../include/tools_share -I${OPENSSL_DIR}/include
50
51 HOSTCC ?= gcc
52