## Copyright (C) 2008-2010 Dirk-Jan C. Binnema ## ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation; either version 3 of the License, or ## (at your option) any later version. ## ## This program is distributed in the hope that it will be useful, ## but WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with this program; if not, write to the Free Software Foundation, ## Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. AC_INIT([mu],[0.9-devel],[http://www.djcbsoftware.nl/code/mu]) AC_CONFIG_HEADERS([config.h]) AC_CONFIG_SRCDIR([src/mu.cc]) AM_INIT_AUTOMAKE([dist-bzip2]) # silent build AM_SILENT_RULES([yes]) # we set the set the version of the Xapian database layout here; it # will become part of the db name, so we can automatically recreate the # database when we incompatible have changes. # # note that MU_XAPIAN_DB_VERSION does not necessarily follow MU # versioning, as we hopefully don't have updates for each version; # also, this has nothing to do with Xapian's software version AC_DEFINE(MU_XAPIAN_DB_VERSION,["8.0"], [Schema version of the database]) LT_INIT # don't use AC_PROG_LIBTOOL anymore AS_IF([test x$prefix = xNONE],[ prefix=/usr/local]) AC_SUBST(prefix) AC_PROG_CC AC_PROG_CXX AC_HEADER_STDC # require pkg-config AC_PATH_PROG([PKG_CONFIG], [pkg-config], [no]) AS_IF([test "x$PKG_CONFIG" = "xno"],[ AC_MSG_ERROR([ *** The pkg-config script could not be found. Make sure it is *** in your path, or set the PKG_CONFIG environment variable *** to the full path to pkg-config.]) ]) # check for pmccabe AC_PATH_PROG([PMCCABE], [pmccabe], [no]) AS_IF([test "x$PMCCABE" = "xno"],[ AC_MSG_WARN([ *** Developers: you don't seem to have the 'pmccabe' tool installed. *** Please install it if you want to run the automated code checks]) ]) # by default, we 'normalize' strings -- ie., we get rid of accents # etc. both in the database and in the queries. normalization makes # indexing significantly slower, but on the other hand, it makes # querying for accented data much more convenient. by default, # normalization is enabled. AC_ARG_ENABLE([normalization], AS_HELP_STRING([--disable-normalization], [Disable string normalization])) AS_IF([test "x$enable_normalization" = "xno"], [AC_DEFINE(MU_DISABLE_NORMALIZATION,1,[whether data should be normalized]) ]) # # currently, we don't support systems without d_type in their struct # dirent (Solaris 10); but we do support FSs for which d_type is always # DT_UNKNOWN (Like ReiserFS, XFS on Linux) # # note, we could work around this if there are many people for which # this breaks AC_STRUCT_DIRENT_D_TYPE AS_IF([test "x$ac_cv_member_struct_dirent_d_type" != "xyes"],[ AC_MSG_ERROR([ *** We need the d_type member in struct dirent, but it seems *** your system does not have it]) ]) # support for d_ino in struct dirent is optional AC_STRUCT_DIRENT_D_INO # we need these AC_CHECK_FUNCS([memset realpath setlocale strerror]) # glib2? PKG_CHECK_MODULES(GLIB, glib-2.0) AC_SUBST(GLIB_CFLAGS) AC_SUBST(GLIB_LIBS) # g_test was introduced in glib 2.16 PKG_CHECK_MODULES(g_test,glib-2.0 >= 2.16, [have_gtest=yes],[have_gtest=no]) AM_CONDITIONAL(HAVE_GTEST, test "x$have_gtest" = "xyes") AM_CONDITIONAL(HAVE_GLIB216, test "x$have_gtest" = "xyes") AS_IF([test "x$have_gtest" = "xno"],[ AC_MSG_WARN([You need GLIB version >= 2.16 to build the tests]) ]) # gmime2.4? PKG_CHECK_MODULES(GMIME,gmime-2.4,[have_gmime=yes],[have_gmime=no]) AC_SUBST(GMIME_CFLAGS) AC_SUBST(GMIME_LIBS) AS_IF([test "x$have_gmime" = "xno"],[ AC_MSG_ERROR([ *** gmime-2.4 could not be found; please install it *** e.g., in debian/ubuntu the package would be 'libgmime-2.4-dev' *** If you compiled it yourself, you should ensure that the pkgconfig *** installation dir (e.g., /usr/local/lib/pkgconfig) is in your *** PKG_CONFIG_PATH. ]) ]) # do we have gtk3+ installed? this is just for testing the new gtk3 PKG_CHECK_MODULES(GTK,gtk+-3.0,[have_gtk3=yes],[have_gtk3=no]) AC_SUBST(GTK_CFLAGS) AC_SUBST(GTK_LIBS) AS_IF([test "x$have_gtk3" = "xno"],[ PKG_CHECK_MODULES(GTK,gtk+-2.0,[have_gtk2=yes],[have_gtk2=no]) AC_SUBST(GTK_CFLAGS) AC_SUBST(GTK_LIBS) ]) AM_CONDITIONAL(HAVE_GTK, [test "x$have_gtk2" = "xyes" -o "x$have_gtk3" = "xyes"]) # xapian? AC_CHECK_PROG(XAPIAN,xapian-config,xapian-config,no) AM_CONDITIONAL(HAVE_XAPIAN,test "x$XAPIAN" != "xno") AS_IF([test "x$XAPIAN" = "xno"],[ AC_MSG_ERROR([ *** xapian could not be found; please install it *** e.g., in debian/ubuntu the package would be 'libxapian-dev' *** If you compiled it yourself, you should ensure that xapian-config *** is in your PATH. ]) ],[ XAPIAN_CXXFLAGS=`$XAPIAN --cxxflags` XAPIAN_LIBS=`$XAPIAN --libs` have_xapian="yes" ]) AC_SUBST(XAPIAN_CXXFLAGS) AC_SUBST(XAPIAN_LIBS) AC_CONFIG_FILES([ Makefile src/Makefile src/tests/Makefile mug/Makefile mug/mug.desktop man/Makefile contrib/Makefile ]) AC_OUTPUT echo echo "mu configuration is complete." echo "-----------------------------" echo echo "Note: the Xapian database is no longer stored as /xapian-0.6" echo "but instead simply as /xapian. You can remove the older" echo "/xapian-0.6 directory to save some disk space" echo echo "type 'make' to build mu, or 'make check' to run the unit tests." echo "use 'make V=1' to show the detailed output during the build"