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