@@ -125,7 +125,7 @@ command=${0##*/}
125125case $(getopts '[-][123:xyz]' opt --xyz 2>/dev/null; echo 0$opt) in
1261260123) USAGE=$'
127127[-?
128- @(#)$Id: '$command$' (ksh 93u+m) 2026-02-10 $
128+ @(#)$Id: '$command$' (ksh 93u+m) 2026-03-31 $
129129]
130130[-author?Glenn Fowler <gsf@research.att.com>]
131131[-author?Contributors to https://github.com/ksh93/ksh]
@@ -145,8 +145,9 @@ case $(getopts '[-][123:xyz]' opt --xyz 2>/dev/null; echo 0$opt) in
145145[+?Note that no environment variables need be set by the user;
146146 \b'$command$'\b determines the environment based on the current working
147147 directory. The \buse\b action starts a \bsh\b(1) with the environment
148- initialized. \bCC\b, \bCCFLAGS\b, \bHOSTTYPE\b and \bSHELL\b may be set
149- by explicit command argument assignments to override the defaults.]
148+ initialized. \bCC\b, \bCCFLAGS\b, \bHOSTTYPE\b, \bHOSTTAG\b and \bSHELL\b
149+ may be set by explicit command argument assignments to override the
150+ defaults.]
150151[+?The command arguments are composed of a sequence of words: zero or
151152 more \aqualifiers\a, one \aaction\a, and zero or more action-specific
152153 \aarguments\a, and zero or more \aname=value\a definitions.
@@ -277,6 +278,13 @@ case $(getopts '[-][123:xyz]' opt --xyz 2>/dev/null; echo 0$opt) in
277278 shared libraries. All other architecture-dependent logic is handled
278279 either by the \bAST\b \biffe\b(1) command or by component-specific
279280 configure scripts.]
281+ [+?\b$HOSTTAG\b may contain a short string that, if present, will be added
282+ to the detected \b$HOSTTYPE\b separated by a comma. This is useful to
283+ maintain several object code directories for the same architecture (for
284+ example, with different \bCCFLAGS\b or built from different \bgit\b(1)
285+ branches) under \barch\b while still auto-detecting \b$HOSTTYPE\b.
286+ The value must not contain whitespace or other shell-unsafe characters.
287+ If \bHOSTTYPE\b is specified manually, \bHOSTTAG\b is ignored.]
280288[+?Each component contains a \bMAM\b (make abstract machine)
281289 file (\bMamfile\b). A Mamfile contains a portable makefile description
282290 written in a simple dependency tree language using indented
@@ -406,9 +414,9 @@ DESCRIPTION
406414
407415 Note that no environment variables need be set by the user; package
408416 determines the environment based on the current working directory. The use
409- action starts a sh(1) with the environment initialized. CC, CCFLAGS, HOSTTYPE
410- and SHELL may be set by explicit command argument assignments to override the
411- defaults.
417+ action starts a sh(1) with the environment initialized. CC, CCFLAGS,
418+ HOSTTYPE, HOSTTAG and SHELL may be set by explicit command argument
419+ assignments to override the defaults.
412420
413421 The command arguments are composed of a sequence of words: zero or more
414422 qualifiers, one action, and zero or more action-specific arguments, and zero
@@ -481,8 +489,8 @@ DESCRIPTION
481489 build is done in the $INSTALLROOT directory tree viewpathed on top of
482490 the $PACKAGEROOT directory tree. Leaf directory names matching the
483491 |-separated shell pattern $MAKESKIP are ignored. The view action is
484- done before making. option operands are passed to the underlying make
485- command.
492+ done before making. option operands are passed to the underlying
493+ mamake command.
486494 results [ failed ] [ path ] [ old ] [make | test | write ]
487495 List results and interesting messages captured by the most recent
488496 make (default), test or write action. old specifies the previous
@@ -527,6 +535,14 @@ DETAILS
527535 libraries. All other architecture-dependent logic is handled either by the
528536 AST iffe(1) command or by component-specific configure scripts.
529537
538+ $HOSTTAG may contain a short string that, if present, will be added to the
539+ detected $HOSTTYPE separated by a comma. This is useful to maintain several
540+ object code directories for the same architecture (for example, with
541+ different CCFLAGS or built from different git(1) branches) under arch while
542+ still auto-detecting $HOSTTYPE. The value must not contain whitespace or
543+ other shell-unsafe characters. If HOSTTYPE is specified manually, HOSTTAG is
544+ ignored.
545+
530546 Each component contains a MAM (make abstract machine) file (Mamfile). A
531547 Mamfile contains a portable makefile description written in a simple
532548 dependency tree language using indented make...done blocks.
@@ -543,7 +559,7 @@ SEE ALSO
543559 pkgadd(1), pkgmk(1), rpm(1), sh(1), tar(1), optget(3)
544560
545561IMPLEMENTATION
546- version package (ksh 93u+m) 2026-02-10
562+ version package (ksh 93u+m) 2026-03-31
547563 author Glenn Fowler <gsf@research.att.com>
548564 author Contributors to https://github.com/ksh93/ksh
549565 copyright (c) 1994-2012 AT&T Intellectual Property
@@ -605,7 +621,8 @@ do case $i in
605621 assign="$assign $n=$vq"
606622 eval "$n=\$v"
607623 ;;
608- CC) eval "$n=\$v"
624+ CC | HOSTTAG)
625+ eval "$n=\$v"
609626 ;;
610627 CCFLAGS)
611628 eval "$n=\$v"
@@ -1545,6 +1562,11 @@ int b(void) { return 0; }
15451562 set -- $_hostinfo_
15461563 _hostinfo_=$*
15471564
1565+ # add host tag if given
1566+ case $HOSTTAG in
1567+ ?*) _hostinfo_=${_hostinfo_},$HOSTTAG ;;
1568+ esac
1569+
15481570 # restore the global state
15491571
15501572 PATH=$path
0 commit comments