tfa-layerscape: fix build on systems without openssl headers
authorHauke Mehrtens <hauke@hauke-m.de>
Tue, 28 Dec 2021 15:10:37 +0000 (16:10 +0100)
committerHauke Mehrtens <hauke@hauke-m.de>
Tue, 28 Dec 2021 17:04:13 +0000 (18:04 +0100)
The build fails when the openssl/sha.h header file is not installed on
the host system. Fix this by setting the HOSTCCFLAGS variable to the
OpenWrt HOST_CFLAGS variable, without setting this the include paths and
other modifications in the host flags done by OpenWrt will be ignored by
the build.

This fixes the following build problem:
gcc -c -D_GNU_SOURCE -D_XOPEN_SOURCE=700 -Wall -Werror -pedantic -std=c99 -O2 -I../../include/tools_share fiptool.c -o fiptool.o
In file included from fiptool.h:16,
                 from fiptool.c:19:
fiptool_platform.h:19:11: fatal error: openssl/sha.h: No such file or directory
   19 | # include <openssl/sha.h>
      |           ^~~~~~~~~~~~~~~

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
package/boot/tfa-layerscape/Makefile

index 31a900412ec3f6ceedfa1c13217d9256b7bc60fb..84ababf5e01ec9ec90c92398a8f7add1f77b3f10 100644 (file)
@@ -25,7 +25,8 @@ define Host/Compile
        $(MAKE) -C \
                $(HOST_BUILD_DIR)/tools/fiptool \
                CFLAGS="$(HOST_CFLAGS)" \
-               LDFLAGS="$(HOST_LDFLAGS)"
+               LDFLAGS="$(HOST_LDFLAGS)" \
+               HOSTCCFLAGS="$(HOST_CFLAGS)"
        $(MAKE) -C \
                $(HOST_BUILD_DIR)/tools/nxp \
                CFLAGS="$(HOST_CFLAGS)"