diff options
author | Ralf Habacker <ralf.habacker@freenet.de> | 2017-02-15 16:02:32 +0100 |
---|---|---|
committer | Simon McVittie <smcv@debian.org> | 2017-03-20 14:14:42 +0000 |
commit | 216627825dd6fd5675b4c521b8b67b7850d7ad4c (patch) | |
tree | b47c4f094512e439e34de89b22d1b8d8e26e1fcc /configure.ac | |
parent | 71959d5bca3ddff90a5b418461314fc3f9fadcc5 (diff) | |
download | dbus-216627825dd6fd5675b4c521b8b67b7850d7ad4c.tar.gz |
cmake: Optionally create relocatable dbus-1.pc file
Relocatable pkgconfig files are necessary when using packages installed to
a location that does not match the location for which they were compiled.
However, using ${pcfiledir} is problematic for system installations
in standard locations, because it interferes with pkg-config's
ability to filter out -I, -L options that are redundant with compiler
defaults (which is important if you are trying to use a newer version
of a library than the system copy).
In practice operating system vendors installing dbus to standard
locations use Autotools, so we enable relocatable builds by default
when building with CMake.
For simplicity, we're also not relocatable if the library directory
is something more complicated than lib or lib64 (e.g. under Debian
multiarch); we don't want to have to compute how many ../ to add.
This is non-trivial to determine in an Autotools build, so for now
there is no support for relocation when built with Autotools,
even as an opt-in feature.
Going via the ${original_prefix} variable is because under Autotools,
both ${prefix} and ${exec_prefix} technically default to NONE, with
NONE replaced with their real defaults of /usr/local and '${prefix}'
(respectively) later on. If we tried to expand ${prefix} at the time
that we choose the value of ${pkgconfig_prefix}, that would cause
a broken value "prefix=NONE" to be hard-coded.
[smcv: no relocation on Autotools, make it optional in CMake,
expand commit message]
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=99721
Reviewed-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
Signed-off-by: Simon McVittie <smcv@collabora.com>
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac index 00c271cb..b0afc947 100644 --- a/configure.ac +++ b/configure.ac @@ -1530,6 +1530,9 @@ AS_AC_EXPAND(EXPANDED_LIBDIR, "$libdir") AS_AC_EXPAND(EXPANDED_LIBEXECDIR, "$libexecdir") AS_AC_EXPAND(EXPANDED_DATADIR, "$datadir") +# For the moment we don't support relocation when building with Autotools +AC_SUBST([pkgconfig_prefix], ['${original_prefix}']) + #### Check our operating system operating_system=unknown if test -f /etc/redhat-release || test -f $EXPANDED_SYSCONFDIR/redhat-release ; then |