Skip to content

Commit

Permalink
Makefile: Simplify the NI-845X detection
Browse files Browse the repository at this point in the history
The current auto detection is kind of broken. Since the NI-845X driver
package is likely not changing, hardcode `C:\Program Files
(x86)\National Instuments\NI-845x\MS Visual C` as default path to search
for the library and header. This can be overridden by setting
`CONFIG_NI845X_LIBRARY_PATH` to the custom path.

TEST=Run make HAS_LIB_NI845X=yes CONFIG_NI845X=yes successfully on MSYS2
MINGW32

Change-Id: I2115c30d0884e35eb549a31beef04d966ba4f491
Signed-off-by: Thomas Heijligen <[email protected]>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/75234
Reviewed-by: Alexander Goncharov <[email protected]>
Reviewed-by: Anastasia Klimchuk <[email protected]>
Reviewed-by: Stefan Reinauer <[email protected]>
Tested-by: build bot (Jenkins) <[email protected]>
Reviewed-by: Angel Pons <[email protected]>
Reviewed-by: Miklós Márton <[email protected]>
  • Loading branch information
heijligen authored and Anastasia Klimchuk committed Jul 13, 2023
1 parent 751b16e commit f317a11
Showing 1 changed file with 3 additions and 13 deletions.
16 changes: 3 additions & 13 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -211,19 +211,9 @@ CONFIG_LIBFTDI1_VERSION := $(call dependency_version, libftdi1)
CONFIG_LIBFTDI1_CFLAGS := $(call dependency_cflags, libftdi1)
CONFIG_LIBFTDI1_LDFLAGS := $(call dependency_ldflags, libftdi1)

# Hack to keep legacy auto detection of Program Files (x86), Only active if none of the CONFIG_ variables for ni845x are set.
ifeq ($(CONFIG_NI845X_LIBRARY_PATH)$(CONFIG_LIB_NI845X_CFLAGS)$(CONFIG_LIB_NI845X_LDFLAGS),)
PROGRAMFILES_X86 = $(shell env | sed -n "s/^PROGRAMFILES(X86)=https://p")
ifneq ($(PROGRAMFILES_X86DIR),)
ifneq ($(PROGRAMFILES_X86DIR), ${PROGRAMFILES})
NI854_X86_LIBRARY_PATH := '${PROGRAMFILES_X86}\National Instruments\NI-845x\MS Visual C'
endif
endif
endif

CONFIG_NI845X_LIBRARY_PATH := '${PROGRAMFILES}\National Instruments\NI-845x\MS Visual C'
CONFIG_LIB_NI845X_CFLAGS := -I$(CONFIG_NI845X_LIBRARY_PATH) $(if NI854_X86_LIBRARY_PATH, -I${NI854_X86_LIBRARY_PATH})
CONFIG_LIB_NI845X_LDFLAGS := -L$(CONFIG_NI845X_LIBRARY_PATH) $(if NI854_X86_LIBRARY_PATH, -L${NI854_X86_LIBRARY_PATH}) -lni845x
CONFIG_NI845X_LIBRARY_PATH := 'C:\Program Files (x86)\National Instruments\NI-845x\MS Visual C'
CONFIG_LIB_NI845X_CFLAGS := -I$(CONFIG_NI845X_LIBRARY_PATH)
CONFIG_LIB_NI845X_LDFLAGS := -L$(CONFIG_NI845X_LIBRARY_PATH) -lni845x

CONFIG_LIBJAYLINK_VERSION := $(call dependency_version, libjaylink)
CONFIG_LIBJAYLINK_CFLAGS := $(call dependency_cflags, libjaylink)
Expand Down

0 comments on commit f317a11

Please sign in to comment.