summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2016-02-25 23:36:50 -0800
committerAlan Coopersmith <alan.coopersmith@oracle.com>2016-03-03 18:24:12 -0800
commit490a25e6f8a4d2482af4364c700b68ad11a4d10b (patch)
tree87cb9f917700aa3dbcc57bfcce012473257b1491 /configure.ac
parent54ba591149f3a92c5a4a66e428ae2a33d1027053 (diff)
downloadxorg-lib-libXext-490a25e6f8a4d2482af4364c700b68ad11a4d10b.tar.gz
Use __builtin_popcountl if available to replace Ones() in XSecurity.c
If the compiler knows of a better algorithm for counting the number of bits set in a word for the target CPU, let it use that, instead of the classic algorithm optimized for PDP-6. Tested for the range of values used in XSecurity.c and verified results are the same from both: for (unsigned long i = 0; i <= XSecurityAllAuthorizationAttributes; i++) { printf("ones: %d\tpopcnt: %d\n", Ones(i), __builtin_popcountl(i)); } Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac3
1 files changed, 3 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 8efdd1f..5c241f5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -5,6 +5,7 @@ AC_INIT([libXext], [1.3.3],
[https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], [libXext])
AC_CONFIG_SRCDIR([Makefile.am])
AC_CONFIG_HEADERS([config.h])
+AC_CONFIG_MACRO_DIR([m4])
# Initialize Automake
AM_INIT_AUTOMAKE([foreign dist-bzip2])
@@ -38,6 +39,8 @@ AC_SUBST(XEXT_SOREV)
# Obtain compiler/linker options for depedencies
PKG_CHECK_MODULES(XEXT, [xproto >= 7.0.13] [x11 >= 1.6] [xextproto >= 7.1.99])
+AX_GCC_BUILTIN([__builtin_popcountl])
+
# Allow checking code with lint, sparse, etc.
XORG_WITH_LINT
XORG_LINT_LIBRARY([Xext])