mirror of
https://review.coreboot.org/flashrom.git
synced 2025-07-01 14:11:15 +02:00
Makefile: Make pkg-config mandatory to find libpci
Use `make HAS_LIBPCI=yes/no` to override the pkg-config detection and `CONFIG_LIBPCI_CFLAGS` and `CONFIG_LIBPCI_LDFLAGS` to set cflags and ldflags manually. The optional dependency of libpci libz, is automatically handled by pkg-config. Change-Id: I21b4a261b34b7e688635fc6e20b7beebfa64c7ed Signed-off-by: Thomas Heijligen <thomas.heijligen@secunet.com> Reviewed-on: https://review.coreboot.org/c/flashrom/+/59050 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Nico Huber <nico.h@gmx.de> Reviewed-by: Paul Menzel <paulepanter@mailbox.org>
This commit is contained in:

committed by
Nico Huber

parent
980cf7d31f
commit
462a6159ab
@ -51,43 +51,3 @@ endef
|
||||
define dependency_ldflags
|
||||
$(call debug_shell, $(if $(PKG_CONFIG_LIBDIR),PKG_CONFIG_LIBDIR=$(PKG_CONFIG_LIBDIR),) $(PKG_CONFIG) --libs $1 2>/dev/null)
|
||||
endef
|
||||
|
||||
define LIBPCI_TEST
|
||||
/* Avoid a failing test due to libpci header symbol shadowing breakage */
|
||||
#define index shadow_workaround_index
|
||||
#if !defined __NetBSD__
|
||||
#include <pci/pci.h>
|
||||
#else
|
||||
#include <pciutils/pci.h>
|
||||
#endif
|
||||
struct pci_access *pacc;
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
(void) argc;
|
||||
(void) argv;
|
||||
pacc = pci_alloc();
|
||||
return 0;
|
||||
}
|
||||
endef
|
||||
export LIBPCI_TEST
|
||||
|
||||
define PCI_GET_DEV_TEST
|
||||
/* Avoid a failing test due to libpci header symbol shadowing breakage */
|
||||
#define index shadow_workaround_index
|
||||
#if !defined __NetBSD__
|
||||
#include <pci/pci.h>
|
||||
#else
|
||||
#include <pciutils/pci.h>
|
||||
#endif
|
||||
struct pci_access *pacc;
|
||||
struct pci_dev *dev = {0};
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
(void) argc;
|
||||
(void) argv;
|
||||
pacc = pci_alloc();
|
||||
dev = pci_get_dev(pacc, dev->domain, dev->bus, dev->dev, 1);
|
||||
return 0;
|
||||
}
|
||||
endef
|
||||
export PCI_GET_DEV_TEST
|
||||
|
Reference in New Issue
Block a user