summaryrefslogtreecommitdiffstats
path: root/unix/configure.in
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2002-05-29 10:35:34 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2002-05-29 10:35:34 (GMT)
commit52319201a0f33f5984298267ba05ede5689eb818 (patch)
tree69690c28d7ea044538f1557ec58740707718d328 /unix/configure.in
parent3a1941e7d007e93449aa22085687a8fafaddad7e (diff)
downloadtcl-52319201a0f33f5984298267ba05ede5689eb818.zip
tcl-52319201a0f33f5984298267ba05ede5689eb818.tar.gz
tcl-52319201a0f33f5984298267ba05ede5689eb818.tar.bz2
Made Tcl_UniCharNcmp faster on big-endian machines; the system memcmp()is
probably optimized far in excess of anything we could do! Little-endian just use the old code...
Diffstat (limited to 'unix/configure.in')
-rw-r--r--unix/configure.in21
1 files changed, 20 insertions, 1 deletions
diff --git a/unix/configure.in b/unix/configure.in
index 9dcc86f..ce4d7d9 100644
--- a/unix/configure.in
+++ b/unix/configure.in
@@ -3,7 +3,7 @@ dnl This file is an input file used by the GNU "autoconf" program to
dnl generate the file "configure", which is run during Tcl installation
dnl to configure the system for the local environment.
#
-# RCS: @(#) $Id: configure.in,v 1.84 2002/05/21 18:17:55 mdejong Exp $
+# RCS: @(#) $Id: configure.in,v 1.85 2002/05/29 10:35:46 dkf Exp $
AC_INIT(../generic/tcl.h)
@@ -401,6 +401,25 @@ TCL_DBGX=${DBGX}
SC_BLOCKING_STYLE
#--------------------------------------------------------------------
+# The statements below check whether we can optimise comparisons
+# of Tcl_UniChar strings to memcmp; this only holds true on
+# big-endian systems, but we fall-back to not doing it when
+# cross-compiling because that is at least safe (if probably
+# slower when the guess is wrong.)
+#--------------------------------------------------------------------
+
+AC_MSG_CHECKING([for Unicode optimization opportunity])
+AC_CACHE_VAL(tcl_cv_flag_optimize_unicode,[
+ AC_TRY_RUN([#include <unistd.h>
+ int main() {union {char c[2];short s;} u; u.s=1; exit(u.c[0]);}
+ ], tcl_cv_flag_optimize_unicode=yes, tcl_cv_flag_optimize_unicode=no,
+ tcl_cv_flag_optimize_unicode=no)])
+AC_MSG_RESULT($tcl_cv_flag_optimize_unicode)
+if test "x$tcl_cv_flag_optimize_unicode" = "xyes"; then
+ AC_DEFINE(TCL_OPTIMIZE_UNICODE_COMPARE)
+fi
+
+#--------------------------------------------------------------------
# The statements below define a collection of symbols related to
# building libtcl as a shared library instead of a static library.
#--------------------------------------------------------------------