summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorM Joonas Pihlaja <jpihlaja@cc.helsinki.fi>2009-09-14 03:41:42 -0600
committerM Joonas Pihlaja <jpihlaja@cc.helsinki.fi>2009-09-14 13:32:19 +0300
commitcd94bf8bf30de9aa8dfec1a06a7ef3386944c974 (patch)
tree0d4e9548ccf75dff1a6480e263dfd9245ee4987b
parenta343c8c42d3adc8f52afd09bdfbbcfd5299df49e (diff)
[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.
-rw-r--r--util/cairo-trace/cairo-trace.in17
1 files changed, 16 insertions, 1 deletions
diff --git a/util/cairo-trace/cairo-trace.in b/util/cairo-trace/cairo-trace.in
index f2a5b8f5..fc830bf7 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