From: Mark Wielaard Date: Sun, 3 Sep 2023 16:25:56 +0000 (+0200) Subject: tests: Fix system_elf_gelf_test build without system libelf.h X-Git-Tag: elfutils-0.190~31 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=276c367be0807301652817c0df071c90ae3c276b;p=thirdparty%2Felfutils.git tests: Fix system_elf_gelf_test build without system libelf.h If there is no system libelf.h then the building of system-elf-gelf-test fails with: ../libelf/gelf.h:32:10: fatal error: libelf.h: No such file or directory This is because although the testcase includes the headers as ../libelf/libelf.h and ../libelf/gelf.h, gelf.h itself does an Fix this by putting a copy of libelf.h in the build test directory and using -I. for building system-elf-gelf-test. * tests/Makefile.am (BUILT_SOURCES): New for libelf.h. (CLEANFILES): Add libelf.h. (libelf.h): New target that copies srdir libelf.h. (system_elf_gelf_test_CPPFLAGS): Add -I. https://sourceware.org/bugzilla/show_bug.cgi?id=30812 Signed-off-by: Mark Wielaard --- diff --git a/tests/Makefile.am b/tests/Makefile.am index 49069ccfb..32b18e6ef 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -807,9 +807,14 @@ nvidia_extended_linemap_libdw_LDADD = $(libelf) $(libdw) # We want to test the libelf headers against the system elf.h header. # Don't include any -I CPPFLAGS. Except when we install our own elf.h. +# For the gelf test we do want our own libelf.h, but nothing else. +BUILT_SOURCES = libelf.h +CLEANFILES += libelf.h +libelf.h: $(top_srcdir)/libelf/libelf.h + cp $< $@ if !INSTALL_ELFH system_elf_libelf_test_CPPFLAGS = -system_elf_gelf_test_CPPFLAGS = +system_elf_gelf_test_CPPFLAGS = -I. else system_elf_libelf_test_CPPFLAGS = -I$(top_srcdir)/libelf system_elf_gelf_test_CPPFLAGS = -I$(top_srcdir)/libelf