]> granicus.if.org Git - strace/commitdiff
build: initialize ARCH variable in tests-m*32/Makefile.am files properly
authorDmitry V. Levin <ldv@altlinux.org>
Tue, 8 Dec 2015 00:13:38 +0000 (00:13 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Tue, 8 Dec 2015 00:13:38 +0000 (00:13 +0000)
* configure.ac (arch_m32): Set to sparc on sparc64, powerpc on
powerpc64, arm on aarch64, i386 on x86_64 and x32, $arch in other cases.
(arch_mx32): Set to x32 on x86_64, $arch in other cases.
(AC_SUBST): Add arch_m32 and arch_mx32.
* bootstrap: Substitute @arch@ with @arch_m32@ in tests-m32/Makefile.am.
Substitute @arch@ with @arch_mx32@ in tests-mx32/Makefile.am.

bootstrap
configure.ac

index 9b432d415853da58e59e3164f88d222d11fe51a0..cb9026094a28d5a8822d6d9d823763697348634d 100755 (executable)
--- a/bootstrap
+++ b/bootstrap
@@ -1,10 +1,10 @@
 #!/bin/sh -eu
 
-for m in -m32 -mx32; do
-       tests=tests$m
+for m in m32 mx32; do
+       tests=tests-$m
        rm -rf $tests
        mkdir $tests
-       sed "s/^AM_CFLAGS[[:space:]]*=.*/& $m/" \
+       sed "s/@arch@/@arch_$m@/;s/^AM_CFLAGS[[:space:]]*=.*/& -$m/" \
                tests/Makefile.am > $tests/Makefile.am
        for f in tests/*; do
                case "${f##*/}" in
index 71d051e2976d860ba151538331967bb6eff7e7b7..db704cc2a0da909c1b7912e36522099b8bbfd3c4 100644 (file)
@@ -16,6 +16,8 @@ AC_USE_SYSTEM_EXTENSIONS
 AC_PROG_RANLIB
 
 AC_MSG_CHECKING([for supported architecture])
+arch_m32=
+arch_mx32=
 case "$host_cpu" in
 bfin)
        arch=bfin
@@ -35,6 +37,7 @@ m68k)
        ;;
 sparc64*)
        arch=sparc64
+       arch_m32=sparc
        AC_DEFINE([SPARC64], 1, [Define for the SPARC64 architecture.])
        ;;
 sparc*)
@@ -60,6 +63,7 @@ powerpc*)
 # error 32 bit
 #endif], [], arch=powerpc64, arch=powerpc)
        if test "$arch" = "powerpc64"; then
+               arch_m32=powerpc
                AC_DEFINE([POWERPC64], 1, [Define for the PowerPC64 architecture.])
        fi
        ;;
@@ -69,6 +73,7 @@ arm*)
        ;;
 aarch64*)
        arch=aarch64
+       arch_m32=arm
        AC_DEFINE([AARCH64], 1, [Define for the AArch64 architecture.])
        ;;
 avr32*)
@@ -100,11 +105,13 @@ sh*)
        AC_DEFINE([SH], 1, [Define for the SH architecture.])
        ;;
 x86?64*)
+       arch_m32=i386
        AC_TRY_COMPILE(
 [#ifndef __ILP32__
 # error not x32
 #endif], [], arch=x32, arch=x86_64)
        if test "$arch" = "x86_64"; then
+               arch_mx32=x32
                AC_DEFINE([X86_64], 1, [Define for the 64bit AMD x86-64 architecture.])
        else
                AC_DEFINE([X32], 1, [Define for the 32bit AMD x86-64 architecture.])
@@ -148,7 +155,13 @@ xtensa*)
 esac
 AC_MSG_RESULT($arch)
 
+test -n "$arch_m32" ||
+       arch_m32=$arch
+test -n "$arch_mx32" ||
+       arch_mx32=$arch
 AC_SUBST(arch)
+AC_SUBST(arch_m32)
+AC_SUBST(arch_mx32)
 
 if test "$arch" = mips; then
        AC_CACHE_CHECK([for _MIPS_SIM], [st_cv__MIPS_SIM],