From 6b20dbd38e4d1dbe405c275df337871311434c74 Mon Sep 17 00:00:00 2001 From: "Dirk-Jan C. Binnema" Date: Tue, 17 Aug 2010 00:41:37 +0300 Subject: [PATCH] * don't require gio anymore, not even optionally --- configure.ac | 32 +++++++++++++++------------ src/Makefile.am | 1 - src/mu-log.c | 58 +++++++++++++------------------------------------ 3 files changed, 33 insertions(+), 58 deletions(-) diff --git a/configure.ac b/configure.ac index 34d38b3a..1a2913a3 100644 --- a/configure.ac +++ b/configure.ac @@ -14,7 +14,7 @@ ## 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.7],[http://www.djcbsoftware.nl/code/mu]) +AC_INIT([mu],[0.7.1],[http://www.djcbsoftware.nl/code/mu]) AC_CONFIG_HEADERS([config.h]) AC_CONFIG_SRCDIR([src/mu.cc]) AM_INIT_AUTOMAKE([dist-bzip2]) @@ -61,7 +61,6 @@ AS_IF([test "x$PMCCABE" = "xno"],[ ]) - # # 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 @@ -84,16 +83,14 @@ PKG_CHECK_MODULES(GLIB, glib-2.0) AC_SUBST(GLIB_CFLAGS) AC_SUBST(GLIB_LIBS) - # gio has only been added to recent glib -PKG_CHECK_MODULES(GIO,gio-2.0,[have_gio=yes],[have_gio=no]) -AM_CONDITIONAL(HAVE_GIO, [test "x$have_gio" = "xyes"]) -AS_IF([test "x$have_gio" = "xno"],[ - AC_MSG_WARN([GIO not supported]) -],[ - AC_DEFINE(HAVE_GIO,[1],[Wether we have GIO]) -]) - +dnl PKG_CHECK_MODULES(GIO,gio-2.0,[have_gio=yes],[have_gio=no]) +dnl AM_CONDITIONAL(HAVE_GIO, [test "x$have_gio" = "xyes"]) +dnl AS_IF([test "x$have_gio" = "xno"],[ +dnl AC_MSG_WARN([GIO not supported]) +dnl ],[ +dnl AC_DEFINE(HAVE_GIO,[1],[Wether we have GIO]) +dnl ]) # g_test was introduced in glib 2.16 PKG_CHECK_MODULES(g_test,glib-2.0 >= 2.16, [have_gtest=yes],[have_gtest=no]) @@ -111,7 +108,11 @@ 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']) + *** 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. + ]) ]) @@ -121,7 +122,10 @@ 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']) + *** 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` @@ -148,7 +152,7 @@ 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 "/xapian-0.6 directory to save some disk space" echo echo "type 'make' to build mu, or 'make check' to run the unit tests." diff --git a/src/Makefile.am b/src/Makefile.am index 784e76ad..db49f7c6 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -23,7 +23,6 @@ if HAVE_GTEST SUBDIRS += tests endif - INCLUDES=$(XAPIAN_CXXFLAGS) $(GMIME_CFLAGS) $(GLIB_CFLAGS) # don't use -Werror, as it might break on other compilers diff --git a/src/mu-log.c b/src/mu-log.c index 0809e4c3..01759365 100644 --- a/src/mu-log.c +++ b/src/mu-log.c @@ -17,8 +17,9 @@ ** */ -#include +#include +#include #include #include #include @@ -28,10 +29,6 @@ #include #include -#ifdef HAVE_GIO -#include -#endif /*HAVE_GIO*/ - #include "mu-log.h" #include "mu-util.h" @@ -116,49 +113,24 @@ mu_log_init_with_fd (int fd, gboolean doclose, return TRUE; } - - -/* log file is too big!; we move it to .old, overwriting */ -#ifdef HAVE_GIO -static gboolean -move_log_file (const char* logfile) -{ - GFile *src, *dst; - gchar *tmp; - GError *err; - gboolean rv; - - src = g_file_new_for_path (logfile); - tmp = g_strdup_printf ("%s.old", logfile); - dst = g_file_new_for_path (tmp); - g_free (tmp); - - err = NULL; - rv = g_file_move (src, dst, G_FILE_COPY_OVERWRITE, NULL, - NULL, NULL, &err); - if (!rv) { - g_warning ("Failed to move %s to %s.old: %s", - logfile, logfile, err ? err->message : "?"); - if (err) - g_error_free (err); - } - - g_object_unref (G_OBJECT(src)); - g_object_unref (G_OBJECT(dst)); - - return rv; -} -#else static gboolean move_log_file (const char *logfile) { - g_message ("Failed to move log file '%s', because this mu " - "was built without GIO support", logfile); + gchar *logfile_old; + int rv; + + logfile_old = g_strdup_printf ("%s.old", logfile); + rv = rename (logfile, logfile_old); + g_free (logfile_old); + + if (rv != 0) { + g_warning ("Failed to move %s to %s.old: %s", + logfile, logfile, strerror(rv)); + return FALSE; + } else + return TRUE; - return TRUE; /* ignore the error */ } -#endif /* HAVE_GIO */ - static gboolean