diff options
author | Anthony G. Basile <blueness@gentoo.org> | 2012-11-10 14:30:50 -0500 |
---|---|---|
committer | Anthony G. Basile <blueness@gentoo.org> | 2012-11-10 14:30:50 -0500 |
commit | 193fe870825aa2e2b738acd6c2bd7fd4c4698ca9 (patch) | |
tree | 8c66f74f5790492a4fcd7f510d173387e644cb4a /configure.ac | |
parent | Work towards making both PT_PAX and xattr PAX optional (diff) | |
download | elfix-193fe870825aa2e2b738acd6c2bd7fd4c4698ca9.tar.gz elfix-193fe870825aa2e2b738acd6c2bd7fd4c4698ca9.tar.bz2 elfix-193fe870825aa2e2b738acd6c2bd7fd4c4698ca9.zip |
configure.ac: clean up checks for ptpax, xtpax
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 90 |
1 files changed, 41 insertions, 49 deletions
diff --git a/configure.ac b/configure.ac index f0299a8..bfbe367 100644 --- a/configure.ac +++ b/configure.ac @@ -48,37 +48,33 @@ AC_ARG_ENABLE( AS_HELP_STRING( [--enable-ptpax], [enable support for pax markings in PT_PAX ELF phdr] - ), + ) +) + +AS_IF( + [test "x$enable_ptpax" != "xno"], [ - AS_IF( - [test "x$enable_ptpax" = "xyes"], - [ - 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" - ], - [ - CFLAGS+=" -UPTPAX" - ] + 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" ], [ - CFLAGS+=" -DPTPAX" + CFLAGS+=" -UPTPAX" ] ) @@ -87,35 +83,31 @@ AC_ARG_ENABLE( AS_HELP_STRING( [--enable-xtpax], [enable support for pax markings in xattrs] - ), + ) +) + +AS_IF( + [test "x$enable_xtpax" != "xno"], [ - AS_IF( - [test "x$enable_xtpax" = "xyes"], - [ - AC_CHECK_HEADERS( - [attr/xattr.h], - [], - [AC_MSG_ERROR(["Missing necessary attr/xattr.h"])] - ) - AC_CHECK_LIB( - [attr], - [fgetxattr], - [], - [AC_MSG_ERROR(["Missing necessary function fgetxattr in libattr"])] - ) - CFLAGS+=" -DXTPAX" - ], - [ - CFLAGS+=" -UXTPAX" - ] + AC_CHECK_HEADERS( + [attr/xattr.h], + [], + [AC_MSG_ERROR(["Missing necessary attr/xattr.h"])] ) + AC_CHECK_LIB( + [attr], + [fgetxattr], + [], + [AC_MSG_ERROR(["Missing necessary function fgetxattr in libattr"])] + ) + CFLAGS+=" -DXTPAX" ], [ - CFLAGS+=" -DXTPAX" + CFLAGS+=" -UXTPAX" ] ) -if [test "x$enable_ptpax" != "xyes" -a "x$enable_xtpax" != "xyes" ]; then +if [test "x$enable_ptpax" = "xno" -a "x$enable_xtpax" = "xno" ]; then AC_MSG_ERROR(["You must enable either ptpax or xtpax"]) fi |