1 | Building and Installing OSH
|
2 | ===========================
|
3 |
|
4 | OSH is a bash-compatible shell and is part of the Oil project
|
5 | (http://www.oilshell.org).
|
6 |
|
7 | This file describes how to configure, build, and install it from source code.
|
8 |
|
9 | Quick Start
|
10 | -----------
|
11 |
|
12 | If you haven't already done so, extract the tarball:
|
13 |
|
14 | tar -x --xz < oil-0.21.0.tar.xz
|
15 | cd oil-0.21.0
|
16 |
|
17 | Either install as /usr/local/bin/osh:
|
18 |
|
19 | ./configure # completes very quickly
|
20 | make # 30-60 seconds
|
21 | sudo ./install
|
22 |
|
23 | or install as ~/bin/osh and the man page as ~/.local/share/man/man1/osh.1:
|
24 |
|
25 | ./configure --prefix ~ --datarootdir ~/.local/share
|
26 | make
|
27 | ./install
|
28 |
|
29 | The latter doesn't require root access, but it requires:
|
30 |
|
31 | - ~/bin to be in your $PATH
|
32 | - Pages under ~/.local/share/man to be found by 'man'.
|
33 | (See manpath or $MANPATH.)
|
34 |
|
35 | NOTE: Out-of-tree builds are NOT currently supported, so you have to be in the
|
36 | oil-0.21.0 directory.
|
37 |
|
38 | Smoke Test
|
39 | ----------
|
40 |
|
41 | OSH behaves like a POSIX shell:
|
42 |
|
43 | $ osh -c 'echo hi'
|
44 | hi
|
45 |
|
46 | This parses and prints a syntax tree for the 'configure' script.
|
47 |
|
48 | osh -n configure
|
49 |
|
50 | More Documentation
|
51 | ------------------
|
52 |
|
53 | Every release has a home page with links, e.g.
|
54 |
|
55 | https://oilshell.org/release/0.21.0/
|
56 |
|
57 | System Requirements
|
58 | -------------------
|
59 |
|
60 | Roughly speaking, you need:
|
61 |
|
62 | - an ANSI C environment (compiler and libc)
|
63 | - GNU Bash
|
64 | - GNU Make.
|
65 |
|
66 | (I want to remove the GNU requirements and require only POSIX sh instead).
|
67 |
|
68 | Optional:
|
69 |
|
70 | - GNU readline library, for interactive features
|
71 | (https://cnswww.cns.cwru.edu/php/chet/readline/rltop.html)
|
72 |
|
73 | Debian/Ubuntu and derivatives:
|
74 |
|
75 | sudo apt install build-essential libreadline-dev
|
76 |
|
77 | Alpine Linux:
|
78 |
|
79 | apk add libc-dev gcc bash make readline-dev
|
80 |
|
81 | OSH has been tested in several Linux distros and OS X. It aims to run on any
|
82 | POSIX system. If it doesn't, file a bug here:
|
83 |
|
84 | https://github.com/oilshell/oil/issues
|
85 |
|
86 | Build Options
|
87 | -------------
|
88 |
|
89 | ./configure --help will show the options. Right now, the only significant
|
90 | options are --prefix and --{with,without}-readline.
|
91 |
|
92 | Notes
|
93 | -----
|
94 |
|
95 | - The oil.ovm executable behaves like busybox, and osh is a symlink to it.
|
96 | - Oil contains a fork of the Python 2.7 runtime, so it should compile with most
|
97 | popular compiler/OS combinations.
|