From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 35011 invoked by alias); 18 Jan 2019 13:25:58 -0000 Mailing-List: contact elfutils-devel-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Post: List-Help: List-Subscribe: Sender: elfutils-devel-owner@sourceware.org Received: (qmail 34988 invoked by uid 89); 18 Jan 2019 13:25:57 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Checked: by ClamAV 0.100.2 on sourceware.org X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,SPF_PASS,TIME_LIMIT_EXCEEDED autolearn=unavailable version=3.3.2 spammy=OTHER, destdir, elf.h, elfh X-Spam-Status: No, score=-26.9 required=5.0 tests=BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,SPF_PASS,TIME_LIMIT_EXCEEDED autolearn=unavailable version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on sourceware.org X-Spam-Level: X-HELO: gnu.wildebeest.org Received: from wildebeest.demon.nl (HELO gnu.wildebeest.org) (212.238.236.112) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 18 Jan 2019 13:25:47 +0000 Received: from tarox.wildebeest.org (tarox.wildebeest.org [172.31.17.39]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by gnu.wildebeest.org (Postfix) with ESMTPSA id 7D5F43001763; Fri, 18 Jan 2019 14:25:42 +0100 (CET) Received: by tarox.wildebeest.org (Postfix, from userid 1000) id 36B05411DC25; Fri, 18 Jan 2019 14:25:42 +0100 (CET) From: Mark Wielaard To: elfutils-devel@sourceware.org Cc: "Mark W. Krentel" , Mark Wielaard Subject: [PATCH] configure: Add new --enable-install-elfh option. Date: Fri, 18 Jan 2019 13:25:00 -0000 Message-Id: <1547817925-24532-1-git-send-email-mark@klomp.org> X-Mailer: git-send-email 1.8.3.1 X-Spam-Flag: NO X-IsSubscribed: yes X-SW-Source: 2019-q1/txt/msg00059.txt.bz2 We explicitly test (with system-elf-libelf) that our include headers work with the system elf.h header. But it might be helpful to install the elf.h file for a private install. Our elf.h header really is just a copy of the latest glibc elf.h. But it might be newer and include more constants than the system installed elf.h. Add a new configure option --enable-install-elfh to install elf.h. But warn when it is enabled for the default /usr or /usr/local prefix because it might clash with the glibc/system elf.h header in that case. Signed-off-by: Mark Wielaard --- ChangeLog | 4 ++++ configure.ac | 12 ++++++++++++ libelf/ChangeLog | 5 +++++ libelf/Makefile.am | 13 ++++++++++--- 4 files changed, 31 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 45418a0..148ce77 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2019-01-18 Mark Wielaard + + * configure.ac: Add new --enable-install-elfh. + 2018-07-04 Ross Burton * configure.ac: Check for gawk. diff --git a/configure.ac b/configure.ac index b89b867..7d4e69d 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 5783f0c..b89e93f 100644 --- a/libelf/ChangeLog +++ b/libelf/ChangeLog @@ -1,3 +1,8 @@ +2019-01-18 Mark Wielaard + + * 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 * 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 ddaeaa2..d5d63f7 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) -- 1.8.3.1