]> git.saurik.com Git - bison.git/blame - README-hacking
doc: update README-hacking.
[bison.git] / README-hacking
CommitLineData
2ab9a04f
AD
1-*- outline -*-
2
bbb44d83
PE
3These notes intend to help people working on the checked-out sources.
4These requirements do not apply when building from a distribution tarball.
2ab9a04f
AD
5
6* Requirements
7
bbb44d83
PE
8We've opted to keep only the highest-level sources in the repository.
9This eases our maintenance burden, (fewer merges etc.), but imposes more
10requirements on anyone wishing to build from the just-checked-out sources.
11For example, you have to use the latest stable versions of the maintainer
12tools we depend upon, including:
cd3684cf 13
5b4aaf78
PE
14- Automake <http://www.gnu.org/software/automake/>
15- Autoconf <http://www.gnu.org/software/autoconf/>
16- Flex <http://www.gnu.org/software/flex/>
17- Gettext <http://www.gnu.org/software/gettext/>
18- Gzip <http://www.gnu.org/software/gzip/>
6d8e724d
PE
19- Perl <http://www.cpan.org/>
20- Rsync <http://samba.anu.edu.au/rsync/>
5b4aaf78 21- Tar <http://www.gnu.org/software/tar/>
5b4aaf78
PE
22
23Valgrind <http://valgrind.org/> is also highly recommended, if
24Valgrind supports your architecture.
25
26Bison is written using Bison grammars, so there are bootstrapping
27issues. The bootstrap script attempts to discover when the C code
28generated from the grammars is out of date, and to bootstrap with an
29out-of-date version of the C code, but the process is not foolproof.
30Also, you may run into similar problems yourself if you modify Bison.
d1a6f01e 31
6d8e724d
PE
32Only building the initial full source tree will be a bit painful.
33Later, after synchronizing from the repository a plain `make' should
34be sufficient.
d1a6f01e 35
bbb44d83 36* First checkout
d1a6f01e
AD
37
38Obviously, if you are reading these notes, you did manage to check out
6d8e724d 39this package from the repository. For the record, you will find all the
bbb44d83 40relevant information on:
d1a6f01e 41
6469c4d7
AD
42 http://savannah.gnu.org/git/?group=bison
43
44Bison uses Git submodules: subscriptions to other Git repositories.
45In particular it uses gnulib, the GNU portability library. To ask Git
46to perform the first checkout of the submodules, run
47
48 $ git submodule update --init
49
50Git submodule support is weak before versions 1.6 and later, you
51should probably upgrade Git if your version is older.
d1a6f01e 52
bbb44d83
PE
53The next step is to get other files needed to build, which are
54extracted from other source packages:
d1a6f01e 55
6469c4d7 56 $ ./bootstrap
d1a6f01e
AD
57
58And there you are! Just
59
6469c4d7
AD
60 $ ./configure
61 $ make
62 $ make check
d1a6f01e
AD
63
64At this point, there should be no difference between your local copy,
bbb44d83 65and the master copy:
d1a6f01e 66
6469c4d7 67 $ git diff
d1a6f01e 68
5b4aaf78 69should output no difference.
d1a6f01e
AD
70
71Enjoy!
72
6469c4d7
AD
73* Updating
74
75The use of submodules make things somewhat different because git does
76not support recursive operations: submodules must be taken care of
77explicitly by the user.
78
79** Updating Bison
80
81If you pull a newer version of a branch, say via `git pull', you might
82import requests for updated submodules. A simple `git diff' will
83reveal if the current version of the submodule (i.e., the actual
84contents of the gnulib directory) and the current request from the
85subscriber (i.e., the reference of the version of gnulib that the
86Bison reporitory requests) differ. To upgrade the submodules (i.e.,
87to check out the version that is actually requested by the subscriber,
88run `git submodule update'.
89
90 $ git pull
91 $ git submodule update
92
93** Updating a submodule
94To update a submodule, say gnulib, do as follows:
95
96Get the most recent version of the master branch from git.
97
98 $ cd gnulib
99 $ git fetch
100 $ git checkout -b master --track origin/master
101
102Make sure Bison can live with that version of gnulib.
103
104 $ cd ..
105 $ ./bootstrap
106 $ make distcheck
107
108Register your changes.
109
110 $ git checkin ...
111
d1a6f01e
AD
112-----
113
6469c4d7 114Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2009 Free Software
bbb44d83 115Foundation, Inc.
d1a6f01e 116
f16b0819 117This program is free software: you can redistribute it and/or modify
d1a6f01e 118it under the terms of the GNU General Public License as published by
f16b0819
PE
119the Free Software Foundation, either version 3 of the License, or
120(at your option) any later version.
d1a6f01e 121
f16b0819 122This program is distributed in the hope that it will be useful,
d1a6f01e
AD
123but WITHOUT ANY WARRANTY; without even the implied warranty of
124MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
125GNU General Public License for more details.
126
127You should have received a copy of the GNU General Public License
f16b0819 128along with this program. If not, see <http://www.gnu.org/licenses/>.