summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog4
-rw-r--r--configure.ac12
-rw-r--r--libelf/ChangeLog5
-rw-r--r--libelf/Makefile.am13
-rw-r--r--tests/ChangeLog5
-rw-r--r--tests/Makefile.am6
6 files changed, 41 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 45418a0a..148ce77a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2019-01-18 Mark Wielaard <[email protected]>
+
+ * configure.ac: Add new --enable-install-elfh.
+
2018-07-04 Ross Burton <[email protected]>
* configure.ac: Check for gawk.
diff --git a/configure.ac b/configure.ac
index b89b8679..7d4e69d0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -323,6 +323,11 @@ if test "$use_valgrind" = yes; then
fi
AM_CONDITIONAL(USE_VALGRIND, test "$use_valgrind" = yes)
+AC_ARG_ENABLE([install-elfh],
+AS_HELP_STRING([--enable-install-elfh],[install elf.h in include dir]),
+ [install_elfh=$enableval], [install_elfh=no])
+AM_CONDITIONAL(INSTALL_ELFH, test "$install_elfh" = yes)
+
AM_CONDITIONAL(BUILD_STATIC, [dnl
test "$use_gprof" = yes -o "$use_gcov" = yes])
@@ -658,6 +663,7 @@ AC_MSG_NOTICE([
NOT RECOMMENDED FEATURES (should all be no)
Experimental thread safety : ${use_locks}
+ install elf.h : ${install_elfh}
OTHER FEATURES
Deterministic archives by default : ${default_ar_deterministic}
@@ -673,3 +679,9 @@ AC_MSG_NOTICE([
use rpath in tests : ${tests_use_rpath}
test biarch : ${utrace_cv_cc_biarch}
])
+
+if test "$install_elfh" = yes; then
+ if test "${prefix}" = "/usr/local" -o "${prefix}" = "/usr"; then
+ AC_MSG_WARN([installing elf.h in ${includedir} might conflict with glibc/system elf.h])
+ fi
+fi
diff --git a/libelf/ChangeLog b/libelf/ChangeLog
index 5783f0c3..b89e93fe 100644
--- a/libelf/ChangeLog
+++ b/libelf/ChangeLog
@@ -1,3 +1,8 @@
+2019-01-18 Mark Wielaard <[email protected]>
+
+ * Makefile.am (INSTALL_ELFH): Add elf.h to include_HEADERS when
+ defined, otherwise (the default) add elf.h to noinst_HEADERS.
+
2019-01-16 Mark Wielaard <[email protected]>
* note_xlate.h (elf_cvt_note): Check n_namesz and n_descsz don't
diff --git a/libelf/Makefile.am b/libelf/Makefile.am
index ddaeaa2b..d5d63f73 100644
--- a/libelf/Makefile.am
+++ b/libelf/Makefile.am
@@ -39,6 +39,16 @@ noinst_LIBRARIES = libelf_pic.a
noinst_PROGRAMS = $(noinst_LIBRARIES:_pic.a=.so)
include_HEADERS = libelf.h gelf.h nlist.h
+noinst_HEADERS = abstract.h common.h exttypes.h gelf_xlate.h libelfP.h \
+ version_xlate.h gnuhash_xlate.h note_xlate.h dl-hash.h \
+ chdr_xlate.h
+
+if INSTALL_ELFH
+include_HEADERS += elf.h
+else
+noinst_HEADERS += elf.h
+endif
+
pkginclude_HEADERS = elf-knowledge.h
libelf_a_SOURCES = elf_version.c elf_hash.c elf_error.c elf_fill.c \
@@ -123,9 +133,6 @@ uninstall: uninstall-am
rm -f $(DESTDIR)$(libdir)/libelf.so.$(VERSION)
rm -f $(DESTDIR)$(libdir)/libelf.so
-noinst_HEADERS = elf.h abstract.h common.h exttypes.h gelf_xlate.h libelfP.h \
- version_xlate.h gnuhash_xlate.h note_xlate.h dl-hash.h \
- chdr_xlate.h
EXTRA_DIST = libelf.map
CLEANFILES += $(am_libelf_pic_a_OBJECTS) libelf.so.$(VERSION)
diff --git a/tests/ChangeLog b/tests/ChangeLog
index c2d86887..b76c44d9 100644
--- a/tests/ChangeLog
+++ b/tests/ChangeLog
@@ -1,3 +1,8 @@
+2019-01-24 Mark Wielaard <[email protected]>
+
+ * Makefile.am (system_elf_libelf_test_CPPFLAGS): Guard by
+ !INSTALL_ELFH.
+
2019-01-31 Mark Wielaard <[email protected]>
* backtrace-child.c (stdarg): Remove assert (errno == 0).
diff --git a/tests/Makefile.am b/tests/Makefile.am
index bc8c19a6..1b0c7d33 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -595,8 +595,12 @@ elfcopy_LDADD = $(libelf)
addsections_LDADD = $(libelf)
# We want to test the libelf header against the system elf.h header.
-# Don't include any -I CPPFLAGS.
+# Don't include any -I CPPFLAGS. Except when we install our own elf.h.
+if !INSTALL_ELFH
system_elf_libelf_test_CPPFLAGS =
+else
+system_elf_libelf_test_CPPFLAGS = -I$(top_srcdir)/libelf
+endif
system_elf_libelf_test_LDADD = $(libelf)
# A lock file used to make sure only one test dumps core at a time