@@ -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],
@@ -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
@@ -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 = \
@@ -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
@@ -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)
This improves the linking enough to get the build to complete with slibtool and GNU libtool. Signed-off-by: orbea <orbea@riseup.net> --- 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(-)