home *** CD-ROM | disk | FTP | other *** search
- LIB2DLL v1.01 11-08-96
- =============
-
- Introduction
- ============
-
- LIB2DLL.EXE is a utility to help convert existing .LIB files to Blinker v4
- .DLL files. It works by extracting all the public symbols, ie function and
- procedure names, from a list of .LIB or .OBJ files and creating a script file
- which can used by Blinker to create the .DLL file. The script file's EXPORTS
- section will contain all the public symbols found in the .LIB and .OBJ files.
-
- It can be used as a one-off way to build a script file, or within a makefile
- to automatically build a .DLL when ever the library changes.
-
- This program is freeware. Its is written in Clipper 5.3a and Linked using
- Blinker 4 protected mode.
-
- I would like to thank the person who uploaded the file BLDLL.TXT onto the
- Clipper forum, which help me enormously.
-
- Please address any comments to me at : CIS:100265,753 or CIS:100776,3613
-
- Sean Kneller
-
-
- Changes from 1.00
- =================
-
- 1. Fixed a bug which occasionally caused garbage EXPORT labels to be
- generated. This was caused by some PUBDEF records in a library being
- prefixed with two extra null bytes (I don't know why). I've have only
- found this to occur in CLIPPER.LIB version 5.2e.
-
- 2. Automatic filtering of external references has been removed.
-
- 3. New option : /EXTFILTER to filter out groups of external references
- using wild cards.
-
- 4. New option : /EXTMAX to split the external reference list across
- multiple files.
-
- 5. New option : /EXTLEN to filter out external reference symbol names
- above a specified length.
-
- 6. New option : /EXTNOLOWER to filter out external reference symbol names
- which contain lowercase characters.
-
- 7. New option : /EXTPROC to generate dummy PROCEDURES in external
- reference files.
-
-
- Command line options
- ====================
-
- LIB2DLL can process command line options in any order. All options must be
- separated by a space. If any option requires embedded spaces the ENTIRE
- command must be placed in double quotes, Eg. : "/LINK=OUTPUT C:\DLLS\MYDLL"
-
- Usage : LIB2DLL [<Path>]<LibFile> /LNK=<DLLScript> [<Optional commands>]
-
- <LibFile> List of .LIB or .OBJ files - You MUST specify the
- extension. Can include the path and wild cards. If
- no path is specified the OBJ and LIB environment
- variables are used to search for the files.
-
- Note : *.OBJ will process ALL .OBJ files found in the
- OBJ and LIB paths ! - Use .\*.OBJ to process all file
- in the current directory only.
-
- <DLLScript> Name of Blinker 4 script file to create. Any existing
- file is overwritten. The default extension is .LNK.
-
- Optional commands :
-
- /DLL=<DLLFile> Name of DLL file. This is used by the "LIBRARY"
- command in the DEFBEGIN/DEFEND block. Defaults
- to <DLLScript>.DLL.
-
- /FILE=<File> Add "FILE <ObjFile>" command to script file. The file
- is not processed by LIB2DLL in any other way. This
- can be used to specify the .DLL handler : BLDCLP5x.OBJ
-
- /NOFILEPATH Do not include paths of .LIB and .OBJ file in
- <DLLScript>
-
- /LINK=<Command> Extra linker command to be placed in <DLLScript>,
- Eg. : "/LINK=BLI EXEC COMPRESS" - If specified on the
- command line everything including /LINK must be
- enclosed in quotes.
-
- /DEF=<Command> Extra command to be placed between DEFBEGIN/DEFEND
- script statements.
-
- /EXT=<ExtFile> Create list of unresolved external references as a
- Clipper #include file or .PRG file (See /EXTPROC).
- A "REQUEST" command is generated for each symbol. By
- including this file in one of the main program's .PRG
- files ensures that all external functions required by
- the .DLL will be linked into the .EXE. Unfortunately
- if there are too many external references Clipper will
- generate a C3002 error. See the /EXTMAX command and
- notes on filtering out symbols. The default extension
- is .EXT.
-
- /EXTMAX=<nMaxFile> Create multiple .EXT files with a maximum of
- <nMaxFile> REQUESTs in each file. Each .EXT file is
- number sequentially from 1. When using this option
- /EXT=<ExtFile> must contain at least one hash (#)
- symbol to indicate the position to insert the filename
- numbers and the number digits to use, Eg. LIB#
- generates LIB1, LIB2, etc, LIB.### generates LIB.001,
- LIB.002, etc.
-
- /EXTFILTER=<Filter> Exclude external reference label names which match
- <Filter>. <Filter> can include wild cards,
- eg. /EXTFILTER=_* would exclude all symbols starting
- with a underscore. Multiple /EXTFILTER commands can
- be specified on the command line or in a response file.
-
- /EXTLEN=<nMaxLen> Exclude any external reference label names which are
- longer than <nMaxLen>.
-
- /EXTNOLOWER Only include external reference label names which are
- entirely uppercase.
-
- /EXTPROC Generate a dummy PROCEDURE statement inside each .EXT
- file called <ExtFile>. This allows the file to be
- complied and linked into the .EXE rather than
- #include'd in another .PRG file.
-
- @<RespFile> Process commands and files in <RespFile>. Each
- command or file must be on a separate line, but quotes
- are not required around embedded spaces. Files can be
- nested. If the file LIB2DLL.CFG exists in the current
- directory or the directory where LIB2DLL.EXE is
- located it is processed as a default response file.
-
-
- Example :
-
- LIB2DLL \LIB\MYLIB.LIB /LNK=MYDLL.LNK "/LINK=OUTPUT C:\DLLS\MYDLL"
-
- produces a file called MYDLL.LNK which contains :
-
- OUTPUT C:\DLLS\MYDLL
- FILE \LIB\MYLIB.LIB
-
- DEFBEGIN
- LIBRARY MYDLL
-
- EXPORTS
- <Symbol 1>
- <Symbol 2>
- <Symbol n>
- DEFEND
-
- The actual .DLL file can be built using :
-
- BLINKER @MYDLL.LNK FI BLDCLP53 NODEFLIB BLI EXEC EXT BLI EXEC NODEL
-
-
- LIB2DLL.CFG file
- ================
-
- The supplied LIB2DLL.CFG contains the following :
-
- /LINK=// Read from LIB2DLL.CFG
- /LINK=NODEFLIB
- /LINK=BLINKER EXECUTABLE NODELETE
- /LINK=BLINKER EXECUTABLE EXTENDED
-
- /FILE=BLDCLP53
-
- These commands are required for all .DLL script files.
-
-
- Use LIB2DLL.EXE in a .RMK file
- ==============================
-
- The following RMAKE rule allows a .LIB file to be converted to a .DLL
- automatically.
-
- .LIB.DLL:
- LIB2DLL $** /LNK=$*.DNK /EXT=$*.EXT
- BLINKER NOBELL OUTPUT $@ @$*.DNK
- BLILIB /ID $@ /OI $*.DEF /NP
- DEL $*.DNK
-
- I named the script file .DNK so it does not overwrite any existing .LNK file
- of the same name.
-
- I have also created a .DEF file rather than an import .LIB file for the same
- reason. To inform Blinker about the .DLL file use the DEFFILE command in the
- .EXE's link script.
-
-
- Filtering external references
- =============================
-
- Unfortunately if there are too many external references, I estimate about 200,
- Clipper will generate a C3002 error. I'm not sure if this is a 'limitation'
- with Clipper or the .OBJ file format in general.
-
- This problem can be overcome splitting the external reference list into
- separate files using /EXTMAX and/or filtering out unnecessary symbols using
- /EXTFILTER, /EXTLEN and /EXTNOLOWER.
-
-
- Liability disclaimer
- ====================
-
- This program is free to use as you see fit, but it comes with no guarantees
- and I will not be held responsible for any damages caused.
-