-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathPORTING
144 lines (97 loc) · 4.33 KB
/
PORTING
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
Porting FAQ for SING (Schily Is Not Gnu) utilities.
- The base for porting is the makefile system.
Always look into:
https://sourceforge.net/projects/schilytools/files/makefiles/
for a version that might be newer than the one used
inside the program that should be ported.
If you want to know more about the makefile system,
read the man pages makefiles4 and makerules.4,
they are located in man/man4/*
to convert a manpage troff->postscript use:
gtroff -man file.tr | grops > file.ps
to convert a manpage troff->Terminal use:
nroff -man file.tr | more -s
- To be able to use the makefile system, you need a
make program that meets the minimum requirements
for a make program (see makerules(4) man page)
Currently, the following make programs meet this
minimum requirements: Smake (my program), SunPro Make and Gmake
A good idea is to first compile 'smake' if you don't
have it already.
The smake source can be found on:
https://sourceforge.net/projects/s-make/files/
or
https://sourceforge.net/projects/s-make/files/alpha/
for the most recent version.
- To be able to use the makefile system with gmake,
the operating system must have a command named 'uname'.
If not, you have to provide it as a shell script.
1) If you are using smake release 1.1 or newer and
a recent makefile system, the next step should be done
automagically (smake-1.1 or newer implement a -version
option to retrieve the version number).
If you are using gmake, you need to do this by hand.
First step for adding a new architecture is creating
the appropriate rule files in the RULES directory:
RULES/os-{newos}.id For OS identification
RULES/os-{newos}.def For OS definition (man style)
RULES/{newarch}-{newos}-cc.rul
RULES/{newarch}-{newos}-gcc.rul
And create a file:
DEFAULTS/Defaults.{newos}
Have a look in similar files for a template.
If the files hae been generated automagically by smake,
please check the content and mail me a working set for your OS.
2) All C-porting control is located in include/mconfig.h
and in the file incs/{newarch}-{newos}-{cc!gcc}/xconfig.h
The later file is created automatically using GNU
configure. The File conf/xconfig.h.in contains all
templates and comments for the various things that are tested.
In any case, it is recommended to carefully watch the
outout from the 'configure' run (which is automatically
started from within 'make'). You may also wish to check all
files that are created in the directory
incs/{newarch}-{newos}-{cc!gcc}/
3) Everything should compile now.
If not, try to hack the files and mail me your problems.
You should have a closer look at the sources as it may be that
the first attempt to port a utility will not support
all possible features of the new OS.
If your OS supportes these features in a non standard way,
you need to hack conf/configure.in and the source and add
support for the non standard behaviour of your OS.
This is definitely recommended if you want to port programs
like 'cdrecord' 'star' and similar which need fork(2) and
mmap(2) or setprioriry(2) or if you check programs on
non POSIX operating systems like W95/W98/WNT OS/2 and
similar.
Notice for porting tools, that use the SCSI library libscg:
I) Cdrecord should compile at this moment if you are using
a new architecture. The SCSI transport however will not work.
Check this!
All files that contain low level code for SCSI transport are
located in the directory libscg/
II) Implementing a SCSI Transport Layer for your architecture:
You need to add a new block into scsihack.c that will add
support for your OS. Copy the block:
#ifdef __NEW_ARCHITECTURE
#define SCSI_IMPL /* We have a SCSI implementation for XXX */
/*
* Add new hacks here
*/
#include "scsi-new-arch.c"
#endif
and rename __NEW_ARCHITECTURE to reflect your new architecture.
Add a new file that will be called scsi-{newarch}.c
Have a look into scsi-linux-sg.c for a template how to do this.
More hints for writing the needed SCSI low level transport functions
is in:
http://sourceforge.net/projects/cdrtools/files/READMEs/README.scsi-IF
4) Test your ported program.
5) You may check other programs from me to see if everything compiles
and works.
6) Send me your changes
Joerg Schilling