Commit Graph

118 Commits

Author SHA1 Message Date
Bryce Denney
7f38378f97 - select between libtool and win32 specific makefile targets 2002-10-16 02:55:52 +00:00
Bryce Denney
d528a0f020 - add win32 DLL section to the makefile. Use entirely different
target names so that both sets of rules can coexist in the same file.
  The configure script selects which one to use.
- use patterns to build plugins.
- remove Makefile, which was specific to win32.
2002-10-16 02:55:16 +00:00
Bryce Denney
e972168d39 - clean up the libtool section of the makefile
- remove the unsuccessful experiment with libmain.la
- now the executable uses -export-dynamic and the modules use -module,
  as it should be
2002-10-16 02:36:45 +00:00
Bryce Denney
21df25a043 - add error when you try to compile this for nonwindows platform 2002-10-16 02:21:38 +00:00
Bryce Denney
8fcfa44ea0 - disable debug messages in the checked in version 2002-10-16 02:19:46 +00:00
Bryce Denney
be5316b66e - commit my notes from test6. Some day soon I will have to clean this
up and then send about 6 patches to the libtool developers.
2002-10-16 02:16:43 +00:00
Bryce Denney
f49ec8c71c Fix serveral ltdl bugs related to searching for libraries, and what
to do if they cannot be found.

- in try_dlopen, after find_handle() is called and returns 0 over
  and over, it was ignoring the return value of tryall_dlopen.  As
  a result, sometimes the dlopen would fail and return 1 or more
  errors but nobody would notice.  The handle would be returned as
  if the open had succeed, then any use of the handle would segfault
  because handle->loader was NULL.  I have solved this problem by
  capturing the return value in errors, and then checking if errors>0
  in the next if statement.
- fix faulty boolean logic in lt_dlopenext that caused it to only
  search for libraries ending with .la.  Now it says: if try_dlopen
  created a nonzero handle, return it.  Otherwise, if there were
  any errors OTHER THAN file-not-found, return the NULL handle.  If
  the only errors were file-not-found, continue to search.
- just before loading the module in tryall_dlopen, do one final
  call to access() to check for existence of the file.  Without
  this check, you sometimes get the "can't load module" error
  when in fact the problem is "file not found".
2002-10-16 02:08:02 +00:00
Bryce Denney
5d29f481bd - just add some comments 2002-10-16 01:54:46 +00:00
Bryce Denney
bb1a834cc5 - Sometimes lt_dlopen and lt_dlopenext return a valid handle when no
library was actually found.  Add asserts to look for occurrences of this
  "valid handle but NULL loader" problem.
2002-10-16 01:52:39 +00:00
Bryce Denney
9429cb8d62 - add a bunch of debug messages using a macro LTDEBUG_PRINTF(). 2002-10-16 01:45:46 +00:00
Bryce Denney
ebf553f014 - add notes about what works and what doesn't 2002-10-16 01:37:42 +00:00
Bryce Denney
82c91fd104 - let each Makefile.in decide where and when to include INCLTDL and LIBLTDL 2002-10-16 01:37:11 +00:00
Bryce Denney
3f57e5f278 - add reference to a variable, like in test7 2002-10-16 01:32:52 +00:00
Bryce Denney
19a62a4798 - temporarily check in this Makefile that works for cygwin/mingw. Then
I will go back to a unix system and hack Makefile.in and configure.in so
  that we get these exact make commands for cygwin only.
2002-10-16 01:32:27 +00:00
Bryce Denney
5b555711f2 - minor changes to make this work in win32: define LT_SCOPE to be extern
before including <ltdl.h>.  Otherwise it tries to export some symbols
  from main.cc, which then conflict with the real ltdl when it gets linked.
- on win32 I am not using libtool to build the libraries, so I need to
  use a different format string for module names.  On win32 use "%s.dll".
- call lt_dlopenext() instead of lt_dlopen() because it searches for
  filenames using various extensions including the libtool extension .la
  and also the system's native library name (.so or whatever).
2002-10-16 01:28:41 +00:00
Bryce Denney
42e89cc4c7 - fix major bug in LTDL that makes it only look in the first component of
a pathname list.
2002-10-15 20:56:27 +00:00
Bryce Denney
9f90c8d0fa - try to make VPATH work 2002-10-14 21:10:54 +00:00
Bryce Denney
16638b28c9 - mention test6,7 and add a good reference about win32 dlls 2002-10-14 21:08:14 +00:00
Bryce Denney
38c16cb4ab - this makefile was made from scratch by Psyon, and then Bryce made it
somewhat configure-ized and checked it in.
2002-10-14 21:07:23 +00:00
Bryce Denney
d0b169eaba - update for test7-win32dll 2002-10-14 21:06:47 +00:00
Bryce Denney
c0f2cfe189 - add a real implementation of assert() if none is found in headers
- add NULL check in tryall_dlopen_module
- add some debug printfs
2002-10-14 21:05:06 +00:00
Bryce Denney
7bb4b2be20 - add header test for <assert.h> 2002-10-14 21:03:27 +00:00
Bryce Denney
f691060833 - mention backtrace of an ltdl error msg 2002-10-14 21:02:53 +00:00
Bryce Denney
921524de92 - last rev was buggy and failed to produce makefile in test7 dir 2002-10-14 21:02:24 +00:00
Bryce Denney
502eb04660 - do distclean in libltdl directory 2002-10-14 21:01:39 +00:00
Bryce Denney
6a281a02fb - add new subdir, test7-win32dll
- modified: Makefile.in configure.in configure
2002-10-14 20:45:15 +00:00
Bryce Denney
f4c507d4ac - add makefile for VC++ 2002-10-14 20:44:02 +00:00
Bryce Denney
afe8489945 - change main.cc to use LoadLibrary/GetProcAddress instead of ltdl library
- change MAINAPI macro to make code more readable
2002-10-14 20:43:33 +00:00
Bryce Denney
fec82f3ee8 - add reference to version_string so that we test exports of variables too 2002-10-14 20:42:46 +00:00
Bryce Denney
d52e44afdb - test7-win32dll began life as an exact copy of test6-ltdlopen. This
revision is exactly the same as the present versin from test6-ltdlopen.
- added: Makefile.in README main.cc main.h module1.cc module2.cc
2002-10-14 20:34:13 +00:00
Bryce Denney
d6dad223e1 - just dlinit once, at start of main 2002-10-13 02:28:06 +00:00
Bryce Denney
fbe1e69a95 - add more specific printf
- modules are compiled as lib%s.la, not %s.la.
- always load module1 and module2.  Then try to load any modules that
  are mentioned on the command line.
2002-10-13 02:26:09 +00:00
Bryce Denney
0699e46993 - move the extern "C" declaration of module_init into main.h so that it
will affect all modules.
- modified: main.h module1.cc
2002-10-13 02:22:37 +00:00
Bryce Denney
a5a05201d8 - put INCLTDL and LIBLTDL substitution variables into the Makefile
- this requires a correct setting for top_srcdir
2002-10-12 12:29:35 +00:00
Bryce Denney
35142c0ef3 - oops. change order so that things other than libltdl get built as well. 2002-10-12 12:00:44 +00:00
Bryce Denney
b82a5d9e5e - add missing AC_SUBST(LIBS) 2002-10-12 11:59:26 +00:00
Bryce Denney
01ef0ca14c - don't forget to build libltdl 2002-10-12 11:57:33 +00:00
Bryce Denney
ed5ca4801b - add missing call to lt_dlinit(). Why do I keep forgetting this?!
- printf handle was missing the handle
- remove underscore from module_init function name
- fix err msg
2002-10-12 11:50:28 +00:00
Bryce Denney
af8832907a - correct LIBS line is now provided by configure 2002-10-12 11:49:22 +00:00
Bryce Denney
e3bade17e5 - now that libltdl is installed in the source tree, add args to CFLAGS and
LIBS to point to the local version.
2002-10-12 11:48:51 +00:00
Bryce Denney
87d714f9ca - add additional NULL check. I know you can get this if you forget to
call lt_dlinit(), but I'm pretty certain that I've seen it in other
  cases as well.
2002-10-12 11:47:26 +00:00
Bryce Denney
abd8b78317 - add libltdl files from libtool version 1.4.2 2002-10-12 06:03:59 +00:00
Bryce Denney
bf7ebfd2e4 - update 2002-10-12 06:02:18 +00:00
Bryce Denney
f20403d13a - update Makefile.in, remove Makefile 2002-10-12 06:02:01 +00:00
Bryce Denney
a82964072f - add misc notes 2002-10-12 05:54:04 +00:00
Bryce Denney
01e3c37ba4 - add test6-ltdlopen 2002-10-12 05:53:39 +00:00
Bryce Denney
656d465f22 - add some test results and comments 2002-10-12 05:52:55 +00:00
Bryce Denney
31b8154266 - add test6, which actually tries to open a shared lib with lt_dlopen.
For now I've been editing the Makefile directly and haven't updated
  the Makefile.in.  Once it works I'll transfer everything to Makefile.in
  and remove Makefile.
2002-10-12 05:52:15 +00:00
Bryce Denney
eade765a53 - add info about win32 dlls 2002-10-12 03:55:10 +00:00
Bryce Denney
3690ddc95a - when building win32 DLL's use the -no-undefined flag. Otherwise it
will only build static libraries.
2002-10-11 18:56:53 +00:00
Bryce Denney
838df1ee0b - support VPATH build 2002-10-11 18:32:27 +00:00
Bryce Denney
97717adadb - make -C not portable. sigh. 2002-10-11 18:19:38 +00:00
Bryce Denney
89d57436da - add configure support, since I'm starting to need different options
on different platforms

Modified Files:
  Makefile test1-static/Makefile test2-dynamic/Makefile
  test3-twomodules/Makefile test4-interdep/Makefile
  test5-execsymbols/Makefile
Added Files:
  Makefile.in aclocal.m4 config.guess config.h.in config.sub
  configure configure.in install-sh ltmain.sh
  test1-static/Makefile.in test2-dynamic/Makefile.in
  test3-twomodules/Makefile.in test4-interdep/Makefile.in
  test5-execsymbols/Makefile.in
2002-10-11 18:15:27 +00:00
Bryce Denney
6055351e63 - add top level README for plugin-test 2002-10-11 17:35:56 +00:00
Bryce Denney
c607035a27 - add test5 to the list 2002-10-11 17:29:23 +00:00
Bryce Denney
48540356e8 - add LT_LDFLAGS to all libtool links. Remove -no-undefined. 2002-10-11 17:03:50 +00:00
Bryce Denney
5b535b7e83 - test5-execsymbols checks that a module can reach symbols that are defined in
the executable.  On linux you can.
2002-10-11 16:45:31 +00:00
Bryce Denney
043167e8cc - this file is not used 2002-10-11 16:35:53 +00:00
Bryce Denney
c1e54f2fc4 - change #warnings so that they are informative, instead of "case 1,2,3" 2002-10-11 16:25:49 +00:00
Bryce Denney
bd9d45574d - make test requires make all 2002-10-11 16:22:18 +00:00
Bryce Denney
f4a7163433 - tweak DLL import/export macro so that the importer does not have to
define anything special.  If you are not an exporter, then it now
  assumes that you are an importer.
- modified:
	test2-dynamic/module1.h test2-dynamic/uselib.cc
	test3-twomodules/module1.h test3-twomodules/module2.h
	test3-twomodules/uselib.cc test4-interdep/module1.h
	test4-interdep/module2.h test4-interdep/uselib.cc
2002-10-11 16:21:33 +00:00
Bryce Denney
6bd051de38 - add missing MODULE*_DLL_IMPORT definitions in uselib.cc 2002-10-11 16:15:09 +00:00
Bryce Denney
8f94d0a35b - rewrite DLL macros, now somewhat closer to how LT_SCOPE is written
in <ltdl.h>.  Now go back to Linux and test.
2002-10-11 16:09:21 +00:00
Bryce Denney
ba1e549490 - add "make test" target 2002-10-11 16:08:43 +00:00
Bryce Denney
dd9f00f100 - remove -mno-cygwin option from CXXFLAGS, duh 2002-10-11 16:01:11 +00:00
Bryce Denney
2f74efdb0a - rewrite DLL macros, now somewhat closer to how LT_SCOPE is written
in <ltdl.h>.  Now go back to Linux and test.
2002-10-11 15:59:21 +00:00
Bryce Denney
7f9c1489df - make it compile on non-win32 platforms by stuffing all the DLL details
into macros.  I got the idea for the MODULE1API(type) macros from
  expat.h that happens to be sitting on my disk.
- modified:
    test2-dynamic/module1.cc test2-dynamic/module1.h
    test3-twomodules/module1.cc test3-twomodules/module1.h
    test3-twomodules/module2.cc test3-twomodules/module2.h
    test4-interdep/module1.cc test4-interdep/module1.h
    test4-interdep/module2.cc test4-interdep/module2.h
2002-10-11 15:29:32 +00:00
Bryce Denney
059b59c98e - in bochs-testing area, check in shared library tests that I wrote while
trying to get plugins working on Cygwin.

Added Files:
	Makefile
	test1-static/*
	test2-dynamic/*
	test3-twomodules/*
	test4-interdep/*
2002-10-11 14:51:27 +00:00