]> git.ipfire.org Git - thirdparty/elfutils.git/commit
tests: Fix system_elf_gelf_test build without system libelf.h
authorMark Wielaard <mark@klomp.org>
Sun, 3 Sep 2023 16:25:56 +0000 (18:25 +0200)
committerMark Wielaard <mark@klomp.org>
Mon, 4 Sep 2023 11:40:19 +0000 (13:40 +0200)
commit276c367be0807301652817c0df071c90ae3c276b
tree83bc5b3887b12fb5075477e76c6a4d3abfa2f251
parent3ef3fab0d64c89a52dd6e2ce0d01dd5e713d7b5a
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 <mark@klomp.org>
tests/Makefile.am