README.txt 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179
  1. General
  2. =======
  3. Currently generating NetWare-NLM's only work under Linux and win32. (may work under other
  4. unix versions also but this is not tested yet)
  5. Binutils with netware-support needed
  6. ====================================
  7. You need a version of binutils compiled with netware-support. As of FreePascal 1.9.5 Nov 2004
  8. binutils needs to be named i386-netware-* (i.e. i386-netware-ld, i386-netware-nlmconv).
  9. Unfortunately in the Linux distibutions this component of the binutils is not included
  10. so you have to compile it. So download the latest stable binutils package from your
  11. favourite GNU mirror, decompress it ('tar xfz binutils-x.yy.z.tar.gz' on unices
  12. with GNU tar), change to the binutils-x.yy.z directory and configure:
  13. ./configure --prefix=/usr --enable-shared --enable-target=i386-netware
  14. I used the prefix /usr because thats the default location on redhat (thats what I'm using)
  15. and use
  16. make
  17. make install
  18. to build and install binutils. To check that netware is supported by the version of binutils
  19. installed, use i386-netware-ld --version. The emulation 'i386nw' must be present. Also check that
  20. i386-netware-nlmconv
  21. is present and can be started without specifying the complete path of i386-netware-nlmconv.
  22. You can find more information and a binary version of binutils with netware-support for
  23. linux on:
  24. http://home.sch.bme.hu/~keresztg/novell/howto/NLM-Linux-HOWTO.html.
  25. Binutils for win32 and Fedora Core 2 are available from:
  26. ftp://ftp.freepascal.org/pub/fpc/contrib/cross
  27. Building the freepascal runtime-library for netware
  28. ===================================================
  29. Install the current fpc sources from ftp.freepascal.org and change to the directory
  30. rtl/netware under the freepascal sourcetree. Verify the path of your units in
  31. Makefile. The default is /usr/lib/fpc/1.9.5/units/i386-netware/*.
  32. Compile and install the rtl with
  33. make install
  34. This will install the basic rtl files. To install all (packages,fcl and nlm's) do a
  35. make OS_TARGET=netware build
  36. and
  37. make OS_TARGET=netware install
  38. at the fpc source root dir.
  39. Settings and needed files to compile for netware
  40. ================================================
  41. Edit your /etc/fpc.cfg and add the rtl source path for netware. This are my settings,
  42. you may paste it to your fpc.cfg:
  43. #IFDEF Netware_clib
  44. -Fu/usr/lib/fpc/1.9.5/units/i386-netware/*
  45. -Fl/usr/lib/fpc/1.9.5/units/i386-netware/rtl
  46. #ENDIF
  47. #IFDEF Netware_libc
  48. -Fu/usr/lib/fpc/1.9.5/units/i386-netwlibc/*
  49. -Fl/usr/lib/fpc/1.9.5/units/i386-netwlibc/rtl
  50. -XPi386-netware-
  51. #ENDIF
  52. This adds the search path for the rtl-units as well as for the needed import-files.
  53. You can use the import files from the rtl/netware directory, they are automatically
  54. installed. If you want to use import files from novell, be aware that you have to
  55. convert the files to unix format (i.e. with dos2unix).
  56. Building the first nlm
  57. ======================
  58. Ok, now you have installed all needed files, try the following program and compile it
  59. with
  60. ppc386 -Tnetware hello.pas
  61. PROGRAM Hello;
  62. {$Description The FreePascal HelloWorld for Netware}
  63. {$Version 1.0.0}
  64. {$Copyright Copyright (c) 2001 The FreePascal Development Team}
  65. {$Screenname FPC Hello World for Netware}
  66. BEGIN
  67. WriteLn ('This is open source, FreePascal for netware');
  68. END.
  69. Hints on using freepascal for nlm's
  70. ===================================
  71. - Compiler Switches for Netware
  72. -----------------------------
  73. The following compiler-swiches are supported for NetWare:
  74. $DESCRIPTION : NLM-Description, will be displayed at load-time
  75. $M : For Stack-Size. Heap-Size will be ignored
  76. $VERSION x.x.x : Sets Major, Minor and Revision, Revision 0 is nothing, 1=a, 2=b ...
  77. $COPYRIGHT : Sets Copyright, needs a patched nlmconv, patch is
  78. available at the location for binutils-win32 shown
  79. above.
  80. $SCREENNAME : Sets the screen-name (i.e. shown in ctrl-esc screen)
  81. $SCREENNAME DEFAULT : output to logger screen
  82. $SCREENNAME NONE : no output at all (do not use this, writeln,
  83. even from a runtime error may crash the sever)
  84. $SCREENNAME MyScreen: Name the screen "MyScreen"
  85. $THREADNAME : Sets the thread name (dont use names that are to long
  86. for netware, that will prevent your nlm from loading)
  87. - Exports
  88. -------
  89. Exports will be handled like in win32:
  90. procedure bla; CDECL; EXPORT;
  91. begin
  92. end;
  93. exports bla name 'bla';
  94. Be aware that without Name 'bla' this will be exported in upper-case.
  95. - Netware import (.imp) files
  96. ---------------------------
  97. Import files are needed by nlmconv as with other netware linkers. FreePascal is
  98. searching import files via the specified library path (-Fl). If you plan to use
  99. import files from novell be aware that they have to be converted from CR/LF to
  100. LF only. The script 'convertimp' in rtl/netware/nwimp will do that.
  101. If a module name is specified in an import, the module is automatically
  102. declared as autoload by FreePascal.
  103. I.e. the following declaration needs nlmlib.imp and sets nlmlib.nlm as autoload:
  104. FUNCTION rmdir (path : PCHAR) : LONGINT; CDECL; EXTERNAL 'nlmlib.nlm' NAME 'rmdir';
  105. while the following declaration only imports the symbol without autoloading:
  106. FUNCTION rmdir (path : PCHAR) : LONGINT; CDECL; EXTERNAL;
  107. If nlmlib.nlm is not loaded while loading your nlm, you will get an error about
  108. unknown symbols.
  109. - Debugging
  110. ---------
  111. Debugging is possible with gdb on Netware 4.11, 5, 6 and 6.5.
  112. See http://home.arcor.de/armin.diehl/fpcnw/gdbnw.html for details
  113. - Netware SDK
  114. -----------
  115. Delphi declarations for the multiplattform api is available at
  116. http://developer.novell.com. You can download the sdk after registering
  117. as a developer.
  118. The files are designed for win32 so they will not work off the box.
  119. I think changing the dll-name to the corrosponding nlm-name will work.
  120. i.e. in calwin32.imp the following declaration:
  121. function NWAbortServicingQueueJob2; StdCall; external 'calwin32.dll' index 231;
  122. has to be changed to
  123. function NWAbortServicingQueueJob2; CDecl; external 'calwin32.nlm';
  124. [email protected]