New code to install forms so that appropriate icons are shown in the Viewer.
[gpgol.git] / configure.ac
index ebe5849..f9726e7 100644 (file)
@@ -1,5 +1,5 @@
-# configure.ac - for GPGol
-# Copyright (C) 2005 g10 Code GmbH
+# configure.ac - for GpgOL
+# Copyright (C) 2005, 2006, 2007, 2008 g10 Code GmbH
 #
 # This file is free software; as a special exception the author gives
 # unlimited permission to copy and/or distribute it, with or without
 AC_PREREQ(2.59)
 min_automake_version="1.9.4"
 
-# Version number: Remember to change it immediately *after* a release.
-#                 Add a "-cvs" prefix for non-released code.
-AC_INIT(gpgol, 0.9.3-cvs, bug-gpgol@g10code.com)
+# Remember to change the version number immediately *after* a release.
+# Set my_issvn to "yes" for non-released code.  Remember to run an
+# "svn up" and "autogen.sh" right before creating a distribution.
+m4_define([my_version], [0.10.15])
+m4_define([my_issvn], [yes])
 
+m4_define([svn_revision], m4_esyscmd([echo -n $( (svn info 2>/dev/null \
+            || echo 'Revision: 0')|sed -n '/^Revision:/ {s/[^0-9]//gp;q;}')]))
+AC_INIT([gpgol], 
+        [my_version[]m4_if(my_issvn,[yes],[-svn[]svn_revision])],
+        [bug-gpgol@g10code.com])
+
+NEED_GPG_ERROR_VERSION=1.4
 NEED_GPGME_API=1
 NEED_GPGME_VERSION=1.1.0
+NEED_LIBASSUAN_API=1
+NEED_LIBASSUAN_VERSION=1.0.4
 
 
+SVN_REVISION=svn_revision
 PACKAGE=$PACKAGE_NAME
 PACKAGE_GT=${PACKAGE_NAME}
 VERSION=$PACKAGE_VERSION
@@ -28,10 +40,13 @@ VERSION=$PACKAGE_VERSION
 AC_CONFIG_SRCDIR(src/gpgol.def)
 AM_CONFIG_HEADER(config.h)
 AC_CANONICAL_TARGET()
-AM_INIT_AUTOMAKE($PACKAGE, $VERSION)
+AM_INIT_AUTOMAKE
 
 AC_GNU_SOURCE
 
+have_gpg_error=no
+have_libassuan=no
+
 AC_SUBST(PACKAGE)
 AC_SUBST(PACKAGE_GT)
 AC_SUBST(VERSION)
@@ -43,19 +58,26 @@ AC_DEFINE_UNQUOTED(PACKAGE_BUGREPORT, "$PACKAGE_BUGREPORT",
                                         [Bug report address])
 AC_DEFINE_UNQUOTED(NEED_GPGME_VERSION, "$NEED_GPGME_VERSION",
                                        [Required version of GPGME])
+AC_DEFINE_UNQUOTED(SVN_REVISION, ${SVN_REVISION}, [Current SVN revision])
+
 
 BUILD_TIMESTAMP=`date --iso-8601=minutes`
 AC_SUBST(BUILD_TIMESTAMP)
 changequote(,)dnl
-BUILD_FILEVERSION=`echo "$VERSION" | sed 's/\([0-9.]*\).*/\1.0/;s/\./,/g'`
+BUILD_FILEVERSION=`echo "$VERSION" | sed 's/\([0-9.]*\).*/\1./;s/\./,/g'`
 changequote([,])dnl
+BUILD_FILEVERSION="${BUILD_FILEVERSION}${SVN_REVISION}"
 AC_SUBST(BUILD_FILEVERSION)
 
 
 AH_BOTTOM([
 /* Some global constants. */
 
-
+/* Force using of NLS for W32 even if no libintl has been found.  This is 
+   okay because we have our own gettext implementation for W32.  */
+#if defined(HAVE_W32_SYSTEM) && !defined(ENABLE_NLS)
+#define ENABLE_NLS 1
+#endif
 ])
 
 AM_MAINTAINER_MODE
@@ -82,7 +104,6 @@ AC_CHECK_TOOL(DLLTOOL, dlltool, :)
 AC_CHECK_TOOL(WINDRES, windres, :)
 
 
-try_gettext=yes
 have_dosish_system=no
 have_w32_system=no
 case "${host}" in
@@ -93,13 +114,8 @@ case "${host}" in
                   [set this to limit filenames to the 8.3 format])
         AC_DEFINE(HAVE_DRIVE_LETTERS,1,
                   [defined if we must run on a stupid file system])
-        AC_DEFINE(USE_SIMPLE_GETTEXT,1,
-                  [because the Unix gettext has too much overhead on
-                   MingW32 systems and these systems lack Posix functions,
-                   we use a simplified version of gettext])
         have_dosish_system=yes
         have_w32_system=yes
-        try_gettext="no"
         ;;
     *)
     AC_MSG_ERROR([[
@@ -133,9 +149,26 @@ AM_CONDITIONAL(HAVE_W32_SYSTEM, test "$have_w32_system" = yes)
 
 AM_PATH_GPGME("$NEED_GPGME_API:$NEED_GPGME_VERSION",
                have_gpgme=yes,have_gpgme=no)
-AM_PATH_GPG_ERROR(0.5,, AC_MSG_ERROR([libgpg-error was not found]))
+AM_PATH_GPG_ERROR("$NEED_GPG_ERROR_VERSION",
+                  have_gpg_error=yes,have_gpg_error=no)
+AC_DEFINE(GPG_ERR_SOURCE_DEFAULT, GPG_ERR_SOURCE_USER_2,
+          [The default error source for GpgOL.])
+AM_PATH_LIBASSUAN("$NEED_LIBASSUAN_API:$NEED_LIBASSUAN_VERSION",
+                  have_libassuan=yes,have_libassuan=no)
+
+AH_BOTTOM([
+/* We don't want the old assuan codes anymore. */
+#define _ASSUAN_ONLY_GPG_ERRORS 1
+])
+
 
 
+# Note, that autogen.sh greps for the next line.
+AM_GNU_GETTEXT_VERSION(0.12.1)
+AM_GNU_GETTEXT([external])
+# We always want NLs, despite what the above macro figures out.
+USE_NLS=yes
+
 # Checks for header files.
 AC_HEADER_STDC
 AC_CHECK_HEADERS(string.h unistd.h langinfo.h termio.h locale.h)
@@ -157,14 +190,13 @@ if test "$have_w32_system" = yes; then
 fi
 
 if test "$GCC" = yes; then
+    CFLAGS="$CFLAGS -Wall -mms-bitfields"
+    CXXFLAGS="$CXXFLAGS -Wall -mms-bitfields"
     if test "$USE_MAINTAINER_MODE" = "yes"; then
-        CFLAGS="$CFLAGS -Wall -Wcast-align -Wshadow -Wstrict-prototypes"
+        CFLAGS="$CFLAGS -Wcast-align -Wshadow -Wstrict-prototypes"
         CFLAGS="$CFLAGS -Wno-format-y2k -Wformat-security"
-        CXXFLAGS="$CXXFLAGS -Wall -Wcast-align -Wshadow"
+        CXXFLAGS="$CXXFLAGS -Wcast-align -Wshadow"
         CXXFLAGS="$CXXFLAGS -Wno-format-y2k -Wformat-security"
-    else
-        CFLAGS="$CFLAGS -Wall"
-        CXXFLAGS="$CXXFLAGS -Wall"
     fi
 fi
 
@@ -177,6 +209,16 @@ AC_SUBST(W32LIBS)
 # together and the user can acquire them all together.
 #
 die=no
+if test "$have_gpg_error" = "no"; then
+   die=yes
+   AC_MSG_NOTICE([[
+***  
+*** You need libgpg-error to build this program.
+**  This library is for example available at
+***   ftp://ftp.gnupg.org/pub/gcrypt/libgpg-error
+*** (at least version $NEED_GPG_ERROR_VERSION is required.)
+***]])
+fi
 if test "$have_gpgme" = "no"; then
    die=yes
    AC_MSG_NOTICE([[
@@ -187,6 +229,16 @@ if test "$have_gpgme" = "no"; then
 *** (at least version $NEED_GPGME_VERSION is required.)
 ***]])
 fi
+if test "$have_libassuan" = "no"; then
+   die=yes
+   AC_MSG_NOTICE([[
+***
+*** You need libassuan to build this program.
+*** This library is for example available at
+***   ftp://ftp.gnupg.org/pub/gcrypt/libassuan/
+*** (at least version $NEED_LIBASSUAN_VERSION is required).
+***]])
+fi
 if test "$die" = "yes"; then
     AC_MSG_ERROR([[
 ***
@@ -199,5 +251,9 @@ fi
 AC_CONFIG_FILES([ Makefile
 src/Makefile
 src/versioninfo.rc        
+forms/Makefile
+doc/Makefile
+po/Makefile.in
+m4/Makefile
 ])
 AC_OUTPUT