summaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
authorFelipe Sateler <fsateler@debian.org>2016-01-15 01:47:00 (GMT)
committerFelipe Sateler <fsateler@debian.org>2016-01-15 01:47:00 (GMT)
commit5c5026e572e36358b170d15a9451e6a471d710b6 (patch)
treed63b1fee97feddbb4e33cf47257a931557c262d6 /configure.ac
parent2b3c9602e710a92f5ab2c6f0a6143fc382aca724 (diff)
downloadpatchelf-5c5026e572e36358b170d15a9451e6a471d710b6.zip
patchelf-5c5026e572e36358b170d15a9451e6a471d710b6.tar.gz
patchelf-5c5026e572e36358b170d15a9451e6a471d710b6.tar.bz2
Allow specifying page size at configure time
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac18
1 files changed, 18 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 44783c4..29445b1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -6,5 +6,23 @@ AM_INIT_AUTOMAKE([-Wall -Werror dist-bzip2 foreign color-tests parallel-tests])
AM_PROG_CC_C_O
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
+ ])
+)
+
+AC_DEFINE_UNQUOTED(PAGESIZE, ${PAGESIZE})
+AC_MSG_RESULT([Setting page size to ${PAGESIZE}])
+
AC_CONFIG_FILES([Makefile src/Makefile tests/Makefile patchelf.spec])
AC_OUTPUT