1
$Id: compile.txt,v 1.7 2004/01/25 10:39:48 andrew_belov Exp $
5
This is a collection of developers' notes for the open-source
11
UNIX-like systems, as well as OS/2 EMX, need to be configured
12
first. Run "cd gnu; autoheader; autoconf; ./configure; cd .."
13
to proceed with the standard GNU configuration process.
15
Tip: the "configure" script would be different for UNIX-like
16
systems and OS/2 EMX. That is the reason for not including it
17
into the source code distribution.
19
** TODO: on OS/2, InnoTek GCC v 3.2.x has not been tested yet **
21
Next, run GNU make in the toplevel directory. If you specify
22
"DEBUG=1", the executables will be built with debug information.
23
See GNUmakefile for details on available options). Example:
28
ARJ may be packaged in a SFX file by choosing the "package"
29
target instead of the default target, "all". The packages
30
created by the open-source distribution would be similar to
31
those distributed by ARJ Software Russia. Unlike the previous
32
closed-source releases, the open-source ARJ distribution is no
33
longer stamped with a signature known as ARJ-SECURITY.
36
CODE ORGANIZATION CONSIDERATIONS
38
For clarity, handle NULL as it might be !=0, so actions like "if
39
(!strchr(...))" are deprecated.
41
The data structures are described with a simple "struct"
42
statement. "typedef struct" is only used to emphasize a complex
43
type with a "hidden" implementation, like FILE in C, which is
44
different in various C implementations. In other words, the
45
"typedef struct" construct has never to be used in ARJ modules,
46
although it takes longer time to type the extra word, "struct",
49
Some variables may have doubtful names, like bytes_written in
50
hollow_decode(). These result from countless cut+paste
53
Despite our attempts to keep the code scattered within several
54
files, DOS-hosted compilers may run out of memory while
55
compiling the source. Even more, the fact that some files are
56
larger than 64K adversely affects the portability.
58
Be careful when you convert an array definition like char
59
p[SOME_CONSTANT]; to a pointer for dynamic allocation. The size
60
of such array may be referenced with sizeof() statement.
62
No dependencies are made on the *.H files (and actually there
63
are very deep, sometimes even circular dependencies). Most
64
oftenly, all targets must be recompiled when an .H file is
65
changed. An exception may be the introduction of an equate or
66
declaration - in this case, obviously, there is no need to force
72
** TODO: this section will have to be revised **
74
The coding style is distinct in that the single space character
75
is used as indentation.
77
Oftenly, the conditional expressions are writen in the following
80
(control_expression)?result1:result2.
82
Although the brackets around control_expression are a waste of
83
space, we use them to highlight the control_expression.
85
One may use the "BUGBUG:", "TODO:" and "FIXME:" comments
86
("BUGBUG:" is the preferred style) to designate code portions
87
that need further work.
92
Some compilers (e.g. Turbo C++ v 1.0) do not automatically pick
93
default include file subdirectory from INCLUDE environment
94
varibable. In such cases, the include path is usually specified
95
in a corresponding .STS file.
97
Dynamic linkage with LIBC when using IBM C Set/2 is possible
98
only if the libraries have been converted to LINK386-compatible
99
format (LIBCS.LIB) and the headers have been patched to fix the
100
stdin/stdout macro abuse (results in null pointers once the
101
optimization is turned on).
103
The "-O2" GCC optimization parameter may impose problems in GCC
104
v 2.9x through 3.1x. Upgrade to GCC v 3.2 is suggested. "-O2
105
-fno-expensive-optimizations" may also serve as a workaround.
110
Microsoft C compiler v 6.00A performs optimizations incorrectly,
111
resulting in broken code. Therefore, register optimizations have
114
Microsoft C compiler v 6.00A (unsure about the others) prefers a
115
function over the label with the same name in ASM clauses within
118
The run-time library in MS C v 7.00 (even with the Sep'92
119
patches applied) has some quirks with converting dates to/from
120
unixtime. ARJ will report the date in M_ARCHIVE_CREATED one day
121
before than the actual date. This bug does not occur neither
122
with MS C v 6.0, nor with subsequent releases (Visual C/C++).
124
Microsoft Visual C v 1.00 compiler (CL.EXE v 8.00) fails when
125
/Os is specified. /Olerg is used as a workaround to this. An
126
extensive analysis of the exact optimization switch that causes
127
the failure has not been yet performed so the optimization
128
efficiency has been scaled down to pretty inaccurate.
130
This hasn't been investigated thoroughly but it seems that
131
Borland C++ v 4.00 is not able to link COM files with C0T.OBJ. A
132
workaround for this is to use C0T.OBJ from Borland C++ v 3.10
135
MASM v 6.00 occasionally may end up with an exception under
136
OS/2, leaving a blank object file and therefore obstructing the
137
compilation. Microsoft claims that it has been fixed in version
138
6.01. Note that this problem may no longer be observed in ARJ,
139
as the ASM portions have been mostly eliminated in ARJ v 2.71
140
and at early stages of ARJ v 2.72 development.
145
When compiling under DOS, version 4.00 or higher is required due
146
to use of "@" modifiers in MAKEFILE. Compiled executables may
147
be run in lower versions of DOS if it's allowed by their