268
# If we are building on a 64 bit platform test to see if the system
269
# supports building 32 bit programs and disable 32 bit support if it
270
# does not support building 32 bit programs
272
case "$VG_ARCH-$VG_OS" in
273
amd64-linux|ppc64-linux)
274
AC_MSG_CHECKING([for 32 bit build support])
278
int main () { return 0 ; }
283
vg_cv_only64bit="yes"
286
CFLAGS=$safe_CFLAGS;;
289
if test x$vg_cv_only64bit = xyes -a x$vg_cv_only32bit = xyes; then
291
[--enable-only32bit was specified but system does not support 32 bit builds])
242
294
# Establish VG_PLATFORM_PRI. This is the primary build target. The
243
295
# entire system, including regression and performance tests, will be
276
328
VG_PLATFORM_SEC=""
277
329
AC_MSG_RESULT([ok (${host_cpu}-${host_os})])
332
if test x$vg_cv_only64bit = xyes; then
333
VG_PLATFORM_PRI="PPC64_AIX5"
335
elif test x$vg_cv_only32bit = xyes; then
336
VG_PLATFORM_PRI="PPC32_AIX5"
339
VG_PLATFORM_PRI="PPC64_AIX5"
340
VG_PLATFORM_SEC="PPC32_AIX5"
342
AC_MSG_RESULT([ok (${host_cpu}-${host_os})])
280
345
if test x$vg_cv_only64bit = xyes; then
281
346
VG_PLATFORM_PRI="PPC64_LINUX"
300
# Set up VG_<platform>. Either one or two of these become defined.
365
# Set up VGP_<platform>. Either one or two of these become defined.
302
AM_CONDITIONAL(VG_X86_LINUX,
367
AM_CONDITIONAL(VGP_X86_LINUX,
303
368
test x$VG_PLATFORM_PRI = xX86_LINUX \
304
369
-o x$VG_PLATFORM_SEC = xX86_LINUX)
305
AM_CONDITIONAL(VG_AMD64_LINUX,
370
AM_CONDITIONAL(VGP_AMD64_LINUX,
306
371
test x$VG_PLATFORM_PRI = xAMD64_LINUX)
307
AM_CONDITIONAL(VG_PPC32_LINUX,
372
AM_CONDITIONAL(VGP_PPC32_LINUX,
308
373
test x$VG_PLATFORM_PRI = xPPC32_LINUX \
309
374
-o x$VG_PLATFORM_SEC = xPPC32_LINUX)
310
AM_CONDITIONAL(VG_PPC64_LINUX,
375
AM_CONDITIONAL(VGP_PPC64_LINUX,
311
376
test x$VG_PLATFORM_PRI = xPPC64_LINUX)
377
AM_CONDITIONAL(VGP_PPC32_AIX5,
378
test x$VG_PLATFORM_PRI = xPPC32_AIX5 \
379
-o x$VG_PLATFORM_SEC = xPPC32_AIX5)
380
AM_CONDITIONAL(VGP_PPC64_AIX5,
381
test x$VG_PLATFORM_PRI = xPPC64_AIX5)
383
# Similarly, set up VGO_<os>. Exactly one of these becomes defined.
384
# Relies on the assumption that the primary and secondary targets are
385
# for the same OS, so therefore only necessary to test the primary.
387
AM_CONDITIONAL(VGO_LINUX,
388
test x$VG_PLATFORM_PRI = xX86_LINUX \
389
-o x$VG_PLATFORM_PRI = xAMD64_LINUX \
390
-o x$VG_PLATFORM_PRI = xPPC32_LINUX \
391
-o x$VG_PLATFORM_PRI = xPPC64_LINUX)
392
AM_CONDITIONAL(VGO_AIX5,
393
test x$VG_PLATFORM_PRI = xPPC32_AIX5 \
394
-o x$VG_PLATFORM_PRI = xPPC64_AIX5)
397
# Sometimes, in the Makefile.am-s, it's useful to know
398
# whether or not there is a secondary target.
400
AM_CONDITIONAL(VGP_HAVE_SECONDARY,
401
test x$VG_PLATFORM_SEC != x)
314
404
# This variable will collect the individual suppression files
352
AC_MSG_CHECKING([the glibc version])
442
AC_EGREP_CPP([GLIBC_25], [
443
#include <features.h>
444
#ifdef __GNU_LIBRARY__
445
#if (__GLIBC__ == 2 && __GLIBC_MINOR__ == 5)
452
AC_EGREP_CPP([GLIBC_26], [
453
#include <features.h>
454
#ifdef __GNU_LIBRARY__
455
#if (__GLIBC__ == 2 && __GLIBC_MINOR__ == 6)
462
AC_EGREP_CPP([GLIBC_27], [
463
#include <features.h>
464
#ifdef __GNU_LIBRARY__
465
#if (__GLIBC__ == 2 && __GLIBC_MINOR__ == 7)
472
AC_EGREP_CPP([GLIBC_28], [
473
#include <features.h>
474
#ifdef __GNU_LIBRARY__
475
#if (__GLIBC__ == 2 && __GLIBC_MINOR__ == 8)
482
AC_EGREP_CPP([AIX5_LIBC], [
483
#include <standards.h>
484
#if defined(_AIXVERSION_510) || defined(_AIXVERSION_520) || defined(_AIXVERSION_530)
490
AC_MSG_CHECKING([the libc version])
356
494
AC_MSG_RESULT(2.2 family)
357
495
AC_DEFINE([GLIBC_2_2], 1, [Define to 1 if you're using glibc 2.2.x])
358
496
DEFAULT_SUPP="glibc-2.2.supp ${DEFAULT_SUPP}"
497
DEFAULT_SUPP="glibc-2.2-LinuxThreads-helgrind.supp ${DEFAULT_SUPP}"
362
501
AC_MSG_RESULT(2.3 family)
363
502
AC_DEFINE([GLIBC_2_3], 1, [Define to 1 if you're using glibc 2.3.x])
364
503
DEFAULT_SUPP="glibc-2.3.supp ${DEFAULT_SUPP}"
504
DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
368
508
AC_MSG_RESULT(2.4 family)
369
509
AC_DEFINE([GLIBC_2_4], 1, [Define to 1 if you're using glibc 2.4.x])
370
510
DEFAULT_SUPP="glibc-2.4.supp ${DEFAULT_SUPP}"
511
DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
515
AC_MSG_RESULT(2.5 family)
516
AC_DEFINE([GLIBC_2_5], 1, [Define to 1 if you're using glibc 2.5.x])
517
DEFAULT_SUPP="glibc-2.5.supp ${DEFAULT_SUPP}"
518
DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
521
AC_MSG_RESULT(2.6 family)
522
AC_DEFINE([GLIBC_2_6], 1, [Define to 1 if you're using glibc 2.6.x])
523
DEFAULT_SUPP="glibc-2.6.supp ${DEFAULT_SUPP}"
524
DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
527
AC_MSG_RESULT(2.7 family)
528
AC_DEFINE([GLIBC_2_7], 1, [Define to 1 if you're using glibc 2.7.x])
529
DEFAULT_SUPP="glibc-2.7.supp ${DEFAULT_SUPP}"
530
DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
533
AC_MSG_RESULT(2.8 family)
534
AC_DEFINE([GLIBC_2_8], 1, [Define to 1 if you're using glibc 2.8.x])
535
DEFAULT_SUPP="glibc-2.8.supp ${DEFAULT_SUPP}"
536
DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
539
AC_MSG_RESULT(AIX 5.1 or 5.2 or 5.3)
540
AC_DEFINE([AIX5_LIBC], 1, [Define to 1 if you're using AIX 5.1 or 5.2 or 5.3])
541
DEFAULT_SUPP="aix5libc.supp ${DEFAULT_SUPP}"
374
545
AC_MSG_RESULT(unsupported version)
375
AC_MSG_ERROR([Valgrind requires glibc version 2.2, 2.3 or 2.4])
546
AC_MSG_ERROR([Valgrind requires glibc version 2.2 - 2.7])
547
AC_MSG_ERROR([or AIX 5.1 or 5.2 or 5.3 libc])
380
552
# We don't know how to detect the X client library version
381
# (detecting the server version is easy, bu no help). So we
553
# (detecting the server version is easy, but no help). So we
382
554
# just use a hack: always include the suppressions for both
383
555
# versions 3 and 4.
760
# does this compiler support -fno-stack-protector ?
761
AC_MSG_CHECKING([if gcc accepts -fno-stack-protector ])
764
CFLAGS="-fno-stack-protector"
767
int main () { return 0 ; }
770
no_stack_protector=yes
771
FLAG_FNO_STACK_PROTECTOR="-fno-stack-protector"
774
no_stack_protector=no
775
FLAG_FNO_STACK_PROTECTOR=""
780
AC_SUBST(FLAG_FNO_STACK_PROTECTOR)
782
if test x$no_stack_protector = xyes; then
783
CFLAGS="$CFLAGS -fno-stack-protector"
546
787
# does this compiler support __builtin_expect?
547
788
AC_MSG_CHECKING([if gcc supports __builtin_expect])
824
# does the x86/amd64 assembler understand SSE3 instructions?
825
# Note, this doesn't generate a C-level symbol. It generates a
826
# automake-level symbol (BUILD_SSE3_TESTS), used in test Makefile.am's
827
AC_MSG_CHECKING([if x86/amd64 assembler speaks SSE3])
830
do { long long int x;
831
__asm__ __volatile__("fisttpq (%0)" : :"r"(&x) ); }
842
AM_CONDITIONAL(BUILD_SSE3_TESTS, test x$ac_have_as_sse3 = xyes)
583
845
# Check for TLS support in the compiler and linker
584
846
AC_CACHE_CHECK([for TLS support], vg_cv_tls,
585
847
[AC_ARG_ENABLE(tls, [ --enable-tls platform supports TLS],
614
876
AC_CHECK_FUNCS([floor memchr memset mkdir strchr strdup strpbrk strrchr strstr semtimedop])
617
# Do we have a useable MPI setup on the primary target
618
# (mpicc, and suitable MPI2 headers?)
879
# Do we have a useable MPI setup on the primary and/or secondary targets?
880
# On Linux, by default, assumes mpicc and -m32/-m64
881
# On AIX, by default, assumes mpxlc and -q32/-q64
619
882
# Note: this is a kludge in that it assumes the specified mpicc
620
# understands '-m32' or '-m64', as established above
883
# understands -m32/-m64/-q32/-q64 regardless of what is specified using
886
if test x$VG_PLATFORM_PRI = xPPC32_AIX5 \
887
-o x$VG_PLATFORM_PRI = xPPC64_AIX5 ; then
623
892
if test x$VG_PLATFORM_PRI = xX86_LINUX \
624
893
-o x$VG_PLATFORM_PRI = xPPC32_LINUX ; then
626
895
elif test x$VG_PLATFORM_PRI = xAMD64_LINUX \
627
896
-o x$VG_PLATFORM_PRI = xPPC64_LINUX ; then
628
897
mflag_primary=$FLAG_M64
898
elif test x$VG_PLATFORM_PRI = xPPC32_AIX5 ; then
900
elif test x$VG_PLATFORM_PRI = xPPC64_AIX5 ; then
905
if test x$VG_PLATFORM_SEC = xX86_LINUX \
906
-o x$VG_PLATFORM_SEC = xPPC32_LINUX ; then
907
mflag_secondary=$FLAG_M32
908
elif test x$VG_PLATFORM_SEC = xPPC32_AIX5 ; then
631
913
AC_ARG_WITH(mpicc,
632
914
[ --with-mpicc= Specify name of MPI2-ised C compiler],
635
AC_MSG_CHECKING([for usable MPI2-compliant mpicc and mpi.h])
919
## See if MPI_CC works for the primary target
921
AC_MSG_CHECKING([primary target for usable MPI2-compliant C compiler and mpi.h])
637
923
saved_CFLAGS=$CFLAGS
645
931
r |= MPI_Type_get_contents( MPI_INT, 0,0,0, NULL,NULL,NULL );
649
935
AC_MSG_RESULT([yes, $MPI_CC])
652
938
AC_MSG_RESULT([no])
655
941
CFLAGS=$saved_CFLAGS
942
AM_CONDITIONAL(BUILD_MPIWRAP_PRI, test x$ac_have_mpi2_pri = xyes)
657
AM_CONDITIONAL(BUILD_MPIWRAP, test x$ac_have_mpi2 = xyes)
944
## See if MPI_CC works for the secondary target. Complication: what if
945
## there is no secondary target? We need this to then fail.
946
## Kludge this by making MPI_CC something which will surely fail in
949
AC_MSG_CHECKING([secondary target for usable MPI2-compliant C compiler and mpi.h])
952
if test x$VG_PLATFORM_SEC = x ; then
953
CC="$MPI_CC this will surely fail"
957
CFLAGS=$mflag_secondary
962
int r = MPI_Init(NULL,NULL);
963
r |= MPI_Type_get_contents( MPI_INT, 0,0,0, NULL,NULL,NULL );
967
AC_MSG_RESULT([yes, $MPI_CC])
974
AM_CONDITIONAL(BUILD_MPIWRAP_SEC, test x$ac_have_mpi2_sec = xyes)
661
977
# -------------------- ok. We're done. --------------------