home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 21 / IOPROG_21.ISO / SOFT / L2D101.ZIP / LIB2DLL.TXT < prev   
Encoding:
Text File  |  1996-08-11  |  8.8 KB  |  215 lines

  1.                                 LIB2DLL v1.01                   11-08-96
  2.                                 =============
  3.  
  4. Introduction
  5. ============
  6.  
  7. LIB2DLL.EXE is a utility to help convert existing .LIB files to Blinker v4 
  8. .DLL files.  It works by extracting all the public symbols, ie function and 
  9. procedure names, from a list of .LIB or .OBJ files and creating a script file 
  10. which can used by Blinker to create the .DLL file.  The script file's EXPORTS 
  11. section will contain all the public symbols found in the .LIB and .OBJ files.
  12.  
  13. It can be used as a one-off way to build a script file, or within a makefile 
  14. to automatically build a .DLL when ever the library changes.
  15.  
  16. This program is freeware.  Its is written in Clipper 5.3a and Linked using 
  17. Blinker 4 protected mode.
  18.  
  19. I would like to thank the person who uploaded the file BLDLL.TXT onto the 
  20. Clipper forum, which help me enormously.
  21.  
  22. Please address any comments to me at : CIS:100265,753 or CIS:100776,3613
  23.  
  24. Sean Kneller
  25.  
  26.  
  27. Changes from 1.00
  28. =================
  29.  
  30. 1.      Fixed a bug which occasionally caused garbage EXPORT labels to be 
  31.         generated.  This was caused by some PUBDEF records in a library being 
  32.         prefixed with two extra null bytes (I don't know why).  I've have only 
  33.         found this to occur in CLIPPER.LIB version 5.2e.
  34.  
  35. 2.      Automatic filtering of external references has been removed.
  36.  
  37. 3.      New option : /EXTFILTER to filter out groups of external references 
  38.         using wild cards.
  39.  
  40. 4.      New option : /EXTMAX to split the external reference list across 
  41.         multiple files.
  42.  
  43. 5.      New option : /EXTLEN to filter out external reference symbol names 
  44.         above a specified length.
  45.  
  46. 6.      New option : /EXTNOLOWER to filter out external reference symbol names 
  47.         which contain lowercase characters.
  48.  
  49. 7.      New option : /EXTPROC to generate dummy PROCEDURES in external 
  50.         reference files.
  51.  
  52.  
  53. Command line options
  54. ====================
  55.  
  56. LIB2DLL can process command line options in any order.  All options must be 
  57. separated by a space.  If any option requires embedded spaces the ENTIRE 
  58. command must be placed in double quotes, Eg. : "/LINK=OUTPUT C:\DLLS\MYDLL"
  59.  
  60. Usage : LIB2DLL [<Path>]<LibFile> /LNK=<DLLScript> [<Optional commands>]
  61.  
  62.    <LibFile>            List of .LIB or .OBJ files - You MUST specify the 
  63.                         extension.  Can include the path and wild cards.  If 
  64.                         no path is specified the OBJ and LIB environment 
  65.                         variables are used to search for the files.
  66.                         
  67.                         Note : *.OBJ will process ALL .OBJ files found in the 
  68.                         OBJ and LIB paths ! - Use .\*.OBJ to process all file 
  69.                         in the current directory only.
  70.                         
  71.    <DLLScript>          Name of Blinker 4 script file to create.  Any existing 
  72.                         file is overwritten.  The default extension is .LNK.
  73.  
  74. Optional commands :
  75.  
  76.    /DLL=<DLLFile>       Name of DLL file.  This is used by the "LIBRARY" 
  77.                         command in the DEFBEGIN/DEFEND block.  Defaults 
  78.                         to <DLLScript>.DLL.
  79.                         
  80.    /FILE=<File>         Add "FILE <ObjFile>" command to script file.  The file 
  81.                         is not processed by LIB2DLL in any other way.  This 
  82.                         can be used to specify the .DLL handler : BLDCLP5x.OBJ
  83.                         
  84.    /NOFILEPATH          Do not include paths of .LIB and .OBJ file in 
  85.                         <DLLScript>
  86.                         
  87.    /LINK=<Command>      Extra linker command to be placed in <DLLScript>, 
  88.                         Eg. : "/LINK=BLI EXEC COMPRESS" - If specified on the 
  89.                         command line everything including /LINK must be 
  90.                         enclosed in quotes.
  91.                         
  92.    /DEF=<Command>       Extra command to be placed between DEFBEGIN/DEFEND 
  93.                         script statements.
  94.                         
  95.    /EXT=<ExtFile>       Create list of unresolved external references as a 
  96.                         Clipper #include file or .PRG file (See /EXTPROC).  
  97.                         A "REQUEST" command is generated for each symbol.  By 
  98.                         including this file in one of the main program's .PRG 
  99.                         files ensures that all external functions required by 
  100.                         the .DLL will be linked into the .EXE.  Unfortunately 
  101.                         if there are too many external references Clipper will 
  102.                         generate a C3002 error.  See the /EXTMAX command and 
  103.                         notes on filtering out symbols.  The default extension 
  104.                         is .EXT.
  105.                         
  106.    /EXTMAX=<nMaxFile>   Create multiple .EXT files with a maximum of 
  107.                         <nMaxFile> REQUESTs in each file.  Each .EXT file is 
  108.                         number sequentially from 1.  When using this option 
  109.                         /EXT=<ExtFile> must contain at least one hash (#) 
  110.                         symbol to indicate the position to insert the filename 
  111.                         numbers and the number digits to use, Eg. LIB# 
  112.                         generates LIB1, LIB2, etc, LIB.### generates LIB.001, 
  113.                         LIB.002, etc.
  114.  
  115.    /EXTFILTER=<Filter>  Exclude external reference label names which match 
  116.                         <Filter>.  <Filter> can include wild cards, 
  117.                         eg. /EXTFILTER=_* would exclude all symbols starting 
  118.                         with a underscore.  Multiple /EXTFILTER commands can 
  119.                         be specified on the command line or in a response file.
  120.  
  121.    /EXTLEN=<nMaxLen>    Exclude any external reference label names which are 
  122.                         longer than <nMaxLen>.
  123.  
  124.    /EXTNOLOWER          Only include external reference label names which are 
  125.                         entirely uppercase.
  126.  
  127.    /EXTPROC             Generate a dummy PROCEDURE statement inside each .EXT 
  128.                         file called <ExtFile>.  This allows the file to be 
  129.                         complied and linked into the .EXE rather than 
  130.                         #include'd in another .PRG file.
  131.  
  132.    @<RespFile>          Process commands and files in <RespFile>.  Each 
  133.                         command or file must be on a separate line, but quotes 
  134.                         are not required around embedded spaces.  Files can be 
  135.                         nested.  If the file LIB2DLL.CFG exists in the current 
  136.                         directory or the directory where LIB2DLL.EXE is 
  137.                         located it is processed as a default response file.
  138.  
  139.  
  140. Example :
  141.  
  142.         LIB2DLL \LIB\MYLIB.LIB /LNK=MYDLL.LNK "/LINK=OUTPUT C:\DLLS\MYDLL"
  143.  
  144. produces a file called MYDLL.LNK which contains :
  145.  
  146.         OUTPUT C:\DLLS\MYDLL
  147.         FILE \LIB\MYLIB.LIB
  148.         
  149.         DEFBEGIN
  150.            LIBRARY MYDLL
  151.            
  152.            EXPORTS
  153.               <Symbol 1>
  154.               <Symbol 2>
  155.               <Symbol n>
  156.         DEFEND
  157.  
  158. The actual .DLL file can be built using :
  159.  
  160.         BLINKER @MYDLL.LNK FI BLDCLP53 NODEFLIB BLI EXEC EXT BLI EXEC NODEL
  161.  
  162.  
  163. LIB2DLL.CFG file
  164. ================
  165.  
  166. The supplied LIB2DLL.CFG contains the following :
  167.  
  168.         /LINK=// Read from LIB2DLL.CFG
  169.         /LINK=NODEFLIB
  170.         /LINK=BLINKER EXECUTABLE NODELETE
  171.         /LINK=BLINKER EXECUTABLE EXTENDED
  172.  
  173.         /FILE=BLDCLP53
  174.  
  175. These commands are required for all .DLL script files.
  176.  
  177.  
  178. Use LIB2DLL.EXE in a .RMK file
  179. ==============================
  180.  
  181. The following RMAKE rule allows a .LIB file to be converted to a .DLL 
  182. automatically.
  183.  
  184.    .LIB.DLL:
  185.         LIB2DLL $** /LNK=$*.DNK /EXT=$*.EXT
  186.         BLINKER NOBELL OUTPUT $@ @$*.DNK
  187.         BLILIB /ID $@ /OI $*.DEF /NP
  188.         DEL $*.DNK
  189.  
  190. I named the script file .DNK so it does not overwrite any existing .LNK file 
  191. of the same name.  
  192.  
  193. I have also created a .DEF file rather than an import .LIB file for the same 
  194. reason.  To inform Blinker about the .DLL file use the DEFFILE command in the 
  195. .EXE's link script.
  196.  
  197.  
  198. Filtering external references
  199. =============================
  200.  
  201. Unfortunately if there are too many external references, I estimate about 200, 
  202. Clipper will generate a C3002 error.  I'm not sure if this is a 'limitation'
  203. with Clipper or the .OBJ file format in general.  
  204.  
  205. This problem can be overcome splitting the external reference list into 
  206. separate files using /EXTMAX and/or filtering out unnecessary symbols using 
  207. /EXTFILTER, /EXTLEN and /EXTNOLOWER.
  208.  
  209.  
  210. Liability disclaimer
  211. ====================
  212.  
  213. This program is free to use as you see fit, but it comes with no guarantees 
  214. and I will not be held responsible for any damages caused.
  215.