diff options
author | 2013-05-20 09:13:02 -0400 | |
---|---|---|
committer | 2013-05-20 16:00:33 -0400 | |
commit | 2d604e759193995c6b3abe121a7da5586cb05d2a (patch) | |
tree | 492d94823217ef20c6aa23b1768d2707631a2e35 | |
parent | Bump to automake 1.12 (diff) | |
download | elfix-2d604e759193995c6b3abe121a7da5586cb05d2a.tar.gz elfix-2d604e759193995c6b3abe121a7da5586cb05d2a.tar.bz2 elfix-2d604e759193995c6b3abe121a7da5586cb05d2a.zip |
configure.ac: check if ELF_C_RDWR_MMAP is declared in libelf.h
-rw-r--r-- | Makefile.am | 4 | ||||
-rw-r--r-- | configure.ac | 22 | ||||
-rw-r--r-- | doc/Makefile.am | 5 | ||||
-rw-r--r-- | src/Makefile.am | 8 | ||||
-rw-r--r-- | tests/Makefile.am | 5 |
5 files changed, 32 insertions, 12 deletions
diff --git a/Makefile.am b/Makefile.am index 99cd955..8e43c5e 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,6 +1,6 @@ ACLOCAL_AMFLAGS = -I m4 +SUBDIRS = src scripts doc if TEST -SUBDIRS_TESTS = tests +SUBDIRS += tests endif -SUBDIRS = src scripts doc $(SUBDIRS_TESTS) diff --git a/configure.ac b/configure.ac index 3fcf7ed..c4f46c4 100644 --- a/configure.ac +++ b/configure.ac @@ -50,6 +50,10 @@ AC_CHECK_HEADERS( [AC_MSG_ERROR(["Missing necessary header"])] ) +# Checks for DECLs. +AC_CHECK_DECL([ELF_C_RDWR_MMAP],[],[],[[#include <libelf.h>]]) +AM_CONDITIONAL([BUILD_ELF],[test "x$ac_cv_have_decl_ELF_C_RDWR_MMAP" = "xyes"]) + # Checks for typedefs, structures, and compiler characteristics. AC_TYPE_PID_T AC_TYPE_SIZE_T @@ -82,15 +86,21 @@ AC_ARG_ENABLE( AS_IF( [test "x$enable_ptpax" != "xno"], [ - AC_CHECK_DECLS( - [PT_PAX_FLAGS, PF_PAGEEXEC, PF_MPROTECT, PF_RANDMMAP], - [], + AS_IF( + [test "x$ac_cv_have_decl_ELF_C_RDWR_MMAP" = "xyes"], [ - CFLAGS+=" -DNEED_PAX_DECLS" + AC_CHECK_DECLS( + [PT_PAX_FLAGS, PF_PAGEEXEC, PF_MPROTECT, PF_RANDMMAP], + [], + [ + CFLAGS+=" -DNEED_PAX_DECLS" + ], + [[#include <gelf.h>]] + ) + CFLAGS+=" -DPTPAX" ], - [[#include <gelf.h>]] + [AC_MSG_ERROR(["Missing necessary DECL ELF_C_RDWR_MMAP in libelf"])] ) - CFLAGS+=" -DPTPAX" ], [ CFLAGS+=" -UPTPAX -DNEED_PAX_DECLS" diff --git a/doc/Makefile.am b/doc/Makefile.am index 5433f87..323b53f 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -1,3 +1,6 @@ ACLOCAL_AMFLAGS = -I m4 -dist_man_MANS = fix-gnustack.1 paxctl-ng.1 revdep-pax.1 +dist_man_MANS = paxctl-ng.1 revdep-pax.1 +if BUILD_ELF +dist_man_MANS += fix-gnustack.1 +endif diff --git a/src/Makefile.am b/src/Makefile.am index 5685d88..b41f21c 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,5 +1,9 @@ ACLOCAL_AMFLAGS = -I m4 -sbin_PROGRAMS = fix-gnustack paxctl-ng -fix_gnustack_SOURCES = fix-gnustack.c +sbin_PROGRAMS = paxctl-ng paxctl_ng_SOURCES = paxctl-ng.c + +if BUILD_ELF +sbin_PROGRAMS += fix-gnustack +fix_gnustack_SOURCES = fix-gnustack.c +endif diff --git a/tests/Makefile.am b/tests/Makefile.am index 7b5dc89..02e85b9 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -1,3 +1,6 @@ ACLOCAL_AMFLAGS = -I m4 -SUBDIRS = gnustack paxmodule pxtpax revdeppaxtest +SUBDIRS = paxmodule pxtpax revdeppaxtest +if BUILD_ELF +SUBDIRS += gnustack +endif |