summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorPatrick Ohly <patrick.ohly@intel.com>2012-10-09 09:18:42 +0200
committerPatrick Ohly <patrick.ohly@intel.com>2012-10-25 16:43:48 +0200
commitf13956bd4b032e4749f65bbafc4ec5dc8e1a1c01 (patch)
tree0cb0224f76eb9e6d95dc1b4d2b26ee33d5f894d0 /configure.ac
parent8b5644ad0fe61dc32f86faefb01318576e6cb2b2 (diff)
PIM: locale-aware sorting and searching
Change the --enable-dbus-service-pim parameter into one which takes a parameter that specifies how locale-aware sorting and searching is to be implemented. The default implementation uses boost::locale. It is expected to get replaced or augemented by OEMs which want to implement more complex sorting or searching (like ignoring Tussenvoegsel in the Netherlands). The LocaleFactory instance takes the current locale from the environment. Making it and its users aware of locale changes at runtime might be needed at some point but is not part of the API at the moment. The Manager class uses the factory to handle sorting and searching requests coming in via D-Bus. Right now, that is not functional yet because the boost::locale implementation is just a stub. It only compiles and links. FullView::setSortOrder is now functional. Clean up view code a bit: - All views delay populating their content until the caller asks for it. For the FullView this will only happen once, so the caller must be able to handle an already populated view, which was missing in ViewResource. Still need a test for this. - Use init(<smart pointer) consistently.
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac47
1 files changed, 37 insertions, 10 deletions
diff --git a/configure.ac b/configure.ac
index 298b0f12..d7cc4a2b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -61,6 +61,11 @@ dnl check for programs.
AC_PROG_CXX
AC_PROG_MAKE_SET
+# Boost headers: boost/foreach.hpp is needed (1.33/Debian Etch
+# doesn't have it, 1.34/Ubuntu 8.10 Hardy does). 1.35 is available
+# as Debian Etch backport.
+AX_BOOST_BASE(1.34)
+
# TODO: Fix code to pass with -pedantic -Wextra.
# -Wno-unknown-pragmas needed because icalstrdup.h
# currently uses the "#pragma }" trick. Should remove that.
@@ -517,21 +522,48 @@ if test $enable_dbus_service = "yes"; then
AC_DEFINE(DBUS_SERVICE, 1, [define if dbus service is enabled])
AC_ARG_ENABLE(dbus-service-pim,
- AS_HELP_STRING([--enable-dbus-service-pim],
- [enable implementation of org._01.pim D-Bus APIs (depends on libfolks)]),
+ AS_HELP_STRING([--enable-dbus-service-pim[=<locale>]],
+ [Enable implementation of org._01.pim D-Bus APIs (depends on libfolks),
+ using src/dbus/server/pim/locale-factory-<locale>.cpp to implement sorting
+ and searching. The default is <locale>=boost, which uses boost::locale.]),
[ enable_dbus_pim="$enableval" ],
[ enable_dbus_pim="no" ])
case "$enable_dbus_pim" in
no) ;;
- yes)
+ *)
+ if test "$enable_dbus_pim" = "yes"; then
+ enable_dbus_pim=boost
+ fi
+ if ! test -r "$srcdir/src/dbus/server/pim/locale-factory-$enable_dbus_pim.cpp"; then
+ AC_MSG_ERROR([invalid value '$enable_dbus_pim' for --enable-dbus-service-pim, $srcdir/src/dbus/server/pim/locale-factory-$enable_dbus_pim.cpp does not exist or is not readable])
+ fi
PKG_CHECK_MODULES(FOLKS, [folks])
AC_DEFINE(ENABLE_DBUS_PIM, 1, [org._01.pim D-Bus API enabled])
+ DBUS_PIM_PLUGIN=$enable_dbus_pim
+ AC_SUBST(DBUS_PIM_PLUGIN)
+
+ case "$enable_dbus_pim" in
+ boost)
+ AX_BOOST_LOCALE
+ # AX_BOOST_LOCALE incorrectly puts -L/... into LDFLAGS.
+ # That's broken because it then overrides the search path
+ # for *all* libraries in a link, not just for boost. Fix
+ # this by putting the LDFLAGS before the lib and leaving
+ # DBUS_PIM_PLUGIN_LDFLAGS empty (for now - might have to
+ # be revised if there ever are any boost flags which need
+ # to go to the start of the link line).
+ DBUS_PIM_PLUGIN_LIBS='$(BOOST_LDFLAGS) $(BOOST_LOCALE_LIB)'
+ DBUS_PIM_PLUGIN_LDFLAGS=
+ ;;
+ esac
+ AC_SUBST(DBUS_PIM_PLUGIN_CFLAGS)
+ AC_SUBST(DBUS_PIM_PLUGIN_LIBS)
+ AC_SUBST(DBUS_PIM_PLUGIN_LDFLAGS)
;;
- *) AC_MSG_ERROR([invalid value for --enable-dbus-service-pim: '$enable_dbus_pim']);;
esac
fi
AM_CONDITIONAL([NOTIFY_COMPATIBILITY], [test "$enable_notify_compat" = "yes"])
-AM_CONDITIONAL([COND_DBUS_PIM], [test "$enable_dbus_pim" = "yes"])
+AM_CONDITIONAL([COND_DBUS_PIM], [test "$enable_dbus_pim" != "no"])
AC_SUBST(DBUS_CFLAGS)
AC_SUBST(DBUS_LIBS)
@@ -623,11 +655,6 @@ AC_SUBST(GUI_LIBS)
AC_SUBST(GUI_PROGRAMS)
AC_SUBST(GUI_DESKTOP_FILES)
-# Boost headers: boost/foreach.hpp is needed (1.33/Debian Etch
-# doesn't have it, 1.34/Ubuntu 8.10 Hardy does). 1.35 is available
-# 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)