diff options
author | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2016-02-22 19:23:15 (GMT) |
---|---|---|
committer | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2016-02-22 19:23:15 (GMT) |
commit | a28fd74cc71e06909765e388edfafc35f2cff8a3 (patch) | |
tree | 3c6e36c3e91ccfa42df67a64b58b08eded037648 | |
parent | 501009735dd6fb2f094d4c37e141706abf5155de (diff) | |
download | patchelf-a28fd74cc71e06909765e388edfafc35f2cff8a3.zip patchelf-a28fd74cc71e06909765e388edfafc35f2cff8a3.tar.gz patchelf-a28fd74cc71e06909765e388edfafc35f2cff8a3.tar.bz2 |
Fix PAGESIZE auto-determination
Don't use "which" (which might not exist), and don't redirect getconf
auto to /dev/null.
-rw-r--r-- | configure.ac | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/configure.ac b/configure.ac index 29445b1..e25882e 100644 --- a/configure.ac +++ b/configure.ac @@ -8,19 +8,19 @@ AC_PROG_CXX PAGESIZE=auto AC_ARG_WITH([page-size], - AS_HELP_STRING([--with-page-size=SIZE], [Specify default pagesize (default auto)]), - PAGESIZE=$withval - ) - -AS_IF([test "x$PAGESIZE" = xauto], - AS_IF([which getconf &>/dev/null], [ - PAGESIZE=`getconf PAGESIZE &>/dev/null || getconf PAGE_SIZE &>/dev/null` - ]) - AS_IF([test "x$PAGESIZE" = x], [ - PAGESIZE=4096 - ]) + AS_HELP_STRING([--with-page-size=SIZE], [Specify default pagesize (default auto)]), + PAGESIZE=$withval ) +if test "$PAGESIZE" = auto; then + if type -p getconf &>/dev/null; then + PAGESIZE=$(getconf PAGESIZE || getconf PAGE_SIZE) + fi + if test "$PAGESIZE" = auto -o -z "$PAGESIZE"; then + PAGESIZE=4096 + fi +fi + AC_DEFINE_UNQUOTED(PAGESIZE, ${PAGESIZE}) AC_MSG_RESULT([Setting page size to ${PAGESIZE}]) |