1
0
mirror of https://review.coreboot.org/flashrom.git synced 2025-04-29 16:03:47 +02:00

ni845x_spi: handle PROGRAMFILES(X86) env var properly

The PROGRAMFILES(X86) envvar contains brackets which
could not be interpreted by the Makefile's interpreter.
A sed based tweak have been added to extract the variable
value from the env command output. The prefixed include
and linker path with this (now correctly extracted) prefix
only added to the compilation flags if it differ from the
PROGRAMFILES variable.

Change-Id: I397619a5038567d649a417ce6b9d8ac9e1c8c67b
Signed-off-by: Miklós Márton <martonmiklosqdev@gmail.com>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/56636
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-by: Nico Huber <nico.h@gmx.de>
This commit is contained in:
Miklós Márton 2021-07-27 14:29:16 +02:00 committed by Nico Huber
parent a69c5196d2
commit 822cc7ed2a

View File

@ -744,9 +744,18 @@ ifeq ($(CONFIG_NI845X_LIBRARY_PATH),)
# if the user did not specified the NI-845x headers/lib path # if the user did not specified the NI-845x headers/lib path
# do a guess for both 32 and 64 bit Windows versions # do a guess for both 32 and 64 bit Windows versions
NI845X_LIBS += -L'${PROGRAMFILES}\National Instruments\NI-845x\MS Visual C' NI845X_LIBS += -L'${PROGRAMFILES}\National Instruments\NI-845x\MS Visual C'
NI845X_LIBS += -L'${PROGRAMFILES(x86)}\National Instruments\NI-845x\MS Visual C'
NI845X_INCLUDES += -I'${PROGRAMFILES}\National Instruments\NI-845x\MS Visual C' NI845X_INCLUDES += -I'${PROGRAMFILES}\National Instruments\NI-845x\MS Visual C'
NI845X_INCLUDES += -I'${PROGRAMFILES(x86)}\National Instruments\NI-845x\MS Visual C'
# hack to access env variable containing brackets...
PROGRAMFILES_X86DIR = $(shell env | sed -n "s/^PROGRAMFILES(X86)=//p")
ifneq ($(PROGRAMFILES_X86DIR),)
ifneq ($(PROGRAMFILES_X86DIR), ${PROGRAMFILES})
NI845X_LIBS += -L'$(PROGRAMFILES_X86DIR)\National Instruments\NI-845x\MS Visual C'
NI845X_INCLUDES += -I'$(PROGRAMFILES_X86DIR)\National Instruments\NI-845x\MS Visual C'
endif
endif
else else
NI845X_LIBS += -L'$(CONFIG_NI845X_LIBRARY_PATH)' NI845X_LIBS += -L'$(CONFIG_NI845X_LIBRARY_PATH)'
NI845X_INCLUDES += -I'$(CONFIG_NI845X_LIBRARY_PATH)' NI845X_INCLUDES += -I'$(CONFIG_NI845X_LIBRARY_PATH)'