diff options
author | Arun Isaac | 2020-02-23 18:47:06 +0530 |
---|---|---|
committer | Arun Isaac | 2020-02-26 12:30:57 +0530 |
commit | db6f96c7c0ee74f0152aca95abf80040cc25c1b4 (patch) | |
tree | 6a01ae0def702e59e3ad7d369df1fb022ac67aea | |
parent | 3414d8544fc34c79e391913e08b7262d1ab94c71 (diff) | |
download | guile-xapian-db6f96c7c0ee74f0152aca95abf80040cc25c1b4.tar.gz guile-xapian-db6f96c7c0ee74f0152aca95abf80040cc25c1b4.tar.lz guile-xapian-db6f96c7c0ee74f0152aca95abf80040cc25c1b4.zip |
Load libguilexapian with absolute path or through a search path.
* xapian.i: Rename to xapian.i.in.
* xapian.i.in: Try loading libguilexapian with absolute path first. If
it fails, then try searching using LD_LIBRARY_PATH and other
mechanisms.
* Makefile.am: Generate xapian.i from xapian.i.in.
-rw-r--r-- | Makefile.am | 3 | ||||
-rw-r--r-- | xapian.i.in (renamed from xapian.i) | 9 |
2 files changed, 11 insertions, 1 deletions
diff --git a/Makefile.am b/Makefile.am index fa41918..71f83da 100644 --- a/Makefile.am +++ b/Makefile.am @@ -26,6 +26,9 @@ libguilexapian_la_SOURCES = xapian_wrap.cc libguilexapian_la_CXXFLAGS = $(GUILE_CFLAGS) $(XAPIAN_CFLAGS) libguilexapian_la_LDFLAGS = $(GUILE_LIBS) $(XAPIAN_LIBS) +xapian.i: xapian.i.in Makefile + sed 's|@libdir[@]|$(libdir)|g' $< > $@ + xapian_wrap.cc: xapian.i xapian-head.i xapian-headers.i $(SWIG) $(SWIG_FLAGS) -scmstub -o $@ -guile -package xapian -c++ $< @@ -24,7 +24,14 @@ %scheme %{ -(load-extension "libguilexapian" "SWIG_init") +;; Try loading the shared library by absolute path. If that fails, try +;; searching for it using LD_LIBRARY_PATH and other mechanisms. We do this +;; so that guile-xapian finds libguilexapian both before and after installation. +(catch #t + (lambda () + (load-extension "@libdir@/libguilexapian" "SWIG_init")) + (lambda _ + (load-extension "libguilexapian" "SWIG_init"))) %} %include xapian-head.i |