From: Dmitry V. Levin Date: Tue, 8 Dec 2015 00:13:38 +0000 (+0000) Subject: build: initialize ARCH variable in tests-m*32/Makefile.am files properly X-Git-Tag: v4.11~45 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1e04e57a7aa095718321f0df7bab25aa0264d150;p=strace build: initialize ARCH variable in tests-m*32/Makefile.am files properly * 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. --- diff --git a/bootstrap b/bootstrap index 9b432d41..cb902609 100755 --- 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 diff --git a/configure.ac b/configure.ac index 71d051e2..db704cc2 100644 --- a/configure.ac +++ b/configure.ac @@ -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],