home *** CD-ROM | disk | FTP | other *** search
- LIB2DLL v1.00 28-06-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
-
-
- 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.
-
- /EXT=<ExtFile> Create list of unresolved external references as a
- Clipper #include file. 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 notes on filtering out symbols. The
- default extension is .EXT.
-
- /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.
-
- @<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.
-
- To reduce the number of unnecessary external references BLI2DLL ignores any
- which are not in uppercase or more than 10 characters in length. Clipper
- converts all external references to uppercase and truncates them 10
- characters.
-
- I don't feel this is an ideal situation and I am considering adding the
- following options :
-
- The ability to split external references into several include files,
- eg. Place the first 100 symbols in <ExtFile>.001, the next 100 in
- <ExtFile>.002, etc.
-
- Filter out specific symbols or groups of symbols using wildcards,
- eg. _par*, _ret*, _stor*, _gt*, etc.
-
- The ideal solution would be to tell Blinker directly to link in the specified
- symbols, but this does not seem to be an option.
-
- Anyone have any ideas ?
-
-
- 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.
-