1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
<title>The Fossil Build Process</title>
<h1>1.0 Introduction</h1>
The build process for Fossil is tricky in that the source code
needs to be processed by three different preprocessor programs
before it is compiled. Most users will download a
[https://fossil-scm.org/home/uv/download.html | precompiled binary]
so this is of no consequence to them, and even those who
want to compile the code themselves can use one of the
[./build.wiki | existing makefiles].
So must people do not need to be concerned with the
build complexities of Fossil. But hard-core developers who desire
a deep understanding of how Fossil is put together can benefit
from reviewing this article.
<h1 id="srctour">2.0 Source Code Tour</h1>
The source code for Fossil is found in the
|
|
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
<title>The Fossil Build Process</title>
<h1>1.0 Introduction</h1>
The build process for Fossil is tricky in that the source code
needs to be processed by three different preprocessor programs
before it is compiled. Most users will download a
[https://fossil-scm.org/home/uv/download.html | precompiled binary]
so this is of no consequence to them, and even those who
want to compile the code themselves can use one of the
[./build.wiki | existing makefiles].
So most people do not need to be concerned with the
build complexities of Fossil. But hard-core developers who desire
a deep understanding of how Fossil is put together can benefit
from reviewing this article.
<h1 id="srctour">2.0 Source Code Tour</h1>
The source code for Fossil is found in the
|
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
|
8. linenoise.h
The TH1 script engine is implemented using files:
9. th.c
10. th.h
The proprocessing steps are omitted for all of these imported
files.
The VERSION.h header file is generated from other information sources
using a small program called:
11. [/file/tools/mkversion.c | mkversion.c]
The builtin_data.h header file contains the definitions of C-language
byte-array constants that contain various resources such as scripts and
images. The builtin_data.h header file is generate from the original
resource files using a small program called:
12 [/file/tools/mkbuiltin.c | mkbuiltin.c]
Examples of built-in resources include the [/file/src/diff.tcl | diff.tcl]
script used to implement the --tk option to [/help?cmd=diff| fossil diff],
the [/file/src/markdown.md | markdown documentation], and the various
|
|
|
|
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
|
8. linenoise.h
The TH1 script engine is implemented using files:
9. th.c
10. th.h
The preprocessing steps are omitted for all of these imported
files.
The VERSION.h header file is generated from other information sources
using a small program called:
11. [/file/tools/mkversion.c | mkversion.c]
The builtin_data.h header file contains the definitions of C-language
byte-array constants that contain various resources such as scripts and
images. The builtin_data.h header file is generated from the original
resource files using a small program called:
12 [/file/tools/mkbuiltin.c | mkbuiltin.c]
Examples of built-in resources include the [/file/src/diff.tcl | diff.tcl]
script used to implement the --tk option to [/help?cmd=diff| fossil diff],
the [/file/src/markdown.md | markdown documentation], and the various
|
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
|
should understand that whenever "src.c" or "src.h" is used in the text
that follows, we really mean all (79) other source files other than
the exceptions described above.
<h1>3.0 Automatically generated files</h1>
The "VERSION.h" header file contains some C preprocessor macros that
identify the version of Fossil that is to be build. The VERSION.h file is
generated automatically from information extracted from the "manifest",
"manifest.uuid", and "VERSION" source files in the root directory of the
source tree.
(The "manifest" and "manifest.uuid" files are automatically generated and
updated by Fossil itself. See the [/help/setting | fossil set manifest]
command for additional information.)
|
|
|
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
|
should understand that whenever "src.c" or "src.h" is used in the text
that follows, we really mean all (79) other source files other than
the exceptions described above.
<h1>3.0 Automatically generated files</h1>
The "VERSION.h" header file contains some C preprocessor macros that
identify the version of Fossil that is to be built. The VERSION.h file is
generated automatically from information extracted from the "manifest",
"manifest.uuid", and "VERSION" source files in the root directory of the
source tree.
(The "manifest" and "manifest.uuid" files are automatically generated and
updated by Fossil itself. See the [/help/setting | fossil set manifest]
command for additional information.)
|
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
|
the HTTPS option is enabled, then it will also need to link against
the appropriate SSL implementation. And, of course, Fossil needs to
link against the standard C library. No other libraries or external
dependences are used.
<h1>7.0 Debugging</h1>
Debug mode is controlled via FOSSIL_DEBUG preprocessor macro which could be
set explicitly at the make command for the target platform.
However, in practice it is instead recommended to add a respective configure
option for the target platform and then perform a clean build. This way the
Debug flags are consistently applied across the whole build process. For
example, use these Debug flags in addition to other flags passed to the
configure scripts:
On Linux, *NIX and similar platforms:
<pre>
./configure --fossil-debug
</pre>
On Windows:
<pre>
win\buildmsvc.bat FOSSIL_DEBUG=1
</pre>
The resulting fossil binary could then be loaded into a platform-specific
debugger. Source files displayed in the debugger correspond to the ones
generated from the translation stage of the build process, that is what was
actually compiled into the object files.
<h1>8.0 See Also</h1>
* [./tech_overview.wiki | A Technical Overview Of Fossil]
* [./adding_code.wiki | How To Add Features To Fossil]
|
|
|
|
|
|
>
|
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
|
the HTTPS option is enabled, then it will also need to link against
the appropriate SSL implementation. And, of course, Fossil needs to
link against the standard C library. No other libraries or external
dependences are used.
<h1>7.0 Debugging</h1>
Debug mode is controlled via a FOSSIL_DEBUG preprocessor macro. This can be
set explicitly with the make command for the target platform.
However, in practice it is instead recommended to add a respective configure
option for the target platform and then perform a clean build. This way the
Debug flags are consistently applied across the whole build process. For
example, use these Debug flags in addition to other flags passed to the
configure scripts:
On Linux, *NIX and similar platforms:
<pre>
./configure --fossil-debug
</pre>
On Windows:
<pre>
win\buildmsvc.bat FOSSIL_DEBUG=1
</pre>
The resulting fossil binary can then be loaded into a platform-specific
debugger. Source files displayed in the debugger correspond to the ones
generated from the translation stage of the build process, as that is what
was actually compiled into the respective object files that make up the
fossil binary.
<h1>8.0 See Also</h1>
* [./tech_overview.wiki | A Technical Overview Of Fossil]
* [./adding_code.wiki | How To Add Features To Fossil]
|