1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
|
<! "@(#)shared_gcc.so 10.3 (Sleepycat) 9/25/98">
<!Copyright 1997, 1998 by Sleepycat Software, Inc. All rights reserved.>
<html>
<body bgcolor=white>
<head>
<title>Berkeley DB: Building Shared Libraries for the GNU GCC compiler</title>
<meta name="description" content="Berkeley DB: An embedded database programmatic toolkit.">
<meta name="keywords" content="embedded,database,programmatic,toolkit,b+tree,btr
ee,hash,hashing,transaction,transactions,locking,logging,access method,access me
thods,java,C,C++">
</head>
<h1 align=center>Building Shared Libraries for the GNU GCC compiler</h1>
<p>
If you're using gcc and there's no better shared library example for your
architecture, the following shared library build procedure will probably
work.
<ol>
<li>Add the <b>-fpic</b> option to the CFLAGS value in the Makefile.
<p>
<li>
Rebuild all of your .o files. This will create a Berkeley DB
library that contains .o files with PIC code. To build the shared
library, then take the following steps in the library build directory:
<p>
<ul><pre>
% mkdir tmp
% cd tmp
% ar xv ../libdb.a
% gcc -shared -o libdb.so *.o
% mv libdb.so ..
% cd ..
% rm -rf tmp
</pre></ul>
</ol>
<p>
Note, you may have to change the gcc line depending on the requirements
of your system.
<p>
The file libdb.so is your shared library.
</tt>
</body>
</html>
|