From cd94bf8bf30de9aa8dfec1a06a7ef3386944c974 Mon Sep 17 00:00:00 2001 From: M Joonas Pihlaja Date: Mon, 14 Sep 2009 03:41:42 -0600 Subject: [PATCH] [trace] Look harder for the cairo-trace.so library. On OpenBSD the convention is to not use symlinks from unversioned library names to versioned library names. This breaks cairo-trace because it looks for cairo-trace.so explicitly, but on OpenBSD only cairo-trace.so.0.0 is installed. The right thing to do is probably to source the cairo-trace.la file and look for a file name there somehow. Instead this commit just looks for a likely looking file or symlink in the install directory. --- util/cairo-trace/cairo-trace.in | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/util/cairo-trace/cairo-trace.in b/util/cairo-trace/cairo-trace.in index f2a5b8f5a..fc830bf7e 100644 --- a/util/cairo-trace/cairo-trace.in +++ b/util/cairo-trace/cairo-trace.in @@ -88,7 +88,22 @@ fi CAIRO_TRACE_PROG_NAME="$1" export CAIRO_TRACE_PROG_NAME -LD_PRELOAD=@libdir@/cairo/cairo-trace.so +if test "x$CAIRO_TRACE_SO" = "x"; then + CAIRO_TRACE_SO="" + for lib in @libdir@/cairo/cairo-trace.so @libdir@/cairo/cairo-trace.so*; do + if test -h "$lib" -o -f "$lib"; then + CAIRO_TRACE_SO="$lib" + break + fi + done +fi +if test "x$CAIRO_TRACE_SO" = "x"; then + echo "Could not find the cairo-trace shared library in @libdir@/cairo/." >&2 + echo "Set the CAIRO_TRACE_SO environment variable to the full path of the library." >&2 + exit 15 +fi + +LD_PRELOAD="$CAIRO_TRACE_SO" export LD_PRELOAD if test -n "$nocallers"; then