* configure.ac, mu-maildir.c: some compatibility updates

This commit is contained in:
Dirk-Jan C. Binnema
2010-01-16 11:32:07 +02:00
parent 5fd98d2e2e
commit 6f48dbed79
2 changed files with 40 additions and 15 deletions

View File

@ -31,9 +31,8 @@ AC_DEFINE(MU_XAPIAN_DB_VERSION,["0.6"], [Schema version of the database])
AC_PROG_LIBTOOL AC_PROG_LIBTOOL
if test x$prefix = xNONE; then AS_IF([test x$prefix = xNONE],[
prefix=/usr/local prefix=/usr/local])
fi
AC_SUBST(prefix) AC_SUBST(prefix)
AC_PROG_CC AC_PROG_CC
@ -41,14 +40,31 @@ AC_PROG_CXX
AM_PROG_CC_STDC AM_PROG_CC_STDC
AC_HEADER_STDC AC_HEADER_STDC
# have pkg-config? # require pkg-config
AC_PATH_PROG([PKG_CONFIG], [pkg-config], [no]) AC_PATH_PROG([PKG_CONFIG], [pkg-config], [no])
if test "x$PKG_CONFIG" = "xno"; then AS_IF([test "x$PKG_CONFIG" = "xno"],[
AC_MSG_ERROR([ AC_MSG_ERROR([
*** The pkg-config script could not be found. Please make sure it is *** The pkg-config script could not be found. Make sure it is
*** in your path, or set the PKG_CONFIG environment variable *** in your path, or set the PKG_CONFIG environment variable
*** to the full path to pkg-config.]) *** to the full path to pkg-config.])
fi ])
#
# currently, we don' 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 unfortunately
*** your system does not seem to have it])
])
# support for d_ino in struct dirent is optional
AC_STRUCT_DIRENT_D_INO
# glib2? # glib2?
PKG_CHECK_MODULES(GLIB,glib-2.0) PKG_CHECK_MODULES(GLIB,glib-2.0)
@ -63,16 +79,17 @@ AC_SUBST(GMIME_LIBS)
# xapian? # xapian?
AC_CHECK_PROG(XAPIAN,xapian-config,xapian-config,no) AC_CHECK_PROG(XAPIAN,xapian-config,xapian-config,no)
AM_CONDITIONAL(HAVE_XAPIAN,test "x$XAPIAN" != "xno") AM_CONDITIONAL(HAVE_XAPIAN,test "x$XAPIAN" != "xno")
if test "x$XAPIAN" = "xno"; then AS_IF([test "x$XAPIAN" = "xno"],[
AC_MSG_ERROR([ AC_MSG_ERROR([
*** xapian could not be found; please install it *** xapian could not be found; please install it
*** e.g., in debian/ubuntu the package would be 'libxapian-dev']) *** e.g., in debian/ubuntu the package would be 'libxapian-dev'])
else ],[
XAPIAN_CXXFLAGS=`$XAPIAN --cxxflags` XAPIAN_CXXFLAGS=`$XAPIAN --cxxflags`
XAPIAN_LIBS=`$XAPIAN --libs` XAPIAN_LIBS=`$XAPIAN --libs`
have_xapian="yes" have_xapian="yes"
AC_DEFINE(HAVE_XAPIAN,[1],[Whether we have Xapian]) AC_DEFINE(HAVE_XAPIAN,[1],[Whether we have Xapian])
fi ])
AC_SUBST(XAPIAN_CXXFLAGS) AC_SUBST(XAPIAN_CXXFLAGS)
AC_SUBST(XAPIAN_LIBS) AC_SUBST(XAPIAN_LIBS)
@ -82,5 +99,8 @@ Makefile
src/Makefile src/Makefile
]) ])
echo echo
echo "now, type 'make' to build mu" echo "-----------------------------"
echo "mu configuration is complete."
echo "type 'make' to build it"

View File

@ -17,6 +17,8 @@
** **
*/ */
#include "config.h"
#include <unistd.h> #include <unistd.h>
#include <sys/types.h> #include <sys/types.h>
#include <sys/stat.h> #include <sys/stat.h>
@ -398,11 +400,13 @@ dirent_destroy (struct dirent *entry)
g_slice_free(struct dirent, entry); g_slice_free(struct dirent, entry);
} }
#ifdef HAVE_STRUCT_DIRENT_D_INO
static gint static gint
dirent_cmp (struct dirent *d1, struct dirent *d2) dirent_cmp (struct dirent *d1, struct dirent *d2)
{ {
return d1->d_ino - d2->d_ino; return d1->d_ino - d2->d_ino;
} }
#endif /*HAVE_STRUCT_DIRENT_D_INO*/
static MuResult static MuResult
process_dir (const char* path, MuMaildirWalkMsgCallback msg_cb, process_dir (const char* path, MuMaildirWalkMsgCallback msg_cb,
@ -438,8 +442,10 @@ process_dir (const char* path, MuMaildirWalkMsgCallback msg_cb,
lst = g_list_prepend (lst, dirent_copy(entry)); lst = g_list_prepend (lst, dirent_copy(entry));
} }
#if HAVE_STRUCT_DIRENT_D_INO
c = lst = g_list_sort (lst, (GCompareFunc)dirent_cmp); c = lst = g_list_sort (lst, (GCompareFunc)dirent_cmp);
#endif /*HAVE_STRUCT_DIRENT_D_INO*/
for (c = lst, result = MU_OK; c && result == MU_OK; c = c->next) for (c = lst, result = MU_OK; c && result == MU_OK; c = c->next)
result = process_dir_entry (path, (struct dirent*)c->data, result = process_dir_entry (path, (struct dirent*)c->data,
msg_cb, dir_cb, data); msg_cb, dir_cb, data);
@ -491,7 +497,6 @@ mu_maildir_walk (const char *path, MuMaildirWalkMsgCallback cb_msg,
} }
static gboolean static gboolean
clear_links (const gchar* dirname, DIR *dir) clear_links (const gchar* dirname, DIR *dir)
{ {