prefix=/ or prefix=/usr ?

Simon McVittie simon.mcvittie at collabora.co.uk
Thu Sep 7 03:16:13 PDT 2006


On Thu, 07 Sep 2006 at 11:40:09 +0200, frederic heem wrote:
> What is the prefix that should be used ? configure --prefix=/usr 
> or --prefix=/usr

I assume you meant "or --prefix=/"...

If you're setting the prefix to "/", that means you believe the program
you're installing needs to work before /usr is mounted, so it must go in
/bin, /sbin, /lib and occupy scarce root-filesystem space. Unless you
know this to be the case, it most likely isn't!

> In the first case, dbus will install its configuration file in /usr/etc.
> In the second case, dbus will install its header file in /include.
> This is not *nix standard, isn't it ?

Distributions can rarely just use --prefix on configure scripts. In a
typical Linux package (e.g. for Debian) the right thing to do to follow
the FHS/LSB is something like:

    ./configure --prefix=/usr --sysconfdir=/etc \
        --sharedstatedir=/var --localstatedir=/var \
        --libexecdir=/usr/lib

With prefix /usr the GNU standards would put configuration in /usr/etc,
modifiable architecture-independent-data in /usr/com, modifiable single-machine
data in /usr/var and supporting programs in /usr/libexec, which are
inappropriate on Linux, and potentially other Unixes. The libexec one is
debatable - /usr/libexec isn't in the FHS and doesn't exist on Debian-derived
systems, but I seem to remember some other Linux systems still have it.

RPM has a macro (%configure, I think) which expands to the ./configure
arguments Red Hat consider to be appropriate. Its expansion takes up
several screen lines and does things like putting native 64-bit libraries in
/usr/lib64 on x86-64 systems.

The right thing to do for distribution packages is a per-distro issue -
on Debian, for instance, x86-64 libraries usually go in /usr/lib due to
different packaging policies.

For a local install of D-Bus you might even consider something like:

    ./configure --prefix=/usr/local --sysconfdir=/etc --localstatedir=/var \
        --sharedstatedir=/var

which would put the daemon and libraries in /usr/local, but would use
the well-known locations for things like service.d and the daemon
socket.

Regards,
        Simon


More information about the dbus mailing list