Fix build of 'make dist' generated tarballs
[claws.git] / configure.ac
index 9aecf1a546fdddce88d34e1e276fd41cbd1c6a6b..e129d9fceb274c6995423e0b1c97274c325def29 100644 (file)
@@ -7,19 +7,30 @@ AC_CONFIG_MACRO_DIR([m4])
 PACKAGE=claws-mail
 
 dnl version number
-MAJOR_VERSION=3
-MINOR_VERSION=9
-MICRO_VERSION=0
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=91
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
-if test \( $EXTRA_VERSION -eq 0 \) -o \( "x$EXTRA_RELEASE" != "x" \); then
-    VERSION=${MAJOR_VERSION}.${MINOR_VERSION}.${MICRO_VERSION}${EXTRA_RELEASE}${EXTRA_GTK2_VERSION}
+if test \( -d .git \); then
+    GIT_VERSION=`git describe --abbrev=6 --dirty --always`
 else
-    VERSION=${MAJOR_VERSION}.${MINOR_VERSION}.${MICRO_VERSION}cvs${EXTRA_VERSION}${EXTRA_GTK2_VERSION}
+    GIT_VERSION=`sh -c '. ./version'`
+fi
+MAJOR_VERSION=`echo $GIT_VERSION | awk -F. '{print $1}'`
+MINOR_VERSION=`echo $GIT_VERSION | awk -F. '{print $2}'`
+MICRO_VERSION=`echo $GIT_VERSION | awk -F- '{print $1}' | awk -F. '{print $3}'`
+EXTRA_VERSION=`echo $GIT_VERSION | awk -F- '{print $2}'`
+
+if test \( "x$EXTRA_VERSION" != "x" \); then
+    VERSION=${MAJOR_VERSION}.${MINOR_VERSION}.${MICRO_VERSION}git${EXTRA_VERSION}
+else
+    VERSION=${MAJOR_VERSION}.${MINOR_VERSION}.${MICRO_VERSION}
+    EXTRA_VERSION=0
+fi
+
+if test \( "x$EXTRA_RELEASE" != "x" \); then
+    VERSION=${VERSION}${EXTRA_RELEASE}${EXTRA_GTK2_VERSION}
 fi
 
 dnl set $target
@@ -35,6 +46,7 @@ AC_SUBST(MAJOR_VERSION)
 AC_SUBST(MINOR_VERSION)
 AC_SUBST(MICRO_VERSION)
 AC_SUBST(EXTRA_VERSION)
+AC_SUBST(GIT_VERSION)
 
 AC_CHECK_PROG(HAVE_GTK_ICON_CACHE, gtk-update-icon-cache, yes, no)
 AM_CONDITIONAL(UPDATE_GTK_ICON_CACHE, test x"$HAVE_GTK_ICON_CACHE" = xyes)
@@ -148,7 +160,7 @@ fi
 CFLAGS="$CFLAGS -Wall"
 
 if test $USE_MAINTAINER_MODE = yes; then
-       CFLAGS="-g -Wall -Wno-pointer-sign"
+       CFLAGS="-g -Wall -Wno-pointer-sign -DUSE_MAINTAINER_MODE"
 fi
 
 pthread_name=
@@ -185,7 +197,7 @@ AC_CHECK_FUNCS(bind_textdomain_codeset)
 LIBS=$syl_save_LIBS
 
 dnl for gettext
-ALL_LINGUAS="bg ca cs de en_GB es fi fr hu id_ID it ja lt nl pl pt_BR pt_PT ru sk sv uk zh_CN zh_TW"
+ALL_LINGUAS="bg ca cs de en_GB es fi fr he hu id_ID it ja lt nl pl pt_BR pt_PT ru sk sv uk zh_CN zh_TW"
 GETTEXT_PACKAGE=claws-mail
 AC_SUBST(GETTEXT_PACKAGE)
 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [Define text domain.])
@@ -1052,7 +1064,7 @@ dnl During this dependancy check we do the checks themselves, define HAVE_X to
 dnl either yes or no, and do the AC_SUBST calls.
 
 dnl Archive:           libarchive
-dnl Fancy:             Webkit, curl, optionally libsoup-gnome, gtkprintunix
+dnl Fancy:             Webkit, curl, optionally libsoup-gnome
 dnl Gdata:             libgdata
 dnl Notification:      optionally libnotify libindicate libcanberra_gtk hotkey
 dnl Pdf-Viewer:                libpoppler
@@ -1077,7 +1089,7 @@ AC_SUBST(LIBXML_LIBS)
 AC_SUBST(LIBXML_CFLAGS)
 
 dnl webkit *********************************************************************
-PKG_CHECK_MODULES(WEBKIT, webkit-1.0, HAVE_WEBKIT=yes, HAVE_WEBKIT=no)
+PKG_CHECK_MODULES(WEBKIT, webkit-1.0 >= 1.1.14, HAVE_WEBKIT=yes, HAVE_WEBKIT=no)
 AC_SUBST(WEBKIT_LIBS)
 AC_SUBST(WEBKIT_CFLAGS)
 
@@ -1089,14 +1101,6 @@ fi
 AC_SUBST(LIBSOUP_GNOME_CFLAGS)
 AC_SUBST(LIBSOUP_GNOME_LIBS)
 
-dnl gtkprintunix ***************************************************************
-PKG_CHECK_MODULES(GTKPRINTUNIX, gtk+-unix-print-2.0, HAVE_GTKPRINTUNIX=yes, HAVE_GTKPRINTUNIX=no)
-if test x"$HAVE_GTKPRINTUNIX" = xyes; then
-       AC_DEFINE(HAVE_GTKPRINTUNIX, 1, [Define if GtkPrintUnix is available])
-fi
-AC_SUBST(GTKPRINTUNIX_CFLAGS)
-AC_SUBST(GTKPRINTUNIX_LIBS)
-
 dnl libarchive *****************************************************************
 AC_SEARCH_LIBS([archive_read_new], [archive],
                       ARCHIVE_LIBS=-larchive
@@ -1456,13 +1460,34 @@ if test x"$enable_notification_plugin" != xno; then
        AC_DEFINE(NOTIFICATION_BANNER, 1, Activate notification banner)
        AC_DEFINE(NOTIFICATION_COMMAND, 1, Activate notification shell command)
        AC_DEFINE(NOTIFICATION_TRAYICON, 1, Activate notification trayicon)
-       AC_DEFINE(NOTIFICATION_LCDPROC, 1, Activate lcdproc support)
+       if test x"$platform_win32" = xno; then
+               AC_DEFINE(NOTIFICATION_LCDPROC, 1, Activate lcdproc support)
+       fi
 
-       notification_features="(popup:yes banner:yes command:yes trayicon:yes lcdproc:yes"
-       notification_features="$notification_features libnotify:$HAVE_LIBNOTIFY"
-       notification_features="$notification_features libindicate:$HAVE_LIBINDICATE"
-       notification_features="$notification_features libcanberra-gtk:$HAVE_LIBCANBERRA_GTK"
-       notification_features="$notification_features hotkeys:$HAVE_HOTKEYS)"
+       notification_features="banner command"
+       notification_missing_dependencies=""
+       if test x"$HAVE_HOTKEYS" = xyes; then
+               notification_features="$notification_features hotkeys"
+       else
+               notification_missing_dependencies="$notification_missing_dependencies hotkeys"
+       fi
+       notification_features="$notification_features lcdproc"
+       if test x"$HAVE_LIBINDICATE" = xyes; then
+               notification_features="$notification_features libindicate"
+       else
+               notification_missing_dependencies="$notification_missing_dependencies libindicate"
+       fi
+       if test x"$HAVE_LIBNOTIFY" = xyes; then
+               notification_features="$notification_features libnotify"
+       else
+               notification_missing_dependencies="$notification_missing_dependencies libnotify"
+       fi
+       if test x"$HAVE_LIBCANBERRA_GTK" = xyes; then
+               notification_features="$notification_features libcanberra-gtk"
+       else
+               notification_missing_dependencies="$notification_missing_dependencies libcanberra-gtk"
+       fi
+       notification_features="$notification_features popup trayicon"
 else
        DISABLED_PLUGINS="$DISABLED_PLUGINS notification"
        AC_MSG_RESULT(no)
@@ -1819,6 +1844,7 @@ src/plugins/notification/Makefile
 src/plugins/notification/gtkhotkey/Makefile
 src/plugins/pdf_viewer/Makefile
 src/plugins/perl/Makefile
+src/plugins/perl/tools/Makefile
 src/plugins/python/Makefile
 src/plugins/pgpcore/Makefile
 src/plugins/pgpmime/Makefile
@@ -1870,6 +1896,7 @@ manual/de/dist/ps/Makefile
 manual/de/dist/html/Makefile
 manual/de/dist/txt/Makefile
 claws-mail.pc
+version
 ])
 
 dnl Output the configuration summary
@@ -1897,27 +1924,36 @@ echo "NetworkManager     : $enable_networkmanager"
 echo "Manual             : $enable_manual"
 echo "Generic UMPC code  : $enable_generic_umpc"
 echo "Maemo build        : $enable_maemo"
-echo "Config dir         : $with_config_dir"
+echo "Config dir         : $ac_cv_with_config_dir"
 
-echo "Plugins            : Built:"
+echo "Plugins"
+echo "   Built:"
 for plugin in $PLUGINS; do
-features=""
+echo "            - $plugin"
 if test x"$plugin" = xnotification; then
-       features="$notification_features"
+       echo "                Features:"
+       for notif_feature in $notification_features; do
+               echo "                    $notif_feature"
+       done;
+       if test "x$notification_missing_dependencies" != x; then
+               echo "                Disabled due to missing dependencies:"
+               for notif_miss_dep in $notification_missing_dependencies; do
+                       echo "                    $notif_miss_dep"
+               done;
+       fi
 fi
-echo "                      - $plugin $features"
 done;
 if test "x$DISABLED_PLUGINS" != x; then
-echo "                     Disabled:"
+echo "   Disabled:"
 for plugin in $DISABLED_PLUGINS; do
-echo "                      - $plugin"
+echo "            - $plugin"
 done;
 fi
 
 if test "x$MISSING_DEPS_PLUGINS" != x; then
-echo "                     Disabled due to missing dependencies:"
+echo "   Disabled due to missing dependencies:"
 for plugin in $MISSING_DEPS_PLUGINS; do
-echo "                      - $plugin"
+echo "            - $plugin"
 done;
 fi
 echo ""