From patchwork Tue May 31 07:40:30 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: ivanhu X-Patchwork-Id: 1637225 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=canonical.com header.i=@canonical.com header.a=rsa-sha256 header.s=20210705 header.b=cOc34QZG; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=fwts-devel-bounces@lists.ubuntu.com; receiver=) Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4LC42X5KkSz9s75 for ; Tue, 31 May 2022 17:40:51 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1nvwUh-0007NW-5e; Tue, 31 May 2022 07:40:47 +0000 Received: from smtp-relay-canonical-0.internal ([10.131.114.83] helo=smtp-relay-canonical-0.canonical.com) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1nvwUe-0007NO-S2 for fwts-devel@lists.ubuntu.com; Tue, 31 May 2022 07:40:44 +0000 Received: from canonical.com (unknown [106.104.72.120]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-canonical-0.canonical.com (Postfix) with ESMTPSA id D29423F1AC for ; Tue, 31 May 2022 07:40:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1653982844; bh=Q/95zxJ4mrmjkTGc0xW1biP/tYqAPgbQq1joYAODDqM=; h=From:To:Subject:Date:Message-Id:MIME-Version; b=cOc34QZGpg1aOKNLnxXGPXD7L6U2gh4p5zgR5SevMwGCGl94dw15So+lTWqaa1sBC dgPitSoRN7RDgqqfDe1MW0oBTHR5IZ5F84fJYGpqZv2gkJo9hRNeRbDmGXsdFym7PV j8K1HCbixNRAGp4dJsZAk+artGU8kA7850ne+39BolZ6QxA6+ro4alNmWerkZTf76R oOiWCWnkorPf9wI4c/XlCNB2ClY4L4Kc0BRwHy7ySlTvNeiBmuKkgv/4rAU9EKWun1 WuKTd2iY42vjcKRhusZoFUiBJlkFH6udjFVXryOYp7Iuj25hvLjVxRMzsbFE9T6cEZ 4vCthe62nC7DQ== From: Ivan Hu To: fwts-devel@lists.ubuntu.com Subject: [PATCH] build: Improve linking Date: Tue, 31 May 2022 15:40:30 +0800 Message-Id: <20220531074030.8151-1-ivan.hu@canonical.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-BeenThere: fwts-devel@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Firmware Test Suite Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: fwts-devel-bounces@lists.ubuntu.com Sender: "fwts-devel" This improves the linking enough to get the build to complete with slibtool and GNU libtool. Signed-off-by: orbea --- configure.ac | 6 ++++++ src/Makefile.am | 21 +++++++++++---------- src/lib/src/Makefile.am | 18 ++++++++++-------- src/libfwtsacpica/Makefile.am | 6 ++---- src/libfwtsiasl/Makefile.am | 4 ++-- 5 files changed, 31 insertions(+), 24 deletions(-) diff --git a/configure.ac b/configure.ac index f40c3678..ca2f54e2 100644 --- a/configure.ac +++ b/configure.ac @@ -64,6 +64,12 @@ AC_CHECK_HEADERS([asm/opal-prd.h]) AC_CHECK_HEADERS([mtd/mtd-abi.h]) AC_CHECK_HEADERS([pci/pci.h]) + PKG_CHECK_MODULES([GIO], [gio-2.0]) + PKG_CHECK_MODULES([GLIB], [glib-2.0]) + AC_SUBST([GIO_CFLAGS]) + AC_SUBST([GIO_LIBS]) + AC_SUBST([GLIB_CFLAGS]) + AC_SUBST([GLIB_LIBS]) AM_CONDITIONAL([HAVE_ASM_OPAL_PRD_H], [test "x$ac_cv_header_asm_opal_prd_h" = "xyes"]) AM_CONDITIONAL([HAVE_MTD_ABI_H], diff --git a/src/Makefile.am b/src/Makefile.am index 9a26af86..a8c60b79 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -12,7 +12,7 @@ AM_CPPFLAGS = \ -I$(top_srcdir)/src/acpica/source/compiler \ -I$(top_srcdir)/efi_runtime \ -I$(top_srcdir)/smccc_test \ - -pthread `pkg-config --cflags glib-2.0 gio-2.0` \ + -pthread \ -Wall -Werror -Wextra \ -Wno-address-of-packed-member \ -Wfloat-equal -Wmissing-declarations \ @@ -23,7 +23,11 @@ AM_CPPFLAGS = \ bin_PROGRAMS = fwts -fwts_CPPFLAGS = $(AM_CPPFLAGS) -DACPI_DEBUG_OUTPUT +fwts_CPPFLAGS = \ + $(AM_CPPFLAGS) \ + @GIO_CFLAGS@ \ + @GLIB_CFLAGS@ \ + -DACPI_DEBUG_OUTPUT if HAVE_LIBFDT dt_tests = \ @@ -207,16 +211,13 @@ fwts_SOURCES = main.c \ $(power_mgmt_tests) \ $(dt_tests) -fwts_LDFLAGS = -lm -lbsd `pkg-config --libs glib-2.0 gio-2.0` +fwts_LDFLAGS = -no-undefined fwts_LDADD = \ - -lfwts \ - -L$(top_builddir)/src \ - -L$(top_builddir)/src/acpica \ - -L$(top_builddir)/src/libfwtsiasl \ - -L$(top_builddir)/src/libfwtsacpica \ - -L$(top_builddir)/src/lib/src \ - -lfwtsacpica + -lbsd \ + $(top_builddir)/src/lib/src/libfwts.la \ + $(top_builddir)/src/libfwtsiasl/libfwtsiasl.la \ + $(top_builddir)/src/libfwtsacpica/libfwtsacpica.la man_MANS = ../doc/fwts.1 ../doc/fwts-collect.1 ../doc/fwts-frontend-text.1 diff --git a/src/lib/src/Makefile.am b/src/lib/src/Makefile.am index a4fd23e9..d5d53dd7 100644 --- a/src/lib/src/Makefile.am +++ b/src/lib/src/Makefile.am @@ -21,22 +21,24 @@ AM_CPPFLAGS = \ -I$(top_srcdir)/src/libfwtsiasl \ -I$(top_srcdir)/src/acpica/source/include \ -I$(top_srcdir)/src/acpica/source/compiler \ - `pkg-config --silence-errors --cflags json` \ - `pkg-config --silence-errors --cflags json-c` \ - `pkg-config --cflags glib-2.0 gio-2.0` \ -DDATAROOTDIR=\"$(datarootdir)\" \ -Wall -Werror -Wextra \ -Wno-address-of-packed-member pkglib_LTLIBRARIES = libfwts.la -libfwts_la_LDFLAGS = \ +libfwts_la_LDFLAGS = -version-info 1:0:0 + +libfwts_la_LIBADD = \ -lm -lpthread -lbsd \ - -version-info 1:0:0 \ - -L$(top_builddir)/src/libfwtsiasl \ - -lfwtsiasl `pkg-config --libs glib-2.0 gio-2.0` + @GIO_LIBS@ \ + @GLIB_LIBS@ -libfwts_la_CPPFLAGS = $(AM_CPPFLAGS) -DACPI_DEBUG_OUTPUT +libfwts_la_CPPFLAGS = \ + $(AM_CPPFLAGS) \ + @GIO_CFLAGS@ \ + @GLIB_CFLAGS@ \ + -DACPI_DEBUG_OUTPUT if HAVE_LIBFDT dt_sources = \ diff --git a/src/libfwtsacpica/Makefile.am b/src/libfwtsacpica/Makefile.am index 65554b8e..57cd7b82 100644 --- a/src/libfwtsacpica/Makefile.am +++ b/src/libfwtsacpica/Makefile.am @@ -74,7 +74,8 @@ CLEANFILES = osunixxf_munged.c \ pkglib_LTLIBRARIES = libfwtsacpica.la -libfwtsacpica_la_LDFLAGS = -lpthread -version-info 1:0:0 +libfwtsacpica_la_LDFLAGS = -version-info 1:0:0 +libfwtsacpica_la_LIBADD = -lpthread libfwtsacpica_la_CPPFLAGS = $(AM_CPPFLAGS) # @@ -280,8 +281,5 @@ libfwtsacpica_la_SOURCES = \ ../../src/acpica/source/tools/acpiexec/aeinstall.c \ ../../src/acpica/source/os_specific/service_layers/osgendbg.c -libfwtsacpica_la_LIBADD = \ - -L../../src/lib/src -lfwts -lrt - -include ../../git.mk diff --git a/src/libfwtsiasl/Makefile.am b/src/libfwtsiasl/Makefile.am index 1be586f3..2bb32271 100644 --- a/src/libfwtsiasl/Makefile.am +++ b/src/libfwtsiasl/Makefile.am @@ -104,8 +104,8 @@ BUILT_SOURCES = aslcompiler.y \ # # Just export fwts specific API so we don't clash with core ACPICA library # -libfwtsiasl_la_LDFLAGS = -export-symbols-regex "fwts_.*" -lpthread -version-info 1:0:0 - +libfwtsiasl_la_LDFLAGS = -export-symbols-regex "fwts_.*" -version-info 1:0:0 +libfwtsiasl_la_LIBADD = -lpthread CLEANFILES = $(BUILT_SOURCES) libfwtsiasl_la_CPPFLAGS = $(AM_CPPFLAGS)