Nico Huber submitted this change.

View Change

Approvals: build bot (Jenkins): Verified Nico Huber: Looks good to me, approved Angel Pons: Looks good to me, but someone else must approve
Makefile: use pkg-config --libs --static for LDFLAGS

The --static flag of pkg-config returns also the LDFLAGS which are
required to link the library static. Use this flag to successfully
link against static libraries when the shared variant is not available.
This is the case in OpenBSD with libpci.

Change-Id: I6029a096c1ceca625789d18c88119d912d79bc0e
Signed-off-by: Thomas Heijligen <thomas.heijligen@secunet.com>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/61524
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Nico Huber <nico.h@gmx.de>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
---
M Makefile
M Makefile.include
2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/Makefile b/Makefile
index f928019..66a6995 100644
--- a/Makefile
+++ b/Makefile
@@ -72,7 +72,6 @@
endif

ifeq ($(CONFIG_STATIC),yes)
-override PKG_CONFIG += --static
override LDFLAGS += -static
endif

diff --git a/Makefile.include b/Makefile.include
index 2316b30..fbd8456 100644
--- a/Makefile.include
+++ b/Makefile.include
@@ -53,5 +53,5 @@
endef

define dependency_ldflags
-$(call debug_shell, $(if $(PKG_CONFIG_LIBDIR),PKG_CONFIG_LIBDIR=$(PKG_CONFIG_LIBDIR),) $(PKG_CONFIG) --libs $1 2>/dev/null)
+$(call debug_shell, $(if $(PKG_CONFIG_LIBDIR),PKG_CONFIG_LIBDIR=$(PKG_CONFIG_LIBDIR),) $(PKG_CONFIG) --libs --static $1 2>/dev/null)
endef

To view, visit change 61524. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I6029a096c1ceca625789d18c88119d912d79bc0e
Gerrit-Change-Number: 61524
Gerrit-PatchSet: 6
Gerrit-Owner: Thomas Heijligen <src@posteo.de>
Gerrit-Reviewer: Angel Pons <th3fanbus@gmail.com>
Gerrit-Reviewer: Felix Singer <felixsinger@posteo.net>
Gerrit-Reviewer: Nico Huber <nico.h@gmx.de>
Gerrit-Reviewer: build bot (Jenkins) <no-reply@coreboot.org>
Gerrit-MessageType: merged