# # $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= 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