Imported Upstream version 1.4.0
[platform/upstream/augeas.git] / HACKING
1 This file explains some details about developing the Augeas C library.
2
3 Check out the sources
4 ---------------------
5
6 The sources are in a git repo (which you presumably found already)
7
8   git clone git://github.com/hercules-team/augeas
9
10 Building from git
11 -----------------
12
13   Besides the usual build tools (gcc, autoconf, automake etc.) you need the
14   following tools and libraries to build Augeas:
15
16     * Bison
17     * Flex
18     * readline-devel
19     * libxml2-devel
20     * libselinux-devel (optional)
21
22   Augeas uses gnulib, and you need a checkout of gnulib. The build scripts
23   can create a checkout for you behind the scenes - though if you already
24   have a gnulib checkout, you can pass its location to autogen.sh with the
25   --gnulib-srcdir option.
26
27   At its simplest, you build Augeas from git by running the following
28   commands in the toplevel directory of your Augeas checkout:
29
30     ./autogen.sh [--gnulib-srcdir=$GNULIB_CHECKOUT]
31     make && make install
32
33   It is recommended though to turn on a few development features when
34   building; in particular, stricter compiler warnings and some debug
35   logging. You can pass these options either to autogen.sh or to
36   configure. You'd then run autogen like this:
37
38     ./autogen.sh --enable-compile-warnings=error --enable-debug=yes
39
40 Running augtool
41 ---------------
42
43 The script ./src/try can be used to run ./src/augtool against a fresh
44 filesystem root. It copies the files from tests/root/ to build/try/ and
45 starts augtool against that root, using the lenses from lenses/ (and none
46 of the ones that might be installed on your system)
47
48 The script can be used for the following; OPTS are options that are passed
49 to augtool verbatim
50
51   ./src/try OPTS     - run the commands from build/augcmds.txt
52   ./src/try cli OPTS - start an interactive session with augtool
53   ./src/try gdb      - start gdb and set it up from build/gdbcmds.txt for
54                        debugging augtool with commands in build/augcmds.txt
55   ./src/try valgrind - run the commands from build/augcmds.txt through augtool
56                        under valgrind to check for memory leaks