Gentoo Archives: gentoo-commits

From: "Anthony G. Basile" <blueness@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/elfix:elfix-0.8.x commit in: src/, /, doc/, tests/
Date: Mon, 20 May 2013 20:02:48
Message-Id: 1369080033.2d604e759193995c6b3abe121a7da5586cb05d2a.blueness@gentoo
1 commit: 2d604e759193995c6b3abe121a7da5586cb05d2a
2 Author: Anthony G. Basile <blueness <AT> gentoo <DOT> org>
3 AuthorDate: Mon May 20 13:13:02 2013 +0000
4 Commit: Anthony G. Basile <blueness <AT> gentoo <DOT> org>
5 CommitDate: Mon May 20 20:00:33 2013 +0000
6 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/elfix.git;a=commit;h=2d604e75
7
8 configure.ac: check if ELF_C_RDWR_MMAP is declared in libelf.h
9
10 ---
11 Makefile.am | 4 ++--
12 configure.ac | 22 ++++++++++++++++------
13 doc/Makefile.am | 5 ++++-
14 src/Makefile.am | 8 ++++++--
15 tests/Makefile.am | 5 ++++-
16 5 files changed, 32 insertions(+), 12 deletions(-)
17
18 diff --git a/Makefile.am b/Makefile.am
19 index 99cd955..8e43c5e 100644
20 --- a/Makefile.am
21 +++ b/Makefile.am
22 @@ -1,6 +1,6 @@
23 ACLOCAL_AMFLAGS = -I m4
24
25 +SUBDIRS = src scripts doc
26 if TEST
27 -SUBDIRS_TESTS = tests
28 +SUBDIRS += tests
29 endif
30 -SUBDIRS = src scripts doc $(SUBDIRS_TESTS)
31
32 diff --git a/configure.ac b/configure.ac
33 index 3fcf7ed..c4f46c4 100644
34 --- a/configure.ac
35 +++ b/configure.ac
36 @@ -50,6 +50,10 @@ AC_CHECK_HEADERS(
37 [AC_MSG_ERROR(["Missing necessary header"])]
38 )
39
40 +# Checks for DECLs.
41 +AC_CHECK_DECL([ELF_C_RDWR_MMAP],[],[],[[#include <libelf.h>]])
42 +AM_CONDITIONAL([BUILD_ELF],[test "x$ac_cv_have_decl_ELF_C_RDWR_MMAP" = "xyes"])
43 +
44 # Checks for typedefs, structures, and compiler characteristics.
45 AC_TYPE_PID_T
46 AC_TYPE_SIZE_T
47 @@ -82,15 +86,21 @@ AC_ARG_ENABLE(
48 AS_IF(
49 [test "x$enable_ptpax" != "xno"],
50 [
51 - AC_CHECK_DECLS(
52 - [PT_PAX_FLAGS, PF_PAGEEXEC, PF_MPROTECT, PF_RANDMMAP],
53 - [],
54 + AS_IF(
55 + [test "x$ac_cv_have_decl_ELF_C_RDWR_MMAP" = "xyes"],
56 [
57 - CFLAGS+=" -DNEED_PAX_DECLS"
58 + AC_CHECK_DECLS(
59 + [PT_PAX_FLAGS, PF_PAGEEXEC, PF_MPROTECT, PF_RANDMMAP],
60 + [],
61 + [
62 + CFLAGS+=" -DNEED_PAX_DECLS"
63 + ],
64 + [[#include <gelf.h>]]
65 + )
66 + CFLAGS+=" -DPTPAX"
67 ],
68 - [[#include <gelf.h>]]
69 + [AC_MSG_ERROR(["Missing necessary DECL ELF_C_RDWR_MMAP in libelf"])]
70 )
71 - CFLAGS+=" -DPTPAX"
72 ],
73 [
74 CFLAGS+=" -UPTPAX -DNEED_PAX_DECLS"
75
76 diff --git a/doc/Makefile.am b/doc/Makefile.am
77 index 5433f87..323b53f 100644
78 --- a/doc/Makefile.am
79 +++ b/doc/Makefile.am
80 @@ -1,3 +1,6 @@
81 ACLOCAL_AMFLAGS = -I m4
82
83 -dist_man_MANS = fix-gnustack.1 paxctl-ng.1 revdep-pax.1
84 +dist_man_MANS = paxctl-ng.1 revdep-pax.1
85 +if BUILD_ELF
86 +dist_man_MANS += fix-gnustack.1
87 +endif
88
89 diff --git a/src/Makefile.am b/src/Makefile.am
90 index 5685d88..b41f21c 100644
91 --- a/src/Makefile.am
92 +++ b/src/Makefile.am
93 @@ -1,5 +1,9 @@
94 ACLOCAL_AMFLAGS = -I m4
95
96 -sbin_PROGRAMS = fix-gnustack paxctl-ng
97 -fix_gnustack_SOURCES = fix-gnustack.c
98 +sbin_PROGRAMS = paxctl-ng
99 paxctl_ng_SOURCES = paxctl-ng.c
100 +
101 +if BUILD_ELF
102 +sbin_PROGRAMS += fix-gnustack
103 +fix_gnustack_SOURCES = fix-gnustack.c
104 +endif
105
106 diff --git a/tests/Makefile.am b/tests/Makefile.am
107 index 7b5dc89..02e85b9 100644
108 --- a/tests/Makefile.am
109 +++ b/tests/Makefile.am
110 @@ -1,3 +1,6 @@
111 ACLOCAL_AMFLAGS = -I m4
112
113 -SUBDIRS = gnustack paxmodule pxtpax revdeppaxtest
114 +SUBDIRS = paxmodule pxtpax revdeppaxtest
115 +if BUILD_ELF
116 +SUBDIRS += gnustack
117 +endif