From: Radosław Korzeniewski Date: Fri, 19 Feb 2021 11:08:00 +0000 (+0100) Subject: build: Update Plugins build procedure. X-Git-Tag: Release-11.3.2~694 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f71f92a0930e8ccdedbe5b5e14ba62342e7d7cd6;p=thirdparty%2Fbacula.git build: Update Plugins build procedure. --- diff --git a/bacula/.gitignore b/bacula/.gitignore index 35a4e8aaa..8fe596d37 100644 --- a/bacula/.gitignore +++ b/bacula/.gitignore @@ -392,14 +392,14 @@ src/lib/libbacpy.a src/plugins/dir/*.o src/plugins/dir/*.so src/plugins/dir/main -src/plugins/dir/Makefile +src/plugins/dir/Makefile.inc src/plugins/dir/.libs # src/plugins/fd/ src/plugins/fd/*.o src/plugins/fd/*.so src/plugins/fd/main -src/plugins/fd/Makefile +src/plugins/fd/Makefile.inc src/plugins/fd/.libs # src/plugins/sd/ diff --git a/bacula/Makefile.in b/bacula/Makefile.in index 3772c4a93..45eb9fc54 100755 --- a/bacula/Makefile.in +++ b/bacula/Makefile.in @@ -22,13 +22,16 @@ dummy: # --client-only directories fd_subdirs = src scripts src/lib src/findlib src/filed \ - @READLINE_SRC@ @BAT_DIR@ src/console @FD_PLUGIN_DIR@ + @READLINE_SRC@ @BAT_DIR@ src/console # Non-client-only directores -subdirs = src/cats @DIRD_DIR@ @STORED_DIR@ src/tools @DIR_PLUGIN_DIR@ +subdirs = src/cats @DIRD_DIR@ @STORED_DIR@ src/tools all_subdirs = ${fd_subdirs} ${@ALL_DIRS@} manpages +# plugins enabled +pluginsdirs = @FD_PLUGIN_DIR@ @DIR_PLUGIN_DIR@ + DIST = INSTALL README.configure configure Makefile Makefile.in ChangeLog DIST_CFG = autoconf/aclocal.m4 autoconf/configure.in \ @@ -52,9 +55,12 @@ all: Makefile depend: @for I in ${all_subdirs}; \ - do (cd $$I; echo "==>Entering directory `pwd`"; $(MAKE) DESTDIR=$(DESTDIR) $@ || exit 1); done - -bacula-fd: Makefile + do (cd $$I; echo "==>Entering directory `pwd`"; $(MAKE) DESTDIR=$(DESTDIR) $@ || exit 1); done + @for I in ${pluginsdirs}; \ + do echo "==>Entering directory ${I}" + $(MAKE) DESTDIR=$(DESTDIR) -C ${I} $@ ; done + +bacula-fd: Makefile @for I in ${fd_subdirs}; \ do (cd $$I; echo "==>Entering directory `pwd`"; \ $(MAKE) DESTDIR=$(DESTDIR) all || \ @@ -62,6 +68,11 @@ bacula-fd: Makefile echo ""; echo ""; false ) || false) || exit 1; \ done +plugins: + @for I in ${pluginsdirs}; \ + do echo "==> Plugin directory" $$I; \ + $(MAKE) DESTDIR=$(DESTDIR) -C $$I all ; done + #------------------------------------------------------------------------- autoconf/aclocal.m4: autoconf/configure.in autoconf/bacula-macros/* autoconf/gettext-macros/* autoconf/libtool/* @@ -153,6 +164,11 @@ uninstall-autostart-fd: uninstall-autostart-sd: (cd platforms && $(MAKE) DESTDIR=$(DESTDIR) $@ || exit 1) +install-plugins: + @for I in ${pluginsdirs}; \ + do echo "==> Plugin directory $$I"; \ + $(MAKE) DESTDIR=$(DESTDIR) -C $$I install ; done + Makefile: Makefile.in cd $(topdir) \ && CONFIG_FILES=$(thisdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status @@ -176,7 +192,7 @@ Makefiles: (cd src/qt-console/tray-monitor; \ chmod 755 install_conf_file build-depkgs-qt-console) -clean: +clean: clean-plugins @for I in ${all_subdirs} ; \ do (cd $$I; echo "==>Entering directory `pwd`"; ${MAKE} $@ || exit 1); done @(cd platforms; echo "==>Entering directory `pwd`"; ${MAKE} $@ || exit 1) @@ -185,6 +201,10 @@ clean: @$(RMF) -r autom4te.cache @find . -name ".#*" -exec $(RMF) {} \; +clean-plugins: + @for I in ${pluginsdirs}; \ + do echo "==> Plugin directory" $$I; \ + $(MAKE) DESTDIR=$(DESTDIR) -C $$I clean ; done # clean for distribution distclean: diff --git a/bacula/autoconf/configure.in b/bacula/autoconf/configure.in index 64fc3f7c2..6eb075d5c 100644 --- a/bacula/autoconf/configure.in +++ b/bacula/autoconf/configure.in @@ -3234,8 +3234,6 @@ dnl dnl Enable/Disable plugin support dnl -PLUGCONFILES="" - dnl Docker Plugin support_docker=auto AC_ARG_ENABLE(docker-plugin, @@ -3354,7 +3352,6 @@ if test x$support_ldap_bpam = xyes -o x$support_ldap_bpam = xauto; then fi if test x$support_ldap_bpam = xyes; then DIR_PLUGIN_DIR="${DIR_PLUGIN_DIR} src/plugins/dir/ldap/src" - PLUGCONFILES="${PLUGCONFILES} src/plugins/dir/ldap/src/Makefile" fi AC_SUBST(BPAM_LDAP_TARGET) @@ -3838,10 +3835,9 @@ AC_CONFIG_FILES([ src/cats/install-default-backend \ src/findlib/Makefile \ src/tools/Makefile \ - src/plugins/fd/Makefile \ src/plugins/fd/Makefile.inc \ src/plugins/sd/Makefile \ - src/plugins/dir/Makefile \ + src/plugins/dir/Makefile.inc \ po/Makefile.in \ updatedb/update_mysql_tables \ updatedb/update_sqlite3_tables \ @@ -3869,7 +3865,6 @@ AC_CONFIG_FILES([ platforms/rpms/suse/bacula-bat.spec \ platforms/rpms/suse/bacula-docs.spec \ platforms/rpms/suse/bacula-mtx.spec \ - $PLUGCONFILES \ $PFILES ]) AC_OUTPUT diff --git a/bacula/src/plugins/dir/Makefile.in b/bacula/src/plugins/dir/Makefile similarity index 65% rename from bacula/src/plugins/dir/Makefile.in rename to bacula/src/plugins/dir/Makefile index ab7c58639..3f5e858f2 100644 --- a/bacula/src/plugins/dir/Makefile.in +++ b/bacula/src/plugins/dir/Makefile @@ -4,19 +4,8 @@ # Copyright (C) 2000-2015 Kern Sibbald # License: BSD 2-Clause; see file LICENSE-FOSS # -@MCOMMON@ - -# No optimization for now for easy debugging - -DIRDIR=../../dird -SRCDIR=../.. -LIBDIR=../../lib - -topdir = @BUILD_DIR@ -thisdir = src/plugins/dir - -.SUFFIXES: .c .o .lo +include Makefile.inc .c.lo: $(LIBTOOL_COMPILE) $(CXX) $(DEFS) $(DEBUG) $(CPPFLAGS) $(CFLAGS) -I${SRCDIR} -I${DIRDIR} -DTEST_PROGRAM -c $< @@ -39,29 +28,20 @@ test-authentication-api-dir.la: Makefile test-authentication-api-dir.lo dirplugl install: all $(MKDIR) $(DESTDIR)$(plugindir) -# $(LIBTOOL_INSTALL) $(INSTALL_PROGRAM) example-plugin-dir.la $(DESTDIR)$(plugindir) -# $(LIBTOOL_INSTALL) $(INSTALL_PROGRAM) test-authentication-api-dir.la $(DESTDIR)$(plugindir) -# $(RMF) $(DESTDIR)$(plugindir)/example-plugin-dir.la -# $(RMF) $(DESTDIR)$(plugindir)/test-authentication-api-dir.la - -libtool-clean: +$(LIBTOOL_CLEAN_TARGET): find . -name '*.lo' -print | xargs $(LIBTOOL_CLEAN) $(RMF) $(RMF) *.la $(RMF) -r .libs _libs -clean: @LIBTOOL_CLEAN_TARGET@ +clean: $(LIBTOOL_CLEAN_TARGET) rm -f main *.so *.o 1 2 3 distclean: clean rm -f Makefile -libtool-uninstall: +$(LIBTOOL_UNINSTALL_TARGET): $(LIBTOOL_UNINSTALL) $(RMF) $(DESTDIR)$(plugindir)/example-plugin-dir.la -Makefile: Makefile.in $(topdir)/config.status - cd $(topdir) \ - && CONFIG_FILES=$(thisdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status - -uninstall: @LIBTOOL_UNINSTALL_TARGET@ +uninstall: $(LIBTOOL_UNINSTALL_TARGET) depend: diff --git a/bacula/src/plugins/dir/Makefile.inc.in b/bacula/src/plugins/dir/Makefile.inc.in new file mode 100644 index 000000000..e2a83d1c8 --- /dev/null +++ b/bacula/src/plugins/dir/Makefile.inc.in @@ -0,0 +1,28 @@ +# +# Makefile for building FD plugins PluginLibrary for Bacula +# +# Copyright (C) 2000-2020 Kern Sibbald +# License: BSD 2-Clause; see file LICENSE-FOSS +# +# Author: Radoslaw Korzeniewski, radoslaw@korzeniewski.net +# + +@MCOMMON@ + +topdir = @BUILD_DIR@ +working_dir = @working_dir@ +LIBTOOL_CLEAN_TARGET = @LIBTOOL_CLEAN_TARGET@ +LIBTOOL_UNINSTALL_TARGET = @LIBTOOL_UNINSTALL_TARGET@ + +LDAP_LIBS=@LDAP_LIBS@ +LDAP_LDFLAGS=@LDAP_LDFLAGS@ +LDAP_INC=@LDAP_INC@ +BPAM_LDAP_TARGET = @BPAM_LDAP_TARGET@ +BPAM_LDAP_TARGET_INSTALL = @BPAM_LDAP_TARGET_INSTALL@ + +SRCDIR = $(topdir)/src +DIRDIR = $(SRCDIR)/dird +LIBDIR = $(SRCDIR)/lib +DIRPLUGDIR = $(SRCDIR)/plugins/dir + +.SUFFIXES: .c .cpp .lo diff --git a/bacula/src/plugins/dir/ldap/src/Makefile.in b/bacula/src/plugins/dir/ldap/src/Makefile similarity index 74% rename from bacula/src/plugins/dir/ldap/src/Makefile.in rename to bacula/src/plugins/dir/ldap/src/Makefile index fd62206df..f5f1983e4 100644 --- a/bacula/src/plugins/dir/ldap/src/Makefile.in +++ b/bacula/src/plugins/dir/ldap/src/Makefile @@ -5,32 +5,14 @@ # License: BSD 2-Clause; see file LICENSE-FOSS # # -@MCOMMON@ -# No optimization for now for easy debugging - -DIRDIR=../../../../dird -SRCDIR=../../../.. -LIBDIR=../../../../lib -DIRPLUGDIR=../.. - -topdir = @BUILD_DIR@ -working_dir=@working_dir@ -thisdir = src/plugins/dir/ldap/src - -LDAP_LIBS=@LDAP_LIBS@ -LDAP_LDFLAGS=@LDAP_LDFLAGS@ -LDAP_INC=@LDAP_INC@ -BPAM_LDAP_TARGET = @BPAM_LDAP_TARGET@ -BPAM_LDAP_TARGET_INSTALL = @BPAM_LDAP_TARGET_INSTALL@ +include ../../Makefile.inc LDAPSRC = ldap-dir.c LDAPTESTSRC = ldaptest.c LDAPOBJ = $(LDAPSRC:.c=.lo) LDAPTESTOBJ = $(LDAPTESTSRC:.c=.lo) -.SUFFIXES: .c .lo - # ldap-dir.la ldaptest all: $(BPAM_LDAP_TARGET) @@ -56,35 +38,35 @@ ldaptest: $(LDAPTESTOBJ) Makefile install: $(BPAM_LDAP_TARGET_INSTALL) install-ldap: ldap-dir.la - @echo "Installing plugin ... $(^:.la=.so)" + @echo "Installing plugin $(^:.la=.so) ..." $(MKDIR) $(DESTDIR)$(plugindir) $(LIBTOOL_INSTALL) $(INSTALL_PROGRAM) ldap-dir.la $(DESTDIR)$(plugindir) $(NO_ECHO)$(RMF) $(DESTDIR)$(plugindir)/ldap-dir.la install-ldaptest: ldaptest - @echo "Installing ldaptest ..." - $(LIBTOOL_INSTALL) $(INSTALL_PROGRAM) ldaptest $(DESTDIR)$(sbindir) + @echo "Installing $< ..." + $(LIBTOOL_INSTALL) $(INSTALL_PROGRAM) $< $(DESTDIR)$(sbindir) Makefile: Makefile.in $(topdir)/config.status cd $(topdir) \ && CONFIG_FILES=$(thisdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status -libtool-clean: +$(LIBTOOL_CLEAN_TARGET): @find . -name '*.lo' -print | xargs $(LIBTOOL_CLEAN) $(RMF) @$(RMF) *.la @$(RMF) -r .libs _libs -clean: libtool-clean +clean: $(LIBTOOL_CLEAN_TARGET) @rm -f main ldaptest *.so *.o distclean: clean @rm -f Makefile *.la *.lo @rm -rf .libs -libtool-uninstall: +$(LIBTOOL_UNINSTALL_TARGET): $(LIBTOOL_UNINSTALL) $(RMF) $(DESTDIR)$(plugindir)/ldap-dir.so $(LIBTOOL_UNINSTALL) $(RMF) $(DESTDIR)$(plugindir)/msad-fd.so -uninstall: @LIBTOOL_UNINSTALL_TARGET@ +uninstall: $(LIBTOOL_UNINSTALL_TARGET) depend: \ No newline at end of file diff --git a/bacula/src/plugins/fd/Makefile.in b/bacula/src/plugins/fd/Makefile similarity index 93% rename from bacula/src/plugins/fd/Makefile.in rename to bacula/src/plugins/fd/Makefile index b48a4456a..4458e7107 100644 --- a/bacula/src/plugins/fd/Makefile.in +++ b/bacula/src/plugins/fd/Makefile @@ -52,23 +52,19 @@ install-test-plugin: all install-docker: $(MAKE) -C docker install -Makefile: Makefile.in $(topdir)/config.status - cd $(topdir) \ - && CONFIG_FILES=$(FDPLUGDIR)/$@ CONFIG_HEADERS= $(SHELL) ./config.status - -libtool-clean: +$(LIBTOOL_CLEAN_TARGET): @find . -name '*.lo' -print | xargs $(LIBTOOL_CLEAN) $(RMF) @$(RMF) *.la @$(RMF) -r .libs _libs -clean: libtool-clean +clean: $(LIBTOOL_CLEAN_TARGET) @rm -f main *.so *.o 1 2 3 distclean: clean @rm -f Makefile *.la *.lo @rm -rf .libs -libtool-uninstall: +$(LIBTOOL_UNINSTALL_TARGET): $(LIBTOOL_UNINSTALL) $(RMF) $(DESTDIR)$(plugindir)/bpipe-fd.so uninstall: $(LIBTOOL_UNINSTALL_TARGET) diff --git a/bacula/src/plugins/fd/Makefile.inc.in b/bacula/src/plugins/fd/Makefile.inc.in index fdc8a20a8..ca1524454 100644 --- a/bacula/src/plugins/fd/Makefile.inc.in +++ b/bacula/src/plugins/fd/Makefile.inc.in @@ -11,6 +11,9 @@ topdir = @BUILD_DIR@ working_dir = @working_dir@ +LIBTOOL_CLEAN_TARGET = @LIBTOOL_CLEAN_TARGET@ +LIBTOOL_UNINSTALL_TARGET = @LIBTOOL_UNINSTALL_TARGET@ + SYBASE_TMPDIR = @sybase_tmpdir@ SYBASE_CONFIG = @sysconfdir@/sbt.conf ORACLE_TMPDIR = @oracle_tmpdir@ @@ -18,7 +21,6 @@ SAP_TMPDIR = @sap_tmpdir@ RMAN_SCRIPT_DIR = @sysconfdir@ RSYNC_INC = @RSYNC_INC@ RSYNC_LIBS = @RSYNC_LIBS@ -LIBTOOL_UNINSTALL_TARGET = @LIBTOOL_UNINSTALL_TARGET@ SRCDIR = $(topdir)/src FDDIR = $(SRCDIR)/filed diff --git a/bacula/src/plugins/fd/docker/Makefile b/bacula/src/plugins/fd/docker/Makefile index 2356c87be..b65ba515f 100644 --- a/bacula/src/plugins/fd/docker/Makefile +++ b/bacula/src/plugins/fd/docker/Makefile @@ -40,7 +40,7 @@ $(UNITTESTSOBJ): $(LIBBACOBJ): $(MAKE) -C $(LIBDIR) libbac.la -docker-fd.la: Makefile $(DOCKEROBJ) $(PLUGINLIBDIR)/pluginlib.lo $(DOCKERSRCH) $(LIBDIR)/libbac.la +docker-fd.la: Makefile $(DOCKEROBJ) $(PLUGINLIBDIR)/pluginlib.lo $(DOCKERSRCH) @echo "Linking $(@:.la=.so) ..." $(NO_ECHO)$(LIBTOOL_LINK) --silent $(CXX) $(LDFLAGS) -shared $^ -o $@ -rpath $(plugindir) -module -export-dynamic -avoid-version diff --git a/bacula/src/plugins/fd/pluginlib/Makefile b/bacula/src/plugins/fd/pluginlib/Makefile index a4566cbd3..b890b46ce 100644 --- a/bacula/src/plugins/fd/pluginlib/Makefile +++ b/bacula/src/plugins/fd/pluginlib/Makefile @@ -93,8 +93,6 @@ iso8601_test: Makefile $(ISO8601TESTOBJ) $(ISO8601SRC) $(UNITTESTSOBJ) $(LIBBACO install: all $(MKDIR) $(DESTDIR)$(plugindir) - $(LIBTOOL_INSTALL) $(INSTALL_PROGRAM) bpipe-fd.la $(DESTDIR)$(plugindir) - $(RMF) $(DESTDIR)$(plugindir)/bpipe-fd.la libtool-clean: @find . -name '*.lo' -print | xargs $(LIBTOOL_CLEAN) $(RMF)