1 2Start with: 3 4 ./configure --help 5 6to figure out what options to use. Then type: 7 8 ./configure [ options ] 9 make 10 make install 11 12This installs the library into /usr/local/lib and compiles the sample 13command-line program sdb_client. 14 15The normal use of this code is as part of another application. 16The easiest way to do this is to use sdb_client.c as a template to 17modify the application code. The script sdb-config can be used to 18get the right set of options to add to the Makefile. Like this: 19 20cc -c `sdb-config --cflags` sdb_client.c 21cc -o sdb_client `sdb-config --libs` sdb_client.o 22 23Of course, nothing will work unless the database is correctly 24installed, including client libraries. 25 26The sdbd driver is always built. 27 28 29Platforms 30--------- 31 32This library is developed on Linux and tested on the 33following platforms: 34 35 - Linux x86 with libc5 (gcc, Gnu make, Gnu linker) 36 - Linux x86 with libc6 aka glibc (gcc, Gnu make, Gnu linker) 37 - Linux alpha (gcc, Gnu make, Gnu linker) 38 - Solaris (gcc, Sun make, Sun linker) 39 - MacOSX (gcc, Apple make, Apple linker) 40 41Compiling with anything other than GCC is not supported. 42GCC on HP-UX has issues with socket.h. 43 44 45If the build won't work 46----------------------- 47 48To get support for the desired features, you must give the corresponding 49options to configure. Type "./configure --help" for details. 50 51Mysql comes with its own script mysql_config, which is supposed 52to reveal the details libsdb needs to configure itself. If the 53script isn't installed, the information must be given manually by 54running configure with 55 56LDFLAGS=-L/usr/local/lib/mysql ./configure --with-mysql 57 58This is because Mysql hides its libraries in a subdirectory. 59On Linux (at least), the directory must also be added to 60/etc/ld.so.conf and /sbin/ldconfig must be rerun. 61 62On MacOSX, the mysql_config script is broken and adds 63"-arch i386". 64 65 66 67Very old versions of Sqlite require gdbm, so make sure it is installed 68before running 69 70./configure --with-gdbm --with-sqlite 71 72Newer versions of Sqlite do not require gdbm. 73 74 75Postgres, like several others, likes to be installed in places 76where no script can find it. In my case, postgres lives in 77/home/ulric/pgsql, so I run configure like this: 78 79LDFLAGS=-L/home/ulric/pgsql/lib CFLAGS=-I/home/ulric/pgsql/include ./configure - 80-with-postgres 81 82It ain't pretty, but it works. 83 84 85Oracle: Make sure that ORACLE_HOME is set before running configure: 86 87./configure --with-oracle 88 89Tested with Oracle 8.1.7 - 11.1.0 for Linux and Solaris. 90 91Oracle like to move things around. Libraries used to live in 92$ORACLE_HOME/lib and headers in $ORACLE_HOME/rdbms/demo. The 93headers now live in $ORACLE_HOME/rdbms/public, unless you use 94the Oracle Instant Client in which case the libraries live 95directly under the toplevel directory and the headers in the 96subdirectory sdk/include. Sigh. The configure script tries to 97compensate for the various locations. 98 99In case you use the Instant Client, there is no proper ORACLE_HOME. 100Let's say the client is installed in the directory: 101 102/opt/oracle/OracleInstantClient/instantclient_11_1 103 104You then need to set LD_LIBRARY_PATH so the libraries can be found: 105 106LD_LIBRARY_PATH=/opt/oracle/OracleInstantClient/instantclient_11_1 107export LD_LIBRARY_PATH 108 109And tell sdb's configure script the location: 110 111./configure --with-oracle=/opt/oracle/OracleInstantClient/instantclient_11_1 112 113The Instant Client is quite nice, because it allows the database to 114be specified without editing tnsnames.ora. Like this: 115 116sdb_client oracle:uid=username:pwd=password:db=//hostname/sid 117 118 119Ingres: Make sure that II_SYSTEM is set before running configure: 120 121./configure --with-ingres 122 123Libraries live in $II_SYSTEM/ingres/lib and headers in 124$II_SYSTEM/ingres/files. 125 126 127Building on Windows 128------------------- 129Running SDB on Windows is more useful than it seems. Windows already has 130a standard interface to databases (ODBC), so there is little point in 131using anything else for applications on that platform. But it is sometimes 132difficult to access commercial databases from other operating systems 133(usually because the necessary client libraries aren't available), and a 134Windows version of the sdb proxy solves that problem. Example: 135 136 Unix Windows Anything 137.--------------------. .--------------. .----------. 138| Application -> SDB | -> | SDBD -> ODBC | -> | Database | 139`--------------------� `--------------� `----------� 140 141The "Windows" and "Anything" boxes may be one and the same. 142 143There is little reason to implement anything more than the ODBC driver on 144Windows, and nothing else has been tested. So to build on Windows, type: 145 146./configure --with-odbc=odbc32 147make 148make install 149 150Cygwin is required. 151