mu/configure.ac

183 lines
6.1 KiB
Plaintext
Raw Normal View History

2010-08-21 19:44:53 +02:00
## Copyright (C) 2008-2010 Dirk-Jan C. Binnema <djcb@djcbsoftware.nl>
##
## 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.
2010-12-04 11:37:15 +01:00
AC_INIT([mu],[0.9],[http://code.google.com/p/mu0/issues/list])
AC_CONFIG_HEADERS([config.h])
2010-01-31 11:10:21 +01:00
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;
2010-08-21 19:44:53 +02:00
# also, this has nothing to do with Xapian's software version
AC_DEFINE(MU_XAPIAN_DB_VERSION,["9.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([
2010-01-25 07:23:40 +01:00
*** 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])
])
# gmime 2.4 or 2.6? mu has only been tested with gmime-2.4, but Fedora
# 14 ships with gmime 2.5.x, which registers itself (pkgconfig) as 2.6
# it is reported mu works fine with this new gmime as well, so we support
# both; based on patch by GooseYArd
PKG_CHECK_MODULES(GMIME,gmime-2.4,[have_gmime_24=yes],[have_gmime_24=no])
AS_IF([test "x$have_gmime_24" = "xno"],[
PKG_CHECK_MODULES(GMIME,gmime-2.6,[have_gmime_26=yes],[have_gmime_26=no])
AS_IF([test "x$have_gmime_26" = "xno"],[
AC_MSG_ERROR([
*** neither gmime-2.4 nor gmime-2.6 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.
])
])
])
AC_SUBST(GMIME_CFLAGS)
AC_SUBST(GMIME_LIBS)
# 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
2010-11-15 07:43:00 +01:00
toys/Makefile
toys/mug/Makefile
toys/mug/mug.desktop
2010-01-16 14:27:41 +01:00
man/Makefile
2010-08-21 19:44:53 +02:00
contrib/Makefile
])
AC_OUTPUT
echo
echo "mu configuration is complete."
echo "-----------------------------"
echo
2010-11-15 07:43:00 +01:00
echo "Note: since version 0.7, the Xapian database is no longer stored as "
echo "<muhome>/xapian-0.6 but instead simply as <muhome>/xapian. You can "
echo "remove the old <muhome>/xapian-0.6 directory to save some disk space"
echo
echo "type 'make' to build mu, or 'make check' to run the unit tests."
2010-08-21 19:44:53 +02:00
echo "use 'make V=1' to show the detailed output during the build"