-
Notifications
You must be signed in to change notification settings - Fork 44
/
Porting
72 lines (51 loc) · 2.2 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
#
# $Id: Porting,v 1.2 2003-08-19 09:02:22 tigran Exp $
#
P O R T I N G I S S U E
There are several places to take a care.
xx) Makefiles
The good place to start is Makefile.sun. Copy it to new one.
cp Makefile.sun Makefile.newos
Make a modifications which fits into your system.
CC - C compiler
CFLAGS - flags used by C compiler
MAKEDEP - command to generate file dependencies, usually, CC with some flags
SO_EXT - extention for dynamic library ( .so or .dll )
A_EXT - extention for static llibrary ( .a or .lib )
EXE_EXT - extention for executable ( .exe )
AR - maintain portable archive or library ( ar )
ARGLAGS - flags used by AR, ( rv )
RANLIB - generate index to archive ( ranlib )
MAP - way to tell to LD how to make a library export section
CPP - C preprocessor, usually $(CC) -E
LIBS - external libraries ( libpthread, libsocket and so on )
LDFLAGS - LD flag to create a dynamic library
Take a result of a 'uname' application on your system and modify
general Makefile:
NewOS) \
$(MAKE) -f Makefile.newos $@ ;\
If your system is not a UNIX clone, then you are in trouble :)
xx) Threads
If your system natively supports POSIX threads API, you are done.
If not, add your system specific macros into sysdep.h.
xx) System IO
The library supports three methods of accessing system native IO calls.
The first is direct kernel calls. Second is using hooks form libc.
And third is by calling corresponding function, which won't work in
case of preload library and will produce "out of stack" error. To enable
kernel calls, you have to add -DBSD_SYSCALLS to CFLAGS. The libc hooks
enabled by adding -DLIBC_SYSCALLS. In addition -DLIBC=<path to libc>
and corresponding function symbols in libc have to be specified. If none
if none of the system io methods specified, corresponding io calls used.
xx) Byteorder
The dcap library designed to use LARGE FILES. During network operations
required ntohll htonll functions, which is not included into standard libraries and libdcap has its own implementation, which byteorder dependent.
FILEs to be modified:
dcap.c
sysdep.h
system_io.c
system_io.h
byteorder
socklen_t
Makefile.xxxx
Makefile