Am Sonntag, den 08.03.2020, 13:37 +0100 schrieb David Kastrup:
> At any rate, can we focus on the issue at hand rather than building our
> strawmen from straw of future harvests?  We have a current issue that
> has already bitten several not-completely-stupid developers (even if you
> disagree with that characterisation, we just cannot afford further
> restricting the qualifications for being allowed to work with LilyPond),
> so it is reasonable to assume that it will affect also people outside of
> the core team.
> 
> This issue is a lot less likely with things other than libguile.

How about the attached change? This attempts to locate the .pc file
next to guile-config and tries to be very transparent about this. If it
finds a directory, it restricts pkg-config to look only there. This
should work with non-default installations of Guile, at least it works
for a test setup on my machine.

Jonas
diff --git a/configure.ac b/configure.ac
index 29e4e5680f..5ab00d556d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -189,7 +189,51 @@ STEPMAKE_MSGFMT(REQUIRED)
 STEPMAKE_TEXMF(REQUIRED)
 STEPMAKE_TEXMF_DIRS(REQUIRED)
 
+# For compatibility with previous releases.
+if test -n "$GUILE_CONFIG"; then
+  AC_MSG_WARN([Non-empty GUILE_CONFIG detected])
+  AC_MSG_CHECKING([location of pkgconfig file...])
+  GUILE_CONFIG=`STEPMAKE_GET_EXECUTABLE($GUILE_CONFIG)`
+  if test "${PKG_CONFIG_PATH+set}" = "set"; then
+    save_PKG_CONFIG_PATH="$PKG_CONFIG_PATH"
+  fi
+  if test "${PKG_CONFIG_LIBDIR+set}" = "set"; then
+    save_PKG_CONFIG_LIBDIR="$PKG_CONFIG_LIBDIR"
+  fi
+  PKG_CONFIG_PATH=""
+  PKG_CONFIG_LIBDIR=""
+
+  guile_dir="`dirname $GUILE_CONFIG`"
+  guile_dir="`dirname $guile_dir`"
+  for candidate in "$guile_dir/lib/pkgconfig" "$guile_dir/lib64/pkgconfig"; do
+    if test -d "$candidate"; then
+      PKG_CONFIG_LIBDIR="$candidate"
+      break
+    fi
+  done
+
+  if test -n "$PKG_CONFIG_LIBDIR"; then
+    AC_MSG_RESULT([$PKG_CONFIG_LIBDIR])
+  else
+    AC_MSG_ERROR([Could not locate pkgconfig file!])
+  fi
+
+  export PKG_CONFIG_PATH
+  export PKG_CONFIG_LIBDIR
+fi
 STEPMAKE_GUILE_DEVEL(REQUIRED)
+if test -n "$GUILE_CONFIG"; then
+  if test "${save_PKG_CONFIG_PATH+set}" = "set"; then
+    PKG_CONFIG_PATH="$save_PKG_CONFIG_PATH"
+  else
+    unset PKG_CONFIG_PATH
+  fi
+  if test "${save_PKG_CONFIG_LIBDIR+set}" = "set"; then
+    PKG_CONFIG_LIBDIR="$save_PKG_CONFIG_LIBDIR"
+  else
+    unset PKG_CONFIG_LIBDIR
+  fi
+fi
 
 # check for 3 typedefs added in Guile 1.9
 save_CXXFLAGS="$CXXFLAGS"

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to