7 This file attempts to describe the processes we use to maintain M4,
8 and is not part of a release distribution.
14 * If you incorporate a change from somebody on the net:
15 If it is a large change, you must make sure they have signed the
16 appropriate paperwork, and be sure to add their name and email
17 address to THANKS. AUTHORS is built from the FSF list of copyright
18 assignments, on fencepost.gnu.org.
20 * If somebody reports a new bug, write a test case, then mention his
21 name in the ChangeLog entry.
23 * The correct response to most actual bugs is to write a new test case
24 which demonstrates the bug. Then fix the bug, re-run the test suite,
25 and check everything in.
27 * Changes with user-visible effects must be mentioned in NEWS.
29 * New macros must be blind, or else prefixed with `m4' or `__', in
30 order to minimize backward compatibility issues with previous
31 releases of M4 when processing English text.
33 * GNU Coding Standards should be followed:
34 http://www.gnu.org/prep/standards/
35 Additionally, while GNU M4 is not yet POSIX compliant, we are trying
36 to get closer to it (although some design decisions state that POSIX
37 compliance should only happen when POSIXLY_CORRECT is in the
38 environment or the -G option was passed on the command line):
39 http://www.opengroup.org/onlinepubs/009695399/utilities/m4.html
41 * Except for third-party files (libtool, gnulib, ...), all .c files
42 should #include <config.h> before anything else (since there are some
43 #defines in config.h that potentially impact system headers, such as
44 when the user does ./configure --disable-assert). This means that no
45 .h files need to #include <config.h>. However, users compiling
46 external modules should be able to compile without <config.h>, since
47 <config.h> is specific to the M4 build and is not installable.
53 * The master M4 repository is stored in git. You can obtain a read-only
55 git clone git://git.sv.gnu.org/m4.git
57 cvs -d:pserver:anonymous@pserver.git.sv.gnu.org:/srv/git/m4.git \
60 If you are a member of the savannah group for M4, a read-write
61 copy can be obtained by:
62 git clone <savannah-user>@git.sv.gnu.org:/srv/git/m4.git
64 * Before you can build from git, you need to bootstrap. This requires:
65 - A pre-installed version of GNU M4 1.4.5 or later, built from a
66 package (recommend 1.4.13 or later)
67 - A git checkout of Autoconf (2.63b-41 or later)
68 - Automake 1.10b or later
69 - Libtool 2.2 or later
70 - Gettext 0.16 or later
72 - Help2man 1.29 or later
73 - Xz 4.999.8beta or later (from <http://tukaani.org/xz/>)
74 - Texinfo 4.8 or later
75 - Any prerequisites of the above (such as perl, tex)
77 Note that none of these bootstrapping dependencies should be required
78 by a distributed release.
80 * M4 includes gnulib as a git submodule. By default, the bootstrap
81 script will attempt to run
82 git submodule update --init
83 to grab a gnulib clone from the official read-only location of
84 git://git.sv.gnu.org/gnulib.git
86 However, this can be network and disk intensive. If you already have
87 another gnulib clone on your disk, you can use the environment
88 variable GNULIB_SRCDIR to point to the previous checkout to speed up
89 the process. Additionally, both the bootstrap script and gnulib-tool
90 require a shell that supports functions, so you can set the
91 environment variable CONFIG_SHELL to choose a better shell on systems
92 (like Solaris) where /bin/sh is lacking. Thus, you may find it
94 GNULIB_SRCDIR=path/to/gnulib CONFIG_SHELL=path/to/sh \
95 path/to/sh ./bootstrap
97 A read-only copy of gnulib can be obtained by:
98 git clone git://git.sv.gnu.org/gnulib.git
100 cvs -d:pserver:anonymous@pserver.git.sv.gnu.org:/srv/git/gnulib.git \
103 Using a CVS checkout might work, but it is relatively untested,
104 particularly now that we use a git submodule for gnulib.
106 If you are a member of the savannah group for gnulib, a read-write
107 copy can be obtained by:
108 git clone <savannah-user>@git.sv.gnu.org:/srv/git/gnulib.git
110 If you are behind a firewall that blocks the git protocol, you may
111 find it useful to do:
112 git config --global url.http://git.savannah.gnu.org/r/.insteadof \
113 git://git.sv.gnu.org/
114 to force git to transparently rewrite all savannah git references to
117 * Either add the gnulib directory to your PATH, or run
118 GNULIB_TOOL=path/to/gnulib/gnulib-tool ./bootstrap
120 * When it is time for a release, it is a good idea to bootstrap with
121 official releases of the autotools, rather than git builds, to reduce
122 the pain of a user re-running bootstrap on the packaged M4. However,
123 files installed by Automake should be updated to the latest version
124 from their respective upstream source, rather than the version that
125 shipped with the automake release.
127 * Normally, after running bootstrap, 'git status' should not show any
128 differences; if things changed, please provide a patch or at least
129 report it as a bug. One case where things are changed is if the
130 gnulib submodule comes from an older date than the current installed
131 libtool, such that libtoolize will replace the symlinks to an older
132 version of build-aux files with their newer counterpart; the fix to
133 this is updating the submodule to a newer gnulib version.
135 * If you would like to check that you are not missing out on any useful
136 gnulib modules, comment out the gl_ASSERT_NO_GNULIB_POSIXCHECK in
137 configure.ac, then run 'make CFLAGS='-DGNULIB_POSIXCHECK=1' with gcc,
138 and look at the resulting warnings.
146 liberally, on as many platforms as you can. Use as many compilers and
149 * Some of the testsuite is generated from the documentation.
150 All instances of @example in doc/m4.texinfo that are not preceeded by
151 "@comment ignore" are turned into tests in the tests directory.
154 5. Editing 'ChangeLog'
155 ======================
157 * When in doubt, check that emacs can syntax-color properly in
158 change-log-mode. And preferably use emacs 'C-x 4 a'
159 (add-change-log-entry-other-window) to open ChangeLog with an
160 appropriate new template.
162 * If this change is by a different author, or on a different date to the
163 last entry start a new entry at the top of the file with the format
164 (note two spaces between each field):
166 yyyy-mm-dd Name of Author <email@address>
168 * If more than one person collaborated on the change, additional
169 authors can be listed on subsequent lines, thus:
171 yyyy-mm-dd Name of Main Author <email@address>,
172 Name of Contributor <another@email.address>
174 * Where a change author did not supply a copyright assignment, but the
175 changes they submitted were sufficiently trivial to commit in any case
176 (see the GCS for guidelines on this), then flag this against their
177 name in the header, thus:
179 yyyy-mm-dd Name of Author <email@address> (tiny change)
181 * Preferably the next part should be a description of the overall
182 purpose of the change, separated from the header by a blank line,
183 indented by 1 tab, and filled at column 72. The last character of the
184 description should be a colon, :.
186 * Changes to each file come next. Each new file starts on a new line,
187 indented by 1 tab and starting with an asterisk and a space. Multiple
188 files can be listed here relative to $top_srcdir, and comma separated.
189 Names of functions (or sections as appropriate) to which the change
190 applies should be named inside parentheses and comma separated. If
191 this goes beyond column 72, then parens should be closed and re-opened
194 * file, another/file, test/testcases/foo.test (func_foo)
195 (func_bar, func_baz): Description of changes.
197 * If the change does not apply to particular functions (or sections),
198 the section list can be omitted:
200 * file, another/file, test/testcases/foo.test: General changes.
202 * If the changes are particular to certain architectures, they should be
203 listed after the functions in square brackets:
205 * file, another/file (func_foo) [linux, solaris]: Description of
208 * Subsequent changes in other files that are related to the same overall
209 enhancement or bugfix should be listed concurrently, without blank
210 lines. Always start a fresh line for a new file:
212 * file, another/file (func_foo) [linux, solaris]: Description of
214 * doc/foo.texi (Invoking Foo): Document.
217 * If the change is in response to a problem reported by someone other
218 than the author, then credit them at the end of the description with:
220 Reported by Reporter Name <email@address>.
222 * See the GNU Coding Standards document for more details on ChangeLog
228 * Use space-only indentation in nearly all files (Makefile and
229 ChangeLogs being the exception).
231 If you use Emacs and your m4 working directory name matches,
232 this code in your ~/.emacs enables the right mode:
234 ;; In m4, indent with spaces everywhere (not TABs).
235 ;; Exceptions: Makefile and ChangeLog modes.
236 (add-hook 'find-file-hook '(lambda ()
237 (if (and buffer-file-name
238 (string-match "/m4\\>" (buffer-file-name))
239 (not (string-equal mode-name "Change Log"))
240 (not (string-equal mode-name "Makefile")))
241 (setq indent-tabs-mode nil))))
243 * Since the source code was massively converted from tabs in December
244 2009, you may find it helpful to use 'git diff -w' and 'git blame -w'
245 helpful for overlooking the whitespace changes.
247 * Avoid #ifdefs inside function bodies, whenever possible. If you
248 encounter a portability issue, it is better to propose a gnulib module
249 that works around it, and have m4 use that module.
255 * If you are an m4 maintainer, but have not yet registered your
256 gpg public key and (preferred) email address with the FSF, send an
257 email, preferably GPG-signed, to <ftp-upload@gnu.org> that includes
260 (a) name of package(s) that you are the maintainer for, and your
261 preferred email address.
263 (b) an ASCII armored copy of your GnuPG key, as an attachment.
264 ("gpg --export -a YOUR_KEY_ID > mykey.asc" should give you
267 When you have received acknowledgement of your message, the proper GPG
268 keys will be registered on ftp-upload.gnu.org and only then will you be
269 authorized to upload files to the FSF ftp machines.
271 * If you do not have access to the mailing list administrative interface,
272 approach the list owners for the password. Be sure to check the lists
273 (esp. bug-m4) for outstanding bug reports also in the list of
274 pending moderation requests. This step is not strictly necessary, but
275 helps, since by default, m4-announce rejects all posts, so you have to
276 get an administrator to allow your announcement through.
278 * Make sure you have rsync installed.
280 * Make sure you have GNU make installed.
282 * Make sure you have an up-to-date version of help2man installed.
284 * Make sure your locale is sane, e.g. by exporting LC_ALL=C.
286 * Make sure you are happy with the particular gnulib version recorded as
287 the gnulib submodule. If necessary to update to the latest, run:
288 git submodule foreach git pull origin master
289 git commit -m 'Update gnulib submodule to latest.' gnulib
290 In particular, ensure that the gnulib version is at least as new as
291 the latest stable libtool release.
293 * Update the version number in NEWS and ChangeLog, and mention in README
294 whether the release is stable. See
295 http://www.gnu.org/software/libtool/contribute.html for details of the
296 numbering scheme (M4 uses a similar scheme to libtool, although
297 intra-release versions carry more information thanks to
300 * Run ./bootstrap, perhaps with environment variables set.
302 * Run ./configure (a VPATH build should work, but is less tested).
304 * Run `make'. The file doc/m4.1 needs to exist for a distribution, and
305 be up-to-date with m4 --help output, but `make dist' intentionally
306 does not depend on running a built binary.
308 * Run `git commit' from the source tree if there are any changes from
311 * Run `git tag -s -m <version> -u <gpg_key> v<version>' with the desired
312 version number. Do not push anything upstream at this point.
314 * Run `make distcheck'. If there are any problems, fix them, then run
315 `git tag -d v<version>' and start again from the `git commit' step.
317 * Run `make <target>', with target set to `stable', `alpha', or `beta'
318 as appropriate. This will run various additional checks.
320 * Run './build-aux/gnupload --to [dest].gnu.org:m4 [files]' to create
321 detached gpg signature and clear signed directive files, and upload
322 the combination to the correct location. For an alpha release,
323 gnupload will place files in alpha.gnu.org, in /incoming/alpha; for a
324 full release, gnupload will place files in ftp.gnu.org, in
325 /incoming/ftp. Verify that the files uploaded successfully before
326 sending an announcement.
328 * Send announcement to m4-discuss@gnu.org, m4-announce@gnu.org, and
329 autotools-announce@gnu.org. If not an alpha send to info-gnu@gnu.org
330 as well. Use gnulib/build-aux/announce-gen to form an initial
331 template for the announcement (you may also need to install the perl
332 module Digest::SHA1). Contact a list administrator for m4-announce in
333 advance to ensure your post will make it through (the list is normally
334 set to silently discard all posts, even from subscribers).
336 * Update version number in configure.ac to next alpha number.
337 See http://www.gnu.org/software/libtool/contribute.html for details of
338 the numbering scheme.
340 * Update NEWS, README, and ChangeLog to start the intra-release changes,
341 and run `git commit'. Then run `git push origin refs/tags/v<version>'
342 to push the release tag and complete the release.
344 * For stable releases, update the webpages.
345 Run `build-aux/gnu-web-doc-update', which runs `make web-manual' on a
346 temporary git branch corresponding to the release, then copies the
347 contents of doc/manual into a CVS checkout of the M4 manual
348 repository. Follow up with any needed edits to m4.html, using:
350 cvs -z3 -d:ext:<user>@cvs.savannah.gnu.org:/web/m4 co m4
352 * Update the Free Software Directory. Browse to:
353 http://directory.fsf.org/project/m4/
354 and send an email to <bug-directory@gnu.org> mentioning any content
355 that needs to be updated.
358 Copyright (C) 2004-2010, 2013-2014, 2017 Free Software Foundation, Inc.
360 The canonical source of this file is maintained with the
361 GNU M4 package. Report bugs to bug-m4@gnu.org.
363 GNU M4 is free software: you can redistribute it and/or modify
364 it under the terms of the GNU General Public License as published by
365 the Free Software Foundation, either version 3 of the License, or
366 (at your option) any later version.
368 GNU M4 is distributed in the hope that it will be useful,
369 but WITHOUT ANY WARRANTY; without even the implied warranty of
370 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
371 GNU General Public License for more details.
373 You should have received a copy of the GNU General Public License
374 along with this program. If not, see <http://www.gnu.org/licenses/>.