Pierre Muller 603dd63b39 Fix make variable name error: OBJPAS_DEPS_SPU => OBJPAS_DEPS_CPU 1 an în urmă
..
demos b127fc154a * Fixed spell error revealed by lintian. 15 ani în urmă
tests fc32211dd2 * Char -> AnsiChar 2 ani în urmă
Makefile 603dd63b39 Fix make variable name error: OBJPAS_DEPS_SPU => OBJPAS_DEPS_CPU 1 an în urmă
Makefile.fpc cb2d675732 Remove OS specific SYSTEMUNIT variable setting 1 an în urmă
README.txt b127fc154a * Fixed spell error revealed by lintian. 15 ani în urmă
aio.imp e925386393 * moved rtl/netware/nwimp/*.imp to rtl/netware 21 ani în urmă
aio.pp ccfa38c68e * Dotted RTL compiles 2 ani în urmă
audnlm32.imp e925386393 * moved rtl/netware/nwimp/*.imp to rtl/netware 21 ani în urmă
calnlm32.imp e925386393 * moved rtl/netware/nwimp/*.imp to rtl/netware 21 ani în urmă
ccs-os.imp e925386393 * moved rtl/netware/nwimp/*.imp to rtl/netware 21 ani în urmă
ccs.imp e925386393 * moved rtl/netware/nwimp/*.imp to rtl/netware 21 ani în urmă
classes.pp 594090b215 * Add delphi-compatible observers to classes 1 an în urmă
clib.imp 41e0b1a0a7 * added NetWare Alert 20 ani în urmă
clibaux.imp e925386393 * moved rtl/netware/nwimp/*.imp to rtl/netware 21 ani în urmă
clibctx.imp e925386393 * moved rtl/netware/nwimp/*.imp to rtl/netware 21 ani în urmă
clxnlm32.imp e925386393 * moved rtl/netware/nwimp/*.imp to rtl/netware 21 ani în urmă
convertimp e925386393 * moved rtl/netware/nwimp/*.imp to rtl/netware 21 ani în urmă
dos.pp ccfa38c68e * Dotted RTL compiles 2 ani în urmă
dplsv386.imp e925386393 * moved rtl/netware/nwimp/*.imp to rtl/netware 21 ani în urmă
dsapi.imp e925386393 * moved rtl/netware/nwimp/*.imp to rtl/netware 21 ani în urmă
dsevent.imp e925386393 * moved rtl/netware/nwimp/*.imp to rtl/netware 21 ani în urmă
dynlibs.inc ccfa38c68e * Dotted RTL compiles 2 ani în urmă
errno.inc 4ace790492 * remove $Log 20 ani în urmă
initc.pp ccfa38c68e * Dotted RTL compiles 2 ani în urmă
lib0.imp e925386393 * moved rtl/netware/nwimp/*.imp to rtl/netware 21 ani în urmă
locnlm32.imp e925386393 * moved rtl/netware/nwimp/*.imp to rtl/netware 21 ani în urmă
ndpsrpc.imp e925386393 * moved rtl/netware/nwimp/*.imp to rtl/netware 21 ani în urmă
netnlm32.imp e925386393 * moved rtl/netware/nwimp/*.imp to rtl/netware 21 ani în urmă
netware.pp ccfa38c68e * Dotted RTL compiles 2 ani în urmă
nit.imp e925386393 * moved rtl/netware/nwimp/*.imp to rtl/netware 21 ani în urmă
nlmlib.imp e925386393 * moved rtl/netware/nwimp/*.imp to rtl/netware 21 ani în urmă
npackoff.inc 4ace790492 * remove $Log 20 ani în urmă
npackon.inc 4ace790492 * remove $Log 20 ani în urmă
nwcalls.pp ccfa38c68e * Dotted RTL compiles 2 ani în urmă
nwnit.pp ccfa38c68e * Dotted RTL compiles 2 ani în urmă
nwpre.as 50778076c3 initial import 20 ani în urmă
nwpre.imp 03ca42d6e2 nwpre now initializes bss, use linker generated symbol to get address of .text (for lineinfo) 14 ani în urmă
nwpre.pp ccfa38c68e * Dotted RTL compiles 2 ani în urmă
nwprot.pp ccfa38c68e * Dotted RTL compiles 2 ani în urmă
nwpsrv.imp e925386393 * moved rtl/netware/nwimp/*.imp to rtl/netware 21 ani în urmă
nwpsrv3x.imp e925386393 * moved rtl/netware/nwimp/*.imp to rtl/netware 21 ani în urmă
nwserv.pp ccfa38c68e * Dotted RTL compiles 2 ani în urmă
nwsnut.imp e925386393 * moved rtl/netware/nwimp/*.imp to rtl/netware 21 ani în urmă
nwsnut.pp ccfa38c68e * Dotted RTL compiles 2 ani în urmă
nwsock.inc 0135ff90f6 * string -> shortstring 2 ani în urmă
nwsys.inc fc32211dd2 * Char -> AnsiChar 2 ani în urmă
prelude.as 50778076c3 initial import 20 ani în urmă
requestr.imp e925386393 * moved rtl/netware/nwimp/*.imp to rtl/netware 21 ani în urmă
rtldefs.inc da7a67bc74 + FPCRTL_FILESYSTEM_SINGLE_BYTE_API define that is set for targets where we 12 ani în urmă
socklib.imp 50778076c3 initial import 20 ani în urmă
streams.imp e925386393 * moved rtl/netware/nwimp/*.imp to rtl/netware 21 ani în urmă
sysdir.inc fc32211dd2 * Char -> AnsiChar 2 ani în urmă
sysdlh.inc 2d454dc8fa Move DynLibs support to System unit using a manager approach like for Threads, WideStrings, etc.. This is needed so that we can support features like "delayed" and loading of dynamic packages. 10 ani în urmă
sysfile.inc 0f0454a092 Modify references to old syslinux unit in comments 1 an în urmă
sysheap.inc 0c3a2a257d * Convert heap to ptruint. 18 ani în urmă
sysos.inc 4ace790492 * remove $Log 20 ani în urmă
sysosh.inc 3cd4168ab3 + introduce TOSTimestamp 5 ani în urmă
system.pp 0135ff90f6 * string -> shortstring 2 ani în urmă
systhrd.inc fc32211dd2 * Char -> AnsiChar 2 ani în urmă
sysutils.pp ccfa38c68e * Dotted RTL compiles 2 ani în urmă
threads.imp e925386393 * moved rtl/netware/nwimp/*.imp to rtl/netware 21 ani în urmă
tli.imp e925386393 * moved rtl/netware/nwimp/*.imp to rtl/netware 21 ani în urmă
tthread.inc 11b601d44c * TThread.Terminate does not have any platform specific behavior (it should only set FTerminated to true and call TerminatedSet), thus move it to the platform independant part 5 ani în urmă
unicode.imp 50778076c3 initial import 20 ani în urmă
vollib.imp e925386393 * moved rtl/netware/nwimp/*.imp to rtl/netware 21 ani în urmă
ws2_32.imp e925386393 * moved rtl/netware/nwimp/*.imp to rtl/netware 21 ani în urmă
ws2nlm.imp e925386393 * moved rtl/netware/nwimp/*.imp to rtl/netware 21 ani în urmă

README.txt


General
=======

Currently generating NetWare-NLM's only work under Linux and win32. (may work under other
unix versions also but this is not tested yet)


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

You need a version of binutils compiled with netware-support. As of FreePascal 1.9.5 Nov 2004
binutils needs to be named i386-netware-* (i.e. i386-netware-ld, i386-netware-nlmconv).
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-target=i386-netware

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 i386-netware-ld --version. The emulation 'i386nw' must be present. Also check that
i386-netware-nlmconv
is present and can be started without specifying the complete path of i386-netware-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 for win32 and Fedora Core 2 are available from:
ftp://ftp.freepascal.org/pub/fpc/contrib/cross


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/i386-netware/*.
Compile and install the rtl with

make install

This will install the basic rtl files. To install all (packages,fcl and nlm's) do a

make OS_TARGET=netware build

and

make OS_TARGET=netware install

at the fpc source root dir.


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_clib
-Fu/usr/lib/fpc/1.9.5/units/i386-netware/*
-Fl/usr/lib/fpc/1.9.5/units/i386-netware/rtl
#ENDIF

#IFDEF Netware_libc
-Fu/usr/lib/fpc/1.9.5/units/i386-netwlibc/*
-Fl/usr/lib/fpc/1.9.5/units/i386-netwlibc/rtl
-XPi386-netware-
#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 automatically
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 FPC 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 (do not use this, writeln,
even from a runtime error may crash the sever)
$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 automatically
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';

[email protected]