+dnl ******************************
+dnl Check for libphonenumber
+dnl ******************************
+
+EVO_PHONENUMBER_SUPPORT
+
+dnl *******************
+dnl Check for ICU
+dnl *******************
+dnl
+dnl ICU recently started shipping pkg-config files but it's
+dnl not present on many systems, if we don't find the pkg-config
+dnl file then let's fallback on a manual check
+enable_icu=no
+PKG_CHECK_MODULES(ICU, icu-i18n, enable_icu=yes, [
+ enable_icu=yes
+ AC_CHECK_HEADERS(unicode/ucol.h,, enable_icu=no)
+ AC_MSG_CHECKING([for libicui18n])
+ LIBS_old=$LIBS
+ LIBS="$LIBS -licui18n -licuuc -licudata"
+ AC_TRY_LINK([#include <unicode/ucol.h>],
+ [ucol_open ("", NULL);],
+ AC_MSG_RESULT(yes),
+ AC_MSG_RESULT(no); enable_icu=no)
+ LIBS=$LIBS_old
+ if [test x$enable_icu = xyes]; then
+ ICU_CFLAGS=-D_REENTRANT
+ ICU_LIBS="-licui18n -licuuc -licudata"
+ AC_SUBST(ICU_CFLAGS)
+ AC_SUBST(ICU_LIBS)
+ else
+ AC_MSG_ERROR([ICU libs not found, icu-i18n is required.])
+ fi
+])
+
+dnl *************************
+dnl Check for GTK+
+dnl *************************
+AC_ARG_ENABLE([gtk],
+ [AS_HELP_STRING([--enable-gtk],
+ [enable GTK+ (default=yes)])],
+ [enable_gtk=$enableval], [enable_gtk=yes])
+AC_MSG_CHECKING([if GTK+ support is enabled])
+AC_MSG_RESULT([$enable_gtk])
+if test "x$enable_gtk" = xyes; then
+ PKG_CHECK_MODULES(
+ [GTK], [gtk+-3.0 >= gdk_minimum_version],,
+ [AC_MSG_ERROR([
+
+ gtk+-3.0 not found (or version < gdk_minimum_version)
+
+ If you want to disable GTK+ support,
+ please append --disable-gtk to configure.
+
+ ])])
+
+ PKG_CHECK_MODULES(
+ [GCR], [gcr-3 >= gcr_minimum_version],,
+ [AC_MSG_ERROR([
+
+ gcr-3.0 not found (or version < gcr_minimum_version)
+
+ If you want to disable gcr-3.0's GTK+ widgets,
+ please append --disable-gtk to configure.
+
+ ])])
+
+ AC_DEFINE(HAVE_GTK, 1, [Define to 1 if you have the gtk+-3.0 package.])
+fi
+AM_CONDITIONAL(HAVE_GTK, [test x$enable_gtk = xyes])
+
+
+dnl ******************************************
+dnl Check whether to build examples/demos
+dnl ******************************************
+AC_ARG_ENABLE([examples],
+ [AS_HELP_STRING([--enable-examples],
+ [enable the building examples (default=yes)])],
+ [enable_examples=$enableval], [enable_examples=yes])
+AC_MSG_CHECKING([if examples should be built])
+AC_MSG_RESULT([$enable_examples])
+if test "x$enable_examples" = xyes; then
+ PKG_CHECK_MODULES([EXAMPLES],
+ [gtk+-3.0 >= 3.10 glib-2.0 >= 2.38],,
+ [AC_MSG_ERROR([
+ Some packages were not available to build the example program(s).
+
+ If you want to disable examples, please
+ append --disable-examples to configure.
+ ])])
+
+ AC_DEFINE(BUILD_EXAMPLES, 1, [Define to 1 if the examples should be built.])
+fi
+AM_CONDITIONAL(BUILD_EXAMPLES, [test x$enable_examples = xyes])
+
+