~oif-team/ubuntu/natty/qt4-x11/xi2.1

« back to all changes in this revision

Viewing changes to src/3rdparty/dlcompat/README

  • Committer: Bazaar Package Importer
  • Author(s): Adam Conrad
  • Date: 2005-08-24 04:09:09 UTC
  • Revision ID: james.westby@ubuntu.com-20050824040909-xmxe9jfr4a0w5671
Tags: upstream-4.0.0
ImportĀ upstreamĀ versionĀ 4.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
dlcompat for Darwin
 
2
=========================
 
3
 
 
4
This is dlcompat, a small library that emulates the dlopen()
 
5
interface on top of Darwin's dyld API.
 
6
 
 
7
dlcompat allows loading a ".dylib" library (as long as the RTLD_LOCAL 
 
8
flag isn't passed to dlopen()). It can be configured to yield a warning 
 
9
when trying to close it (dynamic libraries cannot currently be unloaded).
 
10
 
 
11
It automatically searches for modules in several directories when no 
 
12
absolute path is specified and the module is not found in the current 
 
13
directory.
 
14
 
 
15
The paths searched are those specified in the environment variables
 
16
LD_LIBRARY_PATH and DYLD_LIBRARY_PATH plus /lib, /usr/local/lib and 
 
17
/usr/lib or the path specified in the environment variable 
 
18
DYLD_FALLBACK_LIBRARY_PATH.
 
19
 
 
20
In the default install the behavior of dlsym is to automatically prepend
 
21
an underscore to passed in symbol names, this allows easier porting of
 
22
applications which were written specifically for ELF based lifeforms.
 
23
 
 
24
Installation
 
25
--------------
 
26
Type:
 
27
        ./configure
 
28
        make
 
29
        sudo make install
 
30
 
 
31
This will compile the source file, generate both a static and shared
 
32
library called libdl and install it into /usr/local/lib. The header
 
33
file dlfcn.h will be installed in /usr/local/include, and the man pages
 
34
go in /usr/local/man.
 
35
 
 
36
If you want to place the files somewhere else, run
 
37
 
 
38
  make clean
 
39
  ./configure --prefix=<prefix>
 
40
  make
 
41
  sudo make install
 
42
 
 
43
where <prefix> is the hierarchy you want to install into, e.g. /usr
 
44
for /usr/lib and /usr/include (_NOT_ recommended!).
 
45
 
 
46
To enable debugging output (useful for me), run
 
47
 
 
48
  make clean
 
49
  ./configure --enable-debug
 
50
  make
 
51
  sudo make install
 
52
  
 
53
If you want old dlcompat style behavior of not prepending the underscore
 
54
on calls to dlsym then type:
 
55
 
 
56
  make clean
 
57
  ./configure --enable-fink
 
58
  make
 
59
  sudo make install
 
60
 
 
61
Usage
 
62
-------
 
63
Software that uses GNU autoconf will likely check for a library called
 
64
libdl, that's why I named it that way. For software that doesn't find
 
65
the library on its own, you must add a '-ldl' to the appropriate
 
66
Makefile (or environment) variable, usually LIBS.
 
67
 
 
68
If you installed dlcompat into a directory other than /usr/local/lib,
 
69
you must tell the compiler where to find it. Add '-L<prefix>/lib' to
 
70
LDFLAGS (or CFLAGS) and '-I<prefix>/include' to CPPFLAGS (or CFLAGS).
 
71
 
 
72
Notes
 
73
-----
 
74
If you are writing new software and plan to have Mac OX X compatibility you
 
75
should look at the dyld api's in /usr/include/mach-o/dyld.h, rather than
 
76
using dlcompat, using the native api's is the supported method of loading
 
77
dynamically on Mac OS X, if you want an small example, look at dlfcn_simple.c,
 
78
which should help get you started.
 
79
 
 
80
As of this version the functions in dlcompat should all be thread safe.
 
81
 
 
82
You can always get the latest version from opendarwin cvs:
 
83
 
 
84
  cvs -d :pserver:anonymous@anoncvs.opendarwin.org:/cvs/od login
 
85
  cvs -z3 -d :pserver:anonymous@anoncvs.opendarwin.org:/cvs/od \
 
86
               co -d dlcompat proj/dlcompat
 
87
               
 
88
But remember that you'll have to run autoconf to generate the configure script.
 
89
 
 
90
It is hoped that this library will be useful, and as bug free as possible, if you find
 
91
any bugs please let us know about them so they can be fixed.
 
92
 
 
93
Please send bug reports to Peter O'Gorman <ogorman@users.sourceforge.net>
 
94
 
 
95
Thanks.
 
96