3
</title></head><body><h3>
7
<img align=left src=pic/wingdorothy.gif><a href=http://www.eecis.udel.edu/~mills/pictures.htm>from <i>The
8
Wizard of Oz</i>, L. Frank Baum</a>
10
<p>Porting Dorothy in Oz.
13
<p>NOTE: The following procedures have been replaced by GNU automake and
14
autoconfigure. This page is to be updated in the next release.
16
<p>Porting to a new machine or operating system ordinarily requires
17
updating the <code>./machines</code> directory and the
18
<code>./compilers</code> directories in order to define the build
19
environment and autoconfigure means. You will probably have to modify
20
the <code>ntp_machines.h</code> file and <code>"l_stdlib.h"</code> files
21
as well. The two most famous trouble spots are the I/O code in
22
<code>./ntpd/ntp_io.c</code> and the clock adjustment code in
23
<code>./ntpd/ntp_unixclock.c</code>.
25
<p>These are the rules so that older bsd systems and the POSIX standard
26
system can coexist together.
30
<li>If you use <code>select</code> then include
31
<code>"ntp_select.h"</code>. <code>select</code> is not standard, since
32
it is very system dependent as to where it is defined. The logic to
33
include the right system dependent include file is in
34
<code>"ntp_select.h"</code>.
36
<p><li>Always use POSIX definition of strings. Include
37
<code>"ntp_string.h"</code> instead of <code><string.h></code>.
39
<p><li>Always include <code>"ntp_malloc.h"</code> if you use
42
<p><li>Always include <code>"ntp_io.h"</code> instead of
43
<code><sys/file.h></code> or <code><fnctl.h></code> to get
44
<code>O_*</code> flags.
46
<p><li>Always include <code>"ntp_if.h"</code> instead of
47
<code><net/if.h></code>.
49
<p><li>Always include <code>"ntp_stdlib.h"</code> instead of
50
<code><stdlib.h></code>.
52
<p><li>Define any special defines needed for a system in
53
<code>./include/ntp_machine.h</code> based on system identifier. This
54
file is included by the <code>"ntp_types.h"</code> file and should
55
always be placed first after the <code><></code> defines.
57
<p><li>Define any special library prototypes left over from the system
58
library and include files in the <code>"l_stdlib.h"</code> file. This
59
file is included by the <code>"ntp_stdlib.h"</code> file and should
60
ordinarily be placed last in the includes list.
62
<p><li>Don't define a include file by the same name as a system include
67
<p><code>"l_stdlib.h"</code> can contain any extra definitions that are
68
needed so that <code>gcc</code> will shut up. They should be controlled
69
by a system identifier and there should be a separate section for each
70
system. Really this will make it easier to maintain.
72
<p>See <code>include/ntp_machines.h</code> for the various compile time
75
<p>When you are satisfied the port works and that other ports are not
76
adversely affected, please send <a href="patches.htm">patches</a> for
77
the system files you have changed, as well as any documentation that
78
should be updated, including the advice herein.
82
<hr><a href=index.htm><img align=left src=pic/home.gif></a><address><a
83
href=mailto:mills@udel.edu> David L. Mills <mills@udel.edu></a>
84
</address></a></body></html>