fpc/rtl/netware
armin 458e3c3780 * makefiles regenerated
* ide: added target netwlibc
2004-09-04 23:33:38 +00:00
..
demos * old logs removed and tabs fixed 2002-09-07 16:01:16 +00:00
tests * changes for new threadvar support 2003-02-15 19:12:54 +00:00
aio.imp * moved rtl/netware/nwimp/*.imp to rtl/netware 2004-08-13 19:57:44 +00:00
aio.pp * added declarations with var parameters 2003-05-10 21:38:22 +00:00
audnlm32.imp * moved rtl/netware/nwimp/*.imp to rtl/netware 2004-08-13 19:57:44 +00:00
calnlm32.imp * moved rtl/netware/nwimp/*.imp to rtl/netware 2004-08-13 19:57:44 +00:00
ccs-os.imp * moved rtl/netware/nwimp/*.imp to rtl/netware 2004-08-13 19:57:44 +00:00
ccs.imp * moved rtl/netware/nwimp/*.imp to rtl/netware 2004-08-13 19:57:44 +00:00
classes.pp * changed dir separator from \ to / 2004-08-01 20:02:48 +00:00
clib.imp * moved rtl/netware/nwimp/*.imp to rtl/netware 2004-08-13 19:57:44 +00:00
clibaux.imp * moved rtl/netware/nwimp/*.imp to rtl/netware 2004-08-13 19:57:44 +00:00
clibctx.imp * moved rtl/netware/nwimp/*.imp to rtl/netware 2004-08-13 19:57:44 +00:00
clxnlm32.imp * moved rtl/netware/nwimp/*.imp to rtl/netware 2004-08-13 19:57:44 +00:00
convertimp * moved rtl/netware/nwimp/*.imp to rtl/netware 2004-08-13 19:57:44 +00:00
crt.pp + Moved CRT interface to common include file 2004-02-08 16:22:20 +00:00
dos.pp * changed dir separator from \ to / 2004-08-01 20:02:48 +00:00
dplsv386.imp * moved rtl/netware/nwimp/*.imp to rtl/netware 2004-08-13 19:57:44 +00:00
dsapi.imp * moved rtl/netware/nwimp/*.imp to rtl/netware 2004-08-13 19:57:44 +00:00
dsevent.imp * moved rtl/netware/nwimp/*.imp to rtl/netware 2004-08-13 19:57:44 +00:00
errno.inc * old logs removed and tabs fixed 2002-09-07 16:01:16 +00:00
initc.pp first version for netware 2004-07-30 14:51:21 +00:00
keyboard.pp * old logs removed and tabs fixed 2002-09-07 16:01:16 +00:00
lib0.imp * moved rtl/netware/nwimp/*.imp to rtl/netware 2004-08-13 19:57:44 +00:00
locnlm32.imp * moved rtl/netware/nwimp/*.imp to rtl/netware 2004-08-13 19:57:44 +00:00
Makefile * aio.imp was listed twice 2004-08-27 17:24:25 +00:00
Makefile.fpc * aio.imp was listed twice 2004-08-27 17:24:25 +00:00
mouse.pp * old logs removed and tabs fixed 2002-09-07 16:01:16 +00:00
ndpsrpc.imp * moved rtl/netware/nwimp/*.imp to rtl/netware 2004-08-13 19:57:44 +00:00
netnlm32.imp * moved rtl/netware/nwimp/*.imp to rtl/netware 2004-08-13 19:57:44 +00:00
netware.pp * old logs removed and tabs fixed 2002-09-07 16:01:16 +00:00
nit.imp * moved rtl/netware/nwimp/*.imp to rtl/netware 2004-08-13 19:57:44 +00:00
nlmlib.imp * moved rtl/netware/nwimp/*.imp to rtl/netware 2004-08-13 19:57:44 +00:00
npackoff.inc * removed nwstdio and nwthread 2003-02-22 18:23:26 +00:00
npackon.inc * removed nwstdio and nwthread 2003-02-22 18:23:26 +00:00
nwnit.pp * removed nwstdio and nwthread 2003-02-22 18:23:26 +00:00
nwpre.as * support for fcl, support for linking without debug info 2003-03-25 18:17:54 +00:00
nwpre.pp * old logs removed and tabs fixed 2002-09-07 16:01:16 +00:00
nwprot.pp * changed dir separator from \ to / 2004-08-01 20:02:48 +00:00
nwpsrv3x.imp * moved rtl/netware/nwimp/*.imp to rtl/netware 2004-08-13 19:57:44 +00:00
nwpsrv.imp * moved rtl/netware/nwimp/*.imp to rtl/netware 2004-08-13 19:57:44 +00:00
nwserv.pp * removed cvars because of problems with nlmconv 2003-03-25 18:09:25 +00:00
nwsnut.imp * moved rtl/netware/nwimp/*.imp to rtl/netware 2004-08-13 19:57:44 +00:00
nwsnut.pp * added nwsnut, nwconio and nwthreads for netware 2003-02-16 17:45:08 +00:00
nwsock.inc * added some missing functions 2002-03-08 19:11:02 +00:00
nwsys.inc * changed dir separator from \ to / 2004-08-01 20:02:48 +00:00
prelude.as * support for fcl, support for linking without debug info 2003-03-25 18:17:54 +00:00
qos.inc * old logs removed and tabs fixed 2002-09-07 16:01:16 +00:00
README * makefiles regenerated 2004-09-04 23:33:38 +00:00
requestr.imp * moved rtl/netware/nwimp/*.imp to rtl/netware 2004-08-13 19:57:44 +00:00
sockets.pp make netware rtl compilable under 1.9.5 2004-07-30 15:05:25 +00:00
socklib.imp * moved rtl/netware/nwimp/*.imp to rtl/netware 2004-08-13 19:57:44 +00:00
streams.imp * moved rtl/netware/nwimp/*.imp to rtl/netware 2004-08-13 19:57:44 +00:00
system.pp + added maxExitCode to all System.pp 2004-09-03 19:25:21 +00:00
systhrds.pp make netware rtl compilable under 1.9.5 2004-07-30 15:05:25 +00:00
sysutils.pp * changed dir separator from \ to / 2004-08-01 20:02:48 +00:00
threads.imp * moved rtl/netware/nwimp/*.imp to rtl/netware 2004-08-13 19:57:44 +00:00
tli.imp * moved rtl/netware/nwimp/*.imp to rtl/netware 2004-08-13 19:57:44 +00:00
tthread.inc make netware rtl compilable under 1.9.5 2004-07-30 15:05:25 +00:00
varutils.pp * old logs removed and tabs fixed 2002-09-07 16:01:16 +00:00
video.pp * old logs removed and tabs fixed 2002-09-07 16:01:16 +00:00
vollib.imp * moved rtl/netware/nwimp/*.imp to rtl/netware 2004-08-13 19:57:44 +00:00
winsock.pp * THandle in sysutils common using System.THandle 2003-10-25 23:42:35 +00:00
ws2_32.imp * moved rtl/netware/nwimp/*.imp to rtl/netware 2004-08-13 19:57:44 +00:00
ws2nlm.imp * moved rtl/netware/nwimp/*.imp to rtl/netware 2004-08-13 19:57:44 +00:00

    News
    ====

    2004/08/01 armin:
     - lot of fixes, compiler can compile itself on a netware server
    2003/02/16 armin:
     - added nwconio, nwthreads, nwsnut
    2003/02/15 armin:
     - changes for new threadvars
    2002/02/27 armin:
     - changes for current fpc 1.1
    2001/04/16 armin:
     - implemented CRT and SYSUTILS
     - nwimp/convertimp to convert .imp files to unix
    2001/05/26 armin:
     - successfuly compiled binutils for win32 under linux. Patched nlmconv
       for win32 available. This makes it possible to use FPC to create NLM's
       unter win32.



    General
    =======

    Currently generating NetWare-NLM's only work under Linux and win32. (may be under bsd also)
    For Win32 you need a win32 compiled binutils with netware target enabled. Because nlmconv
    only works with elf objects, elf support in binutils is also needed.


    Binutils with netware-support needed
    ====================================

    You need a version of binutils compiled with netware-support. (nlmconv has to be present)
    Unfortunately in the Linux distibutions this component of the binutils is not included
    so you have to compile it. So download the latest stable binutils package from your
    favourite GNU mirror, decompress it ('tar xfz binutils-x.yy.z.tar.gz' on unices
    with GNU tar), change to the binutils-x.yy.z directory and configure:

      ./configure --prefix=/usr --enable-shared --enable-targets=i386-netware,i386-linux

    I used the prefix /usr because thats the default location on redhat (thats what I'm using)

    and use

      make
      make install

    to build and install binutils. To check that netware is supported by the version of binutils
    installed, use ld --version. The emulation 'i386nw' must be present. Also check that nlmconv
    is present and can be started without specifying the complete path of nlmconv.

    You can find more information and a binary version of binutils with netware-support for
    linux on:
           http://home.sch.bme.hu/~keresztg/novell/howto/NLM-Linux-HOWTO.html.

    Binutils-2.11 for win32 and RedHat 7.2 with netware support and a patched nlmconv
    that supports "copyright" are available from:
           http://home.arcor.de/armin.diehl/fpcnw
	  
    The copyright-patch is included in newer versions of binutils (2.13)


    Building the freepascal runtime-library for netware
    ===================================================

    Install the current fpc sources from ftp.freepascal.org and change to the directory
    rtl/netware under the freepascal sourcetree. Verify the path of your units in
    Makefile. The default is /usr/lib/fpc/1.9.5/units/netware/rtl.
    Compile and install the rtl with

      make install

    Settings and needed files to compile for netware
    ================================================

    Edit your /etc/fpc.cfg and add the rtl source path for netware. This are my settings,
    you may paste it to your fpc.cfg:

#IFDEF Netware
  -Fu/usr/lib/fpc/1.9.5/units/netware/rtl
  -Fl/usr/lib/fpc/1.9.5/units/netware/rtl
#ENDIF

    This adds the search path for the rtl-units as well as for the needed import-files.
    You can use the import files from the rtl/netware directory, they are automaticly
    installed. If you want to use import files from novell, be aware that you have to
    convert the files to unix format (i.e. with dos2unix).

    Building the first nlm
    ======================

    Ok, now you have installed all needed files, try the following program and compile it
    with

      ppc386 -Tnetware hello.pas

    PROGRAM Hello;
    {$Description The FreePascal HelloWorld for Netware}
    {$Version 1.0.0}
    {$Copyright Copyright (c) 2001 The FreePascal Development Team}
    {$Screenname The Pascal Hello World for Netware}

    BEGIN
      WriteLn ('This is open source ! FreePascal for netware');
    END.

    Hints on using freepascal for nlm's
    ===================================

    - Compiler Switches for Netware
      -----------------------------
      The following compiler-swiches are supported for NetWare:
      $DESCRIPTION    : NLM-Description, will be displayed at load-time
      $M              : For Stack-Size. Heap-Size will be ignored
      $VERSION x.x.x  : Sets Major, Minor and Revision, Revision 0 is nothing, 1=a, 2=b ...
      $COPYRIGHT      : Sets Copyright, needs a patched nlmconv, patch is
                        available at the location for binutils-win32 shown
                        above.
      $SCREENNAME     : Sets the screen-name (i.e. shown in ctrl-esc screen)
                        $SCREENNAME DEFAULT : output to logger screen
			$SCREENNAME NONE    : no output at all
			$SCREENNAME MyScreen: Name the screen "MyScreen"
      $THREADNAME     : Sets the thread name (dont use names that are to long
                        for netware, that will prevent your nlm from loading)

    - Exports
      -------

      Exports will be handled like in win32:
      procedure bla; CDECL; EXPORT;
      begin
      end;

      exports bla name 'bla';

      Be aware that without Name 'bla' this will be exported in upper-case.

    - Netware import (.imp) files
      ---------------------------

      Import files are needed by nlmconv as with other netware linkers. FreePascal is
      searching import files via the specified library path (-Fl). If you plan to use
      import files from novell be aware that they have to be converted from CR/LF to
      LF only. The script 'convertimp' in rtl/netware/nwimp will do that.
      If a module name is specified in an import, the module is automaticly
      declared as autoload by FreePascal.

      I.e. the following declaration needs nlmlib.imp and sets nlmlib.nlm as autoload:

        FUNCTION rmdir (path : PCHAR) : LONGINT; CDECL; EXTERNAL 'nlmlib.nlm' NAME 'rmdir';

      while the following declaration only imports the symbol without autoloading:

        FUNCTION rmdir (path : PCHAR) : LONGINT; CDECL; EXTERNAL;

      If nlmlib.nlm is not loaded while loading your nlm, you will get an error about
      unknown symbols.


    - Debugging
      ---------

      Debugging is possible with gdb on Netware 4.11, 5, 6 and 6.5.
      See http://home.arcor.de/armin.diehl/fpcnw/gdbnw.html for details
      

    - Netware SDK
      -----------

      Delphi declarations for the multiplattform api is available at
      http://developer.novell.com. You can download the sdk after registering
      as a developer.
      The files are designed for win32 so they will not work off the box.
      I think changing the dll-name to the corrosponding nlm-name will work.
      i.e. in calwin32.imp the following declaration:

        function NWAbortServicingQueueJob2;  StdCall; external 'calwin32.dll' index 231;

       has to be changed to

        function NWAbortServicingQueueJob2;  CDecl; external 'calwin32.nlm';

    - FreePascal RTL
      --------------

      Currently the following units are available for netware:

        - SYSTEM
        - CRT
        - DOS
        - SYSUTILS
        - STRINGS
        - KEYBOARD
        - VIDEO
        - MATH
        - TYPINFO
        - OBJECTS
        - GETOPTS
        - HEAPTRC
        - VARUTILS
        - CPU
        - MMX
	- WinSock2
	- SYSTHRDS
	- nwconio
	- nwthreads
	- nwsnut


armin@freepascal.org