aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnthony G. Basile <blueness@gentoo.org>2012-11-10 14:59:46 -0500
committerAnthony G. Basile <blueness@gentoo.org>2012-11-10 14:59:46 -0500
commit2c94229b496315346c90ed0f90c497cb9b75b88e (patch)
treec71664c8fda9ec538301c6febf6c7cf5e464e4ec /configure.ac
parentconfigure.ac: clean up checks for ptpax, xtpax (diff)
downloadelfix-2c94229b496315346c90ed0f90c497cb9b75b88e.tar.gz
elfix-2c94229b496315346c90ed0f90c497cb9b75b88e.tar.bz2
elfix-2c94229b496315346c90ed0f90c497cb9b75b88e.zip
configure.ac, src/paxctl-ng.c: improve checks and propagate defines
configure.ac: always check for gelf.h and libelf since fix-gnustack needs it. src/paxctl-ng.c: add the defines for all possibilities of enable or disable ptpax and xtpax
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac22
1 files changed, 10 insertions, 12 deletions
diff --git a/configure.ac b/configure.ac
index bfbe367..3e22d45 100644
--- a/configure.ac
+++ b/configure.ac
@@ -25,7 +25,7 @@ AC_PROG_SED
# Checks for header files.
AC_CHECK_HEADERS(
- [errno.h error.h fcntl.h libgen.h stdio.h stdlib.h string.h \
+ [errno.h error.h fcntl.h gelf.h libgen.h stdio.h stdlib.h string.h \
sys/mman.h sys/stat.h sys/types.h unistd.h],
[],
[AC_MSG_ERROR(["Missing necessary header"])]
@@ -43,6 +43,15 @@ AC_FUNC_FORK
AC_FUNC_MMAP
AC_CHECK_FUNCS([memset strerror])
+# Note: this is always needed for fix-gnustack
+# and for paxctl-ng only with --enable-ptpax
+AC_CHECK_LIB(
+ [elf],
+ [elf_begin],
+ [],
+ [AC_MSG_ERROR(["Missing necessary function elf_begin in libelf"])]
+)
+
AC_ARG_ENABLE(
[ptpax],
AS_HELP_STRING(
@@ -54,23 +63,12 @@ AC_ARG_ENABLE(
AS_IF(
[test "x$enable_ptpax" != "xno"],
[
- AC_CHECK_HEADERS(
- [gelf.h],
- [],
- [AC_MSG_ERROR(["Missing necessary gelf.h"])]
- )
AC_CHECK_DECLS(
[PT_PAX_FLAGS, PF_PAGEEXEC, PF_MPROTECT, PF_RANDMMAP],
[],
[AC_MSG_ERROR(["Missing necessary function elf_begin in libelf"])],
[[#include <gelf.h>]]
)
- AC_CHECK_LIB(
- [elf],
- [elf_begin],
- [],
- [AC_MSG_ERROR(["Missing necessary function elf_begin in libelf"])]
- )
CFLAGS+=" -DPTPAX"
],
[