]> git.sur5r.net Git - bacula/bacula/commitdiff
Use a helper script to link the correct database backend.
authorMarco van Wieringen <mvw@planets.elm.net>
Fri, 8 Jul 2011 13:44:15 +0000 (15:44 +0200)
committerMarco van Wieringen <mvw@planets.elm.net>
Fri, 8 Jul 2011 15:50:33 +0000 (17:50 +0200)
On some platforms the extension of shared libs is not .so
(OSX seems to use .dylib and some other platform even other
exotic names). We now extract the extension from libtool
which knows best as it also creates our shared libs.

bacula/autoconf/configure.in
bacula/src/cats/Makefile.in
bacula/src/cats/install-default-backend.in [new file with mode: 0755]

index 213e71e9dad55ae00df21c011bacead1fdc15d4e..6d566cc120ed40aff6039162d48af1e8151eb49c 100644 (file)
@@ -3304,6 +3304,7 @@ AC_OUTPUT([autoconf/Make.common \
           src/cats/make_bacula_tables \
           src/cats/drop_bacula_tables \
           src/cats/drop_bacula_database \
+          src/cats/install-default-backend \
           src/findlib/Makefile \
           src/tools/Makefile \
           src/plugins/fd/Makefile \
index a4138eab703638294038574b203a4e8b0e59aa95..2df93d77780b1859c19cd892f68e73447050b52f 100644 (file)
@@ -230,8 +230,7 @@ libtool-install: all
        for db_type in @DB_BACKENDS@; do \
            $(LIBTOOL_INSTALL_FINISH) $(INSTALL_LIB) libbaccats-$${db_type}.la $(DESTDIR)$(libdir); \
        done
-       $(CP) $(DESTDIR)$(libdir)/libbaccats-@DEFAULT_DB_TYPE@-$(LIBBACCATS_LT_RELEASE).so \
-             $(DESTDIR)$(libdir)/libbaccats-$(LIBBACCATS_LT_RELEASE).so
+       ./install-default-backend @DEFAULT_DB_TYPE@ $(LIBBACCATS_LT_RELEASE) $(DESTDIR)$(libdir)
 
 libtool-uninstall:
        $(LIBTOOL_UNINSTALL) $(RMF) $(DESTDIR)$(libdir)/libbacsql.la
diff --git a/bacula/src/cats/install-default-backend.in b/bacula/src/cats/install-default-backend.in
new file mode 100755 (executable)
index 0000000..b456eb2
--- /dev/null
@@ -0,0 +1,33 @@
+#!/bin/sh
+
+LIBTOOL=@LIBTOOL@
+
+if [ $# -lt 3 ]; then
+   echo "Usage: $0 <default_backend> <library_version> <install_dir>"
+   exit 1
+fi
+
+default_backend=$1
+library_version=$2
+install_dir=$3
+
+#
+# Find out what the shared lib extension is for this platform.
+#
+shrext_cmds="`${LIBTOOL} --config | grep shrext_cmds`"
+eval $shrext_cmds
+if [ -z "${shrext_cmds}" ]; then
+   echo "Failed to determine default shared library extension"
+   exit 1
+fi
+
+if [ -f ${install_dir}/libbaccats-${default_backend}-${library_version}${shrext_cmds} ]; then
+   #
+   # Create a default catalog library pointing to one of the shared libs.
+   #
+   rm -f ${install_dir}/libbaccats-${library_version}${shrext_cmds}
+   ln -s ${install_dir}/libbaccats-${default_backend}-${library_version}${shrext_cmds} \
+         ${install_dir}/libbaccats-${library_version}${shrext_cmds}
+fi
+
+exit 0