summaryrefslogtreecommitdiff
path: root/configure.in
diff options
context:
space:
mode:
authorMarc Alff <marc.alff@sun.com>2009-11-24 16:36:31 -0700
committerMarc Alff <marc.alff@sun.com>2009-11-24 16:36:31 -0700
commit6e01be7552aa5c5fb854d30d5d8cb61c2729b292 (patch)
tree06a753b068f7fb21faaa840cf0808981acaaabb2 /configure.in
parentbd6467805a4d232718589f8ba0f2b84493843aba (diff)
downloadmariadb-git-6e01be7552aa5c5fb854d30d5d8cb61c2729b292.tar.gz
WL#2373 Use cycle counter for timing
Diffstat (limited to 'configure.in')
-rw-r--r--configure.in62
1 files changed, 62 insertions, 0 deletions
diff --git a/configure.in b/configure.in
index db86eeaa779..b3dc1314f00 100644
--- a/configure.in
+++ b/configure.in
@@ -1,6 +1,21 @@
dnl -*- ksh -*-
dnl Process this file with autoconf to produce a configure script.
+# Copyright (C) 2008-2009 Sun Microsystems, Inc
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
AC_PREREQ(2.52)dnl Minimum Autoconf version required.
AC_INIT(sql/mysqld.cc)
@@ -2916,7 +2931,54 @@ case $SYSTEM_TYPE in
esac
AC_SUBST(MAKE_BINARY_DISTRIBUTION_OPTIONS)
+#--------------------------------------------------------------------
+# Support for WL#2373 (Use cycle counter for timing)
+#--------------------------------------------------------------------
+
+AC_CHECK_HEADERS(time.h)
+AC_CHECK_HEADERS(sys/time.h)
+AC_CHECK_HEADERS(sys/times.h)
+AC_CHECK_HEADERS(asm/msr.h)
+#msr.h has rdtscll()
+
+AC_CHECK_HEADERS(ia64intrin.h)
+
+AC_CHECK_FUNCS(times)
+AC_CHECK_FUNCS(gettimeofday)
+AC_CHECK_FUNCS(read_real_time)
+# This should work on AIX.
+
+AC_CHECK_FUNCS(ftime)
+# This is still a normal call for milliseconds.
+
+AC_CHECK_FUNCS(time)
+# We can use time() on Macintosh if there is no ftime().
+
+AC_CHECK_FUNCS(rdtscll)
+# I doubt that we'll ever reach the check for this.
+
+# When compiling with Sun Studio C / C++ we need to include
+# my_timer_cycles.il, an "inline templates" separate file,
+# on the command line. It has assembly code, "rd %tick" for
+# SPARC or "rdtsc" for x86.
+RDTSC_SPARC_ASSEMBLY=""
+case $CC_VERSION in
+ *Sun*C*)
+ RDTSC_SPARC_ASSEMBLY="my_timer_cycles.il"
+ ;;
+esac
+case $CXX_VERSION in
+ *Sun*C++*)
+ RDTSC_SPARC_ASSEMBLY="my_timer_cycles.il"
+ ;;
+esac
+
+AC_SUBST([RDTSC_SPARC_ASSEMBLY])
+
+#--------------------------------------------------------------------
# Output results
+#--------------------------------------------------------------------
+
if test -d "$srcdir/pstack" ; then
AC_CONFIG_FILES(pstack/Makefile pstack/aout/Makefile)
fi