summaryrefslogtreecommitdiff
path: root/README
blob: acb74a7126a4f926b1b1d5f98c9e5122c0496317 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
Welcome to Ledger, a command-line accounting program.

Quick start
===========

To build ledger, you will first need these two libraries installed:

    gmp        GNU multi-precision library
    pcre       Perl regular expression library

If you wish to read Gnucash data files, you will also need two XML libraries,
which may or may not be available in a single package (it depends on your
distribution):

    xmlparse
    xmltok

Once you have determined where the headers and libraries for the above
packages are installed, run the script "configure", passing those paths.  If
you installed everything under /usr/local, you can probably just type
"./configure".  Otherwise, do this:

    ./configure CPPFLAGS=-I<INCLUDE-PATH>  LDFLAGS=-L<LIBRARY-PATH>

If you need to specify multiple include or library paths, then do this:

    ./configure CPPFLAGS="-I<PATH1> -I<PATH2>"  LDFLAGS="-L<PATH1> -L<PATH2>"

Once configure is done running, just type:

    make install

Building on OS/X
================

If you are building ledger for OS/X, there are a couple of things you can do
to ensure that it runs as quickly as possible.  First, you will want to
configure ledger using this command, which you can cut and paste from here:

    ./configure CPPFLAGS="-I/sw/include -I/usr/include/httpd/xml" \
		LDFLAGS=-L/sw/lib \
		CXXFLAGS="-fomit-frame-pointer -fastf -mcpu=7450" \
		--enable-standalone

Next, if you are interested, we need to change the system headers so that
command-line ledger can use an STL allocator that is not thread-safe.  Being
hread-safe has no benefit for the standalone, command-line version of ledger,
and so is needlessly 10% slower.  However, there is no easy way to do this,
other than modifying the system headers.  So, sudo over to a root shell, and
edit this file:

  /usr/include/gcc/darwin/3.3/c++/bits/stl_alloc.h

Around line 617, you will find a typedef declaration that looks like this:

  typedef __default_alloc_template<true,0>    __alloc;

Replace this line with the following block, which will permit the ledger
sources to select a different default allocator:

  #ifdef SGI_STL_USE_SINGLE_CLIENT_ALLOCATOR
    typedef __default_alloc_template<false,0>   __alloc;
  #else
    typedef __default_alloc_template<true,0>    __alloc;
  #endif 

The disadvantage to doing this, in general, is that an app using a different
default will not be able to link to other C++ libraries, which use another
default.  But since ledger doesn't use any C++ libraries, this is no problem.