summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorUlf Hermann <[email protected]>2017-03-08 10:54:51 +0100
committerUlf Hermann <[email protected]>2017-05-02 13:44:35 +0000
commitdbb67af24f5c16681b299d288cf9aa4e4dd9bd25 (patch)
tree9eaa8981996cf53dfc55b5c642201b332de77339 /lib
parent46a61aa553eb304f399ac2f62c96ad2adbeda3c0 (diff)
Add a "selfcontained" mode to provide missing headers on windows
On windows there is no features.h, uid_t, gid_t, mode_t, and pid_t are not defined and there is also no elf.h. To make it possible to build other software against libelf and libdw, install our own version of elf.h, and a bare-bones features.h that provides exactly the above declarations. Change-Id: I9df3c8cbffe431b8b6834dbd2246e38df4f5e172 Reviewed-by: Christian Kandeler <[email protected]>
Diffstat (limited to 'lib')
-rw-r--r--lib/Makefile.am11
-rw-r--r--lib/features.h.in43
2 files changed, 53 insertions, 1 deletions
diff --git a/lib/Makefile.am b/lib/Makefile.am
index 17d16d07..87a922ae 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -39,8 +39,17 @@ libeu_a_SOURCES = xstrdup.c xstrndup.c xmalloc.c next_prime.c \
noinst_HEADERS = fixedsizehash.h libeu.h system.h dynamicsizehash.h list.h \
md5.h sha1.h eu-config.h color.h printversion.h
-EXTRA_DIST = dynamicsizehash.c
+EXTRA_DIST = dynamicsizehash.c features.h.in
if !GPROF
xmalloc_CFLAGS = -ffunction-sections
endif
+
+if SELFCONTAINED
+install: install-am features.h.in
+ $(mkinstalldirs) $(DESTDIR)$(includedir)
+ $(INSTALL_HEADER) $(top_srcdir)/lib/features.h.in $(DESTDIR)$(includedir)/features.h
+
+uninstall: uninstall-am
+ rm -f $(DESTDIR)$(includedir)/features.h
+endif
diff --git a/lib/features.h.in b/lib/features.h.in
new file mode 100644
index 00000000..099f4211
--- /dev/null
+++ b/lib/features.h.in
@@ -0,0 +1,43 @@
+/* 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
+
+#include <stdint.h>
+
+typedef uint32_t uid_t;
+typedef uint32_t gid_t;
+typedef uint32_t mode_t;
+#ifdef _WIN64
+typedef int64_t pid_t
+#else
+typedef int32_t pid_t;
+#endif
+
+#endif /* features.h */