autotools: use pcre for regular expressions

Added the necessary autotools rules to use pcre in the src binaries
and libsyncevolution. It's unconditionally required now, which makes
it possible to add code depending on it without having to worry about
the case without pcre.

The alternative to pcre with its C++ binding would have been
boost::Xpressive. pcre was chosen because it has UTF-8 support and is
more common.

boost::regex introduces an undesirable library dependency. The C POSIX
regex code has no C++ binding and does not support easy replacement.

README was updated accordingly.
This commit is contained in:
Patrick Ohly 2011-11-22 20:09:07 +01:00
parent 0f1bed33fe
commit a88ba0a091
4 changed files with 19 additions and 14 deletions

15
HACKING
View file

@ -7,13 +7,17 @@ SyncEvolution source packages and will be used automatically.
The section _`Checking out the source` explains how to work
with sources obtained via the git repositories.
Also needed are the Evolution and Boost (>= 1.35) development
files. For HTTP, either Curl or libsoup can be used.
Also needed are the Evolution (can be disabled), Boost (>= 1.35) and
pcre development files. For HTTP, either Curl or libsoup can be used.
For compiling libsynthesis, sqlite, expat, libz are needed.
On Debian based systems the required packages can be installed with
On Debian based systems, the required packages can be installed with
apt-get install evolution-data-server-dev \
libecal1.2-dev libebook1.2-dev \
libsoup2.4-dev \
libpcre3-dev \
libexpat-dev \
libz-dev \
libboost-dev
libboost-dev >= 1.34, available as libboost1.35-dev backport for Debian Etch.
@ -30,11 +34,6 @@ Optional (enables direct sync with phones):
Optional (only used for SHA-256 when glib is not already a dependency):
apt-get install libnss3-dev
For compiling libsynthesis:
apt-get install libpcre3-dev libsqlite3-dev libexpat-dev libz-dev
This was copied from the libsynthesis README.
The test framework also requires CPPUnit:
apt-get install libcppunit-dev

View file

@ -666,6 +666,10 @@ AC_SUBST(GUI_DESKTOP_FILES)
# as Debian Etch backport.
AX_BOOST_BASE(1.34)
# C++ regular expression support is required often enough to make it
# mandatory.
PKG_CHECK_MODULES(PCRECPP, libpcrecpp)
# need rst2man for man pages
AC_ARG_WITH(rst2man,
AS_HELP_STRING([--with-rst2man=<path to reStructuredText to man converter>],

View file

@ -114,8 +114,8 @@ src_syncevolution_LDADD = $(CORE_LDADD) $(KEYRING_LIBS) $(KDE_KWALLET_LIBS)
if COND_DBUS
src_syncevolution_LDADD += src/gdbus/libgdbussyncevo.la
endif
src_syncevolution_LDFLAGS = $(CORE_LD_FLAGS) $(DBUS_LIBS)
src_syncevolution_CXXFLAGS = $(SYNCEVOLUTION_CXXFLAGS) $(CORE_CXXFLAGS) $(KEYRING_CFLAGS) -I$(top_srcdir)/src/gdbus $(DBUS_CFLAGS) $(KDE_KWALLET_CFLAGS) $(SYNCEVO_WFLAGS)
src_syncevolution_LDFLAGS = $(PCRECPP_LIBS) $(CORE_LD_FLAGS) $(DBUS_LIBS)
src_syncevolution_CXXFLAGS = $(PCRECPP_CFLAGS) $(SYNCEVOLUTION_CXXFLAGS) $(CORE_CXXFLAGS) $(KEYRING_CFLAGS) -I$(top_srcdir)/src/gdbus $(DBUS_CFLAGS) $(KDE_KWALLET_CFLAGS) $(SYNCEVO_WFLAGS)
src_syncevolution_DEPENDENCIES = $(EXTRA_LTLIBRARIES) $(CORE_DEP)
src_syncevolution_CPPFLAGS = $(src_cppflags)
@ -178,8 +178,8 @@ endif
src_syncevo_dbus_server_LDADD = src/dbus/server/libsyncevodbusserver.la src/gdbus/libgdbussyncevo.la $(CORE_LDADD) $(KEYRING_LIBS) $(LIBNOTIFY_LIBS) $(MLITE_LIBS) $(KDE_KWALLET_LIBS) $(DBUS_LIBS)
src_syncevo_dbus_server_CPPFLAGS = -DHAVE_CONFIG_H -I$(top_srcdir)/src/gdbus $(src_cppflags) -DSYNCEVOLUTION_LOCALEDIR=\"${SYNCEVOLUTION_LOCALEDIR}\"
src_syncevo_dbus_server_CXXFLAGS = $(SYNCEVOLUTION_CXXFLAGS) $(CORE_CXXFLAGS) $(GLIB_CFLAGS) $(DBUS_CFLAGS) $(LIBSOUP_CFLAGS) $(KEYRING_CFLAGS) $(LIBNOTIFY_CFLAGS) $(MLITE_CFLAGS) $(KDE_KWALLET_CFLAGS) $(SYNCEVO_WFLAGS)
src_syncevo_dbus_server_LDFLAGS = $(CORE_LD_FLAGS) $(LIBSOUP_LIBS)
src_syncevo_dbus_server_CXXFLAGS = $(PCRECPP_CFLAGS) $(SYNCEVOLUTION_CXXFLAGS) $(CORE_CXXFLAGS) $(GLIB_CFLAGS) $(DBUS_CFLAGS) $(LIBSOUP_CFLAGS) $(KEYRING_CFLAGS) $(LIBNOTIFY_CFLAGS) $(MLITE_CFLAGS) $(KDE_KWALLET_CFLAGS) $(SYNCEVO_WFLAGS)
src_syncevo_dbus_server_LDFLAGS = $(PCRECPP_LIBS) $(CORE_LD_FLAGS) $(LIBSOUP_LIBS)
src_syncevo_dbus_server_DEPENDENCIES = src/dbus/server/libsyncevodbusserver.la src/gdbus/libgdbussyncevo.la $(EXTRA_LTLIBRARIES) $(CORE_DEP) $(SYNTHESIS_DEP)
endif
@ -239,8 +239,8 @@ TEST_FILES_PATCHED = $(wildcard src/testcases/*.tem)
CLIENT_LIB_TEST_FILES += $(TEST_FILES_GENERATED)
src_client_test_CPPFLAGS = -DHAVE_CONFIG_H -DENABLE_INTEGRATION_TESTS -DENABLE_UNIT_TESTS $(src_cppflags) $(BUTEOSYNCPROFILE_CFLAGS) $(BUTEOSYNCCOMMON_CFLAGS) $(QT_CPPFLAGS)
src_client_test_CXXFLAGS = @CPPUNIT_CXXFLAGS@ $(SYNCEVOLUTION_CXXFLAGS) $(CORE_CXXFLAGS) $(KEYRING_CFLAGS) $(BUTEOSYNCPROFILE_CFLAGS) $(BUTEOSYNCCOMMON_CFLAGS) $(filter-out -O2 -g -W -Wall, $(QT_CXXFLAGS)) $(SYNCEVO_WFLAGS)
src_client_test_LDFLAGS = @CPPUNIT_LDFLAGS@ `nm src/syncevo/.libs/libsyncevolution.a | grep funambolAutoRegisterRegistry | sed -e 's/.* /-Wl,-u/'` $(CORE_LD_FLAGS) $(KEYRING_LIBS) $(BUTEOSYNCPROFILE_LIBS) $(BUTEOSYNCCOMMON_LIBS) $(QT_LDFLAGS)
src_client_test_CXXFLAGS = @CPPUNIT_CXXFLAGS@ $(PCRECPP_CFLAGS) $(SYNCEVOLUTION_CXXFLAGS) $(CORE_CXXFLAGS) $(KEYRING_CFLAGS) $(BUTEOSYNCPROFILE_CFLAGS) $(BUTEOSYNCCOMMON_CFLAGS) $(filter-out -O2 -g -W -Wall, $(QT_CXXFLAGS)) $(SYNCEVO_WFLAGS)
src_client_test_LDFLAGS = @CPPUNIT_LDFLAGS@ `nm src/syncevo/.libs/libsyncevolution.a | grep funambolAutoRegisterRegistry | sed -e 's/.* /-Wl,-u/'` $(PCRECPP_LIBS) $(CORE_LD_FLAGS) $(KEYRING_LIBS) $(BUTEOSYNCPROFILE_LIBS) $(BUTEOSYNCCOMMON_LIBS) $(QT_LDFLAGS)
src_client_test_LDADD = $(CORE_LDADD) $(SYNTHESIS_ENGINE) $(BUTEOSYNCPROFILE_LIBS) $(BUTEOSYNCCOMMON_LIBS) $(QT_LIBS)
# These dependencies are intentionally a bit too broad:
# they ensure that all files are in place to *run* client-test.

View file

@ -173,11 +173,13 @@ src_syncevo_libsyncevolution_la_LIBADD = \
@GTHREAD_LIBS@ \
@GLIB_LIBS@ \
$(SYNTHESIS_LIBS) \
$(PCRECPP_LIBS) \
$(TRANSPORT_LIBS) \
@LIBS@ \
$(src_syncevo_ldadd) \
$(NSS_LIBS)
src_syncevo_libsyncevolution_la_CXXFLAGS = \
$(PCRECPP_CFLAGS) \
$(TRANSPORT_CFLAGS) \
$(src_syncevo_cxxflags) \
$(SYNTHESIS_CFLAGS) \