Commit | Line | Data |
---|---|---|
b0749d03 MV |
1 | Hacking It Yourself ================================================== |
2 | ||
3 | As distributed, Guile needs only an ANSI C compiler and a Unix system | |
4 | to compile. However, Guile's makefiles, configuration scripts, and a | |
5 | few other files are automatically generated, not written by hand. If | |
6 | you want to make changes to the system (which we encourage!) you will | |
7 | find it helpful to have the tools we use to develop Guile. They | |
8 | are the following: | |
9 | ||
10 | Autoconf 2.13 --- a system for automatically generating `configure' | |
11 | scripts from templates which list the non-portable features a | |
12 | program would like to use. Available in | |
13 | "ftp://ftp.gnu.org/pub/gnu/autoconf" | |
14 | ||
15 | Automake 1.4 --- a system for automatically generating Makefiles that | |
16 | conform to the (rather Byzantine) GNU coding standards. The | |
17 | nice thing is that it takes care of hairy targets like 'make | |
18 | dist' and 'make distclean', and automatically generates | |
19 | Makefile dependencies. Automake is available in | |
20 | "ftp://ftp.gnu.org/pub/gnu/automake" | |
21 | ||
22 | Before using automake, you may need to copy `threads.m4' and | |
23 | `guile.m4' from the top directory of the Guile core disty to | |
24 | `/usr/local/share/aclocal. | |
25 | ||
26 | libtool 1.3.4 --- a system for managing the zillion hairy options needed | |
27 | on various systems to produce shared libraries. Available in | |
28 | "ftp://ftp.gnu.org/pub/gnu/libtool" | |
29 | ||
30 | You are lost in a little maze of automatically generated files, all | |
31 | different. | |
32 | > | |
33 | ||
795b4217 | 34 | |
0822a9c1 JB |
35 | Contributing Your Changes ============================================ |
36 | ||
37 | - If you have put together a change that meets the coding standards | |
38 | described below, we encourage you to submit it to Guile. The best | |
c5ee0952 JB |
39 | place to post it is guile@sourceware.cygnus.com. Please don't send it |
40 | directly to me; I often don't have time to look things over. If you | |
41 | have tested your change, then you don't need to be shy. | |
0822a9c1 JB |
42 | |
43 | - Please submit patches using either context or unified diffs (diff -c | |
44 | or diff -u). Don't include a patch for ChangeLog; such patches don't | |
45 | apply cleanly, since we've probably changed the top of ChangeLog too. | |
46 | Instead, provide the unaltered text at the top of your patch. | |
47 | ||
48 | Please don't include patches for generated files like configure, | |
49 | aclocal.m4, or any Makefile.in. Such patches are often large, and | |
50 | we're just going to regenerate those files anyway. | |
51 | ||
52 | ||
d2bd3d8d JB |
53 | CVS conventions ====================================================== |
54 | ||
eb4194d6 | 55 | - We use CVS to manage the Guile sources. The repository lives on |
349d9c1f | 56 | egcs.cygnus.com, in /cvs/guile; you will need an |
aa31443a JB |
57 | account on that machine to access the repository. Also, for security |
58 | reasons, egcs presently only supports CVS connections via the SSH | |
59 | protocol, so you must first install the SSH client. Then, you should | |
60 | set your CVS_RSH environment variable to ssh, and use the following as | |
61 | your CVS root: | |
eb4194d6 | 62 | |
349d9c1f | 63 | :ext:USER@egcs.cygnus.com:/cvs/guile |
eb4194d6 JB |
64 | |
65 | Either set your CVSROOT environment variable to that, or give it as | |
66 | the value of the global -d option to CVS when you check out a working | |
67 | directory. | |
68 | ||
848f2a01 | 69 | For more information on SSH, see http://www.cs.hut.fi/ssh. |
eb4194d6 JB |
70 | |
71 | The Guile sources live in several modules: | |
72 | ||
73 | - guile-core --- the interpreter, QuickThreads, and ice-9 | |
e19268af JB |
74 | - guile-doc --- documentation in progress. When complete, this will |
75 | be incorporated into guile-core. | |
15fb0024 | 76 | - guile-oops --- The Guile Object-Oriented Programming System (talk to mdj) |
eb4194d6 | 77 | - guile-tcltk --- the Guile/Tk interface |
b1f4ddc1 | 78 | - guile-tk --- the new Guile/Tk interface, based on STk's modified Tk |
eb4194d6 JB |
79 | - guile-rgx-ctax --- the Guile/Rx interface, and the ctax implementation |
80 | - guile-scsh --- the port of SCSH to guile, talk to Gary Houston | |
b1f4ddc1 | 81 | - guile-www --- A Guile module for making HTTP requests. |
eb4194d6 | 82 | |
afdfe3f4 JB |
83 | There is a mailing list for CVS commit messages; see README for details. |
84 | ||
b5f69988 GB |
85 | - We check Makefile.am and configure.in files into CVS, but the |
86 | "autogen.sh" script must be run from the top-level to generate the | |
87 | actual "configure" script that then must be run to create the various | |
88 | Makefile-s to build guile. The general rule is that you should be able | |
89 | to check out a working directory of Guile from CVS, and then type | |
90 | "./autogen.sh", then "configure", and finally "make". | |
350294b1 | 91 | |
d4c83f63 JB |
92 | - (Automake 1.4 only) Be sure to run automake at the top of the tree |
93 | with no arguments. Do not use `automake Makefile' to regenerate | |
94 | specific Makefile.in files, and do not trust the Makefile rules to | |
95 | rebuild them when they are out of date. Automake 1.4 will add | |
96 | extraneous rules to the top-level Makefile if you specify specific | |
97 | Makefiles to rebuild on the command line. Running the command | |
98 | `autoreconf --force' should take care of everything correctly. | |
99 | ||
795b4217 JB |
100 | - Make sure your changes compile and work, at least on your own |
101 | machine, before checking them into the main branch of the Guile | |
102 | repository. If you really need to check in untested changes, make a | |
103 | branch. | |
104 | ||
d2bd3d8d JB |
105 | - Include each log entry in both the ChangeLog and in the CVS logs. |
106 | If you're using Emacs, the pcl-cvs interface to CVS has features to | |
107 | make this easier; it checks the ChangeLog, and generates good default | |
108 | CVS log entries from that. | |
109 | ||
110 | ||
111 | Coding standards ===================================================== | |
112 | ||
113 | - As for any part of Project GNU, changes to Guile should follow the | |
114 | GNU coding standards. The standards are available via anonymous FTP | |
115 | from prep.ai.mit.edu, as /pub/gnu/standards/standards.texi and | |
116 | make-stds.texi. | |
117 | ||
99be3450 JB |
118 | - The Guile tree should compile without warnings under the following |
119 | GCC switches, which are the default in the current configure script: | |
859bb431 | 120 | -O2 -Wall -Wpointer-arith -Wmissing-prototypes |
18fa97f8 JB |
121 | The only warnings which can be tolerated are those about variables |
122 | being clobbered by longjmp/vfork in eval.c. The variables in question | |
123 | are critical to the interpreter's performance; as far as I can tell, | |
124 | it is difficult/annoying to avoid these warnings without slowing the | |
125 | system down substantially. (If you can figure out a good fix, I'd be happy to see it.) | |
99be3450 | 126 | |
d043e0bb JB |
127 | Note that the warnings generated vary from one version of GCC to the |
128 | next, and from one architecture to the next (apparently). To provide | |
129 | a concrete common standard, Guile should compile without warnings from | |
18fa97f8 | 130 | GCC 2.7.2.3 in a Red Hat 5.2 i386 Linux machine. Furthermore, each |
d043e0bb JB |
131 | developer should pursue any additional warnings noted by on their |
132 | compiler. This means that people using more stringent compilers will | |
133 | have more work to do, and assures that everyone won't switch to the | |
41d368d9 | 134 | most lenient compiler they can find. :) |
d043e0bb | 135 | |
afdfe3f4 JB |
136 | Note also that EGCS (as of November 3 1998) doesn't handle the |
137 | `noreturn' attribute properly, so it doesn't understand that functions | |
138 | like scm_error won't return. This may lead to some silly warnings | |
139 | about uninitialized variables. You should look into these warnings to | |
140 | make sure they are indeed spurious, but you needn't correct warnings | |
141 | caused by this EGCS bug. | |
142 | ||
0822a9c1 JB |
143 | - If you add code which uses functions or other features that are not |
144 | entirely portable, please make sure the rest of Guile will still | |
145 | function properly on systems where they are missing. This usually | |
146 | entails adding a test to configure.in, and then adding #ifdefs to your | |
147 | code to disable it if the system's features are missing. | |
afdfe3f4 | 148 | |
795b4217 JB |
149 | - When you make a user-visible change (i.e. one that should be |
150 | documented, and appear in NEWS, put an asterisk in column zero of the | |
151 | start of the ChangeLog entry, like so: | |
152 | ||
153 | Sat Aug 3 01:27:14 1996 Gary Houston <ghouston@actrix.gen.nz> | |
154 | ||
155 | * * fports.c (scm_open_file): don't return #f, throw error. | |
156 | ||
fa3f45cc JB |
157 | When you've written a NEWS entry and updated the documentation, go |
158 | ahead and remove the asterisk. I will use the asterisks to find and | |
159 | document changes that haven't been dealt with before a release. | |
160 | ||
d49a7907 JB |
161 | - Please write log entries for functions written in C under the |
162 | functions' C names, and write log entries for functions written in | |
163 | Scheme under the functions' Scheme names. Please don't do this: | |
164 | ||
165 | * procs.c, procs.h (procedure-documentation): Moved from eval.c. | |
166 | ||
167 | Entries like this make it harder to search the ChangeLogs, because you | |
afdfe3f4 JB |
168 | can never tell which name the entry will refer to. Instead, write this: |
169 | ||
170 | * procs.c, procs.h (scm_procedure_documentation): Moved from eval.c. | |
d49a7907 | 171 | |
4085a3da JB |
172 | Changes like adding this line are special: |
173 | ||
174 | SCM_PROC (s_serial_map, "serial-map", 2, 0, 1, scm_map); | |
175 | ||
176 | Since the change here is about the name itself --- we're adding a new | |
177 | alias for scm_map that guarantees the order in which we process list | |
178 | elements, but we're not changing scm_map at all --- it's appropriate | |
179 | to use the Scheme name in the log entry. | |
180 | ||
30d14d55 JB |
181 | - There's no need to keep a change log for documentation files. This |
182 | is because documentation is not susceptible to bugs that are hard to | |
183 | fix. Documentation does not consist of parts that must interact in a | |
184 | precisely engineered fashion; to correct an error, you need not know | |
185 | the history of the erroneous passage. (This is copied from the GNU | |
186 | coding standards.) | |
187 | ||
795b4217 JB |
188 | - Make sure you have papers from people before integrating their |
189 | changes or contributions. This is very frustrating, but very | |
190 | important to do right. From maintain.texi, "Information for | |
191 | Maintainers of GNU Software": | |
192 | ||
193 | When incorporating changes from other people, make sure to follow the | |
194 | correct procedures. Doing this ensures that the FSF has the legal | |
195 | right to distribute and defend GNU software. | |
196 | ||
197 | For the sake of registering the copyright on later versions ofthe | |
198 | software you need to keep track of each person who makes significant | |
199 | changes. A change of ten lines or so, or a few such changes, in a | |
200 | large program is not significant. | |
201 | ||
202 | *Before* incorporating significant changes, make sure that the person | |
203 | has signed copyright papers, and that the Free Software Foundation has | |
204 | received them. | |
205 | ||
206 | If you receive contributions you want to use from someone, let me know | |
207 | and I'll take care of the administrivia. Put the contributions aside | |
208 | until we have the necessary papers. | |
209 | ||
fa3f45cc JB |
210 | - When you make substantial changes to a file, add the current year to |
211 | the list of years in the copyright notice at the top of the file. | |
795b4217 | 212 | |
d2bd3d8d JB |
213 | |
214 | Helpful hints ======================================================== | |
215 | ||
f84f77f5 JB |
216 | - [From Mikael Djurfeldt] When working on the Guile internals, it is |
217 | quite often practical to implement a scheme-level procedure which | |
218 | helps you examine the feature you're working on. | |
219 | ||
220 | Examples of such procedures are: pt-size, debug-hand and | |
221 | current-pstate. | |
222 | ||
223 | I've now put #ifdef GUILE_DEBUG around all such procedures, so that | |
224 | they are not compiled into the "normal" Guile library. Please do the | |
225 | same when you add new procedures/C functions for debugging purpose. | |
226 | ||
227 | You can define the GUILE_DEBUG flag by passing --enable-guile-debug to | |
228 | the configure script. | |
229 | ||
52591c80 JB |
230 | - You'll see uses of the macro SCM_P scattered throughout the code; |
231 | those are vestiges of a time when Guile was meant to compile on | |
232 | pre-ANSI compilers. Guile now requires ANSI C, so when you write new | |
233 | functions, feel free to use ANSI declarations, and please provide | |
1cf84ea5 | 234 | prototypes for everything. You don't need to use SCM_P in new code. |
52591c80 | 235 | |
795b4217 JB |
236 | |
237 | Jim Blandy |