From Lazarus wiki
Revision as of 16:32, 27 March 2011 by Armin (talk | contribs) (Target Netware)

The compiler supports two different tragets for netware. Both targets are using the same compiler and binutils but different runtime libraries.

Target Netware

As of fpc 2.5.1 (Mar 27, 2011), the internal linker will be used to generate netware loadable modules. Currently only the clib target is implemented. This means binutils for netware are no longer required. Due to the fact that fpc currently only supports reading coff objects in the internal linker, the object format for netware has been changed to coff. Because nlmconv for binutils only supports coff, linking with binutils does no longer work. I plan to switch back to elf as soon as internal support for elf is available in fpc.

This target is based on the classic netware c-library (clib.nlm). The nlm should work on netware versions from 4.00 on. It will not work on 3.x (mainly because the rtl auto loads nlms from the modular clib, i.e. threads.nlm). You are free to change that in the runtime library. The resulting nlm is a uni-processor nlm (no xdc-data support). There are some netware specific support modules included in the rtl:

aio Serial port support, aio.h in ndk

nwnit Definitions from the following ndk-files: nwaccntg.h, nwafp.h, nwbindry.h, nwdatamg.h, nwdir.h, nwenvrn.h, nwenvrn1.h, nwextatt.h, nwmsg.h, nwnit.h, nwqueue.h, nwserial.h, nwservst.h, nwsync.h, nwtts.h

nwprot netware server protocol library (streams and tli)

nwserv Contains definitions from the follwing header files: string.h dirent.h errno.h fcntl.h limits.h locale.h nwaudnlm.h nwbitops.h nwcntask.h nwconio.h nwconn.h nwdebug.h nwdfs.h nwdos.h nwerrno.h nwfattr.h nwfileio.h nwfileng.h nwfinfo.h nwfshook.h nwipx.h nwlib.h nwlocale.h nwmalloc.h nwncpx.h nwnspace.h nwproc.h nwsemaph.h nwserv.h nwsignal.h nwstring.h nwtoolib.h stdio.h stdlib.h unistd.h time.h utime.h nwthread.h nwmediam.h ioctl.h sys/socket.h sys/time.h sys/filio.h syys/ioctl.h sys/stat.h sys/time.h sys/timeval.h sys/uio.h sys/utsname.h

nwsnut Netware utility text interface (same as in ndk)

winsock Netware winsock2 interface

Target Netwlibc

This target is based on the modern netware libc (libc.nlm). The nlm should work on netware versions from 5.10 on (current service packs and libc fixes may be needed). Older versions of netware are not supported because no libc is available on these versions. Threads within the generated nlm can run on any cpu by default (xdc-data is generated by the compiler). There are some netware specific support modules included in the rtl:

libc Interface to netware libc

winsock Netware winsock2 interface

nwsnut Netware utility text interface (same as in ndk)

Compiler Switches for Netware

{$Description TEXT} Sets the NLM Description displayed while loading the NLM

{$Version x,y,z} Sets the nlm version to x.y.z, x,y, and z has to be numeric, z=1 will be interpreted as rev a, z=1 as rev b ...

{$Screenname} Sets the clib screenname, the following special Screennames will be supported by netware:

default no own screen, stdout and errout are active on console for Netware < 6.0, Logger Screen on newer Versions

none No screen and no stdout/errout at all. You should not use this mode with FreePascal because in case a runtime error will be generated, FreePascal prints the error to stdout and that will fail and generate another runtime error (and so on ...) This will result in a nice abend (even when loaded protected)

{$Threadname} Sets the thread name. Make sure the names are not to long for netware because this will prevent your nlm from loading.

{$Memory Stacksize} {$Memory Stacksize,Heapsize} Specifies the stacksize, the heapsize will be ignored.

Defines for Netware

The compiler defines the symbol NETWARE for both targets, netware and netwlibc. For netware the additional symbol NETWARE_CLIB is defined, for netwlibc, NETWLIBC and NETWARE_LIBC are defined.

 {$if defined(netware)}
 writeln ('Running on netware');
   {$if defined(netware_libc)}
    writeln ('on libc target');
   {$if defined(netware_clib)}
    writeln ('on clib target');

Linker Specials

The netware linker (nlmconv from binutils) requires import file (.imp) with imported symbols. The runtime library contains most of the needed import files. These files are installed in the rtl unit dir and searched via the library search path.

--Armin 00:15, 13 Jan 2005 (CET)