summaryrefslogtreecommitdiffhomepage
path: root/web/content/docs/install.md
diff options
context:
space:
mode:
Diffstat (limited to 'web/content/docs/install.md')
-rw-r--r--web/content/docs/install.md62
1 files changed, 62 insertions, 0 deletions
diff --git a/web/content/docs/install.md b/web/content/docs/install.md
new file mode 100644
index 0000000..3b6d670
--- /dev/null
+++ b/web/content/docs/install.md
@@ -0,0 +1,62 @@
+---
+weight: 10
+title: Building zash
+description: How to build zash on Linux and on z/OS, and what it links against.
+---
+
+
+Two toolchains, one source tree: Clang on Linux, IBM Open XL C/C++ on z/OS.
+The code is plain C23 and does not use library additions newer than the C
+libraries on either platform.
+
+| Platform | Compiler | Standard |
+| --- | --- | --- |
+| Linux | Clang | `-std=c23` |
+| z/OS | IBM Open XL C/C++ (`ibm-clang`) | `-std=c23` |
+
+## Linux
+
+```sh
+git clone https://github.com/skurtz97/zash
+cd zash
+make # -> ./zash
+make check # run the test suite against it
+make install # copy it into $(DESTDIR)$(BINDIR)
+```
+
+`EDIT=libedit LDLIBS=-ledit` builds against libedit instead of the built-in
+line editor. The default editor is compiled in and initialised only for an
+interactive shell.
+
+## z/OS
+
+```sh
+make # the ASCII build, ./zash
+make zos-ebcdic # the EBCDIC (IBM-1047) build, ./zash-ebcdic
+make zos-check # the functional tests, then the EBCDIC ones
+```
+
+Both builds are 64-bit XPLINK. There is a zopen `buildenv` in the tree, so
+`zopen build -gp` builds both test passes and installs into
+`$ZOPEN_INSTALL_DIR`.
+
+`make zos-heapcheck` runs the suite with Language Environment check zones
+after every heap element, `make zos-debug` and `make zos-dbx` open a debug
+build under `dbx`, and `make zos-amblist` maps the CSECTs of the program
+object.
+
+## Choosing an address mode
+
+Both builds are 64-bit. A 64-bit `fork()` used to cost 4.2 ms against 0.10 ms
+for 31-bit, and a trivial program started in 29.5 ms against 1.1 ms, because
+the 64-bit C run-time was loaded out of the linklist on every start. With that
+run-time in the LPA the two widths cost the same, so the shell takes the wider
+one. `bench/README.md` in the source tree has the measurements.
+
+## Documentation targets
+
+`make doc` builds the source reference with Doxygen into `docs/html`, and a
+PDF when `pdflatex` is present. `make docs` adds HTML and PDF of `README.md`
+and `DESIGN.md`, `make spec` typesets `formal/zash-spec.pdf` with typst, and
+`make other-docs` runs the last two together. On z/OS those tools are usually
+missing; the targets say so rather than failing silently.