autotools: building of binaries optional

When building and installing backends on additional build platforms, linking
the binaries is both unnecessary and sometimes problematic (for example,
helper libraries not available in a version that works).

Therefore configure arguments can be used to disable linking of the binaries.

Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
This commit is contained in:
Patrick Ohly 2017-12-13 01:49:54 -08:00
parent 0c59f20b91
commit 55c7eba954
3 changed files with 27 additions and 4 deletions

View file

@ -351,6 +351,7 @@ RUN_SYNCEVOLUTION_CHECK=die if $$?; return $$buffer;
endif
# patch README.rst properties on-the-fly
if COND_CMDLINE
README.patched.rst: README.rst src/syncevolution
$(AM_V_GEN)perl -e '$$syncfound=0; $$sourcefound=0; $$res=0;' \
-e 'sub run { $$cmd = shift; $$buffer = `env LD_LIBRARY_PATH=src/syncevo/.libs:src/gdbus/.libs:src/gdbusxx/.libs:src/build-synthesis/src/.libs:$$ENV{LD_LIBRARY_PATH} $$cmd`; $(RUN_SYNCEVOLUTION_CHECK) }' \
@ -365,6 +366,14 @@ README.patched.rst: README.rst src/syncevolution
-e 'die "<<source-property>> tag not in README.rst?!" unless $$sourcefound;' \
-e 'exit $$res;' \
$< >$@
else
# Simpler version without inserting the actual sync and datastore properties.
README.patched.rst: README.rst
$(AM_V_GEN)perl -p \
-e 's/^:Version: .*/:Version: $(VERSION)/;' \
-e 's/:Date: .*/":Date: " . `date +%Y-%m-%d`/e;' \
$< >$@
endif
CLEANFILES += README.patched.rst
# produce man pages

View file

@ -477,6 +477,18 @@ AC_ARG_ENABLE(core,
enable_core="$enableval",
enable_core="yes")
AM_CONDITIONAL([COND_CORE], [test "$enable_core" = "yes"])
AC_ARG_ENABLE(cmdline,
AS_HELP_STRING([--enable-cmdline],
[enables building the SyncEvolution command line tool, syncevolution]),
enable_cmdline="$enableval",
enable_cmdline="yes")
AM_CONDITIONAL([COND_CMDLINE], [test "$enable_cmdline" = "yes"])
AC_ARG_ENABLE(local-sync,
AS_HELP_STRING([--enable-local-sync],
[enables building the local synchronization support, in particular syncevo-local-sync]),
enable_local_sync="$enableval",
enable_local_sync="yes")
AM_CONDITIONAL([COND_LOCAL_SYNC], [test "$enable_local_sync" = "yes"])
AC_ARG_ENABLE(dbus-service,
AS_HELP_STRING([--enable-dbus-service=args],

View file

@ -18,12 +18,14 @@ include $(top_srcdir)/src/syncevo/syncevo.am
src_cppflags += -I$(top_srcdir)/src/syncevo
include $(top_srcdir)/src/backends/backends.am
src_cppflags += $(addprefix -I$(top_srcdir)/,$(BACKENDS)) -I$(SYNTHESIS_SUBDIR)
bin_PROGRAMS += src/syncevolution
bin_SCRIPTS += src/synccompare
include $(top_srcdir)/src/templates/templates.am
else
src_cppflags += -I$(top_srcdir)/$(SYNTHESIS_SUBDIR_INCLUDES)
endif
if COND_CMDLINE
bin_PROGRAMS += src/syncevolution
endif
include $(top_srcdir)/src/dbus/dbus.am
src_cppflags += -I$(top_srcdir)/src/dbus
@ -182,8 +184,8 @@ distclean-local:
rm -rf $(SYNTHESIS_SUBDIR)
rm -rf $(CLEAN_CLIENT_SRC)
# Local sync helper executable. Built unconditionally at the moment,
# thus creating a hard dependency on D-Bus.
# Local sync helper executable. Depends on D-Bus for internal communication.
if COND_LOCAL_SYNC
libexec_PROGRAMS += src/syncevo-local-sync
src_syncevo_local_sync_SOURCES = \
src/syncevo-local-sync.cpp \
@ -196,7 +198,7 @@ src_syncevo_local_sync_CPPFLAGS = -DHAVE_CONFIG_H -I$(gdbus_dir) $(src_cppflags)
src_syncevo_local_sync_CXXFLAGS = $(PCRECPP_CFLAGS) $(SYNCEVOLUTION_CXXFLAGS) $(CORE_CXXFLAGS) $(GLIB_CFLAGS) $(DBUS_CFLAGS) $(LIBSOUP_CFLAGS) $(SYNCEVO_WFLAGS)
src_syncevo_local_sync_LDFLAGS = $(PCRECPP_LIBS) $(CORE_LD_FLAGS) $(LIBSOUP_LIBS)
src_syncevo_local_sync_DEPENDENCIES = $(top_builddir)/$(gdbus_build_dir)/libgdbussyncevo.la $(EXTRA_LTLIBRARIES) $(CORE_DEP) $(SYNTHESIS_DEP)
endif
# Do the linking here, as with all SyncEvolution executables.
# Sources are compiled in dbus/server.