Update german translation
[gpgol.git] / configure.ac
index d9dcb5d..df72031 100644 (file)
@@ -1,5 +1,5 @@
 # configure.ac - for GpgOL
 # configure.ac - for GpgOL
-# Copyright (C) 2005, 2006, 2007 g10 Code GmbH
+# Copyright (C) 2005, 2006, 2007, 2008, 2011 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
 #
 # This file is free software; as a special exception the author gives
 # unlimited permission to copy and/or distribute it, with or without
 
 # Process this file with autoconf to produce a configure script.
 AC_PREREQ(2.59)
 
 # Process this file with autoconf to produce a configure script.
 AC_PREREQ(2.59)
-min_automake_version="1.9.4"
-
-# 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.3])
-m4_define([my_issvn], [no])
-
-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
+min_automake_version="1.14"
+
+# To build a release you need to create a tag with the version number
+# (git tag -s gpgol-k.n.m) and run "./autogen.sh --force".  Please
+# bump the version number immediately *after* the release and do
+# another commit and push so that the git magic is able to work.
+m4_define([mym4_version], [2.4.3])
+
+# Below is m4 magic to extract and compute the git revision number,
+# the decimalized short revision number, a beta version string and a
+# flag indicating a development version (mym4_isgit).  Note that the
+# m4 processing is done by autoconf and not during the configure run.
+m4_define([mym4_revision],
+          m4_esyscmd([git rev-parse --short HEAD | tr -d '\n\r']))
+m4_define([mym4_revision_dec],
+          m4_esyscmd_s([echo $((0x$(echo ]mym4_revision[|head -c 4)))]))
+m4_define([mym4_betastring],
+          m4_esyscmd_s([git describe --match 'gpgol-[0-9].[0-9].*[0-9]' \
+                         --long | awk -F- '$3!=0{print"-beta"$3}']))
+m4_define([mym4_isgit],m4_if(mym4_betastring,[],[no],[yes]))
+m4_define([mym4_full_version],[mym4_version[]mym4_betastring])
+
+AC_INIT([gpgol],[mym4_full_version], [http://bugs.gnupg.org])
+
+# Bump up this value if you changed any form.
+GPGOL_FORMS_REVISION=335
+
+NEED_GPG_ERROR_VERSION=1.9
 NEED_GPGME_API=1
 NEED_GPGME_API=1
-NEED_GPGME_VERSION=1.1.0
-NEED_LIBASSUAN_API=1
-NEED_LIBASSUAN_VERSION=1.0.4
+NEED_GPGME_VERSION=1.13.0
+NEED_LIBASSUAN_API=2
+NEED_LIBASSUAN_VERSION=2.0.0
 
 
 
 
-SVN_REVISION=svn_revision
+GIT_COMMIT=0x[]mym4_revision
+GIT_COMMIT_DECIMAL=0x[]mym4_revision_dec
 PACKAGE=$PACKAGE_NAME
 PACKAGE_GT=${PACKAGE_NAME}
 VERSION=$PACKAGE_VERSION
 
 PACKAGE=$PACKAGE_NAME
 PACKAGE_GT=${PACKAGE_NAME}
 VERSION=$PACKAGE_VERSION
 
+AC_CONFIG_AUX_DIR([build-aux])
 AC_CONFIG_SRCDIR(src/gpgol.def)
 AM_CONFIG_HEADER(config.h)
 AC_CANONICAL_TARGET()
 AC_CONFIG_SRCDIR(src/gpgol.def)
 AM_CONFIG_HEADER(config.h)
 AC_CANONICAL_TARGET()
@@ -57,6 +73,9 @@ AC_DEFINE_UNQUOTED(PACKAGE_BUGREPORT, "$PACKAGE_BUGREPORT",
                                         [Bug report address])
 AC_DEFINE_UNQUOTED(NEED_GPGME_VERSION, "$NEED_GPGME_VERSION",
                                        [Required version of GPGME])
                                         [Bug report address])
 AC_DEFINE_UNQUOTED(NEED_GPGME_VERSION, "$NEED_GPGME_VERSION",
                                        [Required version of GPGME])
+AC_DEFINE_UNQUOTED(GIT_COMMIT, ${GIT_COMMIT}, [Current GIT commit])
+AC_DEFINE_UNQUOTED(GPGOL_FORMS_REVISION, ${GPGOL_FORMS_REVISION},
+                                          [Current Forms revision])
 
 
 BUILD_TIMESTAMP=`date --iso-8601=minutes`
 
 
 BUILD_TIMESTAMP=`date --iso-8601=minutes`
@@ -64,14 +83,14 @@ AC_SUBST(BUILD_TIMESTAMP)
 changequote(,)dnl
 BUILD_FILEVERSION=`echo "$VERSION" | sed 's/\([0-9.]*\).*/\1./;s/\./,/g'`
 changequote([,])dnl
 changequote(,)dnl
 BUILD_FILEVERSION=`echo "$VERSION" | sed 's/\([0-9.]*\).*/\1./;s/\./,/g'`
 changequote([,])dnl
-BUILD_FILEVERSION="${BUILD_FILEVERSION}${SVN_REVISION}"
+BUILD_FILEVERSION="${BUILD_FILEVERSION}${GIT_COMMIT_DECIMAL}"
 AC_SUBST(BUILD_FILEVERSION)
 
 
 AH_BOTTOM([
 /* Some global constants. */
 
 AC_SUBST(BUILD_FILEVERSION)
 
 
 AH_BOTTOM([
 /* Some global constants. */
 
-/* Force using of NLS for W32 even if no libintl has been found.  This is 
+/* 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
    okay because we have our own gettext implementation for W32.  */
 #if defined(HAVE_W32_SYSTEM) && !defined(ENABLE_NLS)
 #define ENABLE_NLS 1
@@ -116,11 +135,13 @@ case "${host}" in
         have_w32_system=yes
         ;;
     *)
         have_w32_system=yes
         ;;
     *)
-    AC_MSG_ERROR([[
+    AC_MSG_NOTICE([[
 ***
 ***
-*** This software my only be build for W32 systems.  Use
+*** This software is only useful for W32 systems.  Use
 ***     ./autogen.sh --build-w32
 *** to prepare it for such a build.
 ***     ./autogen.sh --build-w32
 *** to prepare it for such a build.
+***
+*** For your current host only tests will be built!
 ***]])
        ;;
 esac
 ***]])
        ;;
 esac
@@ -138,7 +159,7 @@ if test "$have_w32_system" = yes; then
 fi
 AM_CONDITIONAL(HAVE_W32_SYSTEM, test "$have_w32_system" = yes)
 
 fi
 AM_CONDITIONAL(HAVE_W32_SYSTEM, test "$have_w32_system" = yes)
 
-
+AM_CONDITIONAL(BUILD_W64, test "$host" = "x86_64-w64-mingw32")
 
 #
 # Checks for libraries.
 
 #
 # Checks for libraries.
@@ -147,6 +168,7 @@ 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_GPGME("$NEED_GPGME_API:$NEED_GPGME_VERSION",
                have_gpgme=yes,have_gpgme=no)
+AM_PATH_GPGMEPP(have_gpgmepp=yes,have_gpgmepp=no)
 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,
 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,
@@ -154,15 +176,9 @@ AC_DEFINE(GPG_ERR_SOURCE_DEFAULT, GPG_ERR_SOURCE_USER_2,
 AM_PATH_LIBASSUAN("$NEED_LIBASSUAN_API:$NEED_LIBASSUAN_VERSION",
                   have_libassuan=yes,have_libassuan=no)
 
 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.
 
 # Note, that autogen.sh greps for the next line.
-AM_GNU_GETTEXT_VERSION(0.12.1)
+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
 AM_GNU_GETTEXT([external])
 # We always want NLs, despite what the above macro figures out.
 USE_NLS=yes
@@ -171,7 +187,8 @@ USE_NLS=yes
 AC_HEADER_STDC
 AC_CHECK_HEADERS(string.h unistd.h langinfo.h termio.h locale.h)
 
 AC_HEADER_STDC
 AC_CHECK_HEADERS(string.h unistd.h langinfo.h termio.h locale.h)
 
-AC_CHECK_FUNCS(stpcpy)
+# Check for functions
+AC_REPLACE_FUNCS(stpcpy)
 
 # Checks for typedefs, structures, and compiler characteristics.
 AC_C_CONST
 
 # Checks for typedefs, structures, and compiler characteristics.
 AC_C_CONST
@@ -188,19 +205,45 @@ if test "$have_w32_system" = yes; then
 fi
 
 if test "$GCC" = yes; then
 fi
 
 if test "$GCC" = yes; then
-    CFLAGS="$CFLAGS -Wall -mms-bitfields"
-    CXXFLAGS="$CXXFLAGS -Wall -mms-bitfields"
+    CFLAGS="$CFLAGS -Wall -mms-bitfields -fno-strict-aliasing"
+    CXXFLAGS="$CXXFLAGS -Wall -mms-bitfields -fno-strict-aliasing"
+    # Hardening flags
+    # Stack protection
+    # -fstack-protector-all -Wstack-protector --param ssp-buffer-size=4
+    # causes gpgol not to be loaded by Outlook due to a runtime error.
+    # This needs to be analysed but could be an incompatibility between
+    # gcc's stack protection and COM / Outlook system calls.
+    if test "$have_w32_system" = yes; then
+        HARDENING="-Wl,--dynamicbase -Wl,--nxcompat -fno-exceptions -D_FORTIFY_SOURCE=2 -O0"
+    else
+        HARDENING="-fPIC"
+    fi
+    CFLAGS="$CFLAGS $HARDENING"
+    CXXFLAGS="$CXXFLAGS $HARDENING"
+
     if test "$USE_MAINTAINER_MODE" = "yes"; then
     if test "$USE_MAINTAINER_MODE" = "yes"; then
-        CFLAGS="$CFLAGS -Wcast-align -Wshadow -Wstrict-prototypes"
-        CFLAGS="$CFLAGS -Wno-format-y2k -Wformat-security"
-        CXXFLAGS="$CXXFLAGS -Wcast-align -Wshadow"
-        CXXFLAGS="$CXXFLAGS -Wno-format-y2k -Wformat-security"
+        CFLAGS="$CFLAGS -Werror -Wcast-align -Wshadow -Wstrict-prototypes"
+        CFLAGS="$CFLAGS -Wformat-security"
+        CFLAGS="$CFLAGS -W -Wno-sign-compare"
+        CXXFLAGS="$CXXFLAGS -Werror -Wcast-align -Wshadow"
+        CXXFLAGS="$CXXFLAGS -Wformat-security"
+        CXXFLAGS="$CXXFLAGS -W -Wno-sign-compare"
     fi
     fi
-fi
 
 
-AC_SUBST(W32LIBS)
+    AC_MSG_CHECKING([if gcc supports -Wno-pointer-sign])
+    _gcc_cflags_save=$CFLAGS
+    CFLAGS="-Wno-pointer-sign"
+    AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])],_gcc_psign=yes,_gcc_psign=no)
+    AC_MSG_RESULT($_gcc_psign)
+    CFLAGS=$_gcc_cflags_save;
+    if test x"$_gcc_psign" = xyes ; then
+       CFLAGS="$CFLAGS -Wno-pointer-sign"
+    fi
 
 
 
 
+fi
+
+AC_SUBST(W32LIBS)
 
 #
 # Print errors here so that they are visible all
 
 #
 # Print errors here so that they are visible all
@@ -210,7 +253,7 @@ die=no
 if test "$have_gpg_error" = "no"; then
    die=yes
    AC_MSG_NOTICE([[
 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
 *** You need libgpg-error to build this program.
 **  This library is for example available at
 ***   ftp://ftp.gnupg.org/pub/gcrypt/libgpg-error
@@ -220,13 +263,21 @@ fi
 if test "$have_gpgme" = "no"; then
    die=yes
    AC_MSG_NOTICE([[
 if test "$have_gpgme" = "no"; then
    die=yes
    AC_MSG_NOTICE([[
-***  
+***
 *** You need gpgme to build this program.
 **  This library is for example available at
 ***   ftp://ftp.gnupg.org/gcrypt/gpgme/
 *** (at least version $NEED_GPGME_VERSION is required.)
 ***]])
 fi
 *** You need gpgme to build this program.
 **  This library is for example available at
 ***   ftp://ftp.gnupg.org/gcrypt/gpgme/
 *** (at least version $NEED_GPGME_VERSION is required.)
 ***]])
 fi
+if test "$have_gpgmepp" = "no"; then
+   die=yes
+   AC_MSG_NOTICE([[
+***
+*** You need the C++ language binding for gpgme to build this program.
+** Ensure that GPGME was compiled with --enabled-languages=cpp
+***]])
+fi
 if test "$have_libassuan" = "no"; then
    die=yes
    AC_MSG_NOTICE([[
 if test "$have_libassuan" = "no"; then
    die=yes
    AC_MSG_NOTICE([[
@@ -248,9 +299,13 @@ fi
 
 AC_CONFIG_FILES([ Makefile
 src/Makefile
 
 AC_CONFIG_FILES([ Makefile
 src/Makefile
-src/versioninfo.rc        
+src/icons/Makefile
+src/versioninfo.rc
+forms/Makefile
 doc/Makefile
 po/Makefile.in
 m4/Makefile
 doc/Makefile
 po/Makefile.in
 m4/Makefile
+tests/Makefile
 ])
 ])
+
 AC_OUTPUT
 AC_OUTPUT