1# Introduction 2 3Lutok uses the GNU Automake, GNU Autoconf and GNU Libtool utilities as 4its build system. These are used only when compiling the library from 5the source code package. If you want to install Lutok from a binary 6package, you do not need to read this document. 7 8For the impatient: 9 10```shell 11$ ./configure 12$ make 13$ make check 14$ sudo make install # or `make install` with root privileges 15$ make installcheck 16``` 17 18Or alternatively, install as a regular user into your home directory: 19 20```shell 21$ ./configure --prefix ~/local 22$ make 23$ make check 24$ make install 25$ make installcheck 26``` 27 28# Dependencies 29 30To build and use Lutok successfully you need: 31 32* A C++-11 standards-compliant compiler. 33* Lua 5.1 or greater. 34* pkg-config or an equivalent tool, e.g., pkgconf. 35 36Optionally, if you want to build and run the tests (recommended), you 37need: 38 39* Kyua 0.5 or greater. 40* ATF 0.15 or greater. 41 42If you are building Lutok from the code on the repository, you will also 43need the following tools: 44 45* GNU Autoconf 2.68 (or later). 46* GNU Automake 1.9 (or later). 47* GNU Libtool. 48 49 50# Regenerating the build system 51 52This is not necessary if you are building from a formal release 53distribution file. 54 55On the other hand, if you are building Lutok from code extracted from 56the repository, you must first regenerate the files used by the build 57system. You will also need to do this if you modify `configure.ac`, 58`Makefile.am`, or any of the other build system files. To do this, simply 59run: 60 61```shell 62$ autoreconf -i -s 63``` 64 65If ATF is installed in a different prefix than `autoconf`, you will also 66need to tell `autoreconf` where the ATF m4 macros are located. Otherwise, 67the `configure` script will be incomplete and will show confusing syntax 68errors mentioning, for example, `ATF_CHECK_SH`. To fix this, you have 69to run `autoreconf` in the following manner, replacing `<atf-prefix>` with 70the appropriate path: 71 72```shell 73$ autoreconf -i -s -I <atf-prefix>/share/aclocal 74``` 75 76# General build procedure 77 78To build and install the source package, you must follow these steps: 79 80#. Configure the sources to adapt to your operating system. This is 81 done using the `configure` script located on the sources' top 82 directory, and it is usually invoked without arguments unless you 83 want to change the installation prefix. More details on this 84 procedure are given on a later section. 85 86#. Build the sources to generate the binaries and scripts. Simply run 87 `make` on the sources' top directory after configuring them. No 88 problems should arise. 89 90#. Install the library by running `make install`. You may need to 91 become root to issue this step. 92 93#. Issue any manual installation steps that may be required. These are 94 described later in their own section. 95 96#. Check that the installed library works by running `make installcheck`. 97 You do not need to be root to do this. 98 99 100# Configuration flags 101 102The most common, standard flags given to `configure` are: 103 104- `--prefix=directory` 105 - **Possible values**: any path 106 - **Default**: "/usr/local" 107 108 Specifies where the library (binaries and all associated files) will 109 be installed. 110 111- `--help` 112 Shows information about all available flags and exits immediately, 113 without running any configuration tasks. 114 115The following flags are specific to Lutok's `configure` script: 116 117- `--enable-developer` 118 - **Possible values**: "yes", "no" 119 - **Default**: "yes" in Git HEAD builds; "no" in formal releases. 120 121 Enables several features useful for development, such as the inclusion 122 of debugging symbols in all objects or the enforcement of compilation 123 warnings. 124 125 The compiler will be executed with an exhaustive collection of warning 126 detection features regardless of the value of this flag. However, such 127 warnings are only fatal when `--enable-developer` is set to "yes". 128 129- `--enable-atf` 130 - **Possible values**: "yes", "no", "auto". 131 - **Default**: "auto" 132 133 Enables usage of ATF to build (and later install) the tests. 134 135 Setting this to "yes" causes the `configure` script to look for ATF 136 unconditionally and abort if not found. Setting this to "auto" lets 137 `configure` perform the best decision based on availability of ATF. 138 Setting this to "no" explicitly disables ATF usage. 139 140 When support for tests is enabled, the build process will generate the 141 test programs and will later install them into the tests tree. 142 Running `make check` or `make installcheck` from within the source 143 directory will cause these tests to be run with Kyua (assuming it is 144 also installed). 145 146- `--with-doxygen` 147 - **Possible values**: "yes", "no", "auto", or a path. 148 - **Default**: "auto". 149 150 Enables usage of Doxygen to generate documentation for internal APIs. 151 152 Setting this to "yes" causes the `configure` script to look for Doxygen 153 unconditionally and abort if not found. Setting this to "auto" lets 154 `configure` perform the best decision based on availability of Doxygen. 155 Setting this to "no" explicitly disables Doxygen usage. And, lastly, 156 setting this to a path forces `configure` to use a specific Doxygen 157 binary, which must exist. 158 159 When support for Doxygen is enabled, the build process will generate 160 HTML documentation for the Lutok API. This documentation will later 161 be installed in the HTML directory specified by the `configure` script. 162 You can change the location of the HTML documents by providing your 163 desired override with the `--htmldir` flag to the `configure` script. 164 165 166Run the tests! 167============== 168 169Lastly, after a successful installation (and assuming you built the 170sources with support for ATF), you should periodically run the tests 171from the final location to ensure things remain stable. Do so as 172follows: 173 174```shell 175$ kyua test -k /usr/local/tests/lutok/Kyuafile 176``` 177 178And if you see any tests fail, do not hesitate to report them in: 179 180 https://github.com/freebsd/lutok/issues/ 181 182Thank you! 183