[unixODBC-dev] Where should one install .so files?

Steve Langasek vorlon at debian.org
Sun Jul 15 22:19:45 BST 2012

Hi Jean-Michel,

On Sat, Jul 14, 2012 at 11:55:01AM +0000, Jean-Michel Vourgère wrote:
> I'm working on mdbtools, that includes a really free odbc driver for
> microsoft access files.

> I'm used to Debian GNU/Linux OS, and I noticed that most drivers are
> installing themselves in /usr/lib/odbc rather that just /usr/lib.  (Then
> it changed to /usr/lib/i386/odbc, but that is another story...) That way,
> odbcinst.ini only have to reference "Driver = libmdbodbc.so.1" without any
> path.

> But general "upstream" makefile installs in lib/ and not lib/odbc.

> My question is where should a driver install itself on most architectures:
> lib/ or lib/odbc/ ?

> Is the odbc subfolder a general thing for distros? Or just a Debian/Ubuntu
> specific thing?

This follows logically from the requirements of the FHS:

  /usr/lib : Libraries for programming and packages


  /usr/lib includes object files, libraries, and internal binaries that are
  not intended to be executed directly by users or shell scripts. [22]

  Applications may use a single subdirectory under /usr/lib. If an
  application uses a subdirectory, all architecture-dependent data
  exclusively used by the application must be placed within that
  subdirectory.  [23]

So the only files that should be installed directly in /usr/lib are "object
files, libraries, and internal binaries".  ODBC drivers are not any of
these: they are DSOs (dynamic shared objects) which are loaded by the
driver manager by name, not via the ELF linker.

The particular use of /usr/lib/odbc as a path for ODBC drivers may be
specific to Debian and its derivatives.  I'm happy to discuss with UnixODBC
upstream whether there should be a standard way to express this in the
source build, and to export the preferred search path in a way that other
software can consume it (e.g., as a pkg-config variable).

BTW, the other consequence of considering ODBC drivers to be DSOs rather
than libraries is that they shouldn't have sonames.  The preferred install
target for mdbcodbc should be libmdbodbc.so, not libmdbodbc.so.1; the latter
implies that it is a shared library that users *should* link against, and I
think it's wise to discourage this.

Hope that helps,
Steve Langasek                   Give me a lever long enough and a Free OS
Debian Developer                   to set it on, and I can move the world.
Ubuntu Developer                                    http://www.debian.org/
slangasek at ubuntu.com                                     vorlon at debian.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://mailman.unixodbc.org/pipermail/unixodbc-dev/attachments/20120715/f7901f6d/attachment.bin>

More information about the unixODBC-dev mailing list