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