esac
-# Checks for the platform, with the aim of setting VG_ARCH. Note
-# that VG_ARCH must be set to reflect the most that this CPU can
-# do: for example if it is a 64-bit capable PowerPC, then it must
-# be set to ppc64 and not ppc32. Ditto for amd64.
+# Checks for the platform, with the aim of setting VG_ARCH_MAX. Note
+# that VG_ARCH_MAX must be set to reflect the most that this CPU can
+# do: for example if it is a 64-bit capable PowerPC, then it must be
+# set to ppc64 and not ppc32. Ditto for amd64.
+#
+# We will later in this file set VG_ARCH_PRI, which is the arch for
+# the primary target. For example, suppose we do a build on an amd64
+# machine, but --enable-only32bit has been requested. Then
+# VG_ARCH_MAX will be "amd64" since that reflects the most that this
+# cpu can do, but VG_ARCH_PRI will be "x86", since that reflects the
+# arch corresponding to the primary build (VG_PLATFORM_PRI).
AC_CANONICAL_HOST
AC_MSG_CHECKING([for a supported CPU])
-AC_SUBST(VG_ARCH)
+AC_SUBST(VG_ARCH_MAX)
AC_SUBST(VG_ARCH_ALL)
VG_ARCH_ALL="amd64 ppc32 ppc64 x86"
case "${host_cpu}" in
i?86)
AC_MSG_RESULT([ok (${host_cpu})])
- VG_ARCH="x86"
+ VG_ARCH_MAX="x86"
valt_load_address_normal="0x38000000"
valt_load_address_inner="0x28000000"
;;
x86_64)
AC_MSG_RESULT([ok (${host_cpu})])
- VG_ARCH="amd64"
+ VG_ARCH_MAX="amd64"
valt_load_address_normal="0x38000000"
valt_load_address_inner="0x28000000"
;;
powerpc64)
# This value can only happen on Linux, not on AIX
AC_MSG_RESULT([ok (${host_cpu})])
- VG_ARCH="ppc64"
+ VG_ARCH_MAX="ppc64"
valt_load_address_normal="0x38000000"
valt_load_address_inner="0x28000000"
;;
AC_MSG_RESULT([ok (${host_cpu})])
case "${host_os}" in
aix5.*)
- VG_ARCH="ppc64"
+ VG_ARCH_MAX="ppc64"
;;
*)
- VG_ARCH="ppc32"
+ VG_ARCH_MAX="ppc32"
;;
esac
valt_load_address_normal="0x38000000"
# supports building 32 bit programs and disable 32 bit support if it
# does not support building 32 bit programs
-case "$VG_ARCH-$VG_OS" in
+case "$VG_ARCH_MAX-$VG_OS" in
amd64-linux|ppc64-linux)
AC_MSG_CHECKING([for 32 bit build support])
safe_CFLAGS=$CFLAGS
# possible. The system will also be built for this target, but not
# the regression or performance tests.
#
+# Also establish VG_ARCH_PRI, which is the arch for the primary
+# build target. The various makefiles building regression tests
+# sometimes need to see this.
AC_MSG_CHECKING([for a supported CPU/OS combination])
AC_SUBST(VG_PLATFORM_PRI)
AC_SUBST(VG_PLATFORM_SEC)
+AC_SUBST(VG_ARCH_PRI)
+
+# By default, the primary arch is the same as the "max" arch, as
+# commented above (at the definition of VG_ARCH_MAX). We may choose
+# to downgrade it in the big case statement just below here, in the
+# case where we're building on a 64 bit machine but have been
+# requested only to do a 32 bit build.
+VG_ARCH_PRI=$VG_ARCH_MAX
-case "$VG_ARCH-$VG_OS" in
+case "$VG_ARCH_MAX-$VG_OS" in
x86-linux)
VG_PLATFORM_PRI="X86_LINUX"
VG_PLATFORM_SEC=""
elif test x$vg_cv_only32bit = xyes; then
VG_PLATFORM_PRI="X86_LINUX"
VG_PLATFORM_SEC=""
+ VG_ARCH_PRI="x86"
else
VG_PLATFORM_PRI="AMD64_LINUX"
VG_PLATFORM_SEC="X86_LINUX"
elif test x$vg_cv_only32bit = xyes; then
VG_PLATFORM_PRI="PPC32_AIX5"
VG_PLATFORM_SEC=""
+ VG_ARCH_PRI="ppc32"
else
VG_PLATFORM_PRI="PPC64_AIX5"
VG_PLATFORM_SEC="PPC32_AIX5"
elif test x$vg_cv_only32bit = xyes; then
VG_PLATFORM_PRI="PPC32_LINUX"
VG_PLATFORM_SEC=""
+ VG_ARCH_PRI="ppc32"
else
VG_PLATFORM_PRI="PPC64_LINUX"
VG_PLATFORM_SEC="PPC32_LINUX"
cat<<EOF
- Primary build target: ${VG_PLATFORM_PRI}
- Secondary build target: ${VG_PLATFORM_SEC}
- Default supp files: ${DEFAULT_SUPP}
+ configure.in: VG_ARCH_MAX = ${VG_ARCH_MAX}
+ configure.in: VG_ARCH_PRI = ${VG_ARCH_PRI}
+
+ Primary build target: ${VG_PLATFORM_PRI}
+ Secondary build target: ${VG_PLATFORM_SEC}
+ Default supp files: ${DEFAULT_SUPP}
EOF
# Extra stuff for C tests
memcmptest_CFLAGS = $(AM_FLAG_M3264_PRI) $(AM_CFLAGS) -fno-builtin-memcmp
oset_test_CFLAGS = $(AM_FLAG_M3264_PRI) \
- -DVGA_$(VG_ARCH)=1 -DVGO_$(VG_OS)=1 \
- -DVGP_$(VG_ARCH)_$(VG_OS)=1
+ -DVGA_$(VG_ARCH_PRI)=1 -DVGO_$(VG_OS)=1 \
+ -DVGP_$(VG_ARCH_PRI)_$(VG_OS)=1
linux_timerfd_syscall_LDADD = -lrt
vcpu_bz2_CFLAGS = $(AM_FLAG_M3264_PRI) $(AM_CFLAGS) -O2 -g
vcpu_fbench_CFLAGS = $(AM_FLAG_M3264_PRI) $(AM_CFLAGS) -O2 -g
#hello_DEPENDENCIES = $(top_builddir)/valt_load_address.lds
# vgtest_ume is not working
-#vgtest_ume_CFLAGS = -DVGA_$(VG_ARCH) -DVGO_$(VG_OS)
+#vgtest_ume_CFLAGS = -DVGA_$(VG_ARCH_PRI) -DVGO_$(VG_OS)
#vgtest_ume_LDADD = ../../coregrind/m_ume.o