summaryrefslogtreecommitdiffhomepage
path: root/web/content/docs/install.md
blob: ffaeb08396afd4860192968719baf329f35a5f7b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
---
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)
```

The line editor is compiled in, needs no library, and is 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.