Add support for reading DWARF4 .debug_types sections. Fixes #284124.
[ambi/valgrind.git] / configure.in
1
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
10 # Process this file with autoconf to produce a configure script.
11 AC_INIT([Valgrind],[3.8.0.SVN],[valgrind-users@lists.sourceforge.net])
12 AC_CONFIG_SRCDIR(coregrind/m_main.c)
13 AC_CONFIG_HEADERS([config.h])
14 AM_INIT_AUTOMAKE([foreign])
15
16 AM_MAINTAINER_MODE
17
18 #----------------------------------------------------------------------------
19 # Checks for various programs.
20 #----------------------------------------------------------------------------
21 CFLAGS="-Wno-long-long $CFLAGS"
22
23 AC_PROG_LN_S
24 AC_PROG_CC
25 AM_PROG_CC_C_O
26 AC_PROG_CPP
27 AC_PROG_CXX
28 # 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:
32 # - 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 #        ])
41 AC_PROG_RANLIB
42 # provide a very basic definition for AC_PROG_SED if it's not provided by
43 # autoconf (as e.g. in autoconf 2.59).
44 m4_ifndef([AC_PROG_SED],
45           [AC_DEFUN([AC_PROG_SED],
46                     [AC_ARG_VAR([SED])
47                      AC_CHECK_PROGS([SED],[gsed sed])])])
48 AC_PROG_SED
49
50 # If no AR variable was specified, look up the name of the archiver. Otherwise
51 # do not touch the AR variable.
52 if test "x$AR" = "x"; then
53   AC_PATH_PROGS([AR], [`echo $LD | $SED 's/ld$/ar/'` "ar"], [ar])
54 fi
55 AC_ARG_VAR([AR],[Archiver command])
56
57 # Check for the compiler support
58 if test "${GCC}" != "yes" ; then
59    AC_MSG_ERROR([Valgrind relies on GCC to be compiled])
60 fi
61
62 # figure out where perl lives
63 AC_PATH_PROG(PERL, perl)
64
65 # figure out where gdb lives
66 AC_PATH_PROG(GDB, gdb, "/no/gdb/was/found/at/configure/time")
67 AC_DEFINE_UNQUOTED(GDB_PATH, "$GDB", [path to GDB])
68
69 # some older automake's don't have it so try something on our own
70 ifdef([AM_PROG_AS],[AM_PROG_AS],
71 [
72 AS="${CC}"
73 AC_SUBST(AS)
74
75 ASFLAGS=""
76 AC_SUBST(ASFLAGS)
77 ])
78
79
80 # Check if 'diff' supports -u (universal diffs) and use it if possible.
81
82 AC_MSG_CHECKING([for diff -u])
83 AC_SUBST(DIFF)
84
85 # Comparing two identical files results in 0.
86 tmpfile="tmp-xxx-yyy-zzz"
87 touch $tmpfile;
88 if diff -u $tmpfile $tmpfile ; then
89     AC_MSG_RESULT([yes])
90     DIFF="diff -u"
91 else
92     AC_MSG_RESULT([no])
93     DIFF="diff"
94 fi
95 rm $tmpfile
96
97
98 # We don't want gcc < 3.0
99 AC_MSG_CHECKING([for a supported version of gcc])
100
101 # Obtain the compiler version.
102
103 # A few examples of how the ${CC} --version output looks like:
104 #
105 # Arch Linux: i686-pc-linux-gnu-gcc (GCC) 4.6.2
106 # Debian Linux: gcc (Debian 4.3.2-1.1) 4.3.2
107 # openSUSE: gcc (SUSE Linux) 4.5.1 20101208 [gcc-4_5-branch revision 167585]
108 # Exherbo Linux: x86_64-pc-linux-gnu-gcc (Exherbo gcc-4.6.2) 4.6.2
109 # MontaVista Linux for ARM: arm-none-linux-gnueabi-gcc (Sourcery G++ Lite 2009q1-203) 4.3.3
110 # OS/X 10.6: i686-apple-darwin10-gcc-4.2.1 (GCC) 4.2.1 (Apple Inc. build 5666) (dot 3)
111 # OS/X 10.7: i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)
112 # Clang: clang version 2.9 (tags/RELEASE_29/final)
113 #
114 [
115   gcc_version=`${CC} -dumpversion 2>/dev/null`
116   if test "x$gcc_version" = x; then
117     gcc_version=`${CC} --version \
118                | $SED -n -e 's/[^ ]*gcc[^ ]* ([^)]*) \([0-9.]*\).*$/\1/p' \
119                          -e 's/[^ ]*clang version \([0-9.]*\).*$/\1/p'`
120   fi
121 ]
122
123 is_clang="notclang"
124 if test "x`${CC} --version | head -n 1 | $SED 's/\(clang\) version.*/\1/'`" = "xclang" ; then
125    is_clang="clang"
126 fi
127
128 case "${is_clang}-${gcc_version}" in
129      notclang-3.*)
130         AC_MSG_RESULT([ok (${gcc_version})])
131         ;;
132      notclang-4.*)
133         AC_MSG_RESULT([ok (${gcc_version})])
134         ;;
135      clang-2.9)
136         AC_MSG_RESULT([ok (clang-${gcc_version})])
137         ;;
138      *)
139         AC_MSG_RESULT([no (${gcc_version})])
140         AC_MSG_ERROR([please use gcc >= 3.0 or clang >= 2.9])
141         ;;
142 esac
143
144 #----------------------------------------------------------------------------
145 # Arch/OS/platform tests.
146 #----------------------------------------------------------------------------
147 # We create a number of arch/OS/platform-related variables.  We prefix them
148 # all with "VGCONF_" which indicates that they are defined at
149 # configure-time, and distinguishes them from the VGA_*/VGO_*/VGP_*
150 # variables used when compiling C files.
151
152 AC_CANONICAL_HOST
153
154 AC_MSG_CHECKING([for a supported CPU])
155
156 # ARCH_MAX reflects the most that this CPU can do: for example if it
157 # is a 64-bit capable PowerPC, then it must be set to ppc64 and not ppc32.
158 # Ditto for amd64.  It is used for more configuration below, but is not used
159 # outside this file.
160 case "${host_cpu}" in
161      i?86) 
162         AC_MSG_RESULT([ok (${host_cpu})])
163         ARCH_MAX="x86"
164         ;;
165
166      x86_64) 
167         AC_MSG_RESULT([ok (${host_cpu})])
168         ARCH_MAX="amd64"
169         ;;
170
171      powerpc64)
172         AC_MSG_RESULT([ok (${host_cpu})])
173         ARCH_MAX="ppc64"
174         ;;
175
176      powerpc)
177         # On Linux this means only a 32-bit capable CPU.
178         AC_MSG_RESULT([ok (${host_cpu})])
179         ARCH_MAX="ppc32"
180         ;;
181
182      s390x)
183         AC_MSG_RESULT([ok (${host_cpu})])
184         ARCH_MAX="s390x"
185         ;;
186
187      armv7*)
188         AC_MSG_RESULT([ok (${host_cpu})])
189         ARCH_MAX="arm"
190         ;;
191
192      *) 
193         AC_MSG_RESULT([no (${host_cpu})])
194         AC_MSG_ERROR([Unsupported host architecture. Sorry])
195         ;;
196 esac
197
198 #----------------------------------------------------------------------------
199
200 # Sometimes it's convenient to subvert the bi-arch build system and
201 # just have a single build even though the underlying platform is
202 # capable of both.  Hence handle --enable-only64bit and
203 # --enable-only32bit.  Complain if both are issued :-)
204 # [Actually, if either of these options are used, I think both get built,
205 # but only one gets installed.  So if you use an in-place build, both can be
206 # used. --njn]
207
208 # Check if a 64-bit only build has been requested
209 AC_CACHE_CHECK([for a 64-bit only build], vg_cv_only64bit,
210    [AC_ARG_ENABLE(only64bit, 
211       [  --enable-only64bit      do a 64-bit only build],
212       [vg_cv_only64bit=$enableval],
213       [vg_cv_only64bit=no])])
214
215 # Check if a 32-bit only build has been requested
216 AC_CACHE_CHECK([for a 32-bit only build], vg_cv_only32bit,
217    [AC_ARG_ENABLE(only32bit, 
218       [  --enable-only32bit      do a 32-bit only build],
219       [vg_cv_only32bit=$enableval],
220       [vg_cv_only32bit=no])])
221
222 # Stay sane
223 if test x$vg_cv_only64bit = xyes -a x$vg_cv_only32bit = xyes; then
224    AC_MSG_ERROR(
225       [Nonsensical: both --enable-only64bit and --enable-only32bit.])
226 fi
227
228 #----------------------------------------------------------------------------
229
230 # VGCONF_OS is the primary build OS, eg. "linux".  It is passed in to
231 # compilation of many C files via -VGO_$(VGCONF_OS) and
232 # -VGP_$(VGCONF_ARCH_PRI)_$(VGCONF_OS).
233 AC_MSG_CHECKING([for a supported OS])
234 AC_SUBST(VGCONF_OS)
235
236 DEFAULT_SUPP=""
237
238 case "${host_os}" in
239      *linux*)
240         AC_MSG_RESULT([ok (${host_os})])
241         VGCONF_OS="linux"
242
243         # Ok, this is linux. Check the kernel version
244         AC_MSG_CHECKING([for the kernel version])
245
246         kernel=`uname -r`
247
248         case "${kernel}" in
249              2.6.*|3.*) 
250                     AC_MSG_RESULT([2.6.x/3.x family (${kernel})])
251                     AC_DEFINE([KERNEL_2_6], 1, [Define to 1 if you're using Linux 2.6.x or Linux 3.x])
252                     ;;
253
254              2.4.*) 
255                     AC_MSG_RESULT([2.4 family (${kernel})])
256                     AC_DEFINE([KERNEL_2_4], 1, [Define to 1 if you're using Linux 2.4.x])
257                     ;;
258
259              *) 
260                     AC_MSG_RESULT([unsupported (${kernel})])
261                     AC_MSG_ERROR([Valgrind works on kernels 2.4, 2.6])
262                     ;;
263         esac
264
265         ;;
266
267      *darwin*)
268         AC_MSG_RESULT([ok (${host_os})])
269         VGCONF_OS="darwin"
270         AC_DEFINE([DARWIN_10_5], 100500, [DARWIN_VERS value for Mac OS X 10.5])
271         AC_DEFINE([DARWIN_10_6], 100600, [DARWIN_VERS value for Mac OS X 10.6])
272         AC_DEFINE([DARWIN_10_7], 100700, [DARWIN_VERS value for Mac OS X 10.7])
273
274         AC_MSG_CHECKING([for the kernel version])
275         kernel=`uname -r`
276
277         # Nb: for Darwin we set DEFAULT_SUPP here.  That's because Darwin
278         # has only one relevant version, the OS version. The `uname` check
279         # is a good way to get that version (i.e. "Darwin 9.6.0" is Mac OS
280         # X 10.5.6, and "Darwin 10.x" is Mac OS X 10.6.x Snow Leopard,
281         # and possibly "Darwin 11.x" is Mac OS X 10.7.x Lion), 
282         # and we don't know of an macros similar to __GLIBC__ to get that info.
283         #
284         # XXX: `uname -r` won't do the right thing for cross-compiles, but
285         # that's not a problem yet.
286         #
287         # jseward 21 Sept 2011: I seriously doubt whether V 3.7.0 will work
288         # on OS X 10.5.x; I haven't tested yet, and only plan to test 3.7.0
289         # on 10.6.8 and 10.7.1.  Although tempted to delete the configure
290         # time support for 10.5 (the 9.* pattern just below), I'll leave it
291         # in for now, just in case anybody wants to give it a try.  But I'm
292         # assuming that 3.7.0 is a Snow Leopard and Lion-only release.
293         case "${kernel}" in
294              9.*)
295                   AC_MSG_RESULT([Darwin 9.x (${kernel}) / Mac OS X 10.5 Leopard])
296                   AC_DEFINE([DARWIN_VERS], DARWIN_10_5, [Darwin / Mac OS X version])
297                   DEFAULT_SUPP="darwin9.supp ${DEFAULT_SUPP}"
298                   DEFAULT_SUPP="darwin9-drd.supp ${DEFAULT_SUPP}"
299                   ;;
300              10.*)
301                   AC_MSG_RESULT([Darwin 10.x (${kernel}) / Mac OS X 10.6 Snow Leopard])
302                   AC_DEFINE([DARWIN_VERS], DARWIN_10_6, [Darwin / Mac OS X version])
303                   DEFAULT_SUPP="darwin10.supp ${DEFAULT_SUPP}"
304                   DEFAULT_SUPP="darwin10-drd.supp ${DEFAULT_SUPP}"
305                   ;;
306              11.*)
307                   AC_MSG_RESULT([Darwin 11.x (${kernel}) / Mac OS X 10.7 Lion])
308                   AC_DEFINE([DARWIN_VERS], DARWIN_10_7, [Darwin / Mac OS X version])
309                   # FIXME: change these to xx11.supp
310                   DEFAULT_SUPP="darwin11.supp ${DEFAULT_SUPP}"
311                   DEFAULT_SUPP="darwin10-drd.supp ${DEFAULT_SUPP}"
312                   ;;
313              *) 
314                   AC_MSG_RESULT([unsupported (${kernel})])
315                   AC_MSG_ERROR([Valgrind works on Darwin 10.x and 11.x (Mac OS X 10.6/7)])
316                   ;;
317         esac
318         ;;
319
320      *) 
321         AC_MSG_RESULT([no (${host_os})])
322         AC_MSG_ERROR([Valgrind is operating system specific. Sorry.])
323         ;;
324 esac
325
326 #----------------------------------------------------------------------------
327
328 # If we are building on a 64 bit platform test to see if the system
329 # supports building 32 bit programs and disable 32 bit support if it
330 # does not support building 32 bit programs
331
332 case "$ARCH_MAX-$VGCONF_OS" in
333      amd64-linux|ppc64-linux)
334         AC_MSG_CHECKING([for 32 bit build support])
335         safe_CFLAGS=$CFLAGS
336         CFLAGS="-m32"
337         AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[
338           return 0;
339         ]])], [
340         AC_MSG_RESULT([yes])
341         ], [
342         vg_cv_only64bit="yes"
343         AC_MSG_RESULT([no])
344         ])
345         CFLAGS=$safe_CFLAGS;;
346 esac
347
348 if test x$vg_cv_only64bit = xyes -a x$vg_cv_only32bit = xyes; then
349    AC_MSG_ERROR(
350       [--enable-only32bit was specified but system does not support 32 bit builds])
351 fi
352
353 #----------------------------------------------------------------------------
354
355 # VGCONF_ARCH_PRI is the arch for the primary build target, eg. "amd64".  By
356 # default it's the same as ARCH_MAX.  But if, say, we do a build on an amd64
357 # machine, but --enable-only32bit has been requested, then ARCH_MAX (see
358 # above) will be "amd64" since that reflects the most that this cpu can do,
359 # but VGCONF_ARCH_PRI will be downgraded to "x86", since that reflects the
360 # arch corresponding to the primary build (VGCONF_PLATFORM_PRI_CAPS).  It is
361 # passed in to compilation of many C files via -VGA_$(VGCONF_ARCH_PRI) and
362 # -VGP_$(VGCONF_ARCH_PRI)_$(VGCONF_OS).
363 AC_SUBST(VGCONF_ARCH_PRI)
364
365 # VGCONF_ARCH_SEC is the arch for the secondary build target, eg. "x86".
366 # It is passed in to compilation of many C files via -VGA_$(VGCONF_ARCH_SEC)
367 # and -VGP_$(VGCONF_ARCH_SEC)_$(VGCONF_OS), if there is a secondary target.
368 # It is empty if there is no secondary target.
369 AC_SUBST(VGCONF_ARCH_SEC)
370
371 # VGCONF_PLATFORM_PRI_CAPS is the primary build target, eg. "AMD64_LINUX".
372 # The entire system, including regression and performance tests, will be
373 # built for this target.  The "_CAPS" indicates that the name is in capital
374 # letters, and it also uses '_' rather than '-' as a separator, because it's
375 # used to create various Makefile variables, which are all in caps by
376 # convention and cannot contain '-' characters.  This is in contrast to
377 # VGCONF_ARCH_PRI and VGCONF_OS which are not in caps.
378 AC_SUBST(VGCONF_PLATFORM_PRI_CAPS)
379
380 # VGCONF_PLATFORM_SEC_CAPS is the secondary build target, if there is one.
381 # Valgrind and tools will also be built for this target, but not the
382 # regression or performance tests.
383 #
384 # By default, the primary arch is the same as the "max" arch, as commented
385 # above (at the definition of ARCH_MAX).  We may choose to downgrade it in
386 # the big case statement just below here, in the case where we're building
387 # on a 64 bit machine but have been requested only to do a 32 bit build.
388 AC_SUBST(VGCONF_PLATFORM_SEC_CAPS)
389
390 AC_MSG_CHECKING([for a supported CPU/OS combination])
391
392 # NB.  The load address for a given platform may be specified in more 
393 # than one place, in some cases, depending on whether we're doing a biarch,
394 # 32-bit only or 64-bit only build.  eg see case for amd64-linux below.
395 # Be careful to give consistent values in all subcases.  Also, all four
396 # valt_load_addres_{pri,sec}_{norml,inner} values must always be set,
397 # even if it is to "0xUNSET".
398 #
399 case "$ARCH_MAX-$VGCONF_OS" in
400      x86-linux)
401         VGCONF_ARCH_PRI="x86"
402         VGCONF_ARCH_SEC=""
403         VGCONF_PLATFORM_PRI_CAPS="X86_LINUX"
404         VGCONF_PLATFORM_SEC_CAPS=""
405         valt_load_address_pri_norml="0x38000000"
406         valt_load_address_pri_inner="0x28000000"
407         valt_load_address_sec_norml="0xUNSET"
408         valt_load_address_sec_inner="0xUNSET"
409         AC_MSG_RESULT([ok (${ARCH_MAX}-${VGCONF_OS})])
410         ;;
411      amd64-linux)
412         valt_load_address_sec_norml="0xUNSET"
413         valt_load_address_sec_inner="0xUNSET"
414         if test x$vg_cv_only64bit = xyes; then
415            VGCONF_ARCH_PRI="amd64"
416            VGCONF_ARCH_SEC=""
417            VGCONF_PLATFORM_PRI_CAPS="AMD64_LINUX"
418            VGCONF_PLATFORM_SEC_CAPS=""
419            valt_load_address_pri_norml="0x38000000"
420            valt_load_address_pri_inner="0x28000000"
421         elif test x$vg_cv_only32bit = xyes; then
422            VGCONF_ARCH_PRI="x86"
423            VGCONF_ARCH_SEC=""
424            VGCONF_PLATFORM_PRI_CAPS="X86_LINUX"
425            VGCONF_PLATFORM_SEC_CAPS=""
426            valt_load_address_pri_norml="0x38000000"
427            valt_load_address_pri_inner="0x28000000"
428         else
429            VGCONF_ARCH_PRI="amd64"
430            VGCONF_ARCH_SEC="x86"
431            VGCONF_PLATFORM_PRI_CAPS="AMD64_LINUX"
432            VGCONF_PLATFORM_SEC_CAPS="X86_LINUX"
433            valt_load_address_pri_norml="0x38000000"
434            valt_load_address_pri_inner="0x28000000"
435            valt_load_address_sec_norml="0x38000000"
436            valt_load_address_sec_inner="0x28000000"
437         fi
438         AC_MSG_RESULT([ok (${ARCH_MAX}-${VGCONF_OS})])
439         ;;
440      ppc32-linux)
441         VGCONF_ARCH_PRI="ppc32"
442         VGCONF_ARCH_SEC=""
443         VGCONF_PLATFORM_PRI_CAPS="PPC32_LINUX"
444         VGCONF_PLATFORM_SEC_CAPS=""
445         valt_load_address_pri_norml="0x38000000"
446         valt_load_address_pri_inner="0x28000000"
447         valt_load_address_sec_norml="0xUNSET"
448         valt_load_address_sec_inner="0xUNSET"
449         AC_MSG_RESULT([ok (${ARCH_MAX}-${VGCONF_OS})])
450         ;;
451      ppc64-linux)
452         valt_load_address_sec_norml="0xUNSET"
453         valt_load_address_sec_inner="0xUNSET"
454         if test x$vg_cv_only64bit = xyes; then
455            VGCONF_ARCH_PRI="ppc64"
456            VGCONF_ARCH_SEC=""
457            VGCONF_PLATFORM_PRI_CAPS="PPC64_LINUX"
458            VGCONF_PLATFORM_SEC_CAPS=""
459            valt_load_address_pri_norml="0x38000000"
460            valt_load_address_pri_inner="0x28000000"
461         elif test x$vg_cv_only32bit = xyes; then
462            VGCONF_ARCH_PRI="ppc32"
463            VGCONF_ARCH_SEC=""
464            VGCONF_PLATFORM_PRI_CAPS="PPC32_LINUX"
465            VGCONF_PLATFORM_SEC_CAPS=""
466            valt_load_address_pri_norml="0x38000000"
467            valt_load_address_pri_inner="0x28000000"
468         else
469            VGCONF_ARCH_PRI="ppc64"
470            VGCONF_ARCH_SEC="ppc32"
471            VGCONF_PLATFORM_PRI_CAPS="PPC64_LINUX"
472            VGCONF_PLATFORM_SEC_CAPS="PPC32_LINUX"
473            valt_load_address_pri_norml="0x38000000"
474            valt_load_address_pri_inner="0x28000000"
475            valt_load_address_sec_norml="0x38000000"
476            valt_load_address_sec_inner="0x28000000"
477         fi
478         AC_MSG_RESULT([ok (${ARCH_MAX}-${VGCONF_OS})])
479         ;;
480      # Darwin gets identified as 32-bit even when it supports 64-bit.
481      # (Not sure why, possibly because 'uname' returns "i386"?)  Just about
482      # all Macs support both 32-bit and 64-bit, so we just build both.  If
483      # someone has a really old 32-bit only machine they can (hopefully?)
484      # build with --enable-only32bit.  See bug 243362.
485      x86-darwin|amd64-darwin)
486         ARCH_MAX="amd64"
487         valt_load_address_sec_norml="0xUNSET"
488         valt_load_address_sec_inner="0xUNSET"
489         if test x$vg_cv_only64bit = xyes; then
490            VGCONF_ARCH_PRI="amd64"
491            VGCONF_ARCH_SEC=""
492            VGCONF_PLATFORM_PRI_CAPS="AMD64_DARWIN"
493            VGCONF_PLATFORM_SEC_CAPS=""
494            valt_load_address_pri_norml="0x138000000"
495            valt_load_address_pri_inner="0x128000000"
496         elif test x$vg_cv_only32bit = xyes; then
497            VGCONF_ARCH_PRI="x86"
498            VGCONF_ARCH_SEC=""
499            VGCONF_PLATFORM_PRI_CAPS="X86_DARWIN"
500            VGCONF_PLATFORM_SEC_CAPS=""
501            VGCONF_ARCH_PRI_CAPS="x86"
502            valt_load_address_pri_norml="0x38000000"
503            valt_load_address_pri_inner="0x28000000"
504         else
505            VGCONF_ARCH_PRI="amd64"
506            VGCONF_ARCH_SEC="x86"
507            VGCONF_PLATFORM_PRI_CAPS="AMD64_DARWIN"
508            VGCONF_PLATFORM_SEC_CAPS="X86_DARWIN"
509            valt_load_address_pri_norml="0x138000000"
510            valt_load_address_pri_inner="0x128000000"
511            valt_load_address_sec_norml="0x38000000"
512            valt_load_address_sec_inner="0x28000000"
513         fi
514         AC_MSG_RESULT([ok (${ARCH_MAX}-${VGCONF_OS})])
515         ;;
516      arm-linux) 
517         VGCONF_ARCH_PRI="arm"
518         VGCONF_PLATFORM_PRI_CAPS="ARM_LINUX"
519         VGCONF_PLATFORM_SEC_CAPS=""
520         valt_load_address_pri_norml="0x38000000"
521         valt_load_address_pri_inner="0x28000000"
522         valt_load_address_sec_norml="0xUNSET"
523         valt_load_address_sec_inner="0xUNSET"
524         AC_MSG_RESULT([ok (${host_cpu}-${host_os})])
525         ;;
526      s390x-linux)
527         VGCONF_ARCH_PRI="s390x"
528         VGCONF_ARCH_SEC=""
529         VGCONF_PLATFORM_PRI_CAPS="S390X_LINUX"
530         VGCONF_PLATFORM_SEC_CAPS=""
531         # we want to have the generated code close to the dispatcher
532         valt_load_address_pri_norml="0x401000000"
533         valt_load_address_pri_inner="0x410000000"
534         valt_load_address_sec_norml="0xUNSET"
535         valt_load_address_sec_inner="0xUNSET"
536         AC_MSG_RESULT([ok (${ARCH_MAX}-${VGCONF_OS})])
537         ;;
538     *)
539         VGCONF_ARCH_PRI="unknown"
540         VGCONF_ARCH_SEC="unknown"
541         VGCONF_PLATFORM_PRI_CAPS="UNKNOWN"
542         VGCONF_PLATFORM_SEC_CAPS="UNKNOWN"
543         valt_load_address_pri_norml="0xUNSET"
544         valt_load_address_pri_inner="0xUNSET"
545         valt_load_address_sec_norml="0xUNSET"
546         valt_load_address_sec_inner="0xUNSET"
547         AC_MSG_RESULT([no (${ARCH_MAX}-${VGCONF_OS})])
548         AC_MSG_ERROR([Valgrind is platform specific. Sorry. Please consider doing a port.])
549         ;;
550 esac
551
552 #----------------------------------------------------------------------------
553
554 # Set up VGCONF_ARCHS_INCLUDE_<arch>.  Either one or two of these become
555 # defined.
556 AM_CONDITIONAL(VGCONF_ARCHS_INCLUDE_X86,   
557                test x$VGCONF_PLATFORM_PRI_CAPS = xX86_LINUX \
558                  -o x$VGCONF_PLATFORM_SEC_CAPS = xX86_LINUX \
559                  -o x$VGCONF_PLATFORM_PRI_CAPS = xX86_DARWIN \
560                  -o x$VGCONF_PLATFORM_SEC_CAPS = xX86_DARWIN )
561 AM_CONDITIONAL(VGCONF_ARCHS_INCLUDE_AMD64, 
562                test x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_LINUX \
563                  -o x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_DARWIN )
564 AM_CONDITIONAL(VGCONF_ARCHS_INCLUDE_PPC32, 
565                test x$VGCONF_PLATFORM_PRI_CAPS = xPPC32_LINUX \ 
566                  -o x$VGCONF_PLATFORM_SEC_CAPS = xPPC32_LINUX )
567 AM_CONDITIONAL(VGCONF_ARCHS_INCLUDE_PPC64, 
568                test x$VGCONF_PLATFORM_PRI_CAPS = xPPC64_LINUX )
569 AM_CONDITIONAL(VGCONF_ARCHS_INCLUDE_ARM,   
570                test x$VGCONF_PLATFORM_PRI_CAPS = xARM_LINUX )
571 AM_CONDITIONAL(VGCONF_ARCHS_INCLUDE_S390X,
572                test x$VGCONF_PLATFORM_PRI_CAPS = xS390X_LINUX )
573
574 # Set up VGCONF_PLATFORMS_INCLUDE_<platform>.  Either one or two of these
575 # become defined.
576 AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_X86_LINUX,   
577                test x$VGCONF_PLATFORM_PRI_CAPS = xX86_LINUX \
578                  -o x$VGCONF_PLATFORM_SEC_CAPS = xX86_LINUX)
579 AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_AMD64_LINUX, 
580                test x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_LINUX)
581 AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_PPC32_LINUX, 
582                test x$VGCONF_PLATFORM_PRI_CAPS = xPPC32_LINUX \ 
583                  -o x$VGCONF_PLATFORM_SEC_CAPS = xPPC32_LINUX)
584 AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_PPC64_LINUX, 
585                test x$VGCONF_PLATFORM_PRI_CAPS = xPPC64_LINUX)
586 AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_ARM_LINUX, 
587                test x$VGCONF_PLATFORM_PRI_CAPS = xARM_LINUX)
588 AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_S390X_LINUX,
589                test x$VGCONF_PLATFORM_PRI_CAPS = xS390X_LINUX \
590                  -o x$VGCONF_PLATFORM_SEC_CAPS = xS390X_LINUX)
591
592 AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_X86_DARWIN,   
593                test x$VGCONF_PLATFORM_PRI_CAPS = xX86_DARWIN \
594                  -o x$VGCONF_PLATFORM_SEC_CAPS = xX86_DARWIN)
595 AM_CONDITIONAL(VGCONF_PLATFORMS_INCLUDE_AMD64_DARWIN, 
596                test x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_DARWIN)
597
598
599 # Similarly, set up VGCONF_OS_IS_<os>.  Exactly one of these becomes defined.
600 # Relies on the assumption that the primary and secondary targets are 
601 # for the same OS, so therefore only necessary to test the primary.
602 AM_CONDITIONAL(VGCONF_OS_IS_LINUX,
603                test x$VGCONF_PLATFORM_PRI_CAPS = xX86_LINUX \
604                  -o x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_LINUX \
605                  -o x$VGCONF_PLATFORM_PRI_CAPS = xPPC32_LINUX \
606                  -o x$VGCONF_PLATFORM_PRI_CAPS = xPPC64_LINUX \
607                  -o x$VGCONF_PLATFORM_PRI_CAPS = xARM_LINUX \
608                  -o x$VGCONF_PLATFORM_PRI_CAPS = xS390X_LINUX)
609 AM_CONDITIONAL(VGCONF_OS_IS_DARWIN,
610                test x$VGCONF_PLATFORM_PRI_CAPS = xX86_DARWIN \
611                  -o x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_DARWIN)
612
613
614 # Sometimes, in the Makefile.am files, it's useful to know whether or not
615 # there is a secondary target.
616 AM_CONDITIONAL(VGCONF_HAVE_PLATFORM_SEC,
617                test x$VGCONF_PLATFORM_SEC_CAPS != x)
618
619
620 #----------------------------------------------------------------------------
621 # Inner Valgrind?
622 #----------------------------------------------------------------------------
623
624 # Check if this should be built as an inner Valgrind, to be run within
625 # another Valgrind.  Choose the load address accordingly.
626 AC_SUBST(VALT_LOAD_ADDRESS_PRI)
627 AC_SUBST(VALT_LOAD_ADDRESS_SEC)
628 AC_CACHE_CHECK([for use as an inner Valgrind], vg_cv_inner,
629    [AC_ARG_ENABLE(inner, 
630       [  --enable-inner          enables self-hosting],
631       [vg_cv_inner=$enableval],
632       [vg_cv_inner=no])])
633 if test "$vg_cv_inner" = yes; then
634     AC_DEFINE([ENABLE_INNER], 1, [configured to run as an inner Valgrind])
635     VALT_LOAD_ADDRESS_PRI=$valt_load_address_pri_inner
636     VALT_LOAD_ADDRESS_SEC=$valt_load_address_sec_inner
637 else
638     VALT_LOAD_ADDRESS_PRI=$valt_load_address_pri_norml
639     VALT_LOAD_ADDRESS_SEC=$valt_load_address_sec_norml
640 fi
641
642
643 #----------------------------------------------------------------------------
644 # Extra fine-tuning of installation directories
645 #----------------------------------------------------------------------------
646 AC_ARG_WITH(tmpdir,
647    [  --with-tmpdir=PATH      Specify path for temporary files],
648    tmpdir="$withval",
649    tmpdir="/tmp")
650 AC_DEFINE_UNQUOTED(VG_TMPDIR, "$tmpdir", [Temporary files directory])
651
652
653 #----------------------------------------------------------------------------
654 # Libc and suppressions
655 #----------------------------------------------------------------------------
656 # This variable will collect the suppression files to be used.
657 AC_SUBST(DEFAULT_SUPP)
658
659 AC_CHECK_HEADER([features.h])
660
661 if test x$ac_cv_header_features_h = xyes; then
662   rm -f conftest.$ac_ext
663   cat <<_ACEOF >conftest.$ac_ext
664 #include <features.h>
665 #if defined(__GNU_LIBRARY__) && defined(__GLIBC__) && defined(__GLIBC_MINOR__)
666 glibc version is: __GLIBC__ __GLIBC_MINOR__
667 #endif
668 _ACEOF
669   GLIBC_VERSION="`$CPP conftest.$ac_ext | $SED -n 's/^glibc version is: //p' | $SED 's/ /./g'`"
670 fi
671
672 # not really a version check
673 AC_EGREP_CPP([DARWIN_LIBC], [
674 #include <sys/cdefs.h>
675 #if defined(__DARWIN_VERS_1050)
676   DARWIN_LIBC
677 #endif
678 ],
679 GLIBC_VERSION="darwin")
680
681 # not really a version check
682 AC_EGREP_CPP([BIONIC_LIBC], [
683 #if defined(__ANDROID__)
684   BIONIC_LIBC
685 #endif
686 ],
687 GLIBC_VERSION="bionic")
688
689
690 AC_MSG_CHECKING([the GLIBC_VERSION version])
691
692 case "${GLIBC_VERSION}" in
693      2.2)
694         AC_MSG_RESULT(2.2 family)
695         AC_DEFINE([GLIBC_2_2], 1, [Define to 1 if you're using glibc 2.2.x])
696         DEFAULT_SUPP="glibc-2.2.supp ${DEFAULT_SUPP}"
697         DEFAULT_SUPP="glibc-2.2-LinuxThreads-helgrind.supp ${DEFAULT_SUPP}"
698         DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
699         ;;
700
701      2.3)
702         AC_MSG_RESULT(2.3 family)
703         AC_DEFINE([GLIBC_2_3], 1, [Define to 1 if you're using glibc 2.3.x])
704         DEFAULT_SUPP="glibc-2.3.supp ${DEFAULT_SUPP}"
705         DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
706         DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
707         ;;
708
709      2.4)
710         AC_MSG_RESULT(2.4 family)
711         AC_DEFINE([GLIBC_2_4], 1, [Define to 1 if you're using glibc 2.4.x])
712         DEFAULT_SUPP="glibc-2.4.supp ${DEFAULT_SUPP}"
713         DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
714         DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
715         ;;
716
717      2.5)
718         AC_MSG_RESULT(2.5 family)
719         AC_DEFINE([GLIBC_2_5], 1, [Define to 1 if you're using glibc 2.5.x])
720         DEFAULT_SUPP="glibc-2.5.supp ${DEFAULT_SUPP}"
721         DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
722         DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
723         ;;
724      2.6)
725         AC_MSG_RESULT(2.6 family)
726         AC_DEFINE([GLIBC_2_6], 1, [Define to 1 if you're using glibc 2.6.x])
727         DEFAULT_SUPP="glibc-2.6.supp ${DEFAULT_SUPP}"
728         DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
729         DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
730         ;;
731      2.7)
732         AC_MSG_RESULT(2.7 family)
733         AC_DEFINE([GLIBC_2_7], 1, [Define to 1 if you're using glibc 2.7.x])
734         DEFAULT_SUPP="glibc-2.X.supp ${DEFAULT_SUPP}"
735         DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
736         DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
737         ;;
738      2.8)
739         AC_MSG_RESULT(2.8 family)
740         AC_DEFINE([GLIBC_2_8], 1, [Define to 1 if you're using glibc 2.8.x])
741         DEFAULT_SUPP="glibc-2.X.supp ${DEFAULT_SUPP}"
742         DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
743         DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
744         ;;
745      2.9)
746         AC_MSG_RESULT(2.9 family)
747         AC_DEFINE([GLIBC_2_9], 1, [Define to 1 if you're using glibc 2.9.x])
748         DEFAULT_SUPP="glibc-2.X.supp ${DEFAULT_SUPP}"
749         DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
750         DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
751         ;;
752      2.10)
753         AC_MSG_RESULT(2.10 family)
754         AC_DEFINE([GLIBC_2_10], 1, [Define to 1 if you're using glibc 2.10.x])
755         DEFAULT_SUPP="glibc-2.X.supp ${DEFAULT_SUPP}"
756         DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
757         DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
758         ;;
759      2.11)
760         AC_MSG_RESULT(2.11 family)
761         AC_DEFINE([GLIBC_2_11], 1, [Define to 1 if you're using glibc 2.11.x])
762         DEFAULT_SUPP="glibc-2.X.supp ${DEFAULT_SUPP}"
763         DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
764         DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
765         ;;
766      2.12)
767         AC_MSG_RESULT(2.12 family)
768         AC_DEFINE([GLIBC_2_12], 1, [Define to 1 if you're using glibc 2.12.x])
769         DEFAULT_SUPP="glibc-2.X.supp ${DEFAULT_SUPP}"
770         DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
771         DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
772         ;;
773      2.13)
774         AC_MSG_RESULT(2.13 family)
775         AC_DEFINE([GLIBC_2_13], 1, [Define to 1 if you're using glibc 2.13.x])
776         DEFAULT_SUPP="glibc-2.X.supp ${DEFAULT_SUPP}"
777         DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
778         DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
779         ;;
780      2.14)
781         AC_MSG_RESULT(2.14 family)
782         AC_DEFINE([GLIBC_2_14], 1, [Define to 1 if you're using glibc 2.14.x])
783         DEFAULT_SUPP="glibc-2.X.supp ${DEFAULT_SUPP}"
784         DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
785         DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
786         ;;
787      2.15)
788         AC_MSG_RESULT(2.15 family)
789         AC_DEFINE([GLIBC_2_15], 1, [Define to 1 if you're using glibc 2.15.x])
790         DEFAULT_SUPP="glibc-2.X.supp ${DEFAULT_SUPP}"
791         DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
792         DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
793         ;;
794      darwin)
795         AC_MSG_RESULT(Darwin)
796         AC_DEFINE([DARWIN_LIBC], 1, [Define to 1 if you're using Darwin])
797         # DEFAULT_SUPP set by kernel version check above.
798         ;;
799      bionic)
800         AC_MSG_RESULT(Bionic)
801         AC_DEFINE([BIONIC_LIBC], 1, [Define to 1 if you're using Bionic])
802         DEFAULT_SUPP="bionic.supp ${DEFAULT_SUPP}"
803         ;;
804
805      *)
806         AC_MSG_RESULT([unsupported version ${GLIBC_VERSION}])
807         AC_MSG_ERROR([Valgrind requires glibc version 2.2 - 2.15])
808         AC_MSG_ERROR([or Darwin libc])
809         ;;
810 esac
811
812 AC_SUBST(GLIBC_VERSION)
813
814
815 # Add default suppressions for the X client libraries.  Make no
816 # attempt to detect whether such libraries are installed on the
817 # build machine (or even if any X facilities are present); just
818 # add the suppressions antidisirregardless.
819 DEFAULT_SUPP="xfree-4.supp ${DEFAULT_SUPP}"
820 DEFAULT_SUPP="xfree-3.supp ${DEFAULT_SUPP}"
821
822 # Add glibc and X11 suppressions for exp-sgcheck
823 DEFAULT_SUPP="exp-sgcheck.supp ${DEFAULT_SUPP}"
824
825
826 #----------------------------------------------------------------------------
827 # Platform variants?
828 #----------------------------------------------------------------------------
829
830 # Normally the PLAT = (ARCH, OS) characterisation of the platform is enough.
831 # But there are times where we need a bit more control.  The motivating
832 # and currently only case is Android: this is almost identical to arm-linux,
833 # but not quite.  So this introduces the concept of platform variant tags,
834 # which get passed in the compile as -DVGPV_<arch>_<os>_<variant> along
835 # with the main -DVGP_<arch>_<os> definition.
836 #
837 # In almost all cases, the <variant> bit is "vanilla".  But for Android
838 # it is "android" instead.
839 #
840 # Consequently (eg), plain arm-linux would build with
841 #
842 #   -DVGP_arm_linux -DVGPV_arm_linux_vanilla
843 #
844 # whilst an Android build would have
845 #
846 #   -DVGP_arm_linux -DVGPV_arm_linux_android
847 #
848 # The setup of the platform variant is pushed relatively far down this
849 # file in order that we can inspect any of the variables set above.
850
851 # In the normal case ..
852 VGCONF_PLATVARIANT="vanilla"
853
854 # Android on ARM ?
855 if test "$VGCONF_ARCH_PRI-$VGCONF_OS" = "arm-linux" \
856         -a "$GLIBC_VERSION" = "bionic";
857 then
858    VGCONF_PLATVARIANT="android"
859 fi
860
861 AC_SUBST(VGCONF_PLATVARIANT)
862
863
864 # FIXME: do we also want to define automake variables
865 # VGCONF_PLATVARIANT_IS_<WHATEVER>, where WHATEVER is (currently)
866 # VANILLA or ANDROID ?  This would be in the style of VGCONF_ARCHS_INCLUDE,
867 # VGCONF_PLATFORMS_INCLUDE and VGCONF_OS_IS above?  Could easily enough
868 # do that.  Problem is that we can't do and-ing in Makefile.am's, but
869 # that's what we'd need to do to use this, since what we'd want to write
870 # is something like
871 #
872 # VGCONF_PLATFORMS_INCLUDE_ARM_LINUX && VGCONF_PLATVARIANT_IS_ANDROID
873 #
874 # Hmm.  Can't think of a nice clean solution to this.
875
876 AM_CONDITIONAL(VGCONF_PLATVARIANT_IS_VANILLA,
877                test x$VGCONF_PLATVARIANT = xvanilla)
878 AM_CONDITIONAL(VGCONF_PLATVARIANT_IS_ANDROID,
879                test x$VGCONF_PLATVARIANT = xandroid)
880
881
882 #----------------------------------------------------------------------------
883 # Checking for various library functions and other definitions
884 #----------------------------------------------------------------------------
885
886 # Check for CLOCK_MONOTONIC
887
888 AC_MSG_CHECKING([for CLOCK_MONOTONIC])
889
890 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
891 #include <time.h>
892 ]], [[
893   struct timespec t;
894   clock_gettime(CLOCK_MONOTONIC, &t);
895   return 0;
896 ]])], [
897 AC_MSG_RESULT([yes])
898 AC_DEFINE([HAVE_CLOCK_MONOTONIC], 1,
899           [Define to 1 if you have the `CLOCK_MONOTONIC' constant.])
900 ], [
901 AC_MSG_RESULT([no])
902 ])
903
904
905 # Check for PTHREAD_RWLOCK_T
906
907 AC_MSG_CHECKING([for pthread_rwlock_t])
908
909 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
910 #define _GNU_SOURCE
911 #include <pthread.h>
912 ]], [[
913   pthread_rwlock_t rwl;
914 ]])], [
915 AC_MSG_RESULT([yes])
916 AC_DEFINE([HAVE_PTHREAD_RWLOCK_T], 1,
917           [Define to 1 if you have the `pthread_rwlock_t' type.])
918 ], [
919 AC_MSG_RESULT([no])
920 ])
921
922
923 # Check for PTHREAD_MUTEX_ADAPTIVE_NP
924
925 AC_MSG_CHECKING([for PTHREAD_MUTEX_ADAPTIVE_NP])
926
927 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
928 #define _GNU_SOURCE
929 #include <pthread.h>
930 ]], [[
931   return (PTHREAD_MUTEX_ADAPTIVE_NP);
932 ]])], [
933 AC_MSG_RESULT([yes])
934 AC_DEFINE([HAVE_PTHREAD_MUTEX_ADAPTIVE_NP], 1,
935           [Define to 1 if you have the `PTHREAD_MUTEX_ADAPTIVE_NP' constant.])
936 ], [
937 AC_MSG_RESULT([no])
938 ])
939
940
941 # Check for PTHREAD_MUTEX_ERRORCHECK_NP
942
943 AC_MSG_CHECKING([for PTHREAD_MUTEX_ERRORCHECK_NP])
944
945 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
946 #define _GNU_SOURCE
947 #include <pthread.h>
948 ]], [[
949   return (PTHREAD_MUTEX_ERRORCHECK_NP);
950 ]])], [
951 AC_MSG_RESULT([yes])
952 AC_DEFINE([HAVE_PTHREAD_MUTEX_ERRORCHECK_NP], 1,
953           [Define to 1 if you have the `PTHREAD_MUTEX_ERRORCHECK_NP' constant.])
954 ], [
955 AC_MSG_RESULT([no])
956 ])
957
958
959 # Check for PTHREAD_MUTEX_RECURSIVE_NP
960
961 AC_MSG_CHECKING([for PTHREAD_MUTEX_RECURSIVE_NP])
962
963 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
964 #define _GNU_SOURCE
965 #include <pthread.h>
966 ]], [[
967   return (PTHREAD_MUTEX_RECURSIVE_NP);
968 ]])], [
969 AC_MSG_RESULT([yes])
970 AC_DEFINE([HAVE_PTHREAD_MUTEX_RECURSIVE_NP], 1,
971           [Define to 1 if you have the `PTHREAD_MUTEX_RECURSIVE_NP' constant.])
972 ], [
973 AC_MSG_RESULT([no])
974 ])
975
976
977 # Check for PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP
978
979 AC_MSG_CHECKING([for PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP])
980
981 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
982 #define _GNU_SOURCE
983 #include <pthread.h>
984 ]], [[
985   pthread_mutex_t m = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP;
986   return 0;
987 ]])], [
988 AC_MSG_RESULT([yes])
989 AC_DEFINE([HAVE_PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP], 1,
990           [Define to 1 if you have the `PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP' constant.])
991 ], [
992 AC_MSG_RESULT([no])
993 ])
994
995
996 # Check whether pthread_mutex_t has a member called __m_kind.
997
998 AC_CHECK_MEMBER([pthread_mutex_t.__m_kind],
999                 [AC_DEFINE([HAVE_PTHREAD_MUTEX_T__M_KIND],
1000                            1,                                   
1001                            [Define to 1 if pthread_mutex_t has a member called __m_kind.])
1002                 ],
1003                 [],
1004                 [#include <pthread.h>])
1005
1006
1007 # Check whether pthread_mutex_t has a member called __data.__kind.
1008
1009 AC_CHECK_MEMBER([pthread_mutex_t.__data.__kind],
1010                 [AC_DEFINE([HAVE_PTHREAD_MUTEX_T__DATA__KIND],
1011                           1,
1012                           [Define to 1 if pthread_mutex_t has a member __data.__kind.])
1013                 ],
1014                 [],
1015                 [#include <pthread.h>])
1016
1017
1018 # does this compiler support -maltivec and does it have the include file
1019 # <altivec.h> ?
1020
1021 AC_MSG_CHECKING([for Altivec])
1022
1023 safe_CFLAGS=$CFLAGS
1024 CFLAGS="-maltivec"
1025
1026 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1027 #include <altivec.h>
1028 ]], [[
1029   vector unsigned int v;
1030 ]])], [
1031 ac_have_altivec=yes
1032 AC_MSG_RESULT([yes])
1033 AC_DEFINE([HAS_ALTIVEC], 1,
1034           [Define to 1 if gcc/as can do Altivec.])
1035 ], [
1036 ac_have_altivec=no
1037 AC_MSG_RESULT([no])
1038 ])
1039 CFLAGS=$safe_CFLAGS
1040
1041 AM_CONDITIONAL([HAS_ALTIVEC], [test x$ac_have_altivec = xyes])
1042
1043
1044 # Check that both: the compiler supports -mvsx and that the assembler
1045 # understands VSX instructions.  If either of those doesn't work,
1046 # conclude that we can't do VSX.  NOTE: basically this is a kludge
1047 # in that it conflates two things that should be separate -- whether
1048 # the compiler understands the flag vs whether the assembler 
1049 # understands the opcodes.  This really ought to be cleaned up
1050 # and done properly, like it is for x86/x86_64.
1051
1052 AC_MSG_CHECKING([for VSX])
1053
1054 safe_CFLAGS=$CFLAGS
1055 CFLAGS="-mvsx"
1056
1057 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1058 #include <altivec.h>
1059 ]], [[
1060   vector unsigned int v;
1061   __asm__ __volatile__("xsmaddadp 32, 32, 33" ::: "memory","cc");
1062 ]])], [
1063 ac_have_vsx=yes
1064 AC_MSG_RESULT([yes])
1065 ], [
1066 ac_have_vsx=no
1067 AC_MSG_RESULT([no])
1068 ])
1069 CFLAGS=$safe_CFLAGS
1070
1071 AM_CONDITIONAL(HAS_VSX, test x$ac_have_vsx = xyes)
1072
1073 AC_MSG_CHECKING([that assembler knows DFP])
1074
1075 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1076 ]], [[
1077   __asm__ __volatile__("dadd 1, 2, 3");
1078 ]])], [
1079 ac_asm_have_dfp=yes
1080 AC_MSG_RESULT([yes])
1081 ], [
1082 ac_asm_have_dfp=no
1083 AC_MSG_RESULT([no])
1084 ])
1085
1086 AC_MSG_CHECKING([that compiler knows -mhard-dfp switch])
1087 safe_CFLAGS=$CFLAGS
1088 CFLAGS="-mhard-dfp"
1089 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1090 ]], [[
1091   __asm__ __volatile__("dadd 1, 2, 3");
1092 ]])], [
1093 ac_gcc_have_dfp=yes
1094 AC_MSG_RESULT([yes])
1095 ], [
1096 ac_gcc_have_dfp=no
1097 AC_MSG_RESULT([no])
1098 ])
1099
1100 CFLAGS=$safe_CFLAGS
1101
1102 AM_CONDITIONAL(HAS_DFP, test x$ac_asm_have_dfp = xyes -a x$ac_gcc_have_dfp = xyes)
1103
1104 # Check for pthread_create@GLIBC2.0
1105 AC_MSG_CHECKING([for pthread_create@GLIBC2.0()])
1106
1107 safe_CFLAGS=$CFLAGS
1108 CFLAGS="-lpthread"
1109 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
1110 extern int pthread_create_glibc_2_0(void*, const void*,
1111                                     void *(*)(void*), void*);
1112 __asm__(".symver pthread_create_glibc_2_0, pthread_create@GLIBC_2.0");
1113 ]], [[
1114 #ifdef __powerpc__
1115 /*
1116  * Apparently on PowerPC linking this program succeeds and generates an
1117  * executable with the undefined symbol pthread_create@GLIBC_2.0.
1118  */
1119 #error This test does not work properly on PowerPC.
1120 #else
1121   pthread_create_glibc_2_0(0, 0, 0, 0);
1122 #endif
1123   return 0;
1124 ]])], [
1125 ac_have_pthread_create_glibc_2_0=yes
1126 AC_MSG_RESULT([yes])
1127 AC_DEFINE([HAVE_PTHREAD_CREATE_GLIBC_2_0], 1,
1128           [Define to 1 if you have the `pthread_create@glibc2.0' function.])
1129 ], [
1130 ac_have_pthread_create_glibc_2_0=no
1131 AC_MSG_RESULT([no])
1132 ])
1133 CFLAGS=$safe_CFLAGS
1134
1135 AM_CONDITIONAL(HAVE_PTHREAD_CREATE_GLIBC_2_0,
1136                test x$ac_have_pthread_create_glibc_2_0 = xyes)
1137
1138
1139 # Check for eventfd_t, eventfd() and eventfd_read()
1140 AC_MSG_CHECKING([for eventfd()])
1141
1142 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
1143 #include <sys/eventfd.h>
1144 ]], [[
1145   eventfd_t ev;
1146   int fd;
1147
1148   fd = eventfd(5, 0);
1149   eventfd_read(fd, &ev);
1150   return 0;
1151 ]])], [
1152 AC_MSG_RESULT([yes])
1153 AC_DEFINE([HAVE_EVENTFD], 1,
1154           [Define to 1 if you have the `eventfd' function.])
1155 AC_DEFINE([HAVE_EVENTFD_READ], 1,
1156           [Define to 1 if you have the `eventfd_read' function.])
1157 ], [
1158 AC_MSG_RESULT([no])
1159 ])
1160
1161
1162 #----------------------------------------------------------------------------
1163 # Checking for supported compiler flags.
1164 #----------------------------------------------------------------------------
1165
1166 # does this compiler support -m32 ?
1167 AC_MSG_CHECKING([if gcc accepts -m32])
1168
1169 safe_CFLAGS=$CFLAGS
1170 CFLAGS="-m32"
1171
1172 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
1173   return 0;
1174 ]])], [
1175 FLAG_M32="-m32"
1176 AC_MSG_RESULT([yes])
1177 ], [
1178 FLAG_M32=""
1179 AC_MSG_RESULT([no])
1180 ])
1181 CFLAGS=$safe_CFLAGS
1182
1183 AC_SUBST(FLAG_M32)
1184
1185
1186 # does this compiler support -m64 ?
1187 AC_MSG_CHECKING([if gcc accepts -m64])
1188
1189 safe_CFLAGS=$CFLAGS
1190 CFLAGS="-m64"
1191
1192 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
1193   return 0;
1194 ]])], [
1195 FLAG_M64="-m64"
1196 AC_MSG_RESULT([yes])
1197 ], [
1198 FLAG_M64=""
1199 AC_MSG_RESULT([no])
1200 ])
1201 CFLAGS=$safe_CFLAGS
1202
1203 AC_SUBST(FLAG_M64)
1204
1205
1206 # does this compiler support -mmmx ?
1207 AC_MSG_CHECKING([if gcc accepts -mmmx])
1208
1209 safe_CFLAGS=$CFLAGS
1210 CFLAGS="-mmmx"
1211
1212 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
1213   return 0;
1214 ]])], [
1215 FLAG_MMMX="-mmmx"
1216 AC_MSG_RESULT([yes])
1217 ], [
1218 FLAG_MMMX=""
1219 AC_MSG_RESULT([no])
1220 ])
1221 CFLAGS=$safe_CFLAGS
1222
1223 AC_SUBST(FLAG_MMMX)
1224
1225
1226 # does this compiler support -msse ?
1227 AC_MSG_CHECKING([if gcc accepts -msse])
1228
1229 safe_CFLAGS=$CFLAGS
1230 CFLAGS="-msse"
1231
1232 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
1233   return 0;
1234 ]])], [
1235 FLAG_MSSE="-msse"
1236 AC_MSG_RESULT([yes])
1237 ], [
1238 FLAG_MSSE=""
1239 AC_MSG_RESULT([no])
1240 ])
1241 CFLAGS=$safe_CFLAGS
1242
1243 AC_SUBST(FLAG_MSSE)
1244
1245
1246 # does this compiler support -mpreferred-stack-boundary=2 ?
1247 AC_MSG_CHECKING([if gcc accepts -mpreferred-stack-boundary])
1248
1249 safe_CFLAGS=$CFLAGS
1250 CFLAGS="-mpreferred-stack-boundary=2"
1251
1252 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
1253   return 0;
1254 ]])], [
1255 PREFERRED_STACK_BOUNDARY="-mpreferred-stack-boundary=2"
1256 AC_MSG_RESULT([yes])
1257 ], [
1258 PREFERRED_STACK_BOUNDARY=""
1259 AC_MSG_RESULT([no])
1260 ])
1261 CFLAGS=$safe_CFLAGS
1262
1263 AC_SUBST(PREFERRED_STACK_BOUNDARY)
1264
1265
1266 # does this compiler support -Wno-pointer-sign ?
1267 AC_MSG_CHECKING([if gcc accepts -Wno-pointer-sign])
1268
1269 safe_CFLAGS=$CFLAGS
1270 CFLAGS="-Wno-pointer-sign"
1271
1272 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
1273   return 0;
1274 ]])], [
1275 no_pointer_sign=yes
1276 AC_MSG_RESULT([yes])
1277 ], [
1278 no_pointer_sign=no
1279 AC_MSG_RESULT([no])
1280 ])
1281 CFLAGS=$safe_CFLAGS
1282
1283 if test x$no_pointer_sign = xyes; then
1284   CFLAGS="$CFLAGS -Wno-pointer-sign"
1285 fi
1286
1287
1288 # does this compiler support -Wno-empty-body ?
1289
1290 AC_MSG_CHECKING([if gcc accepts -Wno-empty-body])
1291
1292 safe_CFLAGS=$CFLAGS
1293 CFLAGS="-Wno-empty-body"
1294
1295 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]], [[
1296   return 0;
1297 ]])], [
1298 AC_SUBST([FLAG_W_NO_EMPTY_BODY], [-Wno-empty-body])
1299 AC_MSG_RESULT([yes])
1300 ], [
1301 AC_SUBST([FLAG_W_NO_EMPTY_BODY], [])
1302 AC_MSG_RESULT([no])
1303 ])
1304 CFLAGS=$safe_CFLAGS
1305
1306
1307 # does this compiler support -Wno-format-zero-length ?
1308
1309 AC_MSG_CHECKING([if gcc accepts -Wno-format-zero-length])
1310
1311 safe_CFLAGS=$CFLAGS
1312 CFLAGS="-Wno-format-zero-length"
1313
1314 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]], [[
1315   return 0;
1316 ]])], [
1317 AC_SUBST([FLAG_W_NO_FORMAT_ZERO_LENGTH], [-Wno-format-zero-length])
1318 AC_MSG_RESULT([yes])
1319 ], [
1320 AC_SUBST([FLAG_W_NO_FORMAT_ZERO_LENGTH], [])
1321 AC_MSG_RESULT([no])
1322 ])
1323 CFLAGS=$safe_CFLAGS
1324
1325
1326 # does this compiler support -Wno-nonnull ?
1327
1328 AC_MSG_CHECKING([if gcc accepts -Wno-nonnull])
1329
1330 safe_CFLAGS=$CFLAGS
1331 CFLAGS="-Wno-nonnull"
1332
1333 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]], [[
1334   return 0;
1335 ]])], [
1336 AC_SUBST([FLAG_W_NO_NONNULL], [-Wno-nonnull])
1337 AC_MSG_RESULT([yes])
1338 ], [
1339 AC_SUBST([FLAG_W_NO_NONNULL], [])
1340 AC_MSG_RESULT([no])
1341 ])
1342 CFLAGS=$safe_CFLAGS
1343
1344
1345 # does this compiler support -Wno-overflow ?
1346
1347 AC_MSG_CHECKING([if gcc accepts -Wno-overflow])
1348
1349 safe_CFLAGS=$CFLAGS
1350 CFLAGS="-Wno-overflow"
1351
1352 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]], [[
1353   return 0;
1354 ]])], [
1355 AC_SUBST([FLAG_W_NO_OVERFLOW], [-Wno-overflow])
1356 AC_MSG_RESULT([yes])
1357 ], [
1358 AC_SUBST([FLAG_W_NO_OVERFLOW], [])
1359 AC_MSG_RESULT([no])
1360 ])
1361 CFLAGS=$safe_CFLAGS
1362
1363
1364 # does this compiler support -Wno-uninitialized ?
1365
1366 AC_MSG_CHECKING([if gcc accepts -Wno-uninitialized])
1367
1368 safe_CFLAGS=$CFLAGS
1369 CFLAGS="-Wno-uninitialized"
1370
1371 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]], [[
1372   return 0;
1373 ]])], [
1374 AC_SUBST([FLAG_W_NO_UNINITIALIZED], [-Wno-uninitialized])
1375 AC_MSG_RESULT([yes])
1376 ], [
1377 AC_SUBST([FLAG_W_NO_UNINITIALIZED], [])
1378 AC_MSG_RESULT([no])
1379 ])
1380 CFLAGS=$safe_CFLAGS
1381
1382
1383 # does this compiler support -Wextra or the older -W ?
1384
1385 AC_MSG_CHECKING([if gcc accepts -Wextra or -W])
1386
1387 safe_CFLAGS=$CFLAGS
1388 CFLAGS="-Wextra"
1389
1390 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]], [[
1391   return 0;
1392 ]])], [
1393 AC_SUBST([FLAG_W_EXTRA], [-Wextra])
1394 AC_MSG_RESULT([-Wextra])
1395 ], [
1396   CFLAGS="-W"
1397   AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]], [[
1398     return 0;
1399   ]])], [
1400   AC_SUBST([FLAG_W_EXTRA], [-W])
1401   AC_MSG_RESULT([-W])
1402   ], [
1403   AC_SUBST([FLAG_W_EXTRA], [])
1404   AC_MSG_RESULT([not supported])
1405   ])
1406 ])
1407 CFLAGS=$safe_CFLAGS
1408
1409
1410 # does this compiler support -fno-stack-protector ?
1411 AC_MSG_CHECKING([if gcc accepts -fno-stack-protector])
1412
1413 safe_CFLAGS=$CFLAGS
1414 CFLAGS="-fno-stack-protector"
1415
1416 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
1417   return 0;
1418 ]])], [
1419 no_stack_protector=yes
1420 FLAG_FNO_STACK_PROTECTOR="-fno-stack-protector"
1421 AC_MSG_RESULT([yes])
1422 ], [
1423 no_stack_protector=no
1424 FLAG_FNO_STACK_PROTECTOR=""
1425 AC_MSG_RESULT([no])
1426 ])
1427 CFLAGS=$safe_CFLAGS
1428
1429 AC_SUBST(FLAG_FNO_STACK_PROTECTOR)
1430
1431 if test x$no_stack_protector = xyes; then
1432   CFLAGS="$CFLAGS -fno-stack-protector"
1433 fi
1434
1435
1436 # does this compiler support --param inline-unit-growth=... ?
1437
1438 AC_MSG_CHECKING([if gcc accepts --param inline-unit-growth])
1439
1440 safe_CFLAGS=$CFLAGS
1441 CFLAGS="--param inline-unit-growth=900"
1442
1443 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]], [[
1444   return 0;
1445 ]])], [
1446 AC_SUBST([FLAG_UNLIMITED_INLINE_UNIT_GROWTH],
1447          ["--param inline-unit-growth=900"])
1448 AC_MSG_RESULT([yes])
1449 ], [
1450 AC_SUBST([FLAG_UNLIMITED_INLINE_UNIT_GROWTH], [""])
1451 AC_MSG_RESULT([no])
1452 ])
1453 CFLAGS=$safe_CFLAGS
1454
1455
1456 # does this compiler support -gdwarf-4 -fdebug-types-section ?
1457
1458 AC_MSG_CHECKING([if gcc accepts -gdwarf-4 -fdebug-types-section])
1459
1460 safe_CFLAGS=$CFLAGS
1461 CFLAGS="-gdwarf-4 -fdebug-types-section"
1462
1463 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]], [[
1464   return 0;
1465 ]])], [
1466 ac_have_dwarf4=yes
1467 AC_MSG_RESULT([yes])
1468 ], [
1469 ac_have_dwarf4=no
1470 AC_MSG_RESULT([no])
1471 ])
1472 AM_CONDITIONAL(DWARF4, test x$ac_have_dwarf4 = xyes)
1473 CFLAGS=$safe_CFLAGS
1474
1475
1476 # does the linker support -Wl,--build-id=none ?  Note, it's
1477 # important that we test indirectly via whichever C compiler
1478 # is selected, rather than testing /usr/bin/ld or whatever
1479 # directly.
1480
1481 AC_MSG_CHECKING([if the linker accepts -Wl,--build-id=none])
1482
1483 safe_CFLAGS=$CFLAGS
1484 CFLAGS="-Wl,--build-id=none"
1485
1486 AC_LINK_IFELSE(
1487 [AC_LANG_PROGRAM([ ], [return 0;])],
1488 [
1489   AC_SUBST([FLAG_NO_BUILD_ID], ["-Wl,--build-id=none"])
1490   AC_MSG_RESULT([yes])
1491 ], [
1492   AC_SUBST([FLAG_NO_BUILD_ID], [""])
1493   AC_MSG_RESULT([no])
1494 ])
1495 CFLAGS=$safe_CFLAGS
1496
1497
1498 # does the ppc assembler support "mtocrf" et al?
1499 AC_MSG_CHECKING([if ppc32/64 as supports mtocrf/mfocrf])
1500
1501 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
1502 __asm__ __volatile__("mtocrf 4,0");
1503 __asm__ __volatile__("mfocrf 0,4");
1504 ]])], [
1505 ac_have_as_ppc_mftocrf=yes
1506 AC_MSG_RESULT([yes])
1507 ], [
1508 ac_have_as_ppc_mftocrf=no
1509 AC_MSG_RESULT([no])
1510 ])
1511 if test x$ac_have_as_ppc_mftocrf = xyes ; then
1512   AC_DEFINE(HAVE_AS_PPC_MFTOCRF, 1, [Define to 1 if as supports mtocrf/mfocrf.])
1513 fi
1514
1515
1516 CFLAGS=$safe_CFLAGS
1517
1518 # does the x86/amd64 assembler understand SSE3 instructions?
1519 # Note, this doesn't generate a C-level symbol.  It generates a
1520 # automake-level symbol (BUILD_SSE3_TESTS), used in test Makefile.am's
1521 AC_MSG_CHECKING([if x86/amd64 assembler speaks SSE3])
1522
1523 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
1524   do { long long int x; 
1525      __asm__ __volatile__("fisttpq (%0)" : :"r"(&x) ); } 
1526   while (0)
1527 ]])], [
1528 ac_have_as_sse3=yes
1529 AC_MSG_RESULT([yes])
1530 ], [
1531 ac_have_as_sse3=no
1532 AC_MSG_RESULT([no])
1533 ])
1534
1535 AM_CONDITIONAL(BUILD_SSE3_TESTS, test x$ac_have_as_sse3 = xyes)
1536
1537
1538 # Ditto for SSSE3 instructions (note extra S)
1539 # Note, this doesn't generate a C-level symbol.  It generates a
1540 # automake-level symbol (BUILD_SSSE3_TESTS), used in test Makefile.am's
1541 AC_MSG_CHECKING([if x86/amd64 assembler speaks SSSE3])
1542
1543 save_CFLAGS="$CFLAGS"
1544 CFLAGS="$CFLAGS -msse"
1545 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
1546   do { long long int x; 
1547    __asm__ __volatile__(
1548       "pabsb (%0),%%xmm7" : : "r"(&x) : "xmm7" ); }
1549   while (0)
1550 ]])], [
1551 ac_have_as_ssse3=yes
1552 AC_MSG_RESULT([yes])
1553 ], [
1554 ac_have_as_ssse3=no
1555 AC_MSG_RESULT([no])
1556 ])
1557 CFLAGS="$save_CFLAGS"
1558
1559 AM_CONDITIONAL(BUILD_SSSE3_TESTS, test x$ac_have_as_ssse3 = xyes)
1560
1561
1562 # does the x86/amd64 assembler understand the PCLMULQDQ instruction?
1563 # Note, this doesn't generate a C-level symbol.  It generates a
1564 # automake-level symbol (BUILD_PCLMULQDQ_TESTS), used in test Makefile.am's
1565 AC_MSG_CHECKING([if x86/amd64 assembler supports 'pclmulqdq'])
1566 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
1567   do {
1568    __asm__ __volatile__(
1569       "pclmulqdq \$17,%%xmm6,%%xmm7" : : : "xmm6", "xmm7" ); }
1570   while (0)
1571 ]])], [
1572 ac_have_as_pclmulqdq=yes
1573 AC_MSG_RESULT([yes])
1574 ], [
1575 ac_have_as_pclmulqdq=no
1576 AC_MSG_RESULT([no])
1577 ])
1578
1579 AM_CONDITIONAL(BUILD_PCLMULQDQ_TESTS, test x$ac_have_as_pclmulqdq = xyes)
1580
1581
1582 # does the x86/amd64 assembler understand the LZCNT instruction?
1583 # Note, this doesn't generate a C-level symbol.  It generates a
1584 # automake-level symbol (BUILD_LZCNT_TESTS), used in test Makefile.am's
1585 AC_MSG_CHECKING([if x86/amd64 assembler supports 'lzcnt'])
1586
1587 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
1588   do {           
1589       __asm__ __volatile__("lzcnt %rax,%rax");
1590   } while (0)
1591 ]])], [
1592   ac_have_as_lzcnt=yes
1593   AC_MSG_RESULT([yes])
1594 ], [
1595   ac_have_as_lzcnt=no
1596   AC_MSG_RESULT([no])
1597 ])
1598
1599 AM_CONDITIONAL([BUILD_LZCNT_TESTS], [test x$ac_have_as_lzcnt = xyes])
1600
1601
1602 # does the x86/amd64 assembler understand SSE 4.2 instructions?
1603 # Note, this doesn't generate a C-level symbol.  It generates a
1604 # automake-level symbol (BUILD_SSE42_TESTS), used in test Makefile.am's
1605 AC_MSG_CHECKING([if x86/amd64 assembler speaks SSE4.2])
1606
1607 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
1608   do { long long int x; 
1609    __asm__ __volatile__(
1610       "crc32q %%r15,%%r15" : : : "r15" );
1611    __asm__ __volatile__(
1612       "pblendvb (%rcx), %xmm11"); }
1613   while (0)
1614 ]])], [
1615 ac_have_as_sse42=yes
1616 AC_MSG_RESULT([yes])
1617 ], [
1618 ac_have_as_sse42=no
1619 AC_MSG_RESULT([no])
1620 ])
1621
1622 AM_CONDITIONAL(BUILD_SSE42_TESTS, test x$ac_have_as_sse42 = xyes)
1623
1624
1625 # XXX JRS 2010 Oct 13: what is this for?  For sure, we don't need this
1626 # when building the tool executables.  I think we should get rid of it.
1627 #
1628 # Check for TLS support in the compiler and linker
1629 AC_LINK_IFELSE([AC_LANG_PROGRAM([[static __thread int foo;]],
1630                                 [[return foo;]])],
1631                                [vg_cv_linktime_tls=yes],
1632                                [vg_cv_linktime_tls=no])
1633 # Native compilation: check whether running a program using TLS succeeds.
1634 # Linking only is not sufficient -- e.g. on Red Hat 7.3 linking TLS programs
1635 # succeeds but running programs using TLS fails.
1636 # Cross-compiling: check whether linking a program using TLS succeeds.
1637 AC_CACHE_CHECK([for TLS support], vg_cv_tls,
1638                [AC_ARG_ENABLE(tls, [  --enable-tls            platform supports TLS],
1639                 [vg_cv_tls=$enableval],
1640                 [AC_RUN_IFELSE([AC_LANG_PROGRAM([[static __thread int foo;]],
1641                                                 [[return foo;]])],
1642                                [vg_cv_tls=yes],
1643                                [vg_cv_tls=no],
1644                                [vg_cv_tls=$vg_cv_linktime_tls])])])
1645
1646 if test "$vg_cv_tls" = yes; then
1647 AC_DEFINE([HAVE_TLS], 1, [can use __thread to define thread-local variables])
1648 fi
1649
1650
1651 #----------------------------------------------------------------------------
1652 # Checks for C header files.
1653 #----------------------------------------------------------------------------
1654
1655 AC_HEADER_STDC
1656 AC_CHECK_HEADERS([       \
1657         asm/unistd.h     \
1658         endian.h         \
1659         mqueue.h         \
1660         sys/endian.h     \
1661         sys/epoll.h      \
1662         sys/eventfd.h    \
1663         sys/klog.h       \
1664         sys/poll.h       \
1665         sys/signal.h     \
1666         sys/signalfd.h   \
1667         sys/syscall.h    \
1668         sys/time.h       \
1669         sys/types.h      \
1670         ])
1671
1672 # Verify whether the <linux/futex.h> header is usable.
1673 AC_MSG_CHECKING([if <linux/futex.h> is usable])
1674
1675 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1676 #include <linux/futex.h>
1677 ]], [[
1678   return FUTEX_WAIT;
1679 ]])], [
1680 ac_have_usable_linux_futex_h=yes
1681 AC_DEFINE([HAVE_USABLE_LINUX_FUTEX_H], 1,
1682           [Define to 1 if you have a usable <linux/futex.h> header file.])
1683 AC_MSG_RESULT([yes])
1684 ], [
1685 ac_have_usable_linux_futex_h=no
1686 AC_MSG_RESULT([no])
1687 ])
1688
1689 #----------------------------------------------------------------------------
1690 # Checks for typedefs, structures, and compiler characteristics.
1691 #----------------------------------------------------------------------------
1692 AC_TYPE_UID_T
1693 AC_TYPE_OFF_T
1694 AC_TYPE_SIZE_T
1695 AC_HEADER_TIME
1696
1697
1698 #----------------------------------------------------------------------------
1699 # Checks for library functions.
1700 #----------------------------------------------------------------------------
1701 AC_FUNC_MEMCMP
1702 AC_FUNC_MMAP
1703
1704 AC_CHECK_LIB([pthread], [pthread_create])
1705 AC_CHECK_LIB([rt], [clock_gettime])
1706
1707 AC_CHECK_FUNCS([     \
1708         clock_gettime\
1709         epoll_create \
1710         epoll_pwait  \
1711         klogctl      \
1712         mallinfo     \
1713         memchr       \
1714         memset       \
1715         mkdir        \
1716         mremap       \
1717         ppoll        \
1718         pthread_barrier_init       \
1719         pthread_condattr_setclock  \
1720         pthread_mutex_timedlock    \
1721         pthread_rwlock_timedrdlock \
1722         pthread_rwlock_timedwrlock \
1723         pthread_spin_lock          \
1724         pthread_yield              \
1725         readlinkat   \
1726         semtimedop   \
1727         signalfd     \
1728         sigwaitinfo  \
1729         strchr       \
1730         strdup       \
1731         strpbrk      \
1732         strrchr      \
1733         strstr       \
1734         syscall      \
1735         utimensat    \
1736         process_vm_readv  \
1737         process_vm_writev \
1738         ])
1739
1740 # AC_CHECK_LIB adds any library found to the variable LIBS, and links these
1741 # libraries with any shared object and/or executable. This is NOT what we
1742 # want for e.g. vgpreload_core-x86-linux.so
1743 LIBS=""
1744
1745 AM_CONDITIONAL([HAVE_PTHREAD_BARRIER],
1746                [test x$ac_cv_func_pthread_barrier_init = xyes])
1747 AM_CONDITIONAL([HAVE_PTHREAD_MUTEX_TIMEDLOCK],
1748                [test x$ac_cv_func_pthread_mutex_timedlock = xyes])
1749 AM_CONDITIONAL([HAVE_PTHREAD_SPINLOCK],
1750                [test x$ac_cv_func_pthread_spin_lock = xyes])
1751
1752
1753 #----------------------------------------------------------------------------
1754 # MPI checks
1755 #----------------------------------------------------------------------------
1756 # Do we have a useable MPI setup on the primary and/or secondary targets?
1757 # On Linux, by default, assumes mpicc and -m32/-m64
1758 # Note: this is a kludge in that it assumes the specified mpicc 
1759 # understands -m32/-m64 regardless of what is specified using
1760 # --with-mpicc=.
1761 MPI_CC="mpicc"
1762
1763 mflag_primary=
1764 if test x$VGCONF_PLATFORM_PRI_CAPS = xX86_LINUX \
1765      -o x$VGCONF_PLATFORM_PRI_CAPS = xPPC32_LINUX \
1766      -o x$VGCONF_PLATFORM_PRI_CAPS = xARM_LINUX ; then
1767   mflag_primary=$FLAG_M32
1768 elif test x$VGCONF_PLATFORM_PRI_CAPS = xAMD64_LINUX \
1769        -o x$VGCONF_PLATFORM_PRI_CAPS = xPPC64_LINUX \
1770        -o x$VGCONF_PLATFORM_PRI_CAPS = xS390X_LINUX ; then
1771   mflag_primary=$FLAG_M64
1772 fi
1773
1774 mflag_secondary=
1775 if test x$VGCONF_PLATFORM_SEC_CAPS = xX86_LINUX \
1776      -o x$VGCONF_PLATFORM_SEC_CAPS = xPPC32_LINUX ; then
1777   mflag_secondary=$FLAG_M32
1778 fi
1779
1780
1781 AC_ARG_WITH(mpicc,
1782    [  --with-mpicc=           Specify name of MPI2-ised C compiler],
1783    MPI_CC=$withval
1784 )
1785 AC_SUBST(MPI_CC)
1786
1787 ## See if MPI_CC works for the primary target
1788 ##
1789 AC_MSG_CHECKING([primary target for usable MPI2-compliant C compiler and mpi.h])
1790 saved_CC=$CC
1791 saved_CFLAGS=$CFLAGS
1792 CC=$MPI_CC
1793 CFLAGS=$mflag_primary
1794 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
1795 #include <mpi.h>
1796 #include <stdio.h>
1797 ]], [[
1798   int r = MPI_Init(NULL,NULL);
1799   r |= MPI_Type_get_contents( MPI_INT, 0,0,0, NULL,NULL,NULL );
1800   return r; 
1801 ]])], [
1802 ac_have_mpi2_pri=yes
1803 AC_MSG_RESULT([yes, $MPI_CC])
1804 ], [
1805 ac_have_mpi2_pri=no
1806 AC_MSG_RESULT([no])
1807 ])
1808 CC=$saved_CC
1809 CFLAGS=$saved_CFLAGS
1810 AM_CONDITIONAL(BUILD_MPIWRAP_PRI, test x$ac_have_mpi2_pri = xyes)
1811
1812 ## See if MPI_CC works for the secondary target.  Complication: what if
1813 ## there is no secondary target?  We need this to then fail.
1814 ## Kludge this by making MPI_CC something which will surely fail in
1815 ## such a case.
1816 ##
1817 AC_MSG_CHECKING([secondary target for usable MPI2-compliant C compiler and mpi.h])
1818 saved_CC=$CC
1819 saved_CFLAGS=$CFLAGS
1820 if test x$VGCONF_PLATFORM_SEC_CAPS = x ; then
1821   CC="$MPI_CC this will surely fail"
1822 else
1823   CC=$MPI_CC
1824 fi
1825 CFLAGS=$mflag_secondary
1826 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
1827 #include <mpi.h>
1828 #include <stdio.h>
1829 ]], [[
1830   int r = MPI_Init(NULL,NULL);
1831   r |= MPI_Type_get_contents( MPI_INT, 0,0,0, NULL,NULL,NULL );
1832   return r; 
1833 ]])], [
1834 ac_have_mpi2_sec=yes
1835 AC_MSG_RESULT([yes, $MPI_CC])
1836 ], [
1837 ac_have_mpi2_sec=no
1838 AC_MSG_RESULT([no])
1839 ])
1840 CC=$saved_CC
1841 CFLAGS=$saved_CFLAGS
1842 AM_CONDITIONAL(BUILD_MPIWRAP_SEC, test x$ac_have_mpi2_sec = xyes)
1843
1844
1845 #----------------------------------------------------------------------------
1846 # Other library checks
1847 #----------------------------------------------------------------------------
1848 # There now follow some tests for Boost, and OpenMP.  These
1849 # tests are present because Drd has some regression tests that use
1850 # these packages.  All regression test programs all compiled only
1851 # for the primary target.  And so it is important that the configure
1852 # checks that follow, use the correct -m32 or -m64 flag for the
1853 # primary target (called $mflag_primary).  Otherwise, we can end up
1854 # in a situation (eg) where, on amd64-linux, the test for Boost checks
1855 # for usable 64-bit Boost facilities, but because we are doing a 32-bit
1856 # only build (meaning, the primary target is x86-linux), the build
1857 # of the regtest programs that use Boost fails, because they are 
1858 # build as 32-bit (IN THIS EXAMPLE).
1859 #
1860 # Hence: ALWAYS USE $mflag_primary FOR CONFIGURE TESTS FOR FACILITIES
1861 # NEEDED BY THE REGRESSION TEST PROGRAMS.
1862
1863
1864 # Check whether the boost library 1.35 or later has been installed.
1865 # The Boost.Threads library has undergone a major rewrite in version 1.35.0.
1866
1867 AC_MSG_CHECKING([for boost])
1868
1869 AC_LANG(C++)
1870 safe_CXXFLAGS=$CXXFLAGS
1871 CXXFLAGS="-lboost_thread-mt $mflag_primary"
1872
1873 AC_LINK_IFELSE([AC_LANG_SOURCE([
1874 #include <boost/thread.hpp>
1875 static void thread_func(void)
1876 { }
1877 int main(int argc, char** argv)
1878 {
1879   boost::thread t(thread_func);
1880   return 0;
1881 }
1882 ])],
1883 [
1884 ac_have_boost_1_35=yes
1885 AC_SUBST([BOOST_CFLAGS], [])
1886 AC_SUBST([BOOST_LIBS], ["${CXXFLAGS}"])
1887 AC_MSG_RESULT([yes])
1888 ], [
1889 ac_have_boost_1_35=no
1890 AC_MSG_RESULT([no])
1891 ])
1892
1893 CXXFLAGS=$safe_CXXFLAGS
1894 AC_LANG(C)
1895
1896 AM_CONDITIONAL([HAVE_BOOST_1_35], [test x$ac_have_boost_1_35 = xyes])
1897
1898
1899 # does this compiler support -fopenmp, does it have the include file
1900 # <omp.h> and does it have libgomp ?
1901
1902 AC_MSG_CHECKING([for OpenMP])
1903
1904 safe_CFLAGS=$CFLAGS
1905 CFLAGS="-fopenmp $mflag_primary"
1906
1907 AC_LINK_IFELSE([AC_LANG_SOURCE([
1908 #include <omp.h> 
1909 int main(int argc, char** argv)
1910 {
1911   omp_set_dynamic(0);
1912   return 0;
1913 }
1914 ])],
1915 [
1916 ac_have_openmp=yes
1917 AC_MSG_RESULT([yes])
1918 ], [
1919 ac_have_openmp=no
1920 AC_MSG_RESULT([no])
1921 ])
1922 CFLAGS=$safe_CFLAGS
1923
1924 AM_CONDITIONAL([HAVE_OPENMP], [test x$ac_have_openmp = xyes])
1925
1926
1927 # does this compiler have built-in functions for atomic memory access for the
1928 # primary target ?
1929 AC_MSG_CHECKING([if gcc supports __sync_add_and_fetch for the primary target])
1930
1931 safe_CFLAGS=$CFLAGS
1932 CFLAGS="$mflag_primary"
1933
1934 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[
1935   int variable = 1;
1936   return (__sync_bool_compare_and_swap(&variable, 1, 2)
1937           && __sync_add_and_fetch(&variable, 1) ? 1 : 0)
1938 ]])], [
1939   ac_have_builtin_atomic_primary=yes
1940   AC_MSG_RESULT([yes])
1941   AC_DEFINE(HAVE_BUILTIN_ATOMIC, 1, [Define to 1 if gcc supports __sync_bool_compare_and_swap() and __sync_add_and_fetch() for the primary target])
1942 ], [
1943   ac_have_builtin_atomic_primary=no
1944   AC_MSG_RESULT([no])
1945 ])
1946
1947 CFLAGS=$safe_CFLAGS
1948
1949 AM_CONDITIONAL([HAVE_BUILTIN_ATOMIC],
1950                [test x$ac_have_builtin_atomic_primary = xyes])
1951
1952
1953 # does this compiler have built-in functions for atomic memory access for the
1954 # secondary target ?
1955
1956 if test x$VGCONF_PLATFORM_SEC_CAPS != x; then
1957
1958 AC_MSG_CHECKING([if gcc supports __sync_add_and_fetch for the secondary target])
1959
1960 safe_CFLAGS=$CFLAGS
1961 CFLAGS="$mflag_secondary"
1962
1963 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[
1964   int variable = 1;
1965   return (__sync_add_and_fetch(&variable, 1) ? 1 : 0)
1966 ]])], [
1967   ac_have_builtin_atomic_secondary=yes
1968   AC_MSG_RESULT([yes])
1969 ], [
1970   ac_have_builtin_atomic_secondary=no
1971   AC_MSG_RESULT([no])
1972 ])
1973
1974 CFLAGS=$safe_CFLAGS
1975
1976 fi
1977
1978 AM_CONDITIONAL([HAVE_BUILTIN_ATOMIC_SECONDARY],
1979                [test x$ac_have_builtin_atomic_secondary = xyes])
1980
1981 # does this compiler have built-in functions for atomic memory access on
1982 # 64-bit integers for all targets ?
1983
1984 AC_MSG_CHECKING([if gcc supports __sync_add_and_fetch on uint64_t for all targets])
1985
1986 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
1987   #include <stdint.h>
1988 ]], [[
1989   uint64_t variable = 1;
1990   return __sync_add_and_fetch(&variable, 1)
1991 ]])], [
1992   ac_have_builtin_atomic64_primary=yes
1993 ], [
1994   ac_have_builtin_atomic64_primary=no
1995 ])
1996
1997 if test x$VGCONF_PLATFORM_SEC_CAPS != x; then
1998
1999 safe_CFLAGS=$CFLAGS
2000 CFLAGS="$mflag_secondary"
2001
2002 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
2003   #include <stdint.h>
2004 ]], [[
2005   uint64_t variable = 1;
2006   return __sync_add_and_fetch(&variable, 1)
2007 ]])], [
2008   ac_have_builtin_atomic64_secondary=yes
2009 ], [
2010   ac_have_builtin_atomic64_secondary=no
2011 ])
2012
2013 CFLAGS=$safe_CFLAGS
2014
2015 fi
2016
2017 if test x$ac_have_builtin_atomic64_primary = xyes && \
2018    test x$VGCONF_PLATFORM_SEC_CAPS = x \
2019      -o x$ac_have_builtin_atomic64_secondary = xyes; then
2020   AC_MSG_RESULT([yes])
2021   ac_have_builtin_atomic64=yes
2022 else
2023   AC_MSG_RESULT([no])
2024   ac_have_builtin_atomic64=no
2025 fi
2026
2027 AM_CONDITIONAL([HAVE_BUILTIN_ATOMIC64],
2028                [test x$ac_have_builtin_atomic64 = xyes])
2029
2030
2031 # does g++ have built-in functions for atomic memory access ?
2032 AC_MSG_CHECKING([if g++ supports __sync_add_and_fetch])
2033
2034 safe_CXXFLAGS=$CXXFLAGS
2035 CXXFLAGS="$mflag_primary"
2036
2037 AC_LANG_PUSH(C++)
2038 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[
2039   int variable = 1;
2040   return (__sync_bool_compare_and_swap(&variable, 1, 2)
2041           && __sync_add_and_fetch(&variable, 1) ? 1 : 0)
2042 ]])], [
2043   ac_have_builtin_atomic_cxx=yes
2044   AC_MSG_RESULT([yes])
2045   AC_DEFINE(HAVE_BUILTIN_ATOMIC_CXX, 1, [Define to 1 if g++ supports __sync_bool_compare_and_swap() and __sync_add_and_fetch()])
2046 ], [
2047   ac_have_builtin_atomic_cxx=no
2048   AC_MSG_RESULT([no])
2049 ])
2050 AC_LANG_POP(C++)
2051
2052 CXXFLAGS=$safe_CXXFLAGS
2053
2054 AM_CONDITIONAL([HAVE_BUILTIN_ATOMIC_CXX], [test x$ac_have_builtin_atomic_cxx = xyes])
2055
2056
2057 if test x$ac_have_usable_linux_futex_h = xyes \
2058         -a x$ac_have_builtin_atomic_primary = xyes; then
2059   ac_enable_linux_ticket_lock_primary=yes
2060 fi
2061 AM_CONDITIONAL([ENABLE_LINUX_TICKET_LOCK_PRIMARY],
2062                [test x$ac_enable_linux_ticket_lock_primary = xyes])
2063
2064 if test x$VGCONF_PLATFORM_SEC_CAPS != x \
2065         -a x$ac_have_usable_linux_futex_h = xyes \
2066         -a x$ac_have_builtin_atomic_secondary = xyes; then
2067   ac_enable_linux_ticket_lock_secondary=yes
2068 fi
2069 AM_CONDITIONAL([ENABLE_LINUX_TICKET_LOCK_SECONDARY],
2070                [test x$ac_enable_linux_ticket_lock_secondary = xyes])
2071
2072
2073 # does libstdc++ support annotating shared pointers ?
2074 AC_MSG_CHECKING([if libstdc++ supports annotating shared pointers])
2075
2076 safe_CXXFLAGS=$CFLAGS
2077 CXXFLAGS="-std=c++0x"
2078
2079 AC_LANG_PUSH(C++)
2080 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
2081   #include <memory>
2082 ]], [[
2083   std::shared_ptr<int> p
2084 ]])], [
2085   ac_have_shared_ptr=yes
2086 ], [
2087   ac_have_shared_ptr=no
2088 ])
2089 if test x$ac_have_shared_ptr = xyes; then
2090   # If compilation of the program below fails because of a syntax error
2091   # triggered by substituting one of the annotation macros then that
2092   # means that libstdc++ supports these macros.
2093   AC_LINK_IFELSE([AC_LANG_PROGRAM([[
2094     #define _GLIBCXX_SYNCHRONIZATION_HAPPENS_BEFORE(a) (a)----
2095     #define _GLIBCXX_SYNCHRONIZATION_HAPPENS_AFTER(a) (a)----
2096     #include <memory>
2097   ]], [[
2098     std::shared_ptr<int> p
2099   ]])], [
2100     ac_have_shared_pointer_annotation=no
2101     AC_MSG_RESULT([no])
2102   ], [
2103     ac_have_shared_pointer_annotation=yes
2104     AC_MSG_RESULT([yes])
2105     AC_DEFINE(HAVE_SHARED_POINTER_ANNOTATION, 1,
2106               [Define to 1 if libstd++ supports annotating shared pointers])
2107   ])
2108 else
2109   ac_have_shared_pointer_annotation=no
2110   AC_MSG_RESULT([no])
2111 fi
2112 AC_LANG_POP(C++)
2113
2114 CXXFLAGS=$safe_CXXFLAGS
2115
2116 AM_CONDITIONAL([HAVE_SHARED_POINTER_ANNOTATION],
2117                [test x$ac_have_shared_pointer_annotation = xyes])
2118
2119
2120 #----------------------------------------------------------------------------
2121 # Ok.  We're done checking.
2122 #----------------------------------------------------------------------------
2123
2124 # Nb: VEX/Makefile is generated from Makefile.vex.in.
2125 AC_CONFIG_FILES([
2126    Makefile 
2127    VEX/Makefile:Makefile.vex.in
2128    valgrind.spec
2129    valgrind.pc
2130    glibc-2.X.supp
2131    docs/Makefile 
2132    tests/Makefile 
2133    tests/vg_regtest 
2134    perf/Makefile 
2135    perf/vg_perf
2136    gdbserver_tests/Makefile
2137    include/Makefile 
2138    auxprogs/Makefile
2139    mpi/Makefile
2140    coregrind/Makefile 
2141    memcheck/Makefile
2142    memcheck/tests/Makefile
2143    memcheck/tests/amd64/Makefile
2144    memcheck/tests/x86/Makefile
2145    memcheck/tests/linux/Makefile
2146    memcheck/tests/darwin/Makefile
2147    memcheck/tests/amd64-linux/Makefile
2148    memcheck/tests/x86-linux/Makefile
2149    memcheck/tests/ppc32/Makefile
2150    memcheck/tests/ppc64/Makefile
2151    cachegrind/Makefile
2152    cachegrind/tests/Makefile
2153    cachegrind/tests/x86/Makefile
2154    cachegrind/cg_annotate
2155    cachegrind/cg_diff
2156    callgrind/Makefile
2157    callgrind/callgrind_annotate
2158    callgrind/callgrind_control
2159    callgrind/tests/Makefile
2160    helgrind/Makefile
2161    helgrind/tests/Makefile
2162    massif/Makefile
2163    massif/tests/Makefile
2164    massif/ms_print
2165    lackey/Makefile
2166    lackey/tests/Makefile
2167    none/Makefile
2168    none/tests/Makefile
2169    none/tests/amd64/Makefile
2170    none/tests/ppc32/Makefile
2171    none/tests/ppc64/Makefile
2172    none/tests/x86/Makefile
2173    none/tests/arm/Makefile
2174    none/tests/s390x/Makefile
2175    none/tests/linux/Makefile
2176    none/tests/darwin/Makefile
2177    none/tests/x86-linux/Makefile
2178    exp-sgcheck/Makefile
2179    exp-sgcheck/tests/Makefile
2180    drd/Makefile
2181    drd/scripts/download-and-build-splash2
2182    drd/tests/Makefile
2183    exp-bbv/Makefile
2184    exp-bbv/tests/Makefile
2185    exp-bbv/tests/x86/Makefile
2186    exp-bbv/tests/x86-linux/Makefile
2187    exp-bbv/tests/amd64-linux/Makefile
2188    exp-bbv/tests/ppc32-linux/Makefile
2189    exp-bbv/tests/arm-linux/Makefile
2190    exp-dhat/Makefile
2191    exp-dhat/tests/Makefile
2192 ])
2193 AC_CONFIG_FILES([coregrind/link_tool_exe_linux],
2194                 [chmod +x coregrind/link_tool_exe_linux])
2195 AC_CONFIG_FILES([coregrind/link_tool_exe_darwin],
2196                 [chmod +x coregrind/link_tool_exe_darwin])
2197 AC_OUTPUT
2198
2199 cat<<EOF
2200
2201          Maximum build arch: ${ARCH_MAX}
2202          Primary build arch: ${VGCONF_ARCH_PRI}
2203        Secondary build arch: ${VGCONF_ARCH_SEC}
2204                    Build OS: ${VGCONF_OS}
2205        Primary build target: ${VGCONF_PLATFORM_PRI_CAPS}
2206      Secondary build target: ${VGCONF_PLATFORM_SEC_CAPS}
2207            Platform variant: ${VGCONF_PLATVARIANT}
2208       Primary -DVGPV string: -DVGPV_${VGCONF_ARCH_PRI}_${VGCONF_OS}_${VGCONF_PLATVARIANT}=1
2209          Default supp files: ${DEFAULT_SUPP}
2210
2211 EOF