OSDN Git Service

Modify pgindent to use an external typedefs file rather than included
[pg-rex/syncrep.git] / src / tools / pgindent / README
1 This can format all PostgreSQL *.c and *.h files, but excludes *.y, and *.l
2 files.
3
4 To use pgindent:
5
6 1) Build the source tree with _debug_ symbols and all possible configure options
7
8 2) Install to /usr/local/pgsql
9
10 3) Install all /contrib modules
11
12 4) Save a list of typedefs by running:
13
14         src/tools/find_typedef /usr/local/pgsql/bin /usr/local/pgsql/lib > /tmp/pgtypedefs
15
16 5) Run 'gmake distclean' from the top of the source tree to remove any
17    derived C files.
18
19 6) From the top of the source tree, run:
20
21         find . -name '*.[ch]' -type f -print |
22         egrep -v '/s_lock.h|/ecpg/test/expected/|/snowball/libstemmer/' |
23         xargs -n100 pgindent /tmp/pgtypedefs
24
25 ---------------------------------------------------------------------------
26
27 We have standardized on NetBSD's indent.  We have fixed a few bugs which 
28 requre the NetBSD source to be patched with indent.bsd.patch patch.  A 
29 fully patched  version is available at ftp://ftp.postgresql.org/pub/dev.
30
31 GNU indent, version 2.2.6, has several problems, and is not recommended.
32 These bugs become pretty major when you are doing >500k lines of code.
33 If you don't believe me, take a directory and make a copy.  Run pgindent
34 on the copy using GNU indent, and do a diff -r. You will see what I
35 mean. GNU indent does some things better, but mangles too.
36
37 Notes about excluded files:
38
39 src/include/storage/s_lock.h is excluded because it contains assembly code
40 that pgindent tends to mess up.
41
42 src/interfaces/ecpg/test/expected/ is excluded to avoid breaking the ecpg
43 regression tests.
44
45 src/include/snowball/libstemmer/ and src/backend/snowball/libstemmer/
46 are excluded because those files are imported from an external project,
47 not maintained locally, and are machine-generated anyway.