This is the mail archive of the elfutils-devel@sourceware.org mailing list for the elfutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Add empty features.h replacement


gnulib #defines all the types we need from it in config.h, so it is empty.
We still need it because other files #include it. We use this for building
elfutils itself. The other features.h in lib gets installed in selfcontained
mode for other projects that include elfutils headers in a different
environment.

Signed-off-by: Ulf Hermann <ulf.hermann@qt.io>
---
 ChangeLog            |  4 ++++
 configure.ac         |  3 +++
 libgnu/ChangeLog     |  5 +++++
 libgnu/Makefile.am   | 10 +++++++++-
 libgnu/features.in.h | 35 +++++++++++++++++++++++++++++++++++
 5 files changed, 56 insertions(+), 1 deletion(-)
 create mode 100644 libgnu/features.in.h

diff --git a/ChangeLog b/ChangeLog
index 814a133..4024550 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2017-05-04  Ulf Hermann  <ulf.hermann@qt.io>
 
+	* configure.ac: Check for features.h.
+
+2017-05-04  Ulf Hermann  <ulf.hermann@qt.io>
+
 	* configure.ac: Check for ar.h.
 
 2017-05-04  Ulf Hermann  <ulf.hermann@qt.io>
diff --git a/configure.ac b/configure.ac
index ba560d6..fc5edf8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -580,6 +580,9 @@ long sysconf(int name);
 AC_CHECK_HEADERS(ar.h)
 AM_CONDITIONAL(HAVE_AR_H, [test "x$ac_cv_header_ar_h" = "xyes"])
 
+AC_CHECK_HEADERS(features.h)
+AM_CONDITIONAL(HAVE_FEATURES_H, [test "x$ac_cv_header_features_h" = "xyes"])
+
 dnl Check if we have <linux/bpf.h> for EM_BPF disassembly.
 AC_CHECK_HEADERS(linux/bpf.h)
 AM_CONDITIONAL(HAVE_LINUX_BPF_H, [test "x$ac_cv_header_linux_bpf_h" = "xyes"])
diff --git a/libgnu/ChangeLog b/libgnu/ChangeLog
index 3d30ce1..7d70bfc 100644
--- a/libgnu/ChangeLog
+++ b/libgnu/ChangeLog
@@ -1,5 +1,10 @@
 2017-05-04  Ulf Hermann  <ulf.hermann@qt.io>
 
+	* Makefile.am: If features.h is unavailable, use our own.
+	* features.in.h: New file.
+
+2017-05-04  Ulf Hermann  <ulf.hermann@qt.io>
+
 	* Makefile.am: If ar.h is unavailable, use our own version.
 	* ar.in.h: New file.
 
diff --git a/libgnu/Makefile.am b/libgnu/Makefile.am
index d7af59a..ed8aff1 100644
--- a/libgnu/Makefile.am
+++ b/libgnu/Makefile.am
@@ -35,7 +35,8 @@ noinst_LIBRARIES =
 MOSTLYCLEANFILES =
 MOSTLYCLEANDIRS =
 BUILT_SOURCES =
-EXTRA_DIST = endian.in.h byteswap.in.h sys_mman.win32.h mman_win32.c sysconf_win32.c ar.in.h
+EXTRA_DIST = endian.in.h byteswap.in.h sys_mman.win32.h mman_win32.c sysconf_win32.c ar.in.h \
+             features.in.h
 CLEANFILES =
 SUFFIXES =
 
@@ -60,6 +61,13 @@ BUILT_SOURCES += ar.h
 MOSTLYCLEANFILES += ar.h
 endif
 
+if !HAVE_FEATURES_H
+features.h: features.in.h
+	$(AM_V_GEN)rm -f $@ && cat $< > $@
+BUILT_SOURCES += features.h
+MOSTLYCLEANFILES += features.h
+endif
+
 if !HAVE_SYS_MMAN_H
 if USE_WIN32_MMAN
 sys/mman.h: sys_mman.win32.h
diff --git a/libgnu/features.in.h b/libgnu/features.in.h
new file mode 100644
index 0000000..41f94a3
--- /dev/null
+++ b/libgnu/features.in.h
@@ -0,0 +1,35 @@
+/* This file defines uid_t, gid_t, mode_t, pid_t
+   Copyright (C) 2017 The Qt Company Ltd
+   This file is part of elfutils.
+
+   This file is free software; you can redistribute it and/or modify
+   it under the terms of either
+
+     * the GNU Lesser General Public License as published by the Free
+       Software Foundation; either version 3 of the License, or (at
+       your option) any later version
+
+   or
+
+     * the GNU General Public License as published by the Free
+       Software Foundation; either version 2 of the License, or (at
+       your option) any later version
+
+   or both in parallel, as here.
+
+   elfutils is distributed in the hope that it will be useful, but
+   WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   General Public License for more details.
+
+   You should have received copies of the GNU General Public License and
+   the GNU Lesser General Public License along with this program.  If
+   not, see <http://www.gnu.org/licenses/>.  */
+
+#ifndef _FEATURES_H
+#define _FEATURES_H 1
+
+// Don't define the actual types here.
+// Gnulib adds #define statements for them to config.h
+
+#endif /* features.h */
-- 
2.1.4


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]