]> git.ipfire.org Git - thirdparty/dbus.git/commitdiff
build: Give better error messages if relocation is impossible
authorSimon McVittie <smcv@collabora.com>
Wed, 29 Aug 2018 13:01:02 +0000 (14:01 +0100)
committerSimon McVittie <smcv@collabora.com>
Thu, 30 Aug 2018 16:44:08 +0000 (17:44 +0100)
There are two reasons why we might reject relocation: the exec_prefix
differing from the prefix, or the libdir not being a first-level
subdirectory named "lib" or "lib64" of the prefix. Make it clearer
which one failed and why.

Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=107662

configure.ac

index 8c96e74d203f8685a14b05778a0b1a2c52fa8a2c..f0d8358929d3ef9b833610086473959939628cc1 100644 (file)
@@ -1581,17 +1581,23 @@ AS_CASE(["${exec_prefix}"],
   ['NONE'|'${prefix}'],
     [:],
   [*],
-    [can_relocate=no])
+    [
+      can_relocate=no
+      # If the user said --enable-relocation but we can't do it, error out
+      AS_IF([test "x$enable_relocation" = xyes],
+        [AC_MSG_ERROR([Relocatable pkg-config metadata requires --exec-prefix='\${prefix}', not ${exec_prefix}])])
+    ])
 
 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])])
+    [
+      can_relocate=no
+      # If the user said --enable-relocation but we can't do it, error out
+      AS_IF([test "x$enable_relocation" = xyes],
+        [AC_MSG_ERROR([Relocatable pkg-config metadata requires default libdir, not ${libdir}])])
+    ])
 
 # By default, on Windows we are relocatable if possible
 AS_IF([test "x$enable_relocation" = xauto && test "x$dbus_win" = xyes],