aboutsummaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
authorJay Berkenbilt <ejb@ql.org>2019-06-21 13:01:33 +0200
committerJay Berkenbilt <ejb@ql.org>2019-06-21 19:17:21 +0200
commit2155815234808373a00fcba67a59e40f40c564ee (patch)
tree5ceec67828918c0b94853b070fd37e791f25540c /configure.ac
parentf562d494b09dd889ac7600cfd22e4d7124e8656c (diff)
downloadqpdf-2155815234808373a00fcba67a59e40f40c564ee.tar.zst
configure: determine wordsize automatically
Based on sizeof(size_t). Assumes 64 if not 32.
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac22
1 files changed, 9 insertions, 13 deletions
diff --git a/configure.ac b/configure.ac
index 13db7395..9dba223f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -123,20 +123,16 @@ else
AC_MSG_RESULT(yes)
fi
-WINDOWS_WORDSIZE=
-AC_SUBST(WINDOWS_WORDSIZE)
-AC_ARG_WITH(windows-wordsize,
- AS_HELP_STRING([--with-windows-wordsize={32,64}],
- [Windows only: whether this is a 32-bit or 64-bit build; required if external-libs are enabled]),
- [WINDOWS_WORDSIZE=$withval],
- [WINDOWS_WORDSIZE=none])
-if test "$USE_EXTERNAL_LIBS" = "1"; then
- AC_MSG_CHECKING(for windows wordsize)
- AC_MSG_RESULT($WINDOWS_WORDSIZE)
- if ! test "$WINDOWS_WORDSIZE" = "32" -o "$WINDOWS_WORDSIZE" = "64"; then
- AC_MSG_ERROR(Windows wordsize of 32 or 64 must be specified if external libs are being used.)
- fi
+AC_CHECK_SIZEOF([size_t])
+if test "$ac_cv_sizeof_size_t" = "4"; then
+ IS_32BIT=1
+ WINDOWS_WORDSIZE=32
+else
+ IS_32BIT=0
+ WINDOWS_WORDSIZE=64
fi
+AC_SUBST(IS_32BIT)
+AC_SUBST(WINDOWS_WORDSIZE)
if test "$BUILD_INTERNAL_LIBS" = "0"; then
AC_CHECK_HEADER(zlib.h,,[MISSING_ZLIB_H=1; MISSING_ANY=1])