configure: Move deduplifying targetArchs to where HAIKU_PACKAGING_ARCHS is built.

If one specifies a cross-tools path instead of --build-cross-tools along
with --use-clang, then the specified architecture winds up in the list twice,
as the first test looks for the arch name where only "unknown" exists
(since in the case of cross-tools paths, we delay fetching the arch.)
So we need to move this check to there instead.
This commit is contained in:
Augustin Cavalier 2018-06-18 18:53:47 -04:00
parent ddf7f64365
commit 6c5fcb4f14

20
configure vendored
View File

@ -656,14 +656,12 @@ while [ $# -gt 0 ] ; do
esac
set_variable buildCrossToolsMachine_$targetArch $targetMachine
targetArchs="$targetArchs $targetArch"
HAIKU_PACKAGING_ARCHS=
;;
--cross-tools-prefix)
assertparam "$1" $#
targetArch=unknown${unknownArchIndex}
set_variable crossToolsPrefix_$targetArch "$2"
targetArchs="$targetArchs $targetArch"
HAIKU_PACKAGING_ARCHS=
unknownArchIndex=$(($unknownArchIndex + 1))
shift 2
;;
@ -716,11 +714,7 @@ while [ $# -gt 0 ] ; do
&& [ -z `get_variable buildCrossToolsMachine_$targetArch` ]; then
set_variable crossToolsPrefix_$targetArch llvm-
fi
if ! test "${targetArchs#*$targetArch}" != "$targetArchs"; then
# we have not already added this arch to targetArchs, so add it now
targetArchs="$targetArchs $targetArch"
fi
HAIKU_PACKAGING_ARCHS=
targetArchs="$targetArchs $targetArch"
shift 2
;;
--use-gcc-pipe) HAIKU_USE_GCC_PIPE=1; shift 1;;
@ -807,11 +801,6 @@ if [ "$HAIKU_HOST_BUILD_ONLY" = 1 ]; then
HAIKU_NASM=$invalidCommand
HAIKU_STRIP=$invalidCommand
else
if [ -n "$HAIKU_PACKAGING_ARCHS" ]; then
targetArchs="$HAIKU_PACKAGING_ARCHS"
fi
HAIKU_PACKAGING_ARCHS=
# On Haiku determine target architectures and tools automatically.
if [ -z "$targetArchs" ]; then
if [ $HOST_PLATFORM != haiku_host ]; then
@ -869,10 +858,15 @@ else
isPrimaryArch=1
for targetArch in $targetArchs; do
# Note: targetArch is "unknown<n>" at this point, if a cross-tools
# Note: targetArch is "unknown<n>" at this point if a cross-tools
# prefix was specified. The standard_gcc_settings call below will get
# the actual architecture.
if test "${HAIKU_PACKAGING_ARCHS#*$targetArch}" != "$HAIKU_PACKAGING_ARCHS"; then
# somehow we wound up with a duplicate arch; skip this one
continue
fi
crossToolsPrefix=`get_variable crossToolsPrefix_$targetArch`
# build cross tools from sources