summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2023-03-03 14:55:19 -0800
committerAlan Coopersmith <alan.coopersmith@oracle.com>2023-03-07 00:06:24 +0000
commit4ece1c842a08c11c1f84b95355801d41cd8435b1 (patch)
treed6f8fb17a745b9635a837c78046ac325b0505413 /configure.ac
parent392eb1cd5f2bdb186f0ff7f51abc4dd05ec13709 (diff)
Add XtReallocArray() for overflow checking of multiplied args
Uses reallocarray() if available, otherwise checks for overflow itself, if overflow is possible (i.e. in ILP32 & ILP64 environments, but not LP64 with 32-bit ints). Includes unit tests and XtMallocArray() helper macro. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac10
1 files changed, 9 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac
index e0dbaa4..1da5532 100644
--- a/configure.ac
+++ b/configure.ac
@@ -22,13 +22,18 @@
#
# Initialize Autoconf
-AC_PREREQ([2.60])
+AC_PREREQ([2.70])
AC_INIT([libXt], [1.2.1],
[https://gitlab.freedesktop.org/xorg/lib/libXt/issues], [libXt])
AC_CONFIG_SRCDIR([Makefile.am])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_MACRO_DIR([m4])
+# Set common system defines for POSIX extensions, such as _GNU_SOURCE
+# Must be called before any macros that run the compiler (like AC_PROG_LIBTOOL)
+# to avoid autoconf errors.
+AC_USE_SYSTEM_EXTENSIONS
+
# Initialize Automake
AM_INIT_AUTOMAKE([foreign dist-xz])
@@ -53,6 +58,9 @@ XORG_WITH_PERL
# Checks for header files.
AC_CHECK_HEADER([alloca.h], AC_DEFINE(INCLUDE_ALLOCA_H, 1, [Define to 1 if Xalloca.h should include <alloca.h>]))
+# Checks for library functions.
+AC_CHECK_FUNCS([reallocarray])
+
# Obtain compiler/linker options for dependencies
PKG_CHECK_MODULES(XT, sm ice x11 xproto kbproto)