Bochs/bochs-testing/plugin-test
2002-10-12 05:53:39 +00:00
..
test1-static - support VPATH build 2002-10-11 18:32:27 +00:00
test2-dynamic - support VPATH build 2002-10-11 18:32:27 +00:00
test3-twomodules - support VPATH build 2002-10-11 18:32:27 +00:00
test4-interdep - support VPATH build 2002-10-11 18:32:27 +00:00
test5-execsymbols - add some test results and comments 2002-10-12 05:52:55 +00:00
test6-ltdlopen - add test6, which actually tries to open a shared lib with lt_dlopen. 2002-10-12 05:52:15 +00:00
aclocal.m4 - add configure support, since I'm starting to need different options 2002-10-11 18:15:27 +00:00
config.guess - add configure support, since I'm starting to need different options 2002-10-11 18:15:27 +00:00
config.h.in - add configure support, since I'm starting to need different options 2002-10-11 18:15:27 +00:00
config.sub - add configure support, since I'm starting to need different options 2002-10-11 18:15:27 +00:00
configure - add test6-ltdlopen 2002-10-12 05:53:39 +00:00
configure.in - add test6-ltdlopen 2002-10-12 05:53:39 +00:00
install-sh - add configure support, since I'm starting to need different options 2002-10-11 18:15:27 +00:00
ltmain.sh - add configure support, since I'm starting to need different options 2002-10-11 18:15:27 +00:00
Makefile.in - add test6-ltdlopen 2002-10-12 05:53:39 +00:00
README - add info about win32 dlls 2002-10-12 03:55:10 +00:00

plugin-test
Bryce Denney

This is a series of simple programs that test your platform for shared 
library support.  The tests start from something trivial that should 
work everywhere, and gradually add one feature at a time, until at 
the end (not done yet) it should test all of the shared library 
features that Bochs needs to support plugins.

test1-static: build a static library and link against it
test2-dynamic: with same code, build a shared library and link against it
test3-twomodules: build 2 shared libs and link against them
test4-interdep: build 2 shared libs, one depends on the other, and link
test5-execsymbols: can a shared lib can access a symbol from the executable?









Notes for win32 DLLs:

*.dll.a is an import library

Win32 DLL Topics
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore98/html/_core_dll_topics.asp

------
Mutual DLL imports
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore98/html/_core_mutual_imports.asp

Exporting or importing to another executable file presents complications when
the imports are mutual (or "circular"). For example, two DLLs import symbols
from each other, similar to mutually-recursive functions.

The problem with mutually-importing executable files (usually DLLs) is that
neither can be built without building the other first. Each build process
requires, as input, an import library produced by the other build process.

The solution is to use the LIB utility with the /DEF option, which produces an
import library without building the executable file. Using this utility, you
can build all the import libraries you need, no matter how many DLLs are
involved or how complicated the dependencies are.

The general solution for handling mutual imports is: 

1.Take each DLL in turn. (Any order is feasible, although some orders are more
optimal.) If all the needed import libraries exist and are current, run LINK to
build the executable file (DLL). This produces an import library. Otherwise,
run LIB to produce an import library.

Running LIB with the /DEF option produces an additional file with an .EXP
extension. The .EXP file must be used later to build the executable file.

2.After using either LINK or LIB to build all the import libraries, go back and
run LINK to build any executable files that were not built in the previous
step. Note that the corresponding .EXP file must be specified on the LINK line.

If you had run the LIB utility earlier to produce an import library for DLL1,
LIB would have produced the file DLL1.EXP as well. You must use DLL1.EXP as
input to LINK when building DLL1.DLL.
-----------