[PATCH] Add LIBCHECK_CFLAGS

5 views
Skip to first unread message

Earl Chew

unread,
Jul 8, 2023, 11:56:55 AM7/8/23
to efibootg...@googlegroups.com, Earl Chew
When building unit tests, LIBCHECK_LIBS was already used to find
the corresponding library. Add LIBCHECK_CFLAGS to find the
matching headers.

Signed-off-by: Earl Chew <earl...@yahoo.com>
---
tools/tests/Makefile.am | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/tools/tests/Makefile.am b/tools/tests/Makefile.am
index 71f7159..b0c0242 100644
--- a/tools/tests/Makefile.am
+++ b/tools/tests/Makefile.am
@@ -70,26 +70,26 @@ CLEANFILES += $(FAT_TESTLIB)

SRC_TEST_COMMON=test_main.c

-test_bgenv_init_retval_CFLAGS = $(AM_CFLAGS)
+test_bgenv_init_retval_CFLAGS = $(LIBCHECK_CFLAGS) $(AM_CFLAGS)
test_bgenv_init_retval_SOURCES = test_bgenv_init_retval.c $(SRC_TEST_COMMON)
test_bgenv_init_retval_LDADD = $(FAT_TESTLIB) $(LIBCHECK_LIBS)

-test_probe_config_partitions_CFLAGS = $(AM_CFLAGS)
+test_probe_config_partitions_CFLAGS = $(LIBCHECK_CFLAGS) $(AM_CFLAGS)
test_probe_config_partitions_SOURCES = test_probe_config_partitions.c \
fake_devices.c \
$(SRC_TEST_COMMON)
test_probe_config_partitions_LDADD = $(FAT_TESTLIB) $(LIBCHECK_LIBS)

-test_probe_config_file_CFLAGS = $(AM_CFLAGS) -Wl,--wrap=probe_config_file
+test_probe_config_file_CFLAGS = $(LIBCHECK_CFLAGS) $(AM_CFLAGS) -Wl,--wrap=probe_config_file
test_probe_config_file_SOURCES = test_probe_config_file.c fake_devices.c \
$(SRC_TEST_COMMON)
test_probe_config_file_LDADD = $(FAT_TESTLIB) $(LIBCHECK_LIBS)

-test_ebgenv_api_internal_CFLAGS = $(AM_CFLAGS)
+test_ebgenv_api_internal_CFLAGS = $(LIBCHECK_CFLAGS) $(AM_CFLAGS)
test_ebgenv_api_internal_SOURCES = test_ebgenv_api_internal.c $(SRC_TEST_COMMON)
test_ebgenv_api_internal_LDADD = $(FAT_TESTLIB) $(LIBCHECK_LIBS)

-test_ebgenv_api_CFLAGS = $(AM_CFLAGS) -Wl,--wrap=bgenv_set -Wl,--wrap=bgenv_get
+test_ebgenv_api_CFLAGS = $(LIBCHECK_CFLAGS) $(AM_CFLAGS) -Wl,--wrap=bgenv_set -Wl,--wrap=bgenv_get
test_ebgenv_api_SOURCES = test_ebgenv_api.c $(SRC_TEST_COMMON)
test_ebgenv_api_LDADD = $(FAT_TESTLIB) $(LIBCHECK_LIBS)

--
2.39.1

Jan Kiszka

unread,
Jul 11, 2023, 2:58:18 AM7/11/23
to Earl Chew, efibootg...@googlegroups.com
Thanks for the suggestion. But can't we simply add LIBCHECK_CFLAGS to
AM_CFLAGS in this file?

Jan

--
Siemens AG, Technology
Competence Center Embedded Linux

Earl Chew

unread,
Jul 12, 2023, 10:55:32 AM7/12/23
to Jan Kiszka, efibootg...@googlegroups.com
Jan,

> Thanks for the suggestion. But can't we simply add LIBCHECK_CFLAGS to
> AM_CFLAGS in this file?

Yes.

I was drawn to keeping the reference to LIBCHECK_CFLAGS close
to the existing reference to LIBCHECK_LIBS.

Digging around, I see that AM_LDADD is not supported, hence the
repetition of $(FAT_TESTLIB) $(LIBCHECK_LIBS) for *_LDADD.

I'll upload a new version of the patch per your recommendation.

Earl
Reply all
Reply to author
Forward
0 new messages