mirror of
https://gitlab.freedesktop.org/dbus/dbus.git
synced 2026-05-27 05:48:13 +02:00
autotools: Allow relocatable pkg-config metadata on an opt-in basis
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=99721 Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de> Signed-off-by: Simon McVittie <smcv@collabora.com>
This commit is contained in:
parent
d160c1a71a
commit
30497f854b
1 changed files with 39 additions and 3 deletions
42
configure.ac
42
configure.ac
|
|
@ -1530,9 +1530,6 @@ 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
|
||||
|
|
@ -1694,6 +1691,45 @@ DBUS_LIBEXECDIR="$EXPANDED_LIBEXECDIR"
|
|||
AC_SUBST(DBUS_LIBEXECDIR)
|
||||
AC_DEFINE_UNQUOTED(DBUS_LIBEXECDIR,"$DBUS_LIBEXECDIR", [Directory for installing the libexec binaries])
|
||||
|
||||
AC_ARG_ENABLE([relocation],
|
||||
[AS_HELP_STRING([--enable-relocation[=yes/no/auto]],
|
||||
[Make pkg-config metadata relocatable [default=auto]])],
|
||||
[], [enable_relocation=auto])
|
||||
|
||||
can_relocate=yes
|
||||
|
||||
AS_CASE(["${exec_prefix}"],
|
||||
['NONE'|'${prefix}'],
|
||||
[:],
|
||||
[*],
|
||||
[can_relocate=no])
|
||||
|
||||
AS_CASE(["${libdir}"],
|
||||
['${prefix}/lib'|'${prefix}/lib64'|'${exec_prefix}/lib'|'${exec_prefix}/lib64'],
|
||||
[:],
|
||||
[*],
|
||||
[can_relocate=no])
|
||||
|
||||
# If the user said --enable-relocation but we can't do it, error out
|
||||
AS_IF([test "x$can_relocate" = xno && test "x$enable_relocation" = xyes],
|
||||
[AC_MSG_ERROR([Relocatable pkg-config metadata requires --exec-prefix='\${prefix}' and the default libdir])])
|
||||
|
||||
# By default, on Windows we are relocatable if possible
|
||||
AS_IF([test "x$enable_relocation" = xauto && test "x$dbus_win" = xyes],
|
||||
[enable_relocation="$can_relocate"])
|
||||
|
||||
# By default, on non-Windows we are not relocatable because it can interfere
|
||||
# with pkg-config's ability to filter out system include directories,
|
||||
# resulting in linking an outdated system-wide library in preference to a
|
||||
# newer version installed elsewhere
|
||||
AS_IF([test "x$enable_relocation" = xauto],
|
||||
[enable_relocation="no"])
|
||||
|
||||
|
||||
AS_IF([test "x$enable_relocation" = xyes],
|
||||
[AC_SUBST([pkgconfig_prefix], ['${pcfiledir}/../../'])],
|
||||
[AC_SUBST([pkgconfig_prefix], ['${original_prefix}'])])
|
||||
|
||||
#### Directory to source sysconfdir configuration from
|
||||
|
||||
# On Windows this is relative to where we put the bus setup, in
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue