Install LIBCXX first before installing the LIBCXX SQL Library.
LIBCXX SQL Library should be converted into an installable package instead of building and installing LIBCXX SQL Library directly. The source tarball contains build scripts for Fedora and Ubuntu (most likely works on Debian too, but untested.
The installable packages get created the same way LIBCXX's packages
get created.
Running
“rpmbuild -ta libcxxsql-version
.tar.bz2”
on Fedora
creates the following packages:
The main binary rpm package, with runtime libraries.
The “gmp” subpackage, containing the additional library for interacing with the gmp library.
The “devel” subpackage, containing header files and other supporting files used for developing applications that use the LIBCXX SQL Library.
To build a DEB package:
Create an empty directory and copy/move the tarball into it:
$ mkdir tmp $ mv libcxxsql-VERSION.tar.bz2 tmp $ cd tmp
Unpack the tarball and cd into the unpacked subdirectory:
$ tar xvf libcxxsql-VERSION.tar.bz2 $ cd libcxxsql-VERSION
Run the debuild script in the current directory, which is a wrapper for the system debuild script, and forwards its parameters to it:
$ ./debuild -us -uc
The above steps must be followed strictly. The debuild script expects the distributed tarball in its parent directory.
This eventually produces a deb
subdirectory with
.deb packages that can be
installed with "dpkg -i".
The above steps must be followed strictly. The debuild script expects the distributed tarball in its parent directory.
Building the LIBCXX SQL Library results in an implicit dependency on the underlying version of the LIBCXX, and the resulting rpm packages carry both the LIBCXX SQL Library and the LIBCXX version numbers on them.
Use the following documentation as a guide for preparing an installable the LIBCXX SQL Library package on platforms other than Fedora.
Install LIBCXX first before installing the LIBCXX SQL Library. All LIBCXX's own requirements apply here as well (gcc version, gmake, and others).
unixODBC.
libgmp.
pkg-config.
Linux distributions typically have separate runtime and development packages for these libraries. In all cases, the development packages must be installed to build LIBCXX SQL Library, and only the runtime packages are required to run the applications.
As mentioned above, the LIBCXX SQL Library should be built into a standalone, installable package. Use the following documentation as a guide to create an installation script or a package.
Run the configure
script, followed by
make
(or gmake), and
make install.
configure
takes the usual options that specify
non-default installation directories for various files
(see configure --help).
Additional options are:
dir
Specifies where pkgconfig configuration file gets installed. The configure script goes through the list of some common directories, and checks if they exist.
This option may be needed to override the default even if configure finds it, and does not complain, if it ends up finding and installs its pkgconfig file into the wrong directory.
Run (g)make install DESTDIR=/tmp/libcxxsql-install.
This creates an installation image in the
/tmp/libcxxsql-install
directory, to use as a basis
for creating an installable package.
A plain (g)make install will do it
“for real”, of course.
However, using an installable package is strongly recommended.
See LIBCXX's autotools
instructions. The LIBCXX SQL Library uses the same build framework.
In configure.ac
:
LIBCXX_INIT LIBCXXSQL_INIT
LIBCXX's LIBCXX_INIT gets supplemented by
LIBCXX SQL Library's LIBCXXSQL_INIT,
Similarly the Makefile.am
invokes both
LIBCXX's @LIBCXX_AM@ and LIBCXX SQL Library's
@LIBCXXSQL_AM@:
@LIBCXX_AM@ @LIBCXXSQL_AM@ bin_PROGRAMS=main main_SOURCES=main.C main_LDADD=-lcxxsql -lcxx
It is possible to install multiple versions of the LIBCXX SQL Library to accomodate software that gets built with different versions of the LIBCXX SQL Library. See LIBCXX's documentation for more information. The same process gets used for the LIBCXX SQL Library too.
The LIBCXX SQL Library has no runtime tools or scripts, so LIBCXX SQL Library's compatibility package's contents are the same as the regular package's. LIBCXX SQL Library's installation directories are:
$libdir
/libcxxsql-$version
This directory whose name includes the LIBCXX SQL Library and LIBCXX's API/ABI
versions contains the runtime libraries.
Multiple concurrently-installed version of the LIBCXX SQL Library
get installed into different directories in
.
$libdir
$includedir
/libcxxsql-$version
This directory whose name includes the LIBCXX SQL Library's and LIBCXX's
API/ABI version contains the header files.
Multiple concurrently-installed version of the LIBCXX SQL Library
install their header files into different directories in
.
$includedir
$datadir
/libcxxsql-$version
This directory whose name includes the LIBCXX SQL Library's and LIBCXX's
API/ABI
version contains supporting scripts, macros, and other miscellaneous
supporting files.
Multiple concurrently-installed version of the LIBCXX SQL Library
install their miscellaneous files into different directories in
.
$datadir
The LIBCXX SQL Library installs a package configuration files and an autoconf
macro files into the shared, global
pkgconfig
and
aclocal
directories. The names of these files
include the LIBCXX SQL Library version, making it possible to install
multiple versions of these files, corresponding to each installed
version of the LIBCXX SQL Library.
Re-targeting code that gets compiled with the LIBCXX SQL Library to use a
different version of the LIBCXX SQL Library, if that's possible, follows the
same general process
LIBCXX's, and
sets the LIBCXXSQL_VERSION
environment variable which
gets checked by the LIBCXXSQL_INIT macro.
This is the LIBCXX SQL Library's API/ABI version number which is, generally, the
LIBCXX SQL Library version without the minor release level. One way to obtain
the API/ABI version number is that it gets
included in the name of the lib
subdirectory
where LIBCXX SQL Library's runtime libraries get installed.