blob: 26ccfecc7a42a7477e2d6f6513c38a22dab96c76 [file] [log] [blame]
sewardj01262142006-01-04 01:20:28 +00001
2##------------------------------------------------------------##
3#
4# The multiple-architecture stuff in this file is pretty
5# cryptic. Read docs/internals/multiple-architectures.txt
6# for at least a partial explanation of what is going on.
7#
8##------------------------------------------------------------##
9
sewardjde4a1d02002-03-22 01:27:54 +000010# Process this file with autoconf to produce a configure script.
bart417cf3e2011-10-22 09:21:24 +000011AC_INIT([Valgrind],[3.7.0.SVN],[valgrind-users@lists.sourceforge.net])
njn04e16982005-05-31 00:23:43 +000012AC_CONFIG_SRCDIR(coregrind/m_main.c)
bart417cf3e2011-10-22 09:21:24 +000013AC_CONFIG_HEADERS([config.h])
bart3a2dac02008-03-18 17:40:38 +000014AM_INIT_AUTOMAKE([foreign])
sewardjde4a1d02002-03-22 01:27:54 +000015
gobryb0ed4672002-03-27 20:58:58 +000016AM_MAINTAINER_MODE
17
njn7fd6d382009-01-22 21:56:32 +000018#----------------------------------------------------------------------------
njn7fd6d382009-01-22 21:56:32 +000019# Checks for various programs.
20#----------------------------------------------------------------------------
bartaca399a2010-08-15 18:54:15 +000021CFLAGS="-Wno-long-long $CFLAGS"
gobrye721a522002-03-22 13:38:30 +000022
sewardjde4a1d02002-03-22 01:27:54 +000023AC_PROG_LN_S
24AC_PROG_CC
bart0affa492008-03-18 17:53:09 +000025AM_PROG_CC_C_O
sewardjde4a1d02002-03-22 01:27:54 +000026AC_PROG_CPP
njn25e49d8e72002-09-23 09:36:25 +000027AC_PROG_CXX
njn629a5ec2009-07-14 01:29:39 +000028# AC_PROG_OBJC apparently causes problems on older Linux distros (eg. with
29# autoconf 2.59). If we ever have any Objective-C code in the Valgrind code
30# base (eg. most likely as Darwin-specific tests) we'll need one of the
31# following:
njn0cd26892009-07-12 23:07:13 +000032# - put AC_PROG_OBJC in a Darwin-specific part of this file
33# - Use AC_PROG_OBJC here and up the minimum autoconf version
34# - Use the following, which is apparently equivalent:
35# m4_ifdef([AC_PROG_OBJC],
36# [AC_PROG_OBJC],
37# [AC_CHECK_TOOL([OBJC], [gcc])
38# AC_SUBST([OBJC])
39# AC_SUBST([OBJCFLAGS])
40# ])
sewardjde4a1d02002-03-22 01:27:54 +000041AC_PROG_RANLIB
bart07de2c92010-05-29 06:44:28 +000042# provide a very basic definition for AC_PROG_SED if it's not provided by
43# autoconf (as e.g. in autoconf 2.59).
44m4_ifndef([AC_PROG_SED],
45 [AC_DEFUN([AC_PROG_SED],
46 [AC_ARG_VAR([SED])
47 AC_CHECK_PROGS([SED],[gsed sed])])])
bart12e91122010-05-15 08:37:24 +000048AC_PROG_SED
sewardjde4a1d02002-03-22 01:27:54 +000049
bartcddeaf52008-05-25 15:58:11 +000050# If no AR variable was specified, look up the name of the archiver. Otherwise
51# do not touch the AR variable.
52if test "x$AR" = "x"; then
bart07de2c92010-05-29 06:44:28 +000053 AC_PATH_PROGS([AR], [`echo $LD | $SED 's/ld$/ar/'` "ar"], [ar])
bartcddeaf52008-05-25 15:58:11 +000054fi
55AC_ARG_VAR([AR],[Archiver command])
56
gobrye721a522002-03-22 13:38:30 +000057# Check for the compiler support
58if test "${GCC}" != "yes" ; then
59 AC_MSG_ERROR([Valgrind relies on GCC to be compiled])
60fi
61
sewardj2f685952002-12-22 19:32:23 +000062# figure out where perl lives
63AC_PATH_PROG(PERL, perl)
64
njn9315df32003-04-16 20:50:50 +000065# figure out where gdb lives
sewardjf8722ca2008-11-17 00:20:45 +000066AC_PATH_PROG(GDB, gdb, "/no/gdb/was/found/at/configure/time")
njnfe408942004-11-23 17:52:24 +000067AC_DEFINE_UNQUOTED(GDB_PATH, "$GDB", [path to GDB])
njn9315df32003-04-16 20:50:50 +000068
daywalker48ccca52002-04-15 00:31:58 +000069# some older automake's don't have it so try something on our own
70ifdef([AM_PROG_AS],[AM_PROG_AS],
71[
gobry1be19852002-03-26 20:44:55 +000072AS="${CC}"
73AC_SUBST(AS)
gobry3b777892002-04-04 09:18:39 +000074
gobry1be19852002-03-26 20:44:55 +000075ASFLAGS=""
76AC_SUBST(ASFLAGS)
daywalker48ccca52002-04-15 00:31:58 +000077])
gobry3b777892002-04-04 09:18:39 +000078
gobry3b777892002-04-04 09:18:39 +000079
njn0d2e58f2009-02-25 04:57:56 +000080# Check if 'diff' supports -u (universal diffs) and use it if possible.
81
82AC_MSG_CHECKING([for diff -u])
83AC_SUBST(DIFF)
84
sewardj6e9de462011-06-28 07:25:29 +000085# Comparing two identical files results in 0.
njn31f665e2009-02-26 21:25:50 +000086tmpfile="tmp-xxx-yyy-zzz"
87touch $tmpfile;
88if diff -u $tmpfile $tmpfile ; then
njn0d2e58f2009-02-25 04:57:56 +000089 AC_MSG_RESULT([yes])
90 DIFF="diff -u"
91else
92 AC_MSG_RESULT([no])
93 DIFF="diff"
94fi
njn31f665e2009-02-26 21:25:50 +000095rm $tmpfile
njn0d2e58f2009-02-25 04:57:56 +000096
97
sewardj535c50f2005-06-04 23:14:53 +000098# We don't want gcc < 3.0
gobrye721a522002-03-22 13:38:30 +000099AC_MSG_CHECKING([for a supported version of gcc])
100
sewardja8ca2c52011-09-29 18:18:37 +0000101# Try to get the gcc version, sed-ing out some unexpected stuff
102# that appears with the default gcc on OSX 10.6 and 10.7 respectively.
103# Without this, the version number comes out as 686, 10 or 11 :-(
104#
105# i686-apple-darwin10-gcc-4.2.1 (GCC) 4.2.1 (Apple Inc. build 5666) (dot 3)
106# i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)
107#
108[gcc_version=`${CC} --version \
109 | head -n 1 \
110 | $SED 's/i686-apple-darwin10//' \
111 | $SED 's/i686-apple-darwin11//' \
112 | $SED 's/^[^0-9]*\([0-9.]*\).*$/\1/'`]
gobrye721a522002-03-22 13:38:30 +0000113
sewardj3ab7b662011-09-29 17:30:13 +0000114is_clang="notclang"
115if test "x`${CC} --version | head -n 1 | $SED 's/\(clang\) version.*/\1/'`" = "xclang" ; then
116 is_clang="clang"
117fi
118
119case "${is_clang}-${gcc_version}" in
120 notclang-3.*)
121 AC_MSG_RESULT([ok (${gcc_version})])
122 ;;
123 notclang-4.*)
124 AC_MSG_RESULT([ok (${gcc_version})])
125 ;;
126 clang-2.9)
127 AC_MSG_RESULT([ok (clang-${gcc_version})])
sewardj535c50f2005-06-04 23:14:53 +0000128 ;;
gobrye721a522002-03-22 13:38:30 +0000129 *)
sewardj3ab7b662011-09-29 17:30:13 +0000130 AC_MSG_RESULT([no (${gcc_version})])
131 AC_MSG_ERROR([please use gcc >= 3.0 or clang >= 2.9])
gobrye721a522002-03-22 13:38:30 +0000132 ;;
133esac
134
njn7fd6d382009-01-22 21:56:32 +0000135#----------------------------------------------------------------------------
136# Arch/OS/platform tests.
137#----------------------------------------------------------------------------
138# We create a number of arch/OS/platform-related variables. We prefix them
139# all with "VGCONF_" which indicates that they are defined at
140# configure-time, and distinguishes them from the VGA_*/VGO_*/VGP_*
141# variables used when compiling C files.
sewardj03d86f22006-10-17 00:57:24 +0000142
sewardjde4a1d02002-03-22 01:27:54 +0000143AC_CANONICAL_HOST
144
145AC_MSG_CHECKING([for a supported CPU])
sewardjbc692db2006-01-04 03:31:07 +0000146
njn7fd6d382009-01-22 21:56:32 +0000147# ARCH_MAX reflects the most that this CPU can do: for example if it
148# is a 64-bit capable PowerPC, then it must be set to ppc64 and not ppc32.
149# Ditto for amd64. It is used for more configuration below, but is not used
150# outside this file.
gobrye721a522002-03-22 13:38:30 +0000151case "${host_cpu}" in
sewardjde4a1d02002-03-22 01:27:54 +0000152 i?86)
153 AC_MSG_RESULT([ok (${host_cpu})])
njn7fd6d382009-01-22 21:56:32 +0000154 ARCH_MAX="x86"
sewardjde4a1d02002-03-22 01:27:54 +0000155 ;;
156
njnfe408942004-11-23 17:52:24 +0000157 x86_64)
158 AC_MSG_RESULT([ok (${host_cpu})])
njn7fd6d382009-01-22 21:56:32 +0000159 ARCH_MAX="amd64"
njnfe408942004-11-23 17:52:24 +0000160 ;;
161
sewardj2c48c7b2005-11-29 13:05:56 +0000162 powerpc64)
163 AC_MSG_RESULT([ok (${host_cpu})])
njn7fd6d382009-01-22 21:56:32 +0000164 ARCH_MAX="ppc64"
sewardj2c48c7b2005-11-29 13:05:56 +0000165 ;;
166
167 powerpc)
sewardj6e9de462011-06-28 07:25:29 +0000168 # On Linux this means only a 32-bit capable CPU.
cerion85665ca2005-06-20 15:51:07 +0000169 AC_MSG_RESULT([ok (${host_cpu})])
sewardj6e9de462011-06-28 07:25:29 +0000170 ARCH_MAX="ppc32"
nethercote9bcc9062004-10-13 13:50:01 +0000171 ;;
172
sewardjb5b87402011-03-07 16:05:35 +0000173 s390x)
174 AC_MSG_RESULT([ok (${host_cpu})])
175 ARCH_MAX="s390x"
176 ;;
177
sewardj59570ff2010-01-01 11:59:33 +0000178 armv7*)
179 AC_MSG_RESULT([ok (${host_cpu})])
180 ARCH_MAX="arm"
181 ;;
182
sewardjde4a1d02002-03-22 01:27:54 +0000183 *)
184 AC_MSG_RESULT([no (${host_cpu})])
nethercote81d5c662004-10-13 13:18:51 +0000185 AC_MSG_ERROR([Unsupported host architecture. Sorry])
sewardjde4a1d02002-03-22 01:27:54 +0000186 ;;
187esac
188
njn7fd6d382009-01-22 21:56:32 +0000189#----------------------------------------------------------------------------
190
sewardj86e992f2006-01-28 18:39:09 +0000191# Sometimes it's convenient to subvert the bi-arch build system and
192# just have a single build even though the underlying platform is
193# capable of both. Hence handle --enable-only64bit and
194# --enable-only32bit. Complain if both are issued :-)
njn7fd6d382009-01-22 21:56:32 +0000195# [Actually, if either of these options are used, I think both get built,
196# but only one gets installed. So if you use an in-place build, both can be
197# used. --njn]
sewardj86e992f2006-01-28 18:39:09 +0000198
199# Check if a 64-bit only build has been requested
200AC_CACHE_CHECK([for a 64-bit only build], vg_cv_only64bit,
201 [AC_ARG_ENABLE(only64bit,
202 [ --enable-only64bit do a 64-bit only build],
203 [vg_cv_only64bit=$enableval],
204 [vg_cv_only64bit=no])])
205
206# Check if a 32-bit only build has been requested
207AC_CACHE_CHECK([for a 32-bit only build], vg_cv_only32bit,
208 [AC_ARG_ENABLE(only32bit,
209 [ --enable-only32bit do a 32-bit only build],
210 [vg_cv_only32bit=$enableval],
211 [vg_cv_only32bit=no])])
212
213# Stay sane
214if test x$vg_cv_only64bit = xyes -a x$vg_cv_only32bit = xyes; then
215 AC_MSG_ERROR(
216 [Nonsensical: both --enable-only64bit and --enable-only32bit.])
217fi
218
njn7fd6d382009-01-22 21:56:32 +0000219#----------------------------------------------------------------------------
sewardj86e992f2006-01-28 18:39:09 +0000220
njn311303f2009-02-06 03:46:50 +0000221# VGCONF_OS is the primary build OS, eg. "linux". It is passed in to
222# compilation of many C files via -VGO_$(VGCONF_OS) and
223# -VGP_$(VGCONF_ARCH_PRI)_$(VGCONF_OS).
sewardjde4a1d02002-03-22 01:27:54 +0000224AC_MSG_CHECKING([for a supported OS])
njn7fd6d382009-01-22 21:56:32 +0000225AC_SUBST(VGCONF_OS)
sewardjde4a1d02002-03-22 01:27:54 +0000226
njnf76d27a2009-05-28 01:53:07 +0000227DEFAULT_SUPP=""
228
gobrye721a522002-03-22 13:38:30 +0000229case "${host_os}" in
mueller8c68e042004-01-03 15:21:14 +0000230 *linux*)
sewardjde4a1d02002-03-22 01:27:54 +0000231 AC_MSG_RESULT([ok (${host_os})])
njn7fd6d382009-01-22 21:56:32 +0000232 VGCONF_OS="linux"
mueller8c68e042004-01-03 15:21:14 +0000233
234 # Ok, this is linux. Check the kernel version
235 AC_MSG_CHECKING([for the kernel version])
236
237 kernel=`uname -r`
238
239 case "${kernel}" in
bart0419e512011-06-05 08:51:47 +0000240 2.6.*|3.*)
bart2d6e6e72011-06-05 10:01:48 +0000241 AC_MSG_RESULT([2.6.x/3.x family (${kernel})])
242 AC_DEFINE([KERNEL_2_6], 1, [Define to 1 if you're using Linux 2.6.x or Linux 3.x])
mueller8c68e042004-01-03 15:21:14 +0000243 ;;
244
245 2.4.*)
246 AC_MSG_RESULT([2.4 family (${kernel})])
247 AC_DEFINE([KERNEL_2_4], 1, [Define to 1 if you're using Linux 2.4.x])
248 ;;
249
mueller8c68e042004-01-03 15:21:14 +0000250 *)
251 AC_MSG_RESULT([unsupported (${kernel})])
nethercote4fa681f2004-11-08 17:51:39 +0000252 AC_MSG_ERROR([Valgrind works on kernels 2.4, 2.6])
mueller8c68e042004-01-03 15:21:14 +0000253 ;;
254 esac
255
256 ;;
257
njnf76d27a2009-05-28 01:53:07 +0000258 *darwin*)
259 AC_MSG_RESULT([ok (${host_os})])
260 VGCONF_OS="darwin"
njnea2d6fd2010-07-01 00:20:20 +0000261 AC_DEFINE([DARWIN_10_5], 100500, [DARWIN_VERS value for Mac OS X 10.5])
262 AC_DEFINE([DARWIN_10_6], 100600, [DARWIN_VERS value for Mac OS X 10.6])
263 AC_DEFINE([DARWIN_10_7], 100700, [DARWIN_VERS value for Mac OS X 10.7])
njnf76d27a2009-05-28 01:53:07 +0000264
265 AC_MSG_CHECKING([for the kernel version])
266 kernel=`uname -r`
267
268 # Nb: for Darwin we set DEFAULT_SUPP here. That's because Darwin
269 # has only one relevant version, the OS version. The `uname` check
270 # is a good way to get that version (i.e. "Darwin 9.6.0" is Mac OS
sewardj731f9cf2011-09-21 08:43:08 +0000271 # X 10.5.6, and "Darwin 10.x" is Mac OS X 10.6.x Snow Leopard,
272 # and possibly "Darwin 11.x" is Mac OS X 10.7.x Lion),
njnea2d6fd2010-07-01 00:20:20 +0000273 # and we don't know of an macros similar to __GLIBC__ to get that info.
njnf76d27a2009-05-28 01:53:07 +0000274 #
275 # XXX: `uname -r` won't do the right thing for cross-compiles, but
276 # that's not a problem yet.
sewardj731f9cf2011-09-21 08:43:08 +0000277 #
278 # jseward 21 Sept 2011: I seriously doubt whether V 3.7.0 will work
279 # on OS X 10.5.x; I haven't tested yet, and only plan to test 3.7.0
280 # on 10.6.8 and 10.7.1. Although tempted to delete the configure
281 # time support for 10.5 (the 9.* pattern just below), I'll leave it
282 # in for now, just in case anybody wants to give it a try. But I'm
283 # assuming that 3.7.0 is a Snow Leopard and Lion-only release.
njnf76d27a2009-05-28 01:53:07 +0000284 case "${kernel}" in
285 9.*)
286 AC_MSG_RESULT([Darwin 9.x (${kernel}) / Mac OS X 10.5 Leopard])
njnea2d6fd2010-07-01 00:20:20 +0000287 AC_DEFINE([DARWIN_VERS], DARWIN_10_5, [Darwin / Mac OS X version])
njnf76d27a2009-05-28 01:53:07 +0000288 DEFAULT_SUPP="darwin9.supp ${DEFAULT_SUPP}"
bart6ccda142009-07-23 07:37:32 +0000289 DEFAULT_SUPP="darwin9-drd.supp ${DEFAULT_SUPP}"
njnf76d27a2009-05-28 01:53:07 +0000290 ;;
njnea2d6fd2010-07-01 00:20:20 +0000291 10.*)
292 AC_MSG_RESULT([Darwin 10.x (${kernel}) / Mac OS X 10.6 Snow Leopard])
293 AC_DEFINE([DARWIN_VERS], DARWIN_10_6, [Darwin / Mac OS X version])
294 DEFAULT_SUPP="darwin10.supp ${DEFAULT_SUPP}"
295 DEFAULT_SUPP="darwin10-drd.supp ${DEFAULT_SUPP}"
296 ;;
sewardj731f9cf2011-09-21 08:43:08 +0000297 11.*)
298 AC_MSG_RESULT([Darwin 11.x (${kernel}) / Mac OS X 10.7 Lion])
299 AC_DEFINE([DARWIN_VERS], DARWIN_10_7, [Darwin / Mac OS X version])
300 # FIXME: change these to xx11.supp
301 DEFAULT_SUPP="darwin11.supp ${DEFAULT_SUPP}"
302 DEFAULT_SUPP="darwin10-drd.supp ${DEFAULT_SUPP}"
303 ;;
304 *)
njnf76d27a2009-05-28 01:53:07 +0000305 AC_MSG_RESULT([unsupported (${kernel})])
sewardj731f9cf2011-09-21 08:43:08 +0000306 AC_MSG_ERROR([Valgrind works on Darwin 10.x and 11.x (Mac OS X 10.6/7)])
njnf76d27a2009-05-28 01:53:07 +0000307 ;;
308 esac
309 ;;
310
sewardjde4a1d02002-03-22 01:27:54 +0000311 *)
312 AC_MSG_RESULT([no (${host_os})])
njncc58cea2010-07-05 07:21:22 +0000313 AC_MSG_ERROR([Valgrind is operating system specific. Sorry.])
sewardjde4a1d02002-03-22 01:27:54 +0000314 ;;
315esac
316
njn7fd6d382009-01-22 21:56:32 +0000317#----------------------------------------------------------------------------
318
tomd6398392006-06-07 17:44:36 +0000319# If we are building on a 64 bit platform test to see if the system
320# supports building 32 bit programs and disable 32 bit support if it
321# does not support building 32 bit programs
322
njn7fd6d382009-01-22 21:56:32 +0000323case "$ARCH_MAX-$VGCONF_OS" in
tomd6398392006-06-07 17:44:36 +0000324 amd64-linux|ppc64-linux)
325 AC_MSG_CHECKING([for 32 bit build support])
326 safe_CFLAGS=$CFLAGS
327 CFLAGS="-m32"
bart417cf3e2011-10-22 09:21:24 +0000328 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[
njn9890ee12009-01-21 22:25:50 +0000329 return 0;
bart417cf3e2011-10-22 09:21:24 +0000330 ]])], [
tomd6398392006-06-07 17:44:36 +0000331 AC_MSG_RESULT([yes])
332 ], [
333 vg_cv_only64bit="yes"
334 AC_MSG_RESULT([no])
335 ])
336 CFLAGS=$safe_CFLAGS;;
337esac
338
339if test x$vg_cv_only64bit = xyes -a x$vg_cv_only32bit = xyes; then
340 AC_MSG_ERROR(
341 [--enable-only32bit was specified but system does not support 32 bit builds])
342fi
nethercote888ecb72004-08-23 14:54:40 +0000343
njn7fd6d382009-01-22 21:56:32 +0000344#----------------------------------------------------------------------------
345
njn311303f2009-02-06 03:46:50 +0000346# VGCONF_ARCH_PRI is the arch for the primary build target, eg. "amd64". By
347# default it's the same as ARCH_MAX. But if, say, we do a build on an amd64
348# machine, but --enable-only32bit has been requested, then ARCH_MAX (see
349# above) will be "amd64" since that reflects the most that this cpu can do,
350# but VGCONF_ARCH_PRI will be downgraded to "x86", since that reflects the
351# arch corresponding to the primary build (VGCONF_PLATFORM_PRI_CAPS). It is
njn7fd6d382009-01-22 21:56:32 +0000352# passed in to compilation of many C files via -VGA_$(VGCONF_ARCH_PRI) and
353# -VGP_$(VGCONF_ARCH_PRI)_$(VGCONF_OS).
354AC_SUBST(VGCONF_ARCH_PRI)
355
njn3f8a6e92009-06-02 00:20:47 +0000356# VGCONF_ARCH_SEC is the arch for the secondary build target, eg. "x86".
357# It is passed in to compilation of many C files via -VGA_$(VGCONF_ARCH_SEC)
358# and -VGP_$(VGCONF_ARCH_SEC)_$(VGCONF_OS), if there is a secondary target.
359# It is empty if there is no secondary target.
360AC_SUBST(VGCONF_ARCH_SEC)
361
njn311303f2009-02-06 03:46:50 +0000362# VGCONF_PLATFORM_PRI_CAPS is the primary build target, eg. "AMD64_LINUX".
363# The entire system, including regression and performance tests, will be
364# built for this target. The "_CAPS" indicates that the name is in capital
365# letters, and it also uses '_' rather than '-' as a separator, because it's
njn7fd6d382009-01-22 21:56:32 +0000366# used to create various Makefile variables, which are all in caps by
njn311303f2009-02-06 03:46:50 +0000367# convention and cannot contain '-' characters. This is in contrast to
368# VGCONF_ARCH_PRI and VGCONF_OS which are not in caps.
njn7fd6d382009-01-22 21:56:32 +0000369AC_SUBST(VGCONF_PLATFORM_PRI_CAPS)
370
371# VGCONF_PLATFORM_SEC_CAPS is the secondary build target, if there is one.
372# Valgrind and tools will also be built for this target, but not the
373# regression or performance tests.
sewardj01262142006-01-04 01:20:28 +0000374#
njn7fd6d382009-01-22 21:56:32 +0000375# By default, the primary arch is the same as the "max" arch, as commented
376# above (at the definition of ARCH_MAX). We may choose to downgrade it in
377# the big case statement just below here, in the case where we're building
378# on a 64 bit machine but have been requested only to do a 32 bit build.
379AC_SUBST(VGCONF_PLATFORM_SEC_CAPS)
380
sewardj01262142006-01-04 01:20:28 +0000381AC_MSG_CHECKING([for a supported CPU/OS combination])
nethercote888ecb72004-08-23 14:54:40 +0000382
njnea2d6fd2010-07-01 00:20:20 +0000383# NB. The load address for a given platform may be specified in more
384# than one place, in some cases, depending on whether we're doing a biarch,
385# 32-bit only or 64-bit only build. eg see case for amd64-linux below.
386# Be careful to give consistent values in all subcases. Also, all four
387# valt_load_addres_{pri,sec}_{norml,inner} values must always be set,
388# even if it is to "0xUNSET".
389#
njn7fd6d382009-01-22 21:56:32 +0000390case "$ARCH_MAX-$VGCONF_OS" in
sewardj01262142006-01-04 01:20:28 +0000391 x86-linux)
njn7fd6d382009-01-22 21:56:32 +0000392 VGCONF_ARCH_PRI="x86"
njn3f8a6e92009-06-02 00:20:47 +0000393 VGCONF_ARCH_SEC=""
njn7fd6d382009-01-22 21:56:32 +0000394 VGCONF_PLATFORM_PRI_CAPS="X86_LINUX"
395 VGCONF_PLATFORM_SEC_CAPS=""
njnea2d6fd2010-07-01 00:20:20 +0000396 valt_load_address_pri_norml="0x38000000"
397 valt_load_address_pri_inner="0x28000000"
398 valt_load_address_sec_norml="0xUNSET"
399 valt_load_address_sec_inner="0xUNSET"
njn377c43f2009-05-19 07:39:22 +0000400 AC_MSG_RESULT([ok (${ARCH_MAX}-${VGCONF_OS})])
sewardj01262142006-01-04 01:20:28 +0000401 ;;
402 amd64-linux)
njnea2d6fd2010-07-01 00:20:20 +0000403 valt_load_address_sec_norml="0xUNSET"
404 valt_load_address_sec_inner="0xUNSET"
sewardj86e992f2006-01-28 18:39:09 +0000405 if test x$vg_cv_only64bit = xyes; then
njn7fd6d382009-01-22 21:56:32 +0000406 VGCONF_ARCH_PRI="amd64"
njn3f8a6e92009-06-02 00:20:47 +0000407 VGCONF_ARCH_SEC=""
njn7fd6d382009-01-22 21:56:32 +0000408 VGCONF_PLATFORM_PRI_CAPS="AMD64_LINUX"
409 VGCONF_PLATFORM_SEC_CAPS=""
njnea2d6fd2010-07-01 00:20:20 +0000410 valt_load_address_pri_norml="0x38000000"
411 valt_load_address_pri_inner="0x28000000"
sewardj86e992f2006-01-28 18:39:09 +0000412 elif test x$vg_cv_only32bit = xyes; then
njn7fd6d382009-01-22 21:56:32 +0000413 VGCONF_ARCH_PRI="x86"
njn3f8a6e92009-06-02 00:20:47 +0000414 VGCONF_ARCH_SEC=""
njn7fd6d382009-01-22 21:56:32 +0000415 VGCONF_PLATFORM_PRI_CAPS="X86_LINUX"
416 VGCONF_PLATFORM_SEC_CAPS=""
njnea2d6fd2010-07-01 00:20:20 +0000417 valt_load_address_pri_norml="0x38000000"
418 valt_load_address_pri_inner="0x28000000"
sewardj86e992f2006-01-28 18:39:09 +0000419 else
njn7fd6d382009-01-22 21:56:32 +0000420 VGCONF_ARCH_PRI="amd64"
njn3f8a6e92009-06-02 00:20:47 +0000421 VGCONF_ARCH_SEC="x86"
njn7fd6d382009-01-22 21:56:32 +0000422 VGCONF_PLATFORM_PRI_CAPS="AMD64_LINUX"
423 VGCONF_PLATFORM_SEC_CAPS="X86_LINUX"
njnea2d6fd2010-07-01 00:20:20 +0000424 valt_load_address_pri_norml="0x38000000"
425 valt_load_address_pri_inner="0x28000000"
426 valt_load_address_sec_norml="0x38000000"
427 valt_load_address_sec_inner="0x28000000"
sewardj86e992f2006-01-28 18:39:09 +0000428 fi
njn377c43f2009-05-19 07:39:22 +0000429 AC_MSG_RESULT([ok (${ARCH_MAX}-${VGCONF_OS})])
sewardj01262142006-01-04 01:20:28 +0000430 ;;
431 ppc32-linux)
njn7fd6d382009-01-22 21:56:32 +0000432 VGCONF_ARCH_PRI="ppc32"
njn3f8a6e92009-06-02 00:20:47 +0000433 VGCONF_ARCH_SEC=""
njn7fd6d382009-01-22 21:56:32 +0000434 VGCONF_PLATFORM_PRI_CAPS="PPC32_LINUX"
435 VGCONF_PLATFORM_SEC_CAPS=""
njnea2d6fd2010-07-01 00:20:20 +0000436 valt_load_address_pri_norml="0x38000000"
437 valt_load_address_pri_inner="0x28000000"
438 valt_load_address_sec_norml="0xUNSET"
439 valt_load_address_sec_inner="0xUNSET"
njn377c43f2009-05-19 07:39:22 +0000440 AC_MSG_RESULT([ok (${ARCH_MAX}-${VGCONF_OS})])
sewardj01262142006-01-04 01:20:28 +0000441 ;;
442 ppc64-linux)
njnea2d6fd2010-07-01 00:20:20 +0000443 valt_load_address_sec_norml="0xUNSET"
444 valt_load_address_sec_inner="0xUNSET"
sewardj86e992f2006-01-28 18:39:09 +0000445 if test x$vg_cv_only64bit = xyes; then
njn7fd6d382009-01-22 21:56:32 +0000446 VGCONF_ARCH_PRI="ppc64"
njn3f8a6e92009-06-02 00:20:47 +0000447 VGCONF_ARCH_SEC=""
njn7fd6d382009-01-22 21:56:32 +0000448 VGCONF_PLATFORM_PRI_CAPS="PPC64_LINUX"
449 VGCONF_PLATFORM_SEC_CAPS=""
njnea2d6fd2010-07-01 00:20:20 +0000450 valt_load_address_pri_norml="0x38000000"
451 valt_load_address_pri_inner="0x28000000"
sewardj86e992f2006-01-28 18:39:09 +0000452 elif test x$vg_cv_only32bit = xyes; then
njn7fd6d382009-01-22 21:56:32 +0000453 VGCONF_ARCH_PRI="ppc32"
njn3f8a6e92009-06-02 00:20:47 +0000454 VGCONF_ARCH_SEC=""
njn7fd6d382009-01-22 21:56:32 +0000455 VGCONF_PLATFORM_PRI_CAPS="PPC32_LINUX"
456 VGCONF_PLATFORM_SEC_CAPS=""
njnea2d6fd2010-07-01 00:20:20 +0000457 valt_load_address_pri_norml="0x38000000"
458 valt_load_address_pri_inner="0x28000000"
sewardj86e992f2006-01-28 18:39:09 +0000459 else
njn7fd6d382009-01-22 21:56:32 +0000460 VGCONF_ARCH_PRI="ppc64"
njn3f8a6e92009-06-02 00:20:47 +0000461 VGCONF_ARCH_SEC="ppc32"
njn7fd6d382009-01-22 21:56:32 +0000462 VGCONF_PLATFORM_PRI_CAPS="PPC64_LINUX"
463 VGCONF_PLATFORM_SEC_CAPS="PPC32_LINUX"
njnea2d6fd2010-07-01 00:20:20 +0000464 valt_load_address_pri_norml="0x38000000"
465 valt_load_address_pri_inner="0x28000000"
466 valt_load_address_sec_norml="0x38000000"
467 valt_load_address_sec_inner="0x28000000"
sewardj86e992f2006-01-28 18:39:09 +0000468 fi
njn377c43f2009-05-19 07:39:22 +0000469 AC_MSG_RESULT([ok (${ARCH_MAX}-${VGCONF_OS})])
sewardj01262142006-01-04 01:20:28 +0000470 ;;
njncc58cea2010-07-05 07:21:22 +0000471 # Darwin gets identified as 32-bit even when it supports 64-bit.
472 # (Not sure why, possibly because 'uname' returns "i386"?) Just about
473 # all Macs support both 32-bit and 64-bit, so we just build both. If
474 # someone has a really old 32-bit only machine they can (hopefully?)
475 # build with --enable-only32bit. See bug 243362.
476 x86-darwin|amd64-darwin)
477 ARCH_MAX="amd64"
njnea2d6fd2010-07-01 00:20:20 +0000478 valt_load_address_sec_norml="0xUNSET"
479 valt_load_address_sec_inner="0xUNSET"
njnf76d27a2009-05-28 01:53:07 +0000480 if test x$vg_cv_only64bit = xyes; then
481 VGCONF_ARCH_PRI="amd64"
njn3f8a6e92009-06-02 00:20:47 +0000482 VGCONF_ARCH_SEC=""
njnf76d27a2009-05-28 01:53:07 +0000483 VGCONF_PLATFORM_PRI_CAPS="AMD64_DARWIN"
484 VGCONF_PLATFORM_SEC_CAPS=""
njnea2d6fd2010-07-01 00:20:20 +0000485 valt_load_address_pri_norml="0x138000000"
486 valt_load_address_pri_inner="0x128000000"
njnf76d27a2009-05-28 01:53:07 +0000487 elif test x$vg_cv_only32bit = xyes; then
488 VGCONF_ARCH_PRI="x86"
njn3f8a6e92009-06-02 00:20:47 +0000489 VGCONF_ARCH_SEC=""
njnf76d27a2009-05-28 01:53:07 +0000490 VGCONF_PLATFORM_PRI_CAPS="X86_DARWIN"
491 VGCONF_PLATFORM_SEC_CAPS=""
492 VGCONF_ARCH_PRI_CAPS="x86"
njnea2d6fd2010-07-01 00:20:20 +0000493 valt_load_address_pri_norml="0x38000000"
494 valt_load_address_pri_inner="0x28000000"
njnf76d27a2009-05-28 01:53:07 +0000495 else
496 VGCONF_ARCH_PRI="amd64"
njn3f8a6e92009-06-02 00:20:47 +0000497 VGCONF_ARCH_SEC="x86"
njnf76d27a2009-05-28 01:53:07 +0000498 VGCONF_PLATFORM_PRI_CAPS="AMD64_DARWIN"
499 VGCONF_PLATFORM_SEC_CAPS="X86_DARWIN"
njnea2d6fd2010-07-01 00:20:20 +0000500 valt_load_address_pri_norml="0x138000000"
501 valt_load_address_pri_inner="0x128000000"
502 valt_load_address_sec_norml="0x38000000"
503 valt_load_address_sec_inner="0x28000000"
njnf76d27a2009-05-28 01:53:07 +0000504 fi
njnf76d27a2009-05-28 01:53:07 +0000505 AC_MSG_RESULT([ok (${ARCH_MAX}-${VGCONF_OS})])
506 ;;
sewardj59570ff2010-01-01 11:59:33 +0000507 arm-linux)
508 VGCONF_ARCH_PRI="arm"
509 VGCONF_PLATFORM_PRI_CAPS="ARM_LINUX"
510 VGCONF_PLATFORM_SEC_CAPS=""
njnea2d6fd2010-07-01 00:20:20 +0000511 valt_load_address_pri_norml="0x38000000"
512 valt_load_address_pri_inner="0x28000000"
513 valt_load_address_sec_norml="0xUNSET"
514 valt_load_address_sec_inner="0xUNSET"
sewardj59570ff2010-01-01 11:59:33 +0000515 AC_MSG_RESULT([ok (${host_cpu}-${host_os})])
516 ;;
sewardjb5b87402011-03-07 16:05:35 +0000517 s390x-linux)
518 VGCONF_ARCH_PRI="s390x"
519 VGCONF_ARCH_SEC=""
520 VGCONF_PLATFORM_PRI_CAPS="S390X_LINUX"
521 VGCONF_PLATFORM_SEC_CAPS=""
522 # we want to have the generated code close to the dispatcher
523 valt_load_address_pri_norml="0x401000000"
524 valt_load_address_pri_inner="0x410000000"
525 valt_load_address_sec_norml="0xUNSET"
526 valt_load_address_sec_inner="0xUNSET"
527 AC_MSG_RESULT([ok (${ARCH_MAX}-${VGCONF_OS})])
528 ;;
nethercote888ecb72004-08-23 14:54:40 +0000529 *)
njn7fd6d382009-01-22 21:56:32 +0000530 VGCONF_ARCH_PRI="unknown"
njn3f8a6e92009-06-02 00:20:47 +0000531 VGCONF_ARCH_SEC="unknown"
njn7fd6d382009-01-22 21:56:32 +0000532 VGCONF_PLATFORM_PRI_CAPS="UNKNOWN"
533 VGCONF_PLATFORM_SEC_CAPS="UNKNOWN"
njnea2d6fd2010-07-01 00:20:20 +0000534 valt_load_address_pri_norml="0xUNSET"
535 valt_load_address_pri_inner="0xUNSET"
536 valt_load_address_sec_norml="0xUNSET"
537 valt_load_address_sec_inner="0xUNSET"
njn377c43f2009-05-19 07:39:22 +0000538 AC_MSG_RESULT([no (${ARCH_MAX}-${VGCONF_OS})])
sewardj3e38ce02004-11-23 01:17:29 +0000539 AC_MSG_ERROR([Valgrind is platform specific. Sorry. Please consider doing a port.])
nethercote888ecb72004-08-23 14:54:40 +0000540 ;;
541esac
sewardjde4a1d02002-03-22 01:27:54 +0000542
njn7fd6d382009-01-22 21:56:32 +0000543#----------------------------------------------------------------------------
njna454ec02009-01-19 03:16:59 +0000544
njn7fd6d382009-01-22 21:56:32 +0000545# Set up VGCONF_ARCHS_INCLUDE_<arch>. Either one or two of these become
546# defined.
547AM_CONDITIONAL(VGCONF_ARCHS_INCLUDE_X86,
548 test x$VGCONF_PLATFORM_PRI_CAPS = xX86_LINUX \
njnf76d27a2009-05-28 01:53:07 +0000549 -o x$VGCONF_PLATFORM_SEC_CAPS = xX86_LINUX \
550 -o x$VGCONF_PLATFORM_PRI_CAPS = xX86_DARWIN \
551 -o x$VGCONF_PLATFORM_SEC_CAPS = xX86_DARWIN )
njn7fd6d382009-01-22 21:56:32 +0000552AM_CONDITIONAL(VGCONF_ARCHS_INCLUDE_AMD64,
njnf76d27a2009-05-28 01:53:07 +0000553 test x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_LINUX \
554 -o x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_DARWIN )
njn7fd6d382009-01-22 21:56:32 +0000555AM_CONDITIONAL(VGCONF_ARCHS_INCLUDE_PPC32,
556 test x$VGCONF_PLATFORM_PRI_CAPS = xPPC32_LINUX \
sewardj6e9de462011-06-28 07:25:29 +0000557 -o x$VGCONF_PLATFORM_SEC_CAPS = xPPC32_LINUX )
njn7fd6d382009-01-22 21:56:32 +0000558AM_CONDITIONAL(VGCONF_ARCHS_INCLUDE_PPC64,
sewardj6e9de462011-06-28 07:25:29 +0000559 test x$VGCONF_PLATFORM_PRI_CAPS = xPPC64_LINUX )
sewardj59570ff2010-01-01 11:59:33 +0000560AM_CONDITIONAL(VGCONF_ARCHS_INCLUDE_ARM,
561 test x$VGCONF_PLATFORM_PRI_CAPS = xARM_LINUX )
sewardjb5b87402011-03-07 16:05:35 +0000562AM_CONDITIONAL(VGCONF_ARCHS_INCLUDE_S390X,
563 test x$VGCONF_PLATFORM_PRI_CAPS = xS390X_LINUX )
sewardj03d86f22006-10-17 00:57:24 +0000564
njn7fd6d382009-01-22 21:56:32 +0000565# Set up VGCONF_PLATFORMS_INCLUDE_<platform>. Either one or two of these
566# become defined.
567AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_X86_LINUX,
568 test x$VGCONF_PLATFORM_PRI_CAPS = xX86_LINUX \
569 -o x$VGCONF_PLATFORM_SEC_CAPS = xX86_LINUX)
570AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_AMD64_LINUX,
571 test x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_LINUX)
572AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_PPC32_LINUX,
573 test x$VGCONF_PLATFORM_PRI_CAPS = xPPC32_LINUX \
574 -o x$VGCONF_PLATFORM_SEC_CAPS = xPPC32_LINUX)
575AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_PPC64_LINUX,
576 test x$VGCONF_PLATFORM_PRI_CAPS = xPPC64_LINUX)
sewardj59570ff2010-01-01 11:59:33 +0000577AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_ARM_LINUX,
578 test x$VGCONF_PLATFORM_PRI_CAPS = xARM_LINUX)
sewardjb5b87402011-03-07 16:05:35 +0000579AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_S390X_LINUX,
580 test x$VGCONF_PLATFORM_PRI_CAPS = xS390X_LINUX \
581 -o x$VGCONF_PLATFORM_SEC_CAPS = xS390X_LINUX)
njnf76d27a2009-05-28 01:53:07 +0000582
njnf76d27a2009-05-28 01:53:07 +0000583AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_X86_DARWIN,
584 test x$VGCONF_PLATFORM_PRI_CAPS = xX86_DARWIN \
585 -o x$VGCONF_PLATFORM_SEC_CAPS = xX86_DARWIN)
586AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_AMD64_DARWIN,
587 test x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_DARWIN)
588
589
sewardj72a2d802010-07-29 05:24:20 +0000590# Similarly, set up VGCONF_OS_IS_<os>. Exactly one of these becomes defined.
sewardj03d86f22006-10-17 00:57:24 +0000591# Relies on the assumption that the primary and secondary targets are
592# for the same OS, so therefore only necessary to test the primary.
njn7fd6d382009-01-22 21:56:32 +0000593AM_CONDITIONAL(VGCONF_OS_IS_LINUX,
594 test x$VGCONF_PLATFORM_PRI_CAPS = xX86_LINUX \
595 -o x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_LINUX \
596 -o x$VGCONF_PLATFORM_PRI_CAPS = xPPC32_LINUX \
sewardj59570ff2010-01-01 11:59:33 +0000597 -o x$VGCONF_PLATFORM_PRI_CAPS = xPPC64_LINUX \
sewardjb5b87402011-03-07 16:05:35 +0000598 -o x$VGCONF_PLATFORM_PRI_CAPS = xARM_LINUX \
599 -o x$VGCONF_PLATFORM_PRI_CAPS = xS390X_LINUX)
njnf76d27a2009-05-28 01:53:07 +0000600AM_CONDITIONAL(VGCONF_OS_IS_DARWIN,
601 test x$VGCONF_PLATFORM_PRI_CAPS = xX86_DARWIN \
602 -o x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_DARWIN)
sewardj03d86f22006-10-17 00:57:24 +0000603
604
njn7fd6d382009-01-22 21:56:32 +0000605# Sometimes, in the Makefile.am files, it's useful to know whether or not
606# there is a secondary target.
njnee0c66a2009-06-01 23:59:20 +0000607AM_CONDITIONAL(VGCONF_HAVE_PLATFORM_SEC,
njn7fd6d382009-01-22 21:56:32 +0000608 test x$VGCONF_PLATFORM_SEC_CAPS != x)
tomfb7bcde2005-11-07 15:24:38 +0000609
tomb637bad2005-11-08 12:28:35 +0000610
njn7fd6d382009-01-22 21:56:32 +0000611#----------------------------------------------------------------------------
612# Inner Valgrind?
613#----------------------------------------------------------------------------
614
njnd74b0ef2009-01-20 06:06:52 +0000615# Check if this should be built as an inner Valgrind, to be run within
616# another Valgrind. Choose the load address accordingly.
njnea2d6fd2010-07-01 00:20:20 +0000617AC_SUBST(VALT_LOAD_ADDRESS_PRI)
618AC_SUBST(VALT_LOAD_ADDRESS_SEC)
njnd74b0ef2009-01-20 06:06:52 +0000619AC_CACHE_CHECK([for use as an inner Valgrind], vg_cv_inner,
620 [AC_ARG_ENABLE(inner,
621 [ --enable-inner enables self-hosting],
622 [vg_cv_inner=$enableval],
623 [vg_cv_inner=no])])
624if test "$vg_cv_inner" = yes; then
625 AC_DEFINE([ENABLE_INNER], 1, [configured to run as an inner Valgrind])
njnea2d6fd2010-07-01 00:20:20 +0000626 VALT_LOAD_ADDRESS_PRI=$valt_load_address_pri_inner
627 VALT_LOAD_ADDRESS_SEC=$valt_load_address_sec_inner
njnd74b0ef2009-01-20 06:06:52 +0000628else
njnea2d6fd2010-07-01 00:20:20 +0000629 VALT_LOAD_ADDRESS_PRI=$valt_load_address_pri_norml
630 VALT_LOAD_ADDRESS_SEC=$valt_load_address_sec_norml
njnd74b0ef2009-01-20 06:06:52 +0000631fi
632
633
njn7fd6d382009-01-22 21:56:32 +0000634#----------------------------------------------------------------------------
sewardjcb495c82011-07-11 20:42:34 +0000635# Extra fine-tuning of installation directories
636#----------------------------------------------------------------------------
637AC_ARG_WITH(tmpdir,
638 [ --with-tmpdir=PATH Specify path for temporary files],
639 tmpdir="$withval",
640 tmpdir="/tmp")
641AC_DEFINE_UNQUOTED(VG_TMPDIR, "$tmpdir", [Temporary files directory])
642
sewardj0ba37c92011-07-12 11:46:24 +0000643
sewardjcb495c82011-07-11 20:42:34 +0000644#----------------------------------------------------------------------------
njn7fd6d382009-01-22 21:56:32 +0000645# Libc and suppressions
646#----------------------------------------------------------------------------
647# This variable will collect the suppression files to be used.
njn7fd6d382009-01-22 21:56:32 +0000648AC_SUBST(DEFAULT_SUPP)
sewardj01262142006-01-04 01:20:28 +0000649
bart12e91122010-05-15 08:37:24 +0000650AC_CHECK_HEADER([features.h])
sewardjde4a1d02002-03-22 01:27:54 +0000651
bart12e91122010-05-15 08:37:24 +0000652if test x$ac_cv_header_features_h = xyes; then
653 rm -f conftest.$ac_ext
654 cat <<_ACEOF >conftest.$ac_ext
sewardjde4a1d02002-03-22 01:27:54 +0000655#include <features.h>
bart12e91122010-05-15 08:37:24 +0000656#if defined(__GNU_LIBRARY__) && defined(__GLIBC__) && defined(__GLIBC_MINOR__)
657glibc version is: __GLIBC__ __GLIBC_MINOR__
sewardjde4a1d02002-03-22 01:27:54 +0000658#endif
bart12e91122010-05-15 08:37:24 +0000659_ACEOF
660 GLIBC_VERSION="`$CPP conftest.$ac_ext | $SED -n 's/^glibc version is: //p' | $SED 's/ /./g'`"
661fi
bartb7c3f082010-05-13 06:32:36 +0000662
njnf76d27a2009-05-28 01:53:07 +0000663# not really a version check
664AC_EGREP_CPP([DARWIN_LIBC], [
665#include <sys/cdefs.h>
666#if defined(__DARWIN_VERS_1050)
667 DARWIN_LIBC
668#endif
669],
670GLIBC_VERSION="darwin")
671
sewardjcb495c82011-07-11 20:42:34 +0000672# not really a version check
673AC_EGREP_CPP([BIONIC_LIBC], [
674#if defined(__ANDROID__)
675 BIONIC_LIBC
676#endif
677],
678GLIBC_VERSION="bionic")
679
680
dirk07596a22008-04-25 11:33:30 +0000681AC_MSG_CHECKING([the GLIBC_VERSION version])
sewardj03d86f22006-10-17 00:57:24 +0000682
dirk07596a22008-04-25 11:33:30 +0000683case "${GLIBC_VERSION}" in
sewardjde4a1d02002-03-22 01:27:54 +0000684 2.2)
685 AC_MSG_RESULT(2.2 family)
daywalker418c7482002-10-16 13:09:26 +0000686 AC_DEFINE([GLIBC_2_2], 1, [Define to 1 if you're using glibc 2.2.x])
sewardj2c4f3dd2007-11-11 06:13:01 +0000687 DEFAULT_SUPP="glibc-2.2.supp ${DEFAULT_SUPP}"
688 DEFAULT_SUPP="glibc-2.2-LinuxThreads-helgrind.supp ${DEFAULT_SUPP}"
tom0a0fcee2008-01-05 00:12:45 +0000689 DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
sewardjde4a1d02002-03-22 01:27:54 +0000690 ;;
691
sewardj08c7f012002-10-07 23:56:55 +0000692 2.3)
693 AC_MSG_RESULT(2.3 family)
daywalker418c7482002-10-16 13:09:26 +0000694 AC_DEFINE([GLIBC_2_3], 1, [Define to 1 if you're using glibc 2.3.x])
sewardj2c4f3dd2007-11-11 06:13:01 +0000695 DEFAULT_SUPP="glibc-2.3.supp ${DEFAULT_SUPP}"
sewardj68c80c12007-11-18 14:40:02 +0000696 DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
tom0a0fcee2008-01-05 00:12:45 +0000697 DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
sewardj08c7f012002-10-07 23:56:55 +0000698 ;;
699
njn781dba52005-06-30 04:06:38 +0000700 2.4)
701 AC_MSG_RESULT(2.4 family)
702 AC_DEFINE([GLIBC_2_4], 1, [Define to 1 if you're using glibc 2.4.x])
sewardj2c4f3dd2007-11-11 06:13:01 +0000703 DEFAULT_SUPP="glibc-2.4.supp ${DEFAULT_SUPP}"
sewardj68c80c12007-11-18 14:40:02 +0000704 DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
tom0a0fcee2008-01-05 00:12:45 +0000705 DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
njn781dba52005-06-30 04:06:38 +0000706 ;;
707
dirkaece45c2006-10-12 08:17:49 +0000708 2.5)
709 AC_MSG_RESULT(2.5 family)
710 AC_DEFINE([GLIBC_2_5], 1, [Define to 1 if you're using glibc 2.5.x])
sewardj2c4f3dd2007-11-11 06:13:01 +0000711 DEFAULT_SUPP="glibc-2.5.supp ${DEFAULT_SUPP}"
sewardj68c80c12007-11-18 14:40:02 +0000712 DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
tom0a0fcee2008-01-05 00:12:45 +0000713 DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
dirkaece45c2006-10-12 08:17:49 +0000714 ;;
dirkc8bd0c52007-05-23 17:39:08 +0000715 2.6)
716 AC_MSG_RESULT(2.6 family)
717 AC_DEFINE([GLIBC_2_6], 1, [Define to 1 if you're using glibc 2.6.x])
sewardj2c4f3dd2007-11-11 06:13:01 +0000718 DEFAULT_SUPP="glibc-2.6.supp ${DEFAULT_SUPP}"
sewardj68c80c12007-11-18 14:40:02 +0000719 DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
tom0a0fcee2008-01-05 00:12:45 +0000720 DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
sewardj68c80c12007-11-18 14:40:02 +0000721 ;;
722 2.7)
723 AC_MSG_RESULT(2.7 family)
724 AC_DEFINE([GLIBC_2_7], 1, [Define to 1 if you're using glibc 2.7.x])
dirk07596a22008-04-25 11:33:30 +0000725 DEFAULT_SUPP="glibc-2.X.supp ${DEFAULT_SUPP}"
sewardj68c80c12007-11-18 14:40:02 +0000726 DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
tom0a0fcee2008-01-05 00:12:45 +0000727 DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
dirkc8bd0c52007-05-23 17:39:08 +0000728 ;;
dirk07596a22008-04-25 11:33:30 +0000729 2.8)
730 AC_MSG_RESULT(2.8 family)
dirkeb939fc2008-04-27 20:38:47 +0000731 AC_DEFINE([GLIBC_2_8], 1, [Define to 1 if you're using glibc 2.8.x])
dirk07596a22008-04-25 11:33:30 +0000732 DEFAULT_SUPP="glibc-2.X.supp ${DEFAULT_SUPP}"
733 DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
734 DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
735 ;;
dirkd2e31eb2008-11-19 23:58:36 +0000736 2.9)
737 AC_MSG_RESULT(2.9 family)
738 AC_DEFINE([GLIBC_2_9], 1, [Define to 1 if you're using glibc 2.9.x])
739 DEFAULT_SUPP="glibc-2.X.supp ${DEFAULT_SUPP}"
740 DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
741 DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
742 ;;
sewardj5d425e82009-02-01 19:01:11 +0000743 2.10)
744 AC_MSG_RESULT(2.10 family)
745 AC_DEFINE([GLIBC_2_10], 1, [Define to 1 if you're using glibc 2.10.x])
746 DEFAULT_SUPP="glibc-2.X.supp ${DEFAULT_SUPP}"
747 DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
748 DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
749 ;;
bart0fac7ff2009-11-15 19:11:19 +0000750 2.11)
751 AC_MSG_RESULT(2.11 family)
752 AC_DEFINE([GLIBC_2_11], 1, [Define to 1 if you're using glibc 2.11.x])
753 DEFAULT_SUPP="glibc-2.X.supp ${DEFAULT_SUPP}"
754 DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
755 DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
bartb7c3f082010-05-13 06:32:36 +0000756 ;;
757 2.12)
758 AC_MSG_RESULT(2.12 family)
759 AC_DEFINE([GLIBC_2_12], 1, [Define to 1 if you're using glibc 2.12.x])
760 DEFAULT_SUPP="glibc-2.X.supp ${DEFAULT_SUPP}"
761 DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
762 DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
bart0fac7ff2009-11-15 19:11:19 +0000763 ;;
tomebd619b2011-02-10 09:09:09 +0000764 2.13)
765 AC_MSG_RESULT(2.13 family)
766 AC_DEFINE([GLIBC_2_13], 1, [Define to 1 if you're using glibc 2.13.x])
767 DEFAULT_SUPP="glibc-2.X.supp ${DEFAULT_SUPP}"
768 DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
769 DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
770 ;;
tomcc077412011-06-07 21:52:26 +0000771 2.14)
772 AC_MSG_RESULT(2.14 family)
773 AC_DEFINE([GLIBC_2_14], 1, [Define to 1 if you're using glibc 2.14.x])
774 DEFAULT_SUPP="glibc-2.X.supp ${DEFAULT_SUPP}"
775 DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
776 DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
777 ;;
njnf76d27a2009-05-28 01:53:07 +0000778 darwin)
779 AC_MSG_RESULT(Darwin)
780 AC_DEFINE([DARWIN_LIBC], 1, [Define to 1 if you're using Darwin])
781 # DEFAULT_SUPP set by kernel version check above.
782 ;;
sewardjcb495c82011-07-11 20:42:34 +0000783 bionic)
784 AC_MSG_RESULT(Bionic)
785 AC_DEFINE([BIONIC_LIBC], 1, [Define to 1 if you're using Bionic])
786 DEFAULT_SUPP="bionic.supp ${DEFAULT_SUPP}"
787 ;;
dirkaece45c2006-10-12 08:17:49 +0000788
sewardjde4a1d02002-03-22 01:27:54 +0000789 *)
bart12e91122010-05-15 08:37:24 +0000790 AC_MSG_RESULT([unsupported version ${GLIBC_VERSION}])
tomcc077412011-06-07 21:52:26 +0000791 AC_MSG_ERROR([Valgrind requires glibc version 2.2 - 2.14])
njnf76d27a2009-05-28 01:53:07 +0000792 AC_MSG_ERROR([or Darwin libc])
sewardjde4a1d02002-03-22 01:27:54 +0000793 ;;
794esac
795
dirk07596a22008-04-25 11:33:30 +0000796AC_SUBST(GLIBC_VERSION)
sewardj535c50f2005-06-04 23:14:53 +0000797
sewardj414f3582008-07-18 20:46:00 +0000798
799# Add default suppressions for the X client libraries. Make no
800# attempt to detect whether such libraries are installed on the
801# build machine (or even if any X facilities are present); just
802# add the suppressions antidisirregardless.
803DEFAULT_SUPP="xfree-4.supp ${DEFAULT_SUPP}"
804DEFAULT_SUPP="xfree-3.supp ${DEFAULT_SUPP}"
gobrye721a522002-03-22 13:38:30 +0000805
sewardjd2f95a02011-05-11 16:04:28 +0000806# Add glibc and X11 suppressions for exp-sgcheck
807DEFAULT_SUPP="exp-sgcheck.supp ${DEFAULT_SUPP}"
sewardj5744c022008-10-19 18:58:13 +0000808
sewardj2e10a682003-04-07 19:36:41 +0000809
njn7fd6d382009-01-22 21:56:32 +0000810#----------------------------------------------------------------------------
sewardjcb495c82011-07-11 20:42:34 +0000811# Platform variants?
812#----------------------------------------------------------------------------
813
814# Normally the PLAT = (ARCH, OS) characterisation of the platform is enough.
815# But there are times where we need a bit more control. The motivating
816# and currently only case is Android: this is almost identical to arm-linux,
817# but not quite. So this introduces the concept of platform variant tags,
818# which get passed in the compile as -DVGPV_<arch>_<os>_<variant> along
819# with the main -DVGP_<arch>_<os> definition.
820#
821# In almost all cases, the <variant> bit is "vanilla". But for Android
822# it is "android" instead.
823#
824# Consequently (eg), plain arm-linux would build with
825#
826# -DVGP_arm_linux -DVGPV_arm_linux_vanilla
827#
828# whilst an Android build would have
829#
830# -DVGP_arm_linux -DVGPV_arm_linux_android
831#
832# The setup of the platform variant is pushed relatively far down this
833# file in order that we can inspect any of the variables set above.
834
835# In the normal case ..
836VGCONF_PLATVARIANT="vanilla"
837
838# Android on ARM ?
839if test "$VGCONF_ARCH_PRI-$VGCONF_OS" = "arm-linux" \
840 -a "$GLIBC_VERSION" = "bionic";
841then
842 VGCONF_PLATVARIANT="android"
843fi
844
845AC_SUBST(VGCONF_PLATVARIANT)
846
847
848# FIXME: do we also want to define automake variables
849# VGCONF_PLATVARIANT_IS_<WHATEVER>, where WHATEVER is (currently)
850# VANILLA or ANDROID ? This would be in the style of VGCONF_ARCHS_INCLUDE,
851# VGCONF_PLATFORMS_INCLUDE and VGCONF_OS_IS above? Could easily enough
852# do that. Problem is that we can't do and-ing in Makefile.am's, but
853# that's what we'd need to do to use this, since what we'd want to write
854# is something like
855#
856# VGCONF_PLATFORMS_INCLUDE_ARM_LINUX && VGCONF_PLATVARIANT_IS_ANDROID
857#
sewardj0ba37c92011-07-12 11:46:24 +0000858# Hmm. Can't think of a nice clean solution to this.
859
860AM_CONDITIONAL(VGCONF_PLATVARIANT_IS_VANILLA,
861 test x$VGCONF_PLATVARIANT = xvanilla)
862AM_CONDITIONAL(VGCONF_PLATVARIANT_IS_ANDROID,
863 test x$VGCONF_PLATVARIANT = xandroid)
sewardjcb495c82011-07-11 20:42:34 +0000864
865
866#----------------------------------------------------------------------------
njn7fd6d382009-01-22 21:56:32 +0000867# Checking for various library functions and other definitions
868#----------------------------------------------------------------------------
869
bart59e2f182008-04-28 16:22:53 +0000870# Check for CLOCK_MONOTONIC
871
872AC_MSG_CHECKING([for CLOCK_MONOTONIC])
873
bart417cf3e2011-10-22 09:21:24 +0000874AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
bart59e2f182008-04-28 16:22:53 +0000875#include <time.h>
bart417cf3e2011-10-22 09:21:24 +0000876]], [[
bart59e2f182008-04-28 16:22:53 +0000877 struct timespec t;
878 clock_gettime(CLOCK_MONOTONIC, &t);
879 return 0;
bart417cf3e2011-10-22 09:21:24 +0000880]])], [
bart59e2f182008-04-28 16:22:53 +0000881AC_MSG_RESULT([yes])
882AC_DEFINE([HAVE_CLOCK_MONOTONIC], 1,
883 [Define to 1 if you have the `CLOCK_MONOTONIC' constant.])
884], [
885AC_MSG_RESULT([no])
886])
887
bartfea06922008-05-03 09:12:15 +0000888
sewardj0c09bf02011-07-11 22:11:58 +0000889# Check for PTHREAD_RWLOCK_T
890
891AC_MSG_CHECKING([for pthread_rwlock_t])
892
bart417cf3e2011-10-22 09:21:24 +0000893AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
sewardj0c09bf02011-07-11 22:11:58 +0000894#define _GNU_SOURCE
895#include <pthread.h>
bart417cf3e2011-10-22 09:21:24 +0000896]], [[
sewardj0c09bf02011-07-11 22:11:58 +0000897 pthread_rwlock_t rwl;
bart417cf3e2011-10-22 09:21:24 +0000898]])], [
sewardj0c09bf02011-07-11 22:11:58 +0000899AC_MSG_RESULT([yes])
900AC_DEFINE([HAVE_PTHREAD_RWLOCK_T], 1,
901 [Define to 1 if you have the `pthread_rwlock_t' type.])
902], [
903AC_MSG_RESULT([no])
904])
905
906
bartfea06922008-05-03 09:12:15 +0000907# Check for PTHREAD_MUTEX_ADAPTIVE_NP
908
909AC_MSG_CHECKING([for PTHREAD_MUTEX_ADAPTIVE_NP])
910
bart417cf3e2011-10-22 09:21:24 +0000911AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
bartfea06922008-05-03 09:12:15 +0000912#define _GNU_SOURCE
913#include <pthread.h>
bart417cf3e2011-10-22 09:21:24 +0000914]], [[
bartfea06922008-05-03 09:12:15 +0000915 return (PTHREAD_MUTEX_ADAPTIVE_NP);
bart417cf3e2011-10-22 09:21:24 +0000916]])], [
bartfea06922008-05-03 09:12:15 +0000917AC_MSG_RESULT([yes])
918AC_DEFINE([HAVE_PTHREAD_MUTEX_ADAPTIVE_NP], 1,
919 [Define to 1 if you have the `PTHREAD_MUTEX_ADAPTIVE_NP' constant.])
920], [
921AC_MSG_RESULT([no])
922])
923
924
925# Check for PTHREAD_MUTEX_ERRORCHECK_NP
926
927AC_MSG_CHECKING([for PTHREAD_MUTEX_ERRORCHECK_NP])
928
bart417cf3e2011-10-22 09:21:24 +0000929AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
bartfea06922008-05-03 09:12:15 +0000930#define _GNU_SOURCE
931#include <pthread.h>
bart417cf3e2011-10-22 09:21:24 +0000932]], [[
bartfea06922008-05-03 09:12:15 +0000933 return (PTHREAD_MUTEX_ERRORCHECK_NP);
bart417cf3e2011-10-22 09:21:24 +0000934]])], [
bartfea06922008-05-03 09:12:15 +0000935AC_MSG_RESULT([yes])
936AC_DEFINE([HAVE_PTHREAD_MUTEX_ERRORCHECK_NP], 1,
937 [Define to 1 if you have the `PTHREAD_MUTEX_ERRORCHECK_NP' constant.])
938], [
939AC_MSG_RESULT([no])
940])
941
942
943# Check for PTHREAD_MUTEX_RECURSIVE_NP
944
945AC_MSG_CHECKING([for PTHREAD_MUTEX_RECURSIVE_NP])
946
bart417cf3e2011-10-22 09:21:24 +0000947AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
bartfea06922008-05-03 09:12:15 +0000948#define _GNU_SOURCE
949#include <pthread.h>
bart417cf3e2011-10-22 09:21:24 +0000950]], [[
bartfea06922008-05-03 09:12:15 +0000951 return (PTHREAD_MUTEX_RECURSIVE_NP);
bart417cf3e2011-10-22 09:21:24 +0000952]])], [
bartfea06922008-05-03 09:12:15 +0000953AC_MSG_RESULT([yes])
954AC_DEFINE([HAVE_PTHREAD_MUTEX_RECURSIVE_NP], 1,
955 [Define to 1 if you have the `PTHREAD_MUTEX_RECURSIVE_NP' constant.])
956], [
957AC_MSG_RESULT([no])
958])
959
960
961# Check for PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP
962
963AC_MSG_CHECKING([for PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP])
964
bart417cf3e2011-10-22 09:21:24 +0000965AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
bartfea06922008-05-03 09:12:15 +0000966#define _GNU_SOURCE
967#include <pthread.h>
bart417cf3e2011-10-22 09:21:24 +0000968]], [[
bartfea06922008-05-03 09:12:15 +0000969 pthread_mutex_t m = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP;
970 return 0;
bart417cf3e2011-10-22 09:21:24 +0000971]])], [
bartfea06922008-05-03 09:12:15 +0000972AC_MSG_RESULT([yes])
973AC_DEFINE([HAVE_PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP], 1,
974 [Define to 1 if you have the `PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP' constant.])
975], [
976AC_MSG_RESULT([no])
977])
978
979
bart5e389f12008-04-05 12:53:15 +0000980# Check whether pthread_mutex_t has a member called __m_kind.
981
bartb11355c2010-04-29 16:37:26 +0000982AC_CHECK_MEMBER([pthread_mutex_t.__m_kind],
983 [AC_DEFINE([HAVE_PTHREAD_MUTEX_T__M_KIND],
984 1,
985 [Define to 1 if pthread_mutex_t has a member called __m_kind.])
986 ],
987 [],
988 [#include <pthread.h>])
bart5e389f12008-04-05 12:53:15 +0000989
990
991# Check whether pthread_mutex_t has a member called __data.__kind.
992
bartb11355c2010-04-29 16:37:26 +0000993AC_CHECK_MEMBER([pthread_mutex_t.__data.__kind],
994 [AC_DEFINE([HAVE_PTHREAD_MUTEX_T__DATA__KIND],
995 1,
996 [Define to 1 if pthread_mutex_t has a member __data.__kind.])
997 ],
998 [],
999 [#include <pthread.h>])
bart5e389f12008-04-05 12:53:15 +00001000
1001
bart62c370e2008-05-12 18:50:51 +00001002# does this compiler support -maltivec and does it have the include file
1003# <altivec.h> ?
1004
1005AC_MSG_CHECKING([for Altivec])
1006
1007safe_CFLAGS=$CFLAGS
1008CFLAGS="-maltivec"
1009
bart417cf3e2011-10-22 09:21:24 +00001010AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
bart62c370e2008-05-12 18:50:51 +00001011#include <altivec.h>
bart417cf3e2011-10-22 09:21:24 +00001012]], [[
bart62c370e2008-05-12 18:50:51 +00001013 vector unsigned int v;
bart417cf3e2011-10-22 09:21:24 +00001014]])], [
bart62c370e2008-05-12 18:50:51 +00001015ac_have_altivec=yes
1016AC_MSG_RESULT([yes])
sewardjf9fe6022010-09-03 14:36:50 +00001017AC_DEFINE([HAS_ALTIVEC], 1,
sewardj6467a152010-09-03 14:02:22 +00001018 [Define to 1 if gcc/as can do Altivec.])
bart62c370e2008-05-12 18:50:51 +00001019], [
1020ac_have_altivec=no
1021AC_MSG_RESULT([no])
1022])
1023CFLAGS=$safe_CFLAGS
1024
sewardj0e342a02010-09-03 23:49:33 +00001025AM_CONDITIONAL([HAS_ALTIVEC], [test x$ac_have_altivec = xyes])
bart62c370e2008-05-12 18:50:51 +00001026
1027
sewardjf34eb492011-04-15 11:57:05 +00001028# Check that both: the compiler supports -mvsx and that the assembler
1029# understands VSX instructions. If either of those doesn't work,
1030# conclude that we can't do VSX. NOTE: basically this is a kludge
1031# in that it conflates two things that should be separate -- whether
1032# the compiler understands the flag vs whether the assembler
1033# understands the opcodes. This really ought to be cleaned up
1034# and done properly, like it is for x86/x86_64.
1035
1036AC_MSG_CHECKING([for VSX])
1037
1038safe_CFLAGS=$CFLAGS
1039CFLAGS="-mvsx"
1040
bart417cf3e2011-10-22 09:21:24 +00001041AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
sewardjf34eb492011-04-15 11:57:05 +00001042#include <altivec.h>
bart417cf3e2011-10-22 09:21:24 +00001043]], [[
sewardjf34eb492011-04-15 11:57:05 +00001044 vector unsigned int v;
sewardj9b80ebb2011-04-15 21:16:00 +00001045 __asm__ __volatile__("xsmaddadp 32, 32, 33" ::: "memory","cc");
bart417cf3e2011-10-22 09:21:24 +00001046]])], [
sewardjf34eb492011-04-15 11:57:05 +00001047ac_have_vsx=yes
1048AC_MSG_RESULT([yes])
1049], [
1050ac_have_vsx=no
1051AC_MSG_RESULT([no])
1052])
1053CFLAGS=$safe_CFLAGS
1054
1055AM_CONDITIONAL(HAS_VSX, test x$ac_have_vsx = xyes)
1056
1057
bart36dd85a2009-04-26 07:11:48 +00001058# Check for pthread_create@GLIBC2.0
1059AC_MSG_CHECKING([for pthread_create@GLIBC2.0()])
1060
bart16e1c5a2009-04-26 07:38:53 +00001061safe_CFLAGS=$CFLAGS
1062CFLAGS="-lpthread"
bart417cf3e2011-10-22 09:21:24 +00001063AC_LINK_IFELSE([AC_LANG_PROGRAM([[
bart36dd85a2009-04-26 07:11:48 +00001064extern int pthread_create_glibc_2_0(void*, const void*,
1065 void *(*)(void*), void*);
1066__asm__(".symver pthread_create_glibc_2_0, pthread_create@GLIBC_2.0");
bart417cf3e2011-10-22 09:21:24 +00001067]], [[
bart276ed3a2009-05-10 15:41:45 +00001068#ifdef __powerpc__
1069/*
1070 * Apparently on PowerPC linking this program succeeds and generates an
1071 * executable with the undefined symbol pthread_create@GLIBC_2.0.
1072 */
1073#error This test does not work properly on PowerPC.
1074#else
bart16e1c5a2009-04-26 07:38:53 +00001075 pthread_create_glibc_2_0(0, 0, 0, 0);
bart276ed3a2009-05-10 15:41:45 +00001076#endif
bart16e1c5a2009-04-26 07:38:53 +00001077 return 0;
bart417cf3e2011-10-22 09:21:24 +00001078]])], [
bart36dd85a2009-04-26 07:11:48 +00001079ac_have_pthread_create_glibc_2_0=yes
1080AC_MSG_RESULT([yes])
1081AC_DEFINE([HAVE_PTHREAD_CREATE_GLIBC_2_0], 1,
1082 [Define to 1 if you have the `pthread_create@glibc2.0' function.])
1083], [
1084ac_have_pthread_create_glibc_2_0=no
1085AC_MSG_RESULT([no])
1086])
bart16e1c5a2009-04-26 07:38:53 +00001087CFLAGS=$safe_CFLAGS
bart36dd85a2009-04-26 07:11:48 +00001088
1089AM_CONDITIONAL(HAVE_PTHREAD_CREATE_GLIBC_2_0,
bart24f53902009-04-26 11:29:02 +00001090 test x$ac_have_pthread_create_glibc_2_0 = xyes)
bart36dd85a2009-04-26 07:11:48 +00001091
1092
barta50aa8a2008-04-27 06:06:57 +00001093# Check for eventfd_t, eventfd() and eventfd_read()
1094AC_MSG_CHECKING([for eventfd()])
1095
bart417cf3e2011-10-22 09:21:24 +00001096AC_LINK_IFELSE([AC_LANG_PROGRAM([[
barta50aa8a2008-04-27 06:06:57 +00001097#include <sys/eventfd.h>
bart417cf3e2011-10-22 09:21:24 +00001098]], [[
barta50aa8a2008-04-27 06:06:57 +00001099 eventfd_t ev;
1100 int fd;
1101
1102 fd = eventfd(5, 0);
1103 eventfd_read(fd, &ev);
1104 return 0;
bart417cf3e2011-10-22 09:21:24 +00001105]])], [
barta50aa8a2008-04-27 06:06:57 +00001106AC_MSG_RESULT([yes])
1107AC_DEFINE([HAVE_EVENTFD], 1,
1108 [Define to 1 if you have the `eventfd' function.])
1109AC_DEFINE([HAVE_EVENTFD_READ], 1,
1110 [Define to 1 if you have the `eventfd_read' function.])
1111], [
1112AC_MSG_RESULT([no])
1113])
1114
1115
njn7fd6d382009-01-22 21:56:32 +00001116#----------------------------------------------------------------------------
1117# Checking for supported compiler flags.
1118#----------------------------------------------------------------------------
1119
sewardj535c50f2005-06-04 23:14:53 +00001120# does this compiler support -m32 ?
1121AC_MSG_CHECKING([if gcc accepts -m32])
1122
1123safe_CFLAGS=$CFLAGS
1124CFLAGS="-m32"
1125
bart417cf3e2011-10-22 09:21:24 +00001126AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
njn9890ee12009-01-21 22:25:50 +00001127 return 0;
bart417cf3e2011-10-22 09:21:24 +00001128]])], [
sewardj535c50f2005-06-04 23:14:53 +00001129FLAG_M32="-m32"
1130AC_MSG_RESULT([yes])
1131], [
1132FLAG_M32=""
1133AC_MSG_RESULT([no])
1134])
1135CFLAGS=$safe_CFLAGS
1136
1137AC_SUBST(FLAG_M32)
1138
1139
sewardj01262142006-01-04 01:20:28 +00001140# does this compiler support -m64 ?
1141AC_MSG_CHECKING([if gcc accepts -m64])
1142
1143safe_CFLAGS=$CFLAGS
1144CFLAGS="-m64"
1145
bart417cf3e2011-10-22 09:21:24 +00001146AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
njn9890ee12009-01-21 22:25:50 +00001147 return 0;
bart417cf3e2011-10-22 09:21:24 +00001148]])], [
sewardj01262142006-01-04 01:20:28 +00001149FLAG_M64="-m64"
1150AC_MSG_RESULT([yes])
1151], [
1152FLAG_M64=""
1153AC_MSG_RESULT([no])
1154])
1155CFLAGS=$safe_CFLAGS
1156
1157AC_SUBST(FLAG_M64)
1158
1159
sewardj67f1fcc2005-07-03 10:41:02 +00001160# does this compiler support -mmmx ?
1161AC_MSG_CHECKING([if gcc accepts -mmmx])
1162
1163safe_CFLAGS=$CFLAGS
1164CFLAGS="-mmmx"
1165
bart417cf3e2011-10-22 09:21:24 +00001166AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
njn9890ee12009-01-21 22:25:50 +00001167 return 0;
bart417cf3e2011-10-22 09:21:24 +00001168]])], [
sewardj67f1fcc2005-07-03 10:41:02 +00001169FLAG_MMMX="-mmmx"
1170AC_MSG_RESULT([yes])
1171], [
1172FLAG_MMMX=""
1173AC_MSG_RESULT([no])
1174])
1175CFLAGS=$safe_CFLAGS
1176
1177AC_SUBST(FLAG_MMMX)
1178
1179
1180# does this compiler support -msse ?
1181AC_MSG_CHECKING([if gcc accepts -msse])
1182
1183safe_CFLAGS=$CFLAGS
1184CFLAGS="-msse"
1185
bart417cf3e2011-10-22 09:21:24 +00001186AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
njn9890ee12009-01-21 22:25:50 +00001187 return 0;
bart417cf3e2011-10-22 09:21:24 +00001188]])], [
sewardj67f1fcc2005-07-03 10:41:02 +00001189FLAG_MSSE="-msse"
1190AC_MSG_RESULT([yes])
1191], [
1192FLAG_MSSE=""
1193AC_MSG_RESULT([no])
1194])
1195CFLAGS=$safe_CFLAGS
1196
1197AC_SUBST(FLAG_MSSE)
1198
1199
sewardj5b754b42002-06-03 22:53:35 +00001200# does this compiler support -mpreferred-stack-boundary=2 ?
1201AC_MSG_CHECKING([if gcc accepts -mpreferred-stack-boundary])
1202
daywalker3664f562003-10-17 13:43:46 +00001203safe_CFLAGS=$CFLAGS
sewardj5b754b42002-06-03 22:53:35 +00001204CFLAGS="-mpreferred-stack-boundary=2"
1205
bart417cf3e2011-10-22 09:21:24 +00001206AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
njn9890ee12009-01-21 22:25:50 +00001207 return 0;
bart417cf3e2011-10-22 09:21:24 +00001208]])], [
sewardj5b754b42002-06-03 22:53:35 +00001209PREFERRED_STACK_BOUNDARY="-mpreferred-stack-boundary=2"
daywalker3664f562003-10-17 13:43:46 +00001210AC_MSG_RESULT([yes])
sewardj5b754b42002-06-03 22:53:35 +00001211], [
1212PREFERRED_STACK_BOUNDARY=""
1213AC_MSG_RESULT([no])
1214])
daywalker3664f562003-10-17 13:43:46 +00001215CFLAGS=$safe_CFLAGS
sewardj5b754b42002-06-03 22:53:35 +00001216
1217AC_SUBST(PREFERRED_STACK_BOUNDARY)
1218
sewardj535c50f2005-06-04 23:14:53 +00001219
sewardjb5f6f512005-03-10 23:59:00 +00001220# does this compiler support -Wno-pointer-sign ?
bart56730cd2008-05-11 06:41:46 +00001221AC_MSG_CHECKING([if gcc accepts -Wno-pointer-sign])
sewardjb5f6f512005-03-10 23:59:00 +00001222
1223safe_CFLAGS=$CFLAGS
1224CFLAGS="-Wno-pointer-sign"
1225
bart417cf3e2011-10-22 09:21:24 +00001226AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
njn9890ee12009-01-21 22:25:50 +00001227 return 0;
bart417cf3e2011-10-22 09:21:24 +00001228]])], [
sewardjb5f6f512005-03-10 23:59:00 +00001229no_pointer_sign=yes
1230AC_MSG_RESULT([yes])
1231], [
1232no_pointer_sign=no
1233AC_MSG_RESULT([no])
1234])
1235CFLAGS=$safe_CFLAGS
1236
1237if test x$no_pointer_sign = xyes; then
1238 CFLAGS="$CFLAGS -Wno-pointer-sign"
1239fi
1240
sewardj535c50f2005-06-04 23:14:53 +00001241
barte026bd22009-07-04 12:17:07 +00001242# does this compiler support -Wno-empty-body ?
1243
1244AC_MSG_CHECKING([if gcc accepts -Wno-empty-body])
1245
1246safe_CFLAGS=$CFLAGS
1247CFLAGS="-Wno-empty-body"
1248
bart417cf3e2011-10-22 09:21:24 +00001249AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]], [[
barte026bd22009-07-04 12:17:07 +00001250 return 0;
bart417cf3e2011-10-22 09:21:24 +00001251]])], [
barte026bd22009-07-04 12:17:07 +00001252AC_SUBST([FLAG_W_NO_EMPTY_BODY], [-Wno-empty-body])
1253AC_MSG_RESULT([yes])
bart417cf3e2011-10-22 09:21:24 +00001254], [
barte026bd22009-07-04 12:17:07 +00001255AC_SUBST([FLAG_W_NO_EMPTY_BODY], [])
1256AC_MSG_RESULT([no])
1257])
1258CFLAGS=$safe_CFLAGS
1259
1260
bart9d865fa2008-06-23 12:11:49 +00001261# does this compiler support -Wno-format-zero-length ?
1262
1263AC_MSG_CHECKING([if gcc accepts -Wno-format-zero-length])
1264
1265safe_CFLAGS=$CFLAGS
1266CFLAGS="-Wno-format-zero-length"
1267
bart417cf3e2011-10-22 09:21:24 +00001268AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]], [[
bart9d865fa2008-06-23 12:11:49 +00001269 return 0;
bart417cf3e2011-10-22 09:21:24 +00001270]])], [
bart9d865fa2008-06-23 12:11:49 +00001271AC_SUBST([FLAG_W_NO_FORMAT_ZERO_LENGTH], [-Wno-format-zero-length])
1272AC_MSG_RESULT([yes])
bart417cf3e2011-10-22 09:21:24 +00001273], [
bart9d865fa2008-06-23 12:11:49 +00001274AC_SUBST([FLAG_W_NO_FORMAT_ZERO_LENGTH], [])
1275AC_MSG_RESULT([no])
1276])
1277CFLAGS=$safe_CFLAGS
1278
1279
bart8e216312011-05-15 17:05:36 +00001280# does this compiler support -Wno-nonnull ?
1281
1282AC_MSG_CHECKING([if gcc accepts -Wno-nonnull])
1283
1284safe_CFLAGS=$CFLAGS
1285CFLAGS="-Wno-nonnull"
1286
bart417cf3e2011-10-22 09:21:24 +00001287AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]], [[
bart8e216312011-05-15 17:05:36 +00001288 return 0;
bart417cf3e2011-10-22 09:21:24 +00001289]])], [
bart8e216312011-05-15 17:05:36 +00001290AC_SUBST([FLAG_W_NO_NONNULL], [-Wno-nonnull])
1291AC_MSG_RESULT([yes])
bart417cf3e2011-10-22 09:21:24 +00001292], [
bart8e216312011-05-15 17:05:36 +00001293AC_SUBST([FLAG_W_NO_NONNULL], [])
1294AC_MSG_RESULT([no])
1295])
1296CFLAGS=$safe_CFLAGS
1297
1298
1299# does this compiler support -Wno-overflow ?
1300
1301AC_MSG_CHECKING([if gcc accepts -Wno-overflow])
1302
1303safe_CFLAGS=$CFLAGS
1304CFLAGS="-Wno-overflow"
1305
bart417cf3e2011-10-22 09:21:24 +00001306AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]], [[
bart8e216312011-05-15 17:05:36 +00001307 return 0;
bart417cf3e2011-10-22 09:21:24 +00001308]])], [
bart8e216312011-05-15 17:05:36 +00001309AC_SUBST([FLAG_W_NO_OVERFLOW], [-Wno-overflow])
1310AC_MSG_RESULT([yes])
bart417cf3e2011-10-22 09:21:24 +00001311], [
bart8e216312011-05-15 17:05:36 +00001312AC_SUBST([FLAG_W_NO_OVERFLOW], [])
1313AC_MSG_RESULT([no])
1314])
1315CFLAGS=$safe_CFLAGS
1316
1317
bartbf9b85c2009-08-12 12:55:56 +00001318# does this compiler support -Wno-uninitialized ?
1319
1320AC_MSG_CHECKING([if gcc accepts -Wno-uninitialized])
1321
1322safe_CFLAGS=$CFLAGS
1323CFLAGS="-Wno-uninitialized"
1324
bart417cf3e2011-10-22 09:21:24 +00001325AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]], [[
bartbf9b85c2009-08-12 12:55:56 +00001326 return 0;
bart417cf3e2011-10-22 09:21:24 +00001327]])], [
bartbf9b85c2009-08-12 12:55:56 +00001328AC_SUBST([FLAG_W_NO_UNINITIALIZED], [-Wno-uninitialized])
1329AC_MSG_RESULT([yes])
bart417cf3e2011-10-22 09:21:24 +00001330], [
bartbf9b85c2009-08-12 12:55:56 +00001331AC_SUBST([FLAG_W_NO_UNINITIALIZED], [])
1332AC_MSG_RESULT([no])
1333])
1334CFLAGS=$safe_CFLAGS
1335
1336
bart56730cd2008-05-11 06:41:46 +00001337# does this compiler support -Wextra or the older -W ?
1338
1339AC_MSG_CHECKING([if gcc accepts -Wextra or -W])
1340
1341safe_CFLAGS=$CFLAGS
1342CFLAGS="-Wextra"
1343
bart417cf3e2011-10-22 09:21:24 +00001344AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]], [[
bart56730cd2008-05-11 06:41:46 +00001345 return 0;
bart417cf3e2011-10-22 09:21:24 +00001346]])], [
bart56730cd2008-05-11 06:41:46 +00001347AC_SUBST([FLAG_W_EXTRA], [-Wextra])
1348AC_MSG_RESULT([-Wextra])
1349], [
1350 CFLAGS="-W"
bart417cf3e2011-10-22 09:21:24 +00001351 AC_COMPILE_IFELSE(AC_LANG_PROGRAM([[ ]], [[
bart56730cd2008-05-11 06:41:46 +00001352 return 0;
bart417cf3e2011-10-22 09:21:24 +00001353 ]]), [
bart56730cd2008-05-11 06:41:46 +00001354 AC_SUBST([FLAG_W_EXTRA], [-W])
1355 AC_MSG_RESULT([-W])
1356 ], [
1357 AC_SUBST([FLAG_W_EXTRA], [])
1358 AC_MSG_RESULT([not supported])
1359 ])
1360])
1361CFLAGS=$safe_CFLAGS
1362
1363
sewardja72c26d2007-05-01 13:44:08 +00001364# does this compiler support -fno-stack-protector ?
bart56730cd2008-05-11 06:41:46 +00001365AC_MSG_CHECKING([if gcc accepts -fno-stack-protector])
sewardja72c26d2007-05-01 13:44:08 +00001366
1367safe_CFLAGS=$CFLAGS
1368CFLAGS="-fno-stack-protector"
1369
bart417cf3e2011-10-22 09:21:24 +00001370AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
njn9890ee12009-01-21 22:25:50 +00001371 return 0;
bart417cf3e2011-10-22 09:21:24 +00001372]])], [
sewardja72c26d2007-05-01 13:44:08 +00001373no_stack_protector=yes
1374FLAG_FNO_STACK_PROTECTOR="-fno-stack-protector"
1375AC_MSG_RESULT([yes])
1376], [
1377no_stack_protector=no
1378FLAG_FNO_STACK_PROTECTOR=""
1379AC_MSG_RESULT([no])
1380])
1381CFLAGS=$safe_CFLAGS
1382
1383AC_SUBST(FLAG_FNO_STACK_PROTECTOR)
1384
1385if test x$no_stack_protector = xyes; then
1386 CFLAGS="$CFLAGS -fno-stack-protector"
1387fi
1388
1389
bart56730cd2008-05-11 06:41:46 +00001390# does this compiler support --param inline-unit-growth=... ?
1391
1392AC_MSG_CHECKING([if gcc accepts --param inline-unit-growth])
1393
1394safe_CFLAGS=$CFLAGS
1395CFLAGS="--param inline-unit-growth=900"
1396
bart417cf3e2011-10-22 09:21:24 +00001397AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]], [[
bart56730cd2008-05-11 06:41:46 +00001398 return 0;
bart417cf3e2011-10-22 09:21:24 +00001399]])], [
bart56730cd2008-05-11 06:41:46 +00001400AC_SUBST([FLAG_UNLIMITED_INLINE_UNIT_GROWTH],
1401 ["--param inline-unit-growth=900"])
1402AC_MSG_RESULT([yes])
1403], [
1404AC_SUBST([FLAG_UNLIMITED_INLINE_UNIT_GROWTH], [""])
1405AC_MSG_RESULT([no])
1406])
1407CFLAGS=$safe_CFLAGS
1408
1409
sewardjd3645802010-06-13 22:13:58 +00001410# does the linker support -Wl,--build-id=none ? Note, it's
1411# important that we test indirectly via whichever C compiler
1412# is selected, rather than testing /usr/bin/ld or whatever
1413# directly.
bart699fbac2010-06-08 18:23:59 +00001414
sewardjd3645802010-06-13 22:13:58 +00001415AC_MSG_CHECKING([if the linker accepts -Wl,--build-id=none])
bart699fbac2010-06-08 18:23:59 +00001416
1417safe_CFLAGS=$CFLAGS
1418CFLAGS="-Wl,--build-id=none"
1419
bart8508c752010-06-10 06:26:21 +00001420AC_LINK_IFELSE(
1421[AC_LANG_PROGRAM([ ], [return 0;])],
bart699fbac2010-06-08 18:23:59 +00001422[
1423 AC_SUBST([FLAG_NO_BUILD_ID], ["-Wl,--build-id=none"])
1424 AC_MSG_RESULT([yes])
1425], [
1426 AC_SUBST([FLAG_NO_BUILD_ID], [""])
1427 AC_MSG_RESULT([no])
1428])
1429CFLAGS=$safe_CFLAGS
1430
1431
sewardj00f1e622006-03-12 16:47:10 +00001432# does the ppc assembler support "mtocrf" et al?
1433AC_MSG_CHECKING([if ppc32/64 as supports mtocrf/mfocrf])
1434
bart417cf3e2011-10-22 09:21:24 +00001435AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
sewardjdd4cbe12006-03-12 17:27:44 +00001436__asm__ __volatile__("mtocrf 4,0");
1437__asm__ __volatile__("mfocrf 0,4");
bart417cf3e2011-10-22 09:21:24 +00001438]])], [
sewardj00f1e622006-03-12 16:47:10 +00001439ac_have_as_ppc_mftocrf=yes
1440AC_MSG_RESULT([yes])
1441], [
1442ac_have_as_ppc_mftocrf=no
1443AC_MSG_RESULT([no])
1444])
1445if test x$ac_have_as_ppc_mftocrf = xyes ; then
1446 AC_DEFINE(HAVE_AS_PPC_MFTOCRF, 1, [Define to 1 if as supports mtocrf/mfocrf.])
1447fi
1448
1449
sewardjb5b87402011-03-07 16:05:35 +00001450CFLAGS=$safe_CFLAGS
1451
sewardjf0aabf82007-03-22 00:24:21 +00001452# does the x86/amd64 assembler understand SSE3 instructions?
sewardjfa18a262007-03-22 12:13:13 +00001453# Note, this doesn't generate a C-level symbol. It generates a
1454# automake-level symbol (BUILD_SSE3_TESTS), used in test Makefile.am's
sewardjf0aabf82007-03-22 00:24:21 +00001455AC_MSG_CHECKING([if x86/amd64 assembler speaks SSE3])
1456
bart417cf3e2011-10-22 09:21:24 +00001457AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
sewardjf0aabf82007-03-22 00:24:21 +00001458 do { long long int x;
1459 __asm__ __volatile__("fisttpq (%0)" : :"r"(&x) ); }
1460 while (0)
bart417cf3e2011-10-22 09:21:24 +00001461]])], [
sewardjf0aabf82007-03-22 00:24:21 +00001462ac_have_as_sse3=yes
1463AC_MSG_RESULT([yes])
1464], [
1465ac_have_as_sse3=no
1466AC_MSG_RESULT([no])
1467])
sewardjfa18a262007-03-22 12:13:13 +00001468
1469AM_CONDITIONAL(BUILD_SSE3_TESTS, test x$ac_have_as_sse3 = xyes)
sewardjf0aabf82007-03-22 00:24:21 +00001470
1471
sewardj6d6da5b2008-02-09 12:07:40 +00001472# Ditto for SSSE3 instructions (note extra S)
1473# Note, this doesn't generate a C-level symbol. It generates a
1474# automake-level symbol (BUILD_SSSE3_TESTS), used in test Makefile.am's
1475AC_MSG_CHECKING([if x86/amd64 assembler speaks SSSE3])
1476
bart417cf3e2011-10-22 09:21:24 +00001477AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
sewardj6d6da5b2008-02-09 12:07:40 +00001478 do { long long int x;
1479 __asm__ __volatile__(
1480 "pabsb (%0),%%xmm7" : : "r"(&x) : "xmm7" ); }
1481 while (0)
bart417cf3e2011-10-22 09:21:24 +00001482]])], [
sewardj6d6da5b2008-02-09 12:07:40 +00001483ac_have_as_ssse3=yes
1484AC_MSG_RESULT([yes])
1485], [
1486ac_have_as_ssse3=no
1487AC_MSG_RESULT([no])
1488])
1489
1490AM_CONDITIONAL(BUILD_SSSE3_TESTS, test x$ac_have_as_ssse3 = xyes)
1491
1492
sewardj27d176a2011-01-17 11:15:48 +00001493# does the x86/amd64 assembler understand the PCLMULQDQ instruction?
1494# Note, this doesn't generate a C-level symbol. It generates a
1495# automake-level symbol (BUILD_PCLMULQDQ_TESTS), used in test Makefile.am's
sewardje3ae8a32010-09-28 19:59:47 +00001496AC_MSG_CHECKING([if x86/amd64 assembler supports 'pclmulqdq'])
bart417cf3e2011-10-22 09:21:24 +00001497AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
sewardje3ae8a32010-09-28 19:59:47 +00001498 do {
1499 __asm__ __volatile__(
1500 "pclmulqdq \$17,%%xmm6,%%xmm7" : : : "xmm6", "xmm7" ); }
1501 while (0)
bart417cf3e2011-10-22 09:21:24 +00001502]])], [
sewardje3ae8a32010-09-28 19:59:47 +00001503ac_have_as_pclmulqdq=yes
1504AC_MSG_RESULT([yes])
1505], [
1506ac_have_as_pclmulqdq=no
1507AC_MSG_RESULT([no])
1508])
1509
1510AM_CONDITIONAL(BUILD_PCLMULQDQ_TESTS, test x$ac_have_as_pclmulqdq = xyes)
1511
1512
sewardj27d176a2011-01-17 11:15:48 +00001513# does the x86/amd64 assembler understand the LZCNT instruction?
1514# Note, this doesn't generate a C-level symbol. It generates a
1515# automake-level symbol (BUILD_LZCNT_TESTS), used in test Makefile.am's
bart55e438b2010-09-14 10:53:57 +00001516AC_MSG_CHECKING([if x86/amd64 assembler supports 'lzcnt'])
1517
bart417cf3e2011-10-22 09:21:24 +00001518AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
bart55e438b2010-09-14 10:53:57 +00001519 do {
1520 __asm__ __volatile__("lzcnt %rax,%rax");
1521 } while (0)
bart417cf3e2011-10-22 09:21:24 +00001522]])], [
bart55e438b2010-09-14 10:53:57 +00001523 ac_have_as_lzcnt=yes
1524 AC_MSG_RESULT([yes])
1525], [
1526 ac_have_as_lzcnt=no
1527 AC_MSG_RESULT([no])
1528])
1529
1530AM_CONDITIONAL([BUILD_LZCNT_TESTS], [test x$ac_have_as_lzcnt = xyes])
1531
sewardj27d176a2011-01-17 11:15:48 +00001532
1533# does the x86/amd64 assembler understand SSE 4.2 instructions?
1534# Note, this doesn't generate a C-level symbol. It generates a
1535# automake-level symbol (BUILD_SSE42_TESTS), used in test Makefile.am's
1536AC_MSG_CHECKING([if x86/amd64 assembler speaks SSE4.2])
1537
bart417cf3e2011-10-22 09:21:24 +00001538AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
sewardj27d176a2011-01-17 11:15:48 +00001539 do { long long int x;
1540 __asm__ __volatile__(
1541 "crc32q %%r15,%%r15" : : : "r15" ); }
1542 while (0)
bart417cf3e2011-10-22 09:21:24 +00001543]])], [
sewardj27d176a2011-01-17 11:15:48 +00001544ac_have_as_sse42=yes
1545AC_MSG_RESULT([yes])
1546], [
1547ac_have_as_sse42=no
1548AC_MSG_RESULT([no])
1549])
1550
1551AM_CONDITIONAL(BUILD_SSE42_TESTS, test x$ac_have_as_sse42 = xyes)
1552
1553
sewardje089f012010-10-13 21:47:29 +00001554# XXX JRS 2010 Oct 13: what is this for? For sure, we don't need this
1555# when building the tool executables. I think we should get rid of it.
1556#
sewardjb5f6f512005-03-10 23:59:00 +00001557# Check for TLS support in the compiler and linker
bart2bd9a682011-10-22 09:46:16 +00001558AC_LINK_IFELSE([AC_LANG_PROGRAM([[static __thread int foo;]],
1559 [[return foo;]])],
1560 [vg_cv_linktime_tls=yes],
1561 [vg_cv_linktime_tls=no])
bartca9f2ad2008-06-02 07:14:20 +00001562# Native compilation: check whether running a program using TLS succeeds.
1563# Linking only is not sufficient -- e.g. on Red Hat 7.3 linking TLS programs
1564# succeeds but running programs using TLS fails.
bart2bd9a682011-10-22 09:46:16 +00001565# Cross-compiling: check whether linking a program using TLS succeeds.
bartca9f2ad2008-06-02 07:14:20 +00001566AC_CACHE_CHECK([for TLS support], vg_cv_tls,
1567 [AC_ARG_ENABLE(tls, [ --enable-tls platform supports TLS],
1568 [vg_cv_tls=$enableval],
1569 [AC_RUN_IFELSE([AC_LANG_PROGRAM([[static __thread int foo;]],
1570 [[return foo;]])],
1571 [vg_cv_tls=yes],
bart2bd9a682011-10-22 09:46:16 +00001572 [vg_cv_tls=no],
1573 [vg_cv_tls=$vg_cv_linktime_tls])])])
sewardjb5f6f512005-03-10 23:59:00 +00001574
1575if test "$vg_cv_tls" = yes; then
1576AC_DEFINE([HAVE_TLS], 1, [can use __thread to define thread-local variables])
1577fi
sewardj5b754b42002-06-03 22:53:35 +00001578
sewardj535c50f2005-06-04 23:14:53 +00001579
njn7fd6d382009-01-22 21:56:32 +00001580#----------------------------------------------------------------------------
bart62f54e42008-07-28 11:35:10 +00001581# Checks for C header files.
njn7fd6d382009-01-22 21:56:32 +00001582#----------------------------------------------------------------------------
1583
sewardjde4a1d02002-03-22 01:27:54 +00001584AC_HEADER_STDC
bartf5ceec82008-04-26 07:45:10 +00001585AC_CHECK_HEADERS([ \
bart1f2b1432009-01-16 12:06:54 +00001586 asm/unistd.h \
bartf5ceec82008-04-26 07:45:10 +00001587 endian.h \
1588 mqueue.h \
1589 sys/endian.h \
1590 sys/epoll.h \
1591 sys/eventfd.h \
bartce48fa92008-04-26 10:59:46 +00001592 sys/klog.h \
bartf5ceec82008-04-26 07:45:10 +00001593 sys/poll.h \
bart71bad292008-04-27 11:43:23 +00001594 sys/signal.h \
bartf5ceec82008-04-26 07:45:10 +00001595 sys/signalfd.h \
bart71bad292008-04-27 11:43:23 +00001596 sys/syscall.h \
1597 sys/time.h \
1598 sys/types.h \
bartf5ceec82008-04-26 07:45:10 +00001599 ])
sewardjde4a1d02002-03-22 01:27:54 +00001600
bart818f17e2011-09-17 06:24:49 +00001601# Verify whether the <linux/futex.h> header is usable.
1602AC_MSG_CHECKING([if <linux/futex.h> is usable])
1603
bart417cf3e2011-10-22 09:21:24 +00001604AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
bart818f17e2011-09-17 06:24:49 +00001605#include <linux/futex.h>
bart417cf3e2011-10-22 09:21:24 +00001606]], [[
bart818f17e2011-09-17 06:24:49 +00001607 return FUTEX_WAIT;
bart417cf3e2011-10-22 09:21:24 +00001608]])], [
bart818f17e2011-09-17 06:24:49 +00001609AC_DEFINE([HAVE_USABLE_LINUX_FUTEX_H], 1,
1610 [Define to 1 if you have a usable <linux/futex.h> header file.])
1611AC_MSG_RESULT([yes])
1612], [
1613AC_MSG_RESULT([no])
1614])
1615
njn7fd6d382009-01-22 21:56:32 +00001616#----------------------------------------------------------------------------
sewardjde4a1d02002-03-22 01:27:54 +00001617# Checks for typedefs, structures, and compiler characteristics.
njn7fd6d382009-01-22 21:56:32 +00001618#----------------------------------------------------------------------------
sewardjde4a1d02002-03-22 01:27:54 +00001619AC_TYPE_UID_T
1620AC_TYPE_OFF_T
1621AC_TYPE_SIZE_T
1622AC_HEADER_TIME
1623
sewardj535c50f2005-06-04 23:14:53 +00001624
njn7fd6d382009-01-22 21:56:32 +00001625#----------------------------------------------------------------------------
sewardjde4a1d02002-03-22 01:27:54 +00001626# Checks for library functions.
njn7fd6d382009-01-22 21:56:32 +00001627#----------------------------------------------------------------------------
sewardjde4a1d02002-03-22 01:27:54 +00001628AC_FUNC_MEMCMP
1629AC_FUNC_MMAP
sewardjde4a1d02002-03-22 01:27:54 +00001630
bart26288e42011-04-03 16:46:01 +00001631AC_CHECK_LIB([pthread], [pthread_create])
bart71bad292008-04-27 11:43:23 +00001632AC_CHECK_LIB([rt], [clock_gettime])
bart41ac62a2008-07-07 16:58:03 +00001633
bartf5ceec82008-04-26 07:45:10 +00001634AC_CHECK_FUNCS([ \
bart71bad292008-04-27 11:43:23 +00001635 clock_gettime\
bartf5ceec82008-04-26 07:45:10 +00001636 epoll_create \
1637 epoll_pwait \
bartce48fa92008-04-26 10:59:46 +00001638 klogctl \
bartf5ceec82008-04-26 07:45:10 +00001639 mallinfo \
1640 memchr \
1641 memset \
1642 mkdir \
njnf76d27a2009-05-28 01:53:07 +00001643 mremap \
bartf5ceec82008-04-26 07:45:10 +00001644 ppoll \
bart6d45e922009-01-20 13:45:38 +00001645 pthread_barrier_init \
1646 pthread_condattr_setclock \
1647 pthread_mutex_timedlock \
1648 pthread_rwlock_timedrdlock \
1649 pthread_rwlock_timedwrlock \
1650 pthread_spin_lock \
barta72a27b2010-04-29 06:22:17 +00001651 pthread_yield \
bartd1f724c2009-08-26 18:11:18 +00001652 readlinkat \
bartf5ceec82008-04-26 07:45:10 +00001653 semtimedop \
1654 signalfd \
njn6cc22472009-03-16 03:46:48 +00001655 sigwaitinfo \
bartf5ceec82008-04-26 07:45:10 +00001656 strchr \
1657 strdup \
1658 strpbrk \
1659 strrchr \
1660 strstr \
barta72a27b2010-04-29 06:22:17 +00001661 syscall \
bartf5ceec82008-04-26 07:45:10 +00001662 utimensat \
1663 ])
sewardjde4a1d02002-03-22 01:27:54 +00001664
bart623eec32008-07-29 17:54:49 +00001665# AC_CHECK_LIB adds any library found to the variable LIBS, and links these
1666# libraries with any shared object and/or executable. This is NOT what we
1667# want for e.g. vgpreload_core-x86-linux.so
1668LIBS=""
sewardj80637752006-03-02 13:48:21 +00001669
bart6d45e922009-01-20 13:45:38 +00001670AM_CONDITIONAL([HAVE_PTHREAD_BARRIER],
1671 [test x$ac_cv_func_pthread_barrier_init = xyes])
bart2eaa8f22009-01-20 14:01:16 +00001672AM_CONDITIONAL([HAVE_PTHREAD_MUTEX_TIMEDLOCK],
1673 [test x$ac_cv_func_pthread_mutex_timedlock = xyes])
bart6d45e922009-01-20 13:45:38 +00001674AM_CONDITIONAL([HAVE_PTHREAD_SPINLOCK],
1675 [test x$ac_cv_func_pthread_spin_lock = xyes])
1676
njn7fd6d382009-01-22 21:56:32 +00001677
1678#----------------------------------------------------------------------------
1679# MPI checks
1680#----------------------------------------------------------------------------
sewardj03d86f22006-10-17 00:57:24 +00001681# Do we have a useable MPI setup on the primary and/or secondary targets?
1682# On Linux, by default, assumes mpicc and -m32/-m64
sewardje9fa5062006-03-12 18:29:18 +00001683# Note: this is a kludge in that it assumes the specified mpicc
sewardj6e9de462011-06-28 07:25:29 +00001684# understands -m32/-m64 regardless of what is specified using
sewardj03d86f22006-10-17 00:57:24 +00001685# --with-mpicc=.
sewardj0ad46092006-03-02 17:09:16 +00001686MPI_CC="mpicc"
sewardj03d86f22006-10-17 00:57:24 +00001687
sewardje9fa5062006-03-12 18:29:18 +00001688mflag_primary=
njn7fd6d382009-01-22 21:56:32 +00001689if test x$VGCONF_PLATFORM_PRI_CAPS = xX86_LINUX \
sewardj6e9de462011-06-28 07:25:29 +00001690 -o x$VGCONF_PLATFORM_PRI_CAPS = xPPC32_LINUX \
1691 -o x$VGCONF_PLATFORM_PRI_CAPS = xARM_LINUX ; then
sewardje9fa5062006-03-12 18:29:18 +00001692 mflag_primary=$FLAG_M32
njn7fd6d382009-01-22 21:56:32 +00001693elif test x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_LINUX \
sewardjb5b87402011-03-07 16:05:35 +00001694 -o x$VGCONF_PLATFORM_PRI_CAPS = xPPC64_LINUX \
1695 -o x$VGCONF_PLATFORM_PRI_CAPS = xS390X_LINUX ; then
sewardje9fa5062006-03-12 18:29:18 +00001696 mflag_primary=$FLAG_M64
1697fi
1698
sewardj03d86f22006-10-17 00:57:24 +00001699mflag_secondary=
njn7fd6d382009-01-22 21:56:32 +00001700if test x$VGCONF_PLATFORM_SEC_CAPS = xX86_LINUX \
1701 -o x$VGCONF_PLATFORM_SEC_CAPS = xPPC32_LINUX ; then
sewardj03d86f22006-10-17 00:57:24 +00001702 mflag_secondary=$FLAG_M32
sewardj03d86f22006-10-17 00:57:24 +00001703fi
1704
1705
sewardj0ad46092006-03-02 17:09:16 +00001706AC_ARG_WITH(mpicc,
sewardjb70a6132006-05-27 21:14:09 +00001707 [ --with-mpicc= Specify name of MPI2-ised C compiler],
sewardj0ad46092006-03-02 17:09:16 +00001708 MPI_CC=$withval
1709)
sewardj03d86f22006-10-17 00:57:24 +00001710AC_SUBST(MPI_CC)
1711
1712## See if MPI_CC works for the primary target
1713##
1714AC_MSG_CHECKING([primary target for usable MPI2-compliant C compiler and mpi.h])
sewardj0ad46092006-03-02 17:09:16 +00001715saved_CC=$CC
sewardjde4f3842006-03-09 02:41:41 +00001716saved_CFLAGS=$CFLAGS
sewardj0ad46092006-03-02 17:09:16 +00001717CC=$MPI_CC
sewardje9fa5062006-03-12 18:29:18 +00001718CFLAGS=$mflag_primary
bart417cf3e2011-10-22 09:21:24 +00001719AC_LINK_IFELSE([AC_LANG_PROGRAM([[
sewardj1a85e602006-03-08 15:26:10 +00001720#include <mpi.h>
1721#include <stdio.h>
bart417cf3e2011-10-22 09:21:24 +00001722]], [[
sewardjde4f3842006-03-09 02:41:41 +00001723 int r = MPI_Init(NULL,NULL);
1724 r |= MPI_Type_get_contents( MPI_INT, 0,0,0, NULL,NULL,NULL );
1725 return r;
bart417cf3e2011-10-22 09:21:24 +00001726]])], [
sewardj03d86f22006-10-17 00:57:24 +00001727ac_have_mpi2_pri=yes
sewardj1a85e602006-03-08 15:26:10 +00001728AC_MSG_RESULT([yes, $MPI_CC])
sewardj80637752006-03-02 13:48:21 +00001729], [
sewardj03d86f22006-10-17 00:57:24 +00001730ac_have_mpi2_pri=no
sewardj80637752006-03-02 13:48:21 +00001731AC_MSG_RESULT([no])
1732])
sewardj0ad46092006-03-02 17:09:16 +00001733CC=$saved_CC
sewardjde4f3842006-03-09 02:41:41 +00001734CFLAGS=$saved_CFLAGS
sewardj03d86f22006-10-17 00:57:24 +00001735AM_CONDITIONAL(BUILD_MPIWRAP_PRI, test x$ac_have_mpi2_pri = xyes)
sewardj80637752006-03-02 13:48:21 +00001736
sewardj03d86f22006-10-17 00:57:24 +00001737## See if MPI_CC works for the secondary target. Complication: what if
1738## there is no secondary target? We need this to then fail.
1739## Kludge this by making MPI_CC something which will surely fail in
1740## such a case.
1741##
1742AC_MSG_CHECKING([secondary target for usable MPI2-compliant C compiler and mpi.h])
1743saved_CC=$CC
1744saved_CFLAGS=$CFLAGS
njn7fd6d382009-01-22 21:56:32 +00001745if test x$VGCONF_PLATFORM_SEC_CAPS = x ; then
sewardj03d86f22006-10-17 00:57:24 +00001746 CC="$MPI_CC this will surely fail"
1747else
1748 CC=$MPI_CC
1749fi
1750CFLAGS=$mflag_secondary
bart417cf3e2011-10-22 09:21:24 +00001751AC_LINK_IFELSE([AC_LANG_PROGRAM([[
sewardj03d86f22006-10-17 00:57:24 +00001752#include <mpi.h>
1753#include <stdio.h>
bart417cf3e2011-10-22 09:21:24 +00001754]], [[
sewardj03d86f22006-10-17 00:57:24 +00001755 int r = MPI_Init(NULL,NULL);
1756 r |= MPI_Type_get_contents( MPI_INT, 0,0,0, NULL,NULL,NULL );
1757 return r;
bart417cf3e2011-10-22 09:21:24 +00001758]])], [
sewardj03d86f22006-10-17 00:57:24 +00001759ac_have_mpi2_sec=yes
1760AC_MSG_RESULT([yes, $MPI_CC])
1761], [
1762ac_have_mpi2_sec=no
1763AC_MSG_RESULT([no])
1764])
1765CC=$saved_CC
1766CFLAGS=$saved_CFLAGS
1767AM_CONDITIONAL(BUILD_MPIWRAP_SEC, test x$ac_have_mpi2_sec = xyes)
sewardj80637752006-03-02 13:48:21 +00001768
1769
njn7fd6d382009-01-22 21:56:32 +00001770#----------------------------------------------------------------------------
1771# Other library checks
1772#----------------------------------------------------------------------------
bart2ef12d42010-10-18 16:32:11 +00001773# There now follow some tests for Boost, and OpenMP. These
sewardj493c4ef2008-12-13 16:45:19 +00001774# tests are present because Drd has some regression tests that use
1775# these packages. All regression test programs all compiled only
1776# for the primary target. And so it is important that the configure
1777# checks that follow, use the correct -m32 or -m64 flag for the
1778# primary target (called $mflag_primary). Otherwise, we can end up
1779# in a situation (eg) where, on amd64-linux, the test for Boost checks
1780# for usable 64-bit Boost facilities, but because we are doing a 32-bit
1781# only build (meaning, the primary target is x86-linux), the build
1782# of the regtest programs that use Boost fails, because they are
1783# build as 32-bit (IN THIS EXAMPLE).
1784#
1785# Hence: ALWAYS USE $mflag_primary FOR CONFIGURE TESTS FOR FACILITIES
1786# NEEDED BY THE REGRESSION TEST PROGRAMS.
1787
1788
sewardj493c4ef2008-12-13 16:45:19 +00001789# Check whether the boost library 1.35 or later has been installed.
1790# The Boost.Threads library has undergone a major rewrite in version 1.35.0.
1791
1792AC_MSG_CHECKING([for boost])
1793
1794AC_LANG(C++)
1795safe_CXXFLAGS=$CXXFLAGS
1796CXXFLAGS="-lboost_thread-mt $mflag_primary"
1797
bart128fc522011-03-12 10:36:35 +00001798AC_LINK_IFELSE([AC_LANG_SOURCE([
sewardj493c4ef2008-12-13 16:45:19 +00001799#include <boost/thread.hpp>
1800static void thread_func(void)
1801{ }
1802int main(int argc, char** argv)
1803{
1804 boost::thread t(thread_func);
1805 return 0;
1806}
bart128fc522011-03-12 10:36:35 +00001807])],
sewardj493c4ef2008-12-13 16:45:19 +00001808[
1809ac_have_boost_1_35=yes
1810AC_SUBST([BOOST_CFLAGS], [])
1811AC_SUBST([BOOST_LIBS], ["${CXXFLAGS}"])
1812AC_MSG_RESULT([yes])
1813], [
1814ac_have_boost_1_35=no
1815AC_MSG_RESULT([no])
1816])
1817
1818CXXFLAGS=$safe_CXXFLAGS
1819AC_LANG(C)
1820
1821AM_CONDITIONAL([HAVE_BOOST_1_35], [test x$ac_have_boost_1_35 = xyes])
1822
1823
1824# does this compiler support -fopenmp, does it have the include file
1825# <omp.h> and does it have libgomp ?
1826
1827AC_MSG_CHECKING([for OpenMP])
1828
1829safe_CFLAGS=$CFLAGS
sewardjc876a2f2009-01-22 22:44:30 +00001830CFLAGS="-fopenmp $mflag_primary"
sewardj493c4ef2008-12-13 16:45:19 +00001831
bart128fc522011-03-12 10:36:35 +00001832AC_LINK_IFELSE([AC_LANG_SOURCE([
sewardj493c4ef2008-12-13 16:45:19 +00001833#include <omp.h>
1834int main(int argc, char** argv)
1835{
1836 omp_set_dynamic(0);
1837 return 0;
1838}
bart128fc522011-03-12 10:36:35 +00001839])],
sewardj493c4ef2008-12-13 16:45:19 +00001840[
1841ac_have_openmp=yes
1842AC_MSG_RESULT([yes])
1843], [
1844ac_have_openmp=no
1845AC_MSG_RESULT([no])
1846])
1847CFLAGS=$safe_CFLAGS
1848
1849AM_CONDITIONAL([HAVE_OPENMP], [test x$ac_have_openmp = xyes])
1850
1851
sewardjc876a2f2009-01-22 22:44:30 +00001852# does this compiler have built-in functions for atomic memory access ?
1853AC_MSG_CHECKING([if gcc supports __sync_bool_compare_and_swap])
1854
1855safe_CFLAGS=$CFLAGS
1856CFLAGS="$mflag_primary"
1857
bart417cf3e2011-10-22 09:21:24 +00001858AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[
sewardjc876a2f2009-01-22 22:44:30 +00001859 int variable = 1;
1860 return (__sync_bool_compare_and_swap(&variable, 1, 2)
1861 && __sync_add_and_fetch(&variable, 1) ? 1 : 0)
bart417cf3e2011-10-22 09:21:24 +00001862]])], [
bartc82d1372009-05-31 16:21:23 +00001863 ac_have_builtin_atomic=yes
sewardjc876a2f2009-01-22 22:44:30 +00001864 AC_MSG_RESULT([yes])
barte8740422011-03-24 20:27:54 +00001865 AC_DEFINE(HAVE_BUILTIN_ATOMIC, 1, [Define to 1 if gcc supports __sync_bool_compare_and_swap() and __sync_add_and_fetch()])
bart417cf3e2011-10-22 09:21:24 +00001866], [
bartc82d1372009-05-31 16:21:23 +00001867 ac_have_builtin_atomic=no
sewardjc876a2f2009-01-22 22:44:30 +00001868 AC_MSG_RESULT([no])
1869])
1870
1871CFLAGS=$safe_CFLAGS
1872
bartc82d1372009-05-31 16:21:23 +00001873AM_CONDITIONAL([HAVE_BUILTIN_ATOMIC], [test x$ac_have_builtin_atomic = xyes])
1874
barte8740422011-03-24 20:27:54 +00001875# does g++ have built-in functions for atomic memory access ?
1876AC_MSG_CHECKING([if g++ supports __sync_bool_compare_and_swap])
1877
1878safe_CXXFLAGS=$CXXFLAGS
1879CXXFLAGS="$mflag_primary"
1880
1881AC_LANG_PUSH(C++)
bart417cf3e2011-10-22 09:21:24 +00001882AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[
barte8740422011-03-24 20:27:54 +00001883 int variable = 1;
1884 return (__sync_bool_compare_and_swap(&variable, 1, 2)
1885 && __sync_add_and_fetch(&variable, 1) ? 1 : 0)
bart417cf3e2011-10-22 09:21:24 +00001886]])], [
barte8740422011-03-24 20:27:54 +00001887 ac_have_builtin_atomic_cxx=yes
1888 AC_MSG_RESULT([yes])
1889 AC_DEFINE(HAVE_BUILTIN_ATOMIC_CXX, 1, [Define to 1 if g++ supports __sync_bool_compare_and_swap() and __sync_add_and_fetch()])
bart417cf3e2011-10-22 09:21:24 +00001890], [
barte8740422011-03-24 20:27:54 +00001891 ac_have_builtin_atomic_cxx=no
1892 AC_MSG_RESULT([no])
1893])
1894AC_LANG_POP(C++)
1895
1896CXXFLAGS=$safe_CXXFLAGS
1897
1898AM_CONDITIONAL([HAVE_BUILTIN_ATOMIC_CXX], [test x$ac_have_builtin_atomic_cxx = xyes])
sewardjc876a2f2009-01-22 22:44:30 +00001899
njn7fd6d382009-01-22 21:56:32 +00001900#----------------------------------------------------------------------------
1901# Ok. We're done checking.
1902#----------------------------------------------------------------------------
sewardj80637752006-03-02 13:48:21 +00001903
njn8b68b642009-06-24 00:37:09 +00001904# Nb: VEX/Makefile is generated from Makefile.vex.in.
1905AC_CONFIG_FILES([
sewardjde4a1d02002-03-22 01:27:54 +00001906 Makefile
njn8b68b642009-06-24 00:37:09 +00001907 VEX/Makefile:Makefile.vex.in
njn25cac76cb2002-09-23 11:21:57 +00001908 valgrind.spec
muellerbddd6072003-11-19 21:50:07 +00001909 valgrind.pc
dirk07596a22008-04-25 11:33:30 +00001910 glibc-2.X.supp
njn254d542432002-09-23 16:09:39 +00001911 docs/Makefile
1912 tests/Makefile
njnc2e7f482002-09-27 08:44:17 +00001913 tests/vg_regtest
njnec0c27a2005-12-10 23:11:28 +00001914 perf/Makefile
1915 perf/vg_perf
sewardj3b290482011-05-06 21:02:55 +00001916 gdbserver_tests/Makefile
njn254d542432002-09-23 16:09:39 +00001917 include/Makefile
njn7a6e7462002-11-09 17:53:30 +00001918 auxprogs/Makefile
njn8b68b642009-06-24 00:37:09 +00001919 mpi/Makefile
njn25ab726032002-09-23 16:24:41 +00001920 coregrind/Makefile
njn25cac76cb2002-09-23 11:21:57 +00001921 memcheck/Makefile
1922 memcheck/tests/Makefile
njnc6168192004-11-29 13:54:10 +00001923 memcheck/tests/amd64/Makefile
njnc6168192004-11-29 13:54:10 +00001924 memcheck/tests/x86/Makefile
njn3b3b76d2009-01-19 03:44:19 +00001925 memcheck/tests/linux/Makefile
njnf76d27a2009-05-28 01:53:07 +00001926 memcheck/tests/darwin/Makefile
njnea2d6fd2010-07-01 00:20:20 +00001927 memcheck/tests/amd64-linux/Makefile
njna454ec02009-01-19 03:16:59 +00001928 memcheck/tests/x86-linux/Makefile
sewardj0e342a02010-09-03 23:49:33 +00001929 memcheck/tests/ppc32/Makefile
1930 memcheck/tests/ppc64/Makefile
njn29a5c012009-05-06 06:15:55 +00001931 memcheck/perf/Makefile
njn25cac76cb2002-09-23 11:21:57 +00001932 cachegrind/Makefile
njn25cac76cb2002-09-23 11:21:57 +00001933 cachegrind/tests/Makefile
njnc6168192004-11-29 13:54:10 +00001934 cachegrind/tests/x86/Makefile
njnf2df9b52002-10-04 11:35:47 +00001935 cachegrind/cg_annotate
njn69d495d2010-06-30 05:23:34 +00001936 cachegrind/cg_diff
weidendoa17f2a32006-03-20 10:27:30 +00001937 callgrind/Makefile
1938 callgrind/callgrind_annotate
1939 callgrind/callgrind_control
1940 callgrind/tests/Makefile
njn25cac76cb2002-09-23 11:21:57 +00001941 helgrind/Makefile
njnf2df9b52002-10-04 11:35:47 +00001942 helgrind/tests/Makefile
nethercotec9f36922004-02-14 16:40:02 +00001943 massif/Makefile
nethercotec9f36922004-02-14 16:40:02 +00001944 massif/tests/Makefile
njn734b8052007-11-01 04:40:37 +00001945 massif/perf/Makefile
njnd5a8d242007-11-02 20:44:57 +00001946 massif/ms_print
njn25cac76cb2002-09-23 11:21:57 +00001947 lackey/Makefile
njnf2df9b52002-10-04 11:35:47 +00001948 lackey/tests/Makefile
njn25cac76cb2002-09-23 11:21:57 +00001949 none/Makefile
1950 none/tests/Makefile
njnc6168192004-11-29 13:54:10 +00001951 none/tests/amd64/Makefile
cerion85665ca2005-06-20 15:51:07 +00001952 none/tests/ppc32/Makefile
sewardj2c48c7b2005-11-29 13:05:56 +00001953 none/tests/ppc64/Makefile
njnc6168192004-11-29 13:54:10 +00001954 none/tests/x86/Makefile
sewardj59570ff2010-01-01 11:59:33 +00001955 none/tests/arm/Makefile
sewardjb5b87402011-03-07 16:05:35 +00001956 none/tests/s390x/Makefile
njn0458a122009-02-13 06:23:46 +00001957 none/tests/linux/Makefile
njnf76d27a2009-05-28 01:53:07 +00001958 none/tests/darwin/Makefile
njn06ca3322009-04-15 23:10:04 +00001959 none/tests/x86-linux/Makefile
sewardjd2f95a02011-05-11 16:04:28 +00001960 exp-sgcheck/Makefile
1961 exp-sgcheck/tests/Makefile
bartccf17de2008-07-04 15:14:35 +00001962 drd/Makefile
bartccf17de2008-07-04 15:14:35 +00001963 drd/scripts/download-and-build-splash2
1964 drd/tests/Makefile
njndbebecc2009-07-14 01:39:54 +00001965 exp-bbv/Makefile
njndbebecc2009-07-14 01:39:54 +00001966 exp-bbv/tests/Makefile
1967 exp-bbv/tests/x86/Makefile
1968 exp-bbv/tests/x86-linux/Makefile
1969 exp-bbv/tests/amd64-linux/Makefile
1970 exp-bbv/tests/ppc32-linux/Makefile
vince226e0782010-01-06 15:22:11 +00001971 exp-bbv/tests/arm-linux/Makefile
sewardj4d7d8f52010-10-12 10:09:15 +00001972 exp-dhat/Makefile
1973 exp-dhat/tests/Makefile
njn8b68b642009-06-24 00:37:09 +00001974])
sewardjd3645802010-06-13 22:13:58 +00001975AC_CONFIG_FILES([coregrind/link_tool_exe_linux],
1976 [chmod +x coregrind/link_tool_exe_linux])
1977AC_CONFIG_FILES([coregrind/link_tool_exe_darwin],
1978 [chmod +x coregrind/link_tool_exe_darwin])
njn8b68b642009-06-24 00:37:09 +00001979AC_OUTPUT
gobry3b777892002-04-04 09:18:39 +00001980
1981cat<<EOF
1982
njn311303f2009-02-06 03:46:50 +00001983 Maximum build arch: ${ARCH_MAX}
1984 Primary build arch: ${VGCONF_ARCH_PRI}
njn3f8a6e92009-06-02 00:20:47 +00001985 Secondary build arch: ${VGCONF_ARCH_SEC}
njn311303f2009-02-06 03:46:50 +00001986 Build OS: ${VGCONF_OS}
njn7fd6d382009-01-22 21:56:32 +00001987 Primary build target: ${VGCONF_PLATFORM_PRI_CAPS}
1988 Secondary build target: ${VGCONF_PLATFORM_SEC_CAPS}
sewardjcb495c82011-07-11 20:42:34 +00001989 Platform variant: ${VGCONF_PLATVARIANT}
1990 Primary -DVGPV string: -DVGPV_${VGCONF_ARCH_PRI}_${VGCONF_OS}_${VGCONF_PLATVARIANT}=1
sewardje95d94f2008-09-19 09:02:19 +00001991 Default supp files: ${DEFAULT_SUPP}
gobry3b777892002-04-04 09:18:39 +00001992
gobry3b777892002-04-04 09:18:39 +00001993EOF