| 1 | Building and Installing Oils
 | 
| 2 | ============================
 | 
| 3 | 
 | 
| 4 | Oils is a new Unix shell.  This file describes how to configure, build, and
 | 
| 5 | install it from source code.
 | 
| 6 | 
 | 
| 7 | Quick Start
 | 
| 8 | -----------
 | 
| 9 | 
 | 
| 10 | If you haven't already done so, extract the tarball:
 | 
| 11 |  
 | 
| 12 |     tar -x --gz < oil-for-unix-0.22.0.tar.gz
 | 
| 13 |     cd oils-for-unix-0.22.0
 | 
| 14 | 
 | 
| 15 | This is the traditional way to install it:
 | 
| 16 | 
 | 
| 17 |     ./configure      # completes very quickly
 | 
| 18 |     _build/oils.sh   # 30-60 seconds
 | 
| 19 |     sudo ./install
 | 
| 20 | 
 | 
| 21 | You'll end up with an oils-for-unix binary and two symlinks:
 | 
| 22 | 
 | 
| 23 |     /usr/local/bin/   
 | 
| 24 |       oils-for-unix
 | 
| 25 |       osh -> oils-for-unix
 | 
| 26 |       ysh -> oils-for-unix
 | 
| 27 | 
 | 
| 28 | This structure is similar to the busybox tool.
 | 
| 29 | 
 | 
| 30 | Smoke Test
 | 
| 31 | ----------
 | 
| 32 | 
 | 
| 33 | OSH behaves like a POSIX shell:
 | 
| 34 | 
 | 
| 35 |     $ osh -c 'echo hi'
 | 
| 36 |     hi
 | 
| 37 | 
 | 
| 38 | The -n flag parses and prints a syntax tree for the 'configure' script:
 | 
| 39 | 
 | 
| 40 |     osh -n configure
 | 
| 41 | 
 | 
| 42 | YSH is a legacy-free shell, with structured data:
 | 
| 43 | 
 | 
| 44 |     $ ysh -c 'echo hi'
 | 
| 45 |     hi
 | 
| 46 | 
 | 
| 47 |     $ ysh -c 'json write ({x: 42})'
 | 
| 48 |     {
 | 
| 49 |       "x": 42
 | 
| 50 |     }
 | 
| 51 | 
 | 
| 52 | More Documentation
 | 
| 53 | ------------------
 | 
| 54 | 
 | 
| 55 | Every release has a home page with links:
 | 
| 56 | 
 | 
| 57 |     https://oilshell.org/release/0.22.0/
 | 
| 58 | 
 | 
| 59 | System Requirements
 | 
| 60 | -------------------
 | 
| 61 | 
 | 
| 62 | Oils is designed to have very few dependencies.  You need:
 | 
| 63 | 
 | 
| 64 |   - A C++11 compiler
 | 
| 65 |     - with libc and libstdc++
 | 
| 66 |   - A POSIX shell to invoke _build/oils.sh
 | 
| 67 | 
 | 
| 68 | Optional:
 | 
| 69 | 
 | 
| 70 |   - GNU readline library, for interactive features
 | 
| 71 |     (https://cnswww.cns.cwru.edu/php/chet/readline/rltop.html)
 | 
| 72 | 
 | 
| 73 | Build deps on Debian-like distros, including Ubuntu:
 | 
| 74 | 
 | 
| 75 |     sudo apt-get install build-essential libreadline-dev
 | 
| 76 | 
 | 
| 77 | Alpine Linux:
 | 
| 78 | 
 | 
| 79 |     apk add libc-dev gcc readline-dev
 | 
| 80 | 
 | 
| 81 | Oils has been tested on 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 | Non-root Install
 | 
| 87 | ----------------
 | 
| 88 | 
 | 
| 89 | You can run the binary in-place, e.g.
 | 
| 90 | 
 | 
| 91 |     $ _bin/cxx-opt-sh/osh -c 'echo hi'
 | 
| 92 |     hi
 | 
| 93 | 
 | 
| 94 | Or you can install into ~/bin, with the man page at
 | 
| 95 | ~/.local/share/man/man1/osh.1:
 | 
| 96 | 
 | 
| 97 |     ./configure --prefix ~ --datarootdir ~/.local/share
 | 
| 98 |     _build/oils.sh
 | 
| 99 |     ./install
 | 
| 100 | 
 | 
| 101 | This doesn't require root access, but it requires:
 | 
| 102 | 
 | 
| 103 | - ~/bin to be in your $PATH
 | 
| 104 | - Pages under ~/.local/share/man to be found by 'man'.  (See manpath or
 | 
| 105 |   $MANPATH.)
 | 
| 106 | 
 | 
| 107 | NOTE: Out-of-tree builds are NOT currently supported, so you have to be in the
 | 
| 108 | oils-for-unix-0.22.0 directory.
 | 
| 109 | 
 | 
| 110 | Build Options
 | 
| 111 | -------------
 | 
| 112 | 
 | 
| 113 | Show options with:
 | 
| 114 | 
 | 
| 115 |     ./configure --help 
 | 
| 116 |     
 | 
| 117 | Common flags:
 | 
| 118 | 
 | 
| 119 |     --prefix
 | 
| 120 |     --with-readline
 | 
| 121 |     --without-readline
 | 
| 122 |     --readline  # the location
 | 
| 123 | 
 | 
| 124 | Links
 | 
| 125 | -----
 | 
| 126 | 
 | 
| 127 | - Notes on portability:
 | 
| 128 |   https://oilshell.org/release/0.22.0/doc/portability.html
 | 
| 129 | 
 |