home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 25 / IOPROG_25.ISO / SOFT / LIB2DLL.ZIP / LIB2DLL.TXT < prev   
Encoding:
Text File  |  1996-06-28  |  6.7 KB  |  178 lines

  1.                                 LIB2DLL v1.00                   28-06-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. Command line options
  28. ====================
  29.  
  30. LIB2DLL can process command line options in any order.  All options must be 
  31. separated by a space.  If any option requires embedded spaces the ENTIRE 
  32. command must be placed in double quotes, Eg. : "/LINK=OUTPUT C:\DLLS\MYDLL"
  33.  
  34. Usage : LIB2DLL [<Path>]<LibFile> /LNK=<DLLScript> [<Optional commands>]
  35.  
  36.         <LibFile>       List of .LIB or .OBJ files - You MUST specify the 
  37.                         extension.  Can include the path and wild cards.  If 
  38.                         no path is specified the OBJ and LIB environment 
  39.                         variables are used to search for the files.
  40.  
  41.                         Note : *.OBJ will process ALL .OBJ files found in the 
  42.                         OBJ and LIB paths ! - Use .\*.OBJ to process all file 
  43.                         in the current directory only.
  44.  
  45.         <DLLScript>     Name of Blinker 4 script file to create.  Any existing 
  46.                         file is overwritten.  The default extension is .LNK.
  47.  
  48. Optional commands :
  49.  
  50.         /DLL=<DLLFile>  Name of DLL file.  This is used by the "LIBRARY" 
  51.                         command in the DEFBEGIN/DEFEND block.  Defaults 
  52.                         to <DLLScript>.DLL.
  53.  
  54.         /EXT=<ExtFile>  Create list of unresolved external references as a 
  55.                         Clipper #include file.  A "REQUEST" command is 
  56.                         generated for each symbol.  By including this file in 
  57.                         one of the main program's .PRG files ensures that all 
  58.                         external functions required by the .DLL will be linked 
  59.                         into the .EXE.  Unfortunately if there are too many 
  60.                         external references Clipper will generate a C3002 
  61.                         error.  See notes on filtering out symbols.  The 
  62.                         default extension is .EXT.
  63.  
  64.         /FILE=<File>    Add "FILE <ObjFile>" command to script file.  The file 
  65.                         is not processed by LIB2DLL in any other way.  This 
  66.                         can be used to specify the .DLL handler : BLDCLP5x.OBJ
  67.  
  68.         /NOFILEPATH     Do not include paths of .LIB and .OBJ file in 
  69.                         <DLLScript>
  70.  
  71.         /LINK=<Command> Extra linker command to be placed in <DLLScript>, 
  72.                         Eg. : "/LINK=BLI EXEC COMPRESS" - If specified on the 
  73.                         command line everything including /LINK must be 
  74.                         enclosed in quotes.
  75.  
  76.         /DEF=<Command>  Extra command to be placed between DEFBEGIN/DEFEND 
  77.                         script statements.
  78.  
  79.         @<RespFile>     Process commands and files in <RespFile>.  Each 
  80.                         command or file must be on a separate line, but quotes 
  81.                         are not required around embedded spaces.  Files can be 
  82.                         nested.  If the file LIB2DLL.CFG exists in the current 
  83.                         directory or the directory where LIB2DLL.EXE is 
  84.                         located it is processed as a default response file.
  85.  
  86.  
  87. Example :
  88.  
  89.         LIB2DLL \LIB\MYLIB.LIB /LNK=MYDLL.LNK "/LINK=OUTPUT C:\DLLS\MYDLL"
  90.  
  91. produces a file called MYDLL.LNK which contains :
  92.  
  93.         OUTPUT C:\DLLS\MYDLL
  94.         FILE \LIB\MYLIB.LIB
  95.         
  96.         DEFBEGIN
  97.            LIBRARY MYDLL
  98.            
  99.            EXPORTS
  100.               <Symbol 1>
  101.               <Symbol 2>
  102.               <Symbol n>
  103.         DEFEND
  104.  
  105. The actual .DLL file can be built using :
  106.  
  107.         BLINKER @MYDLL.LNK FI BLDCLP53 NODEFLIB BLI EXEC EXT BLI EXEC NODEL
  108.  
  109.  
  110. LIB2DLL.CFG file
  111. ================
  112.  
  113. The supplied LIB2DLL.CFG contains the following :
  114.  
  115.         /LINK=// Read from LIB2DLL.CFG
  116.         /LINK=NODEFLIB
  117.         /LINK=BLINKER EXECUTABLE NODELETE
  118.         /LINK=BLINKER EXECUTABLE EXTENDED
  119.  
  120.         /FILE=BLDCLP53
  121.  
  122. These commands are required for all .DLL script files.
  123.  
  124.  
  125. Use LIB2DLL.EXE in a .RMK file
  126. ==============================
  127.  
  128. The following RMAKE rule allows a .LIB file to be converted to a .DLL 
  129. automatically.
  130.  
  131.    .LIB.DLL:
  132.         LIB2DLL $** /LNK=$*.DNK /EXT=$*.EXT
  133.         BLINKER NOBELL OUTPUT $@ @$*.DNK
  134.         BLILIB /ID $@ /OI $*.DEF /NP
  135.         DEL $*.DNK
  136.  
  137. I named the script file .DNK so it does not overwrite any existing .LNK file 
  138. of the same name.  
  139.  
  140. I have also created a .DEF file rather than an import .LIB file for the same 
  141. reason.  To inform Blinker about the .DLL file use the DEFFILE command in the 
  142. .EXE's link script.
  143.  
  144.  
  145. Filtering external references
  146. =============================
  147.  
  148. Unfortunately if there are too many external references, I estimate about 200, 
  149. Clipper will generate a C3002 error.  I'm not sure if this is a 'limitation'
  150. with Clipper or the .OBJ file format in general.
  151.  
  152. To reduce the number of unnecessary external references BLI2DLL ignores any 
  153. which are not in uppercase or more than 10 characters in length.  Clipper 
  154. converts all external references to uppercase and truncates them 10 
  155. characters.
  156.  
  157. I don't feel this is an ideal situation and I am considering adding the 
  158. following options :
  159.  
  160.         The ability to split external references into several include files, 
  161.         eg. Place the first 100 symbols in <ExtFile>.001, the next 100 in 
  162.         <ExtFile>.002, etc.
  163.         
  164.         Filter out specific symbols or groups of symbols using wildcards,
  165.         eg. _par*, _ret*, _stor*, _gt*, etc.
  166.  
  167. The ideal solution would be to tell Blinker directly to link in the specified 
  168. symbols, but this does not seem to be an option.
  169.  
  170. Anyone have any ideas ?
  171.  
  172.  
  173. Liability disclaimer
  174. ====================
  175.  
  176. This program is free to use as you see fit, but it comes with no guarantees 
  177. and I will not be held responsible for any damages caused.
  178.