summaryrefslogtreecommitdiff
path: root/build.sh
diff options
context:
space:
mode:
authorPaul Smith <psmith@gnu.org>2023-01-07 21:50:59 -0500
committerPaul Smith <psmith@gnu.org>2023-01-08 10:45:38 -0500
commit11444fb001cf57f32fb5022cd934c3cf489e66b2 (patch)
tree137a265d39ea813a74cb187f6a84771fc3ac68e5 /build.sh
parent0de7a0d3bf29a240c5e0fef79b5b3eae8a6a01f5 (diff)
downloadmake-git-11444fb001cf57f32fb5022cd934c3cf489e66b2.tar.gz
[SV 62654] Support GNU Make on z/OS
Original patches provided by Igor Todorovski <itodorov@ca.ibm.com> Reworked by Paul Smith <psmith@gnu.org>. Thanks to IBM for providing a test system. * NEWS: Announce support. * AUTHORS: Ditto. * README.zOS: Provide details on building GNU Make on z/OS. * build.sh (get_mk_var): z/OS sh has a strange bug which causes it to generate extra lines of output: rework the function to print output as we compute it instead of collecting it into a variable, which works around this bug. * src/makeint.h: Declare MK_OS_ZOS if we're building for z/OS. * src/arscan.c: Don't include <ar.h> on z/OS. * src/job.c: We can't change environ in ASCII mode on z/OS. * src/main.c: Ditto. Also we can't use pselect() on z/OS. * src/posixos.c: pselect() seems to hang on z/OS: don't use it. * tests/run_make_tests.pl: Handle different exit codes on z/OS. * tests/test_driver.pl: Preserve some special z/OS env.vars. Add special checks to output comparisons when on z/OS. * tests/scripts/features/archives: Don't validate names. Don't try to compile empty files as IBM compilers complain. * tests/scripts/features/shell_assignment: Fix octal value of #. * tests/scripts/features/temp_stdin: Don't print "term". * tests/scripts/functions/shell: Handle shell exit codes. * tests/scripts/targets/ONESHELL: Ditto. * tests/scripts/targets/POSIX: sh -x prints differently. * tests/scripts/variables/SHELL: Ditto.
Diffstat (limited to 'build.sh')
-rwxr-xr-xbuild.sh12
1 files changed, 3 insertions, 9 deletions
diff --git a/build.sh b/build.sh
index 0813fcf4..96e8f91c 100755
--- a/build.sh
+++ b/build.sh
@@ -42,19 +42,13 @@ defines="-DLOCALEDIR=\"$localedir\" -DLIBDIR=\"$libdir\" -DINCLUDEDIR=\"$include
# Print the value to stdout.
get_mk_var ()
{
- file=$1
- var=$2
-
- val=
- v=$(sed -e :a -e '/\\$/N; s/\\\n//; ta' "$file" | sed -n "s=^ *$var *\= *==p")
+ v=$(sed -e :a -e '/\\$/N; s/\\\n//; ta' "$1" | sed -n "s=^ *$2 *\= *==p")
for w in $v; do
case $w in
- (\$[\(\{]*[\)\}]) w=${w#\$[\(\{]}; w=$(get_mk_var "$file" "${w%[\)\}]}") ;;
+ (\$[\(\{]*[\)\}]) w=${w#\$[\(\{]}; (get_mk_var "$1" "${w%[\)\}]}") ;;
+ (*) echo "$w" ;;
esac
- val="${val:+$val }$w"
done
-
- printf '%s\n' "$val"
}
# Compile source files. Object files are put into $objs.