summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile.am2
-rw-r--r--README.windows4
-rw-r--r--configure.ac22
-rw-r--r--lib/Makefile.am2
-rw-r--r--libelf/Makefile.am20
-rw-r--r--tests/Makefile.am10
6 files changed, 35 insertions, 25 deletions
diff --git a/Makefile.am b/Makefile.am
index 7e6f6bb4..5936be34 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -39,7 +39,7 @@ EXTRA_DIST = elfutils.spec GPG-KEY NOTES CONTRIBUTING \
# Run all tests under valgrind.
AM_DISTCHECK_CONFIGURE_FLAGS = \
--libdir=`echo $(libdir) | sed "s,^$(exec_prefix),$$dc_install_base,"`\
- --enable-gnulib --enable-selfcontained \
+ --enable-gnulib --enable-install-elfh --enable-install-featuresh \
--disable-symbol-versioning \
--enable-valgrind --enable-sanitize-undefined \
CC="$(CC)"
diff --git a/README.windows b/README.windows
index 2c4df058..170754db 100644
--- a/README.windows
+++ b/README.windows
@@ -1,12 +1,12 @@
In order to build this with mingw/msys for perfparser, use the following configure line:
-LDFLAGS=-static-libgcc configure --enable-maintainer-mode --enable-selfcontained --enable-gnulib \
+LDFLAGS=-static-libgcc configure --enable-maintainer-mode --enable-install-elfh --enable-install-featuresh --enable-gnulib \
--without-bzlib --without-lzma --disable-symbol-versioning
That is:
- static-libgcc so that we don't depend on a shared libgcc
- maintainer-mode as we are building from git
-- selfcontained to ship the headers needed to link perfparser
+- install-elfh and install-featuresh to ship the headers needed to build perfparser
- gnulib to replace missing libc functions
- without-bzlib to avoid extra dependencies
- without-lzma also to avoid dependencies
diff --git a/configure.ac b/configure.ac
index b351f086..eddacb8b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -125,11 +125,11 @@ AS_HELP_STRING([--enable-gnulib],
use_gnulib=$enableval, use_gnulib=no)
AM_CONDITIONAL(USE_GNULIB, test "$use_gnulib" = yes)
-AC_ARG_ENABLE([selfcontained],
-AS_HELP_STRING([--enable-selfcontained],
- [install extra headers to enable including and linking the libraries on non-GNU systems]),
- selfcontained=$enableval, selfcontained=no)
-AM_CONDITIONAL(SELFCONTAINED, test "$selfcontained" = yes)
+AC_ARG_ENABLE([install-featuresh],
+AS_HELP_STRING([--enable-install-featuresh],
+ [install a dummy features.h header]),
+ install_featuresh=$enableval, install_featuresh=no)
+AM_CONDITIONAL(INSTALL_FEATURESH, test "$install_featuresh" = yes)
AC_PROG_CC
@@ -389,6 +389,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])
@@ -811,6 +816,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}
@@ -826,3 +832,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/lib/Makefile.am b/lib/Makefile.am
index edd669fb..908bd894 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -46,7 +46,7 @@ if !GPROF
xmalloc_CFLAGS = -ffunction-sections
endif
-if SELFCONTAINED
+if INSTALL_FEATURESH
install-headers: install-am features.h.in
$(mkinstalldirs) $(DESTDIR)$(includedir)
$(INSTALL_HEADER) $(top_srcdir)/lib/features.h.in $(DESTDIR)$(includedir)/features.h
diff --git a/libelf/Makefile.am b/libelf/Makefile.am
index 015a07e3..9d6da6b4 100644
--- a/libelf/Makefile.am
+++ b/libelf/Makefile.am
@@ -38,6 +38,16 @@ noinst_LIBRARIES = libelf_pic.a
noinst_DATA = $(libelf_BARE)
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 \
@@ -149,16 +159,6 @@ endif
install: install-am install-lib
uninstall: uninstall-am uninstall-lib
-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 SELFCONTAINED
-include_HEADERS += elf.h
-else
-noinst_HEADERS += elf.h
-endif
-
EXTRA_DIST = libelf.map
CLEANFILES += $(am_libelf_pic_a_OBJECTS) $(libelf_SONAME) $(libelf_BARE)
diff --git a/tests/Makefile.am b/tests/Makefile.am
index d60d6636..4b88e16d 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -608,14 +608,12 @@ next_cfi_LDADD = $(libelf) $(libdw) $(libgnu)
elfcopy_LDADD = $(libelf) $(libgnu)
addsections_LDADD = $(libelf) $(libgnu)
-if SELFCONTAINED
-# In self contained mode we cannot expect a system elf header.
-# Use our own then
-system_elf_libelf_test_CPPFLAGS = -I$(top_srcdir)/libelf
-else
# 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
if USE_GNULIB
system_elf_libelf_test_CPPFLAGS += -I$(top_srcdir)/libgnu -I$(top_builddir)/libgnu