From 30aa34d9eee2416d8cdd58561979b8a6ca73f779 Mon Sep 17 00:00:00 2001 From: Marco van Wieringen Date: Thu, 24 Dec 2009 22:50:28 +0100 Subject: [PATCH] Plugins are dependable on libtool now so cleaned the Makefiles and the fd plugins are only build when --enable-plugins is set and libtool is used. --- bacula/Makefile.in | 2 +- bacula/autoconf/configure.in | 30 +++++++++++++++++++++++++ bacula/src/plugins/dir/Makefile.in | 29 ++++++------------------- bacula/src/plugins/fd/Makefile.in | 35 ++++++------------------------ bacula/src/plugins/sd/Makefile.in | 25 +++++---------------- 5 files changed, 50 insertions(+), 71 deletions(-) diff --git a/bacula/Makefile.in b/bacula/Makefile.in index 3e89b45a0f..83681b6065 100755 --- a/bacula/Makefile.in +++ b/bacula/Makefile.in @@ -21,7 +21,7 @@ dummy: # --client-only directories fd_subdirs = src scripts src/lib src/findlib src/filed \ @READLINE_SRC@ @BAT_DIR@ @TRAY_MONITOR_DIR@ @WX_DIR@ \ - src/console src/plugins/fd + src/console @FD_PLUGIN_DIR@ # Non-client-only directores subdirs = src/cats @DIRD_DIR@ @STORED_DIR@ src/tools diff --git a/bacula/autoconf/configure.in b/bacula/autoconf/configure.in index d52dcfb030..76895e10f8 100644 --- a/bacula/autoconf/configure.in +++ b/bacula/autoconf/configure.in @@ -1671,6 +1671,36 @@ AC_ARG_WITH(sbin-perm, AC_SUBST(SBINPERM) +dnl -------------------------------------------------- +dnl plugin support +dnl -------------------------------------------------- +use_plugins=yes +AC_ARG_ENABLE(plugins, + AC_HELP_STRING([--enable-plugins], [enable plugin support @<:@default=yes@:>@]), + [ + if test x$enableval = xno; then + use_plugins=no + fi + ] +) + +if test "x$use_libtool" != "xyes" -a test "x$use_plugins" = "xyes"; then + echo " " + echo "You specified --enable-plugins but disabled libtool with --disable-libtool" + echo "We only support plugins using libtool so either disable plugins or enable libtool" + echo " " + echo "Aborting the configuration ..." + echo " " + echo " " + exit 1 +fi + +FD_PLUGIN_DIR="" +if test "x$use_plugins" = "xyes" ; then + FD_PLUGIN_DIR="src/plugins/fd" +fi +AC_SUBST(FD_PLUGIN_DIR) + dnl ------------------------------------------------ dnl Bacula check for various SQL database engines dnl ------------------------------------------------ diff --git a/bacula/src/plugins/dir/Makefile.in b/bacula/src/plugins/dir/Makefile.in index 6c4582108a..2c767e7e66 100644 --- a/bacula/src/plugins/dir/Makefile.in +++ b/bacula/src/plugins/dir/Makefile.in @@ -14,37 +14,20 @@ LIBDIR=../../lib .SUFFIXES: .c .o .lo -.c.o: - $(CXX) $(DEFS) $(DEBUG) $(CPPFLAGS) -I${SRCDIR} -I${DIRDIR} -DTEST_PROGRAM -c $< - .c.lo: $(LIBTOOL_COMPILE) $(CXX) $(DEFS) $(DEBUG) $(CPPFLAGS) -I${SRCDIR} -I${DIRDIR} -DTEST_PROGRAM -c $< -all: example-plugin-dir$(DEFAULT_SHARED_OBJECT_TYPE) - -test: main example-plugin-dir.so - -dir_plugins.o: ${DIRDIR}/dir_plugins.h ${DIRDIR}/dir_plugins.c - $(CXX) -I${SRCDIR} -I${DIRDIR} -DTEST_PROGRAM -c ${DIRDIR}/dir_plugins.c - -main: dir_plugins.o - $(CXX) $(LDFLAGS) -L${LIBDIR} dir_plugins.o -o main -lbac -lpthread -lssl -l crypto -ldl - -example-plugin-dir.o: example-plugin-dir.c ${DIRDIR}/dir_plugins.h - $(CXX) $(DEFS) $(DEBUG) $(CPPFLAGS) -fPIC -I../.. -I${DIRDIR} -c example-plugin-dir.c - -example-plugin-dir.so: example-plugin-dir.o - $(CXX) $(LDFLAGS) -shared example-plugin-dir.o -o example-plugin-dir.so +all: example-plugin-dir.la example-plugin-dir.lo: example-plugin-dir.c ${DIRDIR}/dir_plugins.h $(LIBTOOL_COMPILE) $(CXX) $(DEFS) $(DEBUG) $(CFLAGS) -I../.. -I${DIRDIR} -c example-plugin-dir.c -example-plugin-dir.la: Makefile example-plugin-dir$(DEFAULT_OBJECT_TYPE) +example-plugin-dir.la: Makefile example-plugin-dir.lo $(LIBTOOL_LINK) $(CXX) $(LDFLAGS) -shared example-plugin-dir.lo -o $@ -rpath $(plugindir) -module -export-dynamic -avoid-version install: all $(MKDIR) $(DESTDIR)$(plugindir) - $(LIBTOOL_INSTALL) $(INSTALL_PROGRAM) example-plugin-dir$(DEFAULT_SHARED_OBJECT_TYPE) $(DESTDIR)$(plugindir) + $(LIBTOOL_INSTALL) $(INSTALL_PROGRAM) example-plugin-dir.la $(DESTDIR)$(plugindir) $(RMF) $(DESTDIR)$(plugindir)/example-plugin-dir.la libtool-clean: @@ -58,7 +41,9 @@ clean: @LIBTOOL_CLEAN_TARGET@ distclean: clean rm -f Makefile -uninstall: - $(RMF) $(DESTDIR)$(plugindir)/example-plugin-dir.so +libtool-uninstall: + $(LIBTOOL_UNINSTALL) $(RMF) $(DESTDIR)$(plugindir)/example-plugin-dir.la + +uninstall: @LIBTOOL_UNINSTALL_TARGET@ depend: diff --git a/bacula/src/plugins/fd/Makefile.in b/bacula/src/plugins/fd/Makefile.in index eccbc7e770..edb4337660 100644 --- a/bacula/src/plugins/fd/Makefile.in +++ b/bacula/src/plugins/fd/Makefile.in @@ -12,32 +12,12 @@ FDDIR=../../filed SRCDIR=../.. LIBDIR=../../lib -.SUFFIXES: .c .o .lo - -.c.o: - $(CXX) $(DEFS) $(DEBUG) $(CPPFLAGS) -I${SRCDIR} -I${FDDIR} -DTEST_PROGRAM -c $< +.SUFFIXES: .c .lo .c.lo: $(LIBTOOL_COMPILE) $(CXX) $(DEFS) $(DEBUG) $(CPPFLAGS) -I${SRCDIR} -I${FDDIR} -DTEST_PROGRAM -c $< -all: bpipe-fd$(DEFAULT_SHARED_OBJECT_TYPE) - -test: main example-plugin-fd.so - -fd_plugins.o: ${FDDIR}/fd_plugins.h ${FDDIR}/fd_plugins.c - $(CXX) -I${SRCDIR} -I${FDDIR} -DTEST_PROGRAM -c ${FDDIR}/fd_plugins.c - -main: fd_plugins.o - $(CXX) $(LDFLAGS) -L${LIBDIR} fd_plugins.o -o main -lbac -lpthread -lssl -l crypto -ldl - -example-plugin-fd.o: example-plugin-fd.c ${FDDIR}/fd_plugins.h - $(CXX) -fPIC -I../.. -I${FDDIR} -c example-plugin-fd.c - -example-plugin-fd.so: example-plugin-fd.o - $(CXX) $(LDFLAGS) -shared example-plugin-fd.o -o example-plugin-fd.so - -bpipe-fd.o: bpipe-fd.c ${FDDIR}/fd_plugins.h - $(CXX) $(DEFS) $(DEBUG) $(CPPFLAGS) -fPIC -I../.. -I${FDDIR} -c bpipe-fd.c +all: bpipe-fd.la bpipe-fd.lo: bpipe-fd.c ${FDDIR}/fd_plugins.h $(LIBTOOL_COMPILE) $(CXX) $(DEFS) $(DEBUG) $(CPPFLAGS) $(CFLAGS) -I../.. -I${FDDIR} -c bpipe-fd.c @@ -45,12 +25,9 @@ bpipe-fd.lo: bpipe-fd.c ${FDDIR}/fd_plugins.h bpipe-fd.la: Makefile bpipe-fd$(DEFAULT_OBJECT_TYPE) $(LIBTOOL_LINK) $(CXX) $(LDFLAGS) -shared bpipe-fd.lo -o $@ -rpath $(plugindir) -module -export-dynamic -avoid-version -bpipe-fd.so: bpipe-fd.o - $(CXX) $(LDFLAGS) -shared bpipe-fd.o -o $@ - install: all $(MKDIR) $(DESTDIR)$(plugindir) - $(LIBTOOL_INSTALL) $(INSTALL_PROGRAM) bpipe-fd$(DEFAULT_SHARED_OBJECT_TYPE) $(DESTDIR)$(plugindir) + $(LIBTOOL_INSTALL) $(INSTALL_PROGRAM) bpipe-fd.la $(DESTDIR)$(plugindir) $(RMF) $(DESTDIR)$(plugindir)/bpipe-fd.la libtool-clean: @@ -64,7 +41,9 @@ clean: libtool-clean distclean: clean @rm -f Makefile -uninstall: - $(RMF) $(DESTDIR)$(plugindir)/bpipe-fd.so +libtool-uninstall: + $(LIBTOOL_UNINSTALL) $(RMF) $(DESTDIR)$(plugindir)/bpipe-fd.so + +uninstall: @LIBTOOL_UNINSTALL_TARGET@ depend: diff --git a/bacula/src/plugins/sd/Makefile.in b/bacula/src/plugins/sd/Makefile.in index 3584fdeae7..61f5211e5c 100644 --- a/bacula/src/plugins/sd/Makefile.in +++ b/bacula/src/plugins/sd/Makefile.in @@ -14,27 +14,10 @@ LIBDIR=../../lib .SUFFIXES: .c .o .lo -.c.o: - $(CXX) $(DEFS) $(DEBUG) $(CPPFLAGS) -I${SRCDIR} -I${SDDIR} -DTEST_PROGRAM -c $< - .c.lo: $(LIBTOOL_COMPILE) $(CXX) $(DEFS) $(DEBUG) $(CPPFLAGS) -I${SRCDIR} -I${SDDIR} -DTEST_PROGRAM -c $< -all: example-plugin-sd$(DEFAULT_SHARED_OBJECT_TYPE) - -test: main example-plugin-sd.so - -dir_plugins.o: ${SDDIR}/dir_plugins.h ${SDDIR}/dir_plugins.c - $(CXX) -I${SRCDIR} -I${SDDIR} -DTEST_PROGRAM -c ${SDDIR}/dir_plugins.c - -main: dir_plugins.o - $(CXX) $(LDFLAGS) -L${LIBDIR} dir_plugins.o -o main -lbac -lpthread -lssl -l crypto -ldl - -example-plugin-sd.o: example-plugin-sd.c ${SDDIR}/dir_plugins.h - $(CXX) $(DEFS) $(DEBUG) $(CPPFLAGS) -fPIC -I../.. -I${SDDIR} -c example-plugin-sd.c - -example-plugin-sd.so: example-plugin-sd.o - $(CXX) $(LDFLAGS) -shared example-plugin-sd.o -o example-plugin-sd.so +all: example-plugin-sd.la example-plugin-sd.lo: example-plugin-sd.c ${SDDIR}/dir_plugins.h $(LIBTOOL_COMPILE) $(CXX) $(DEFS) $(DEBUG) $(CFLAGS) -I../.. -I${SDDIR} -c example-plugin-sd.c @@ -58,7 +41,9 @@ clean: @LIBTOOL_CLEAN_TARGET@ distclean: clean rm -f Makefile -uninstall: - $(RMF) $(DESTDIR)$(plugindir)/example-plugin-sd.so +libtool-uninstall: + $(LIBTOOL_UNINSTALL) $(RMF) $(DESTDIR)$(plugindir)/example-plugin-sd.so + +uninstall: @LIBTOOL_UNINSTALL_TARGET@ depend: -- 2.39.5