From 7cae8b427c95a0e30ff7929b61d913409e7a74c6 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Wed, 29 Aug 2018 14:01:02 +0100 Subject: build: Give better error messages if relocation is impossible 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 Reviewed-by: Philip Withnall Bug: https://bugs.freedesktop.org/show_bug.cgi?id=107662 --- configure.ac | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index 8c96e74d..f0d83589 100644 --- a/configure.ac +++ b/configure.ac @@ -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], -- cgit v1.2.1