2006-02-22 Marcus Brinkmann <marcus@g10code.de>
[gpgme.git] / configure.ac
index 547ff4578cca02c8026b717798f01f39e3b3ce84..1de84b910f38db402e851779323f85b70de45b15 100644 (file)
@@ -1,6 +1,6 @@
 # configure.ac for GPGME
 # Copyright (C) 2000 Werner Koch (dd9jn)
-# Copyright (C) 2001, 2002, 2003, 2004, 2005 g10 Code GmbH
+# Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006 g10 Code GmbH
 # 
 # This file is part of GPGME.
 # 
 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
  
 # (Process this file with autoconf to produce a configure script.)
-
 AC_PREREQ(2.59)
 min_automake_version="1.9.3"
 
 # Version number: Remember to change it immediately *after* a release.
-AC_INIT(gpgme, 1.1.0, [bug-gpgme@gnupg.org])
+#                 Make sure to run  "svn up" before a "make dist".
+#                 See below for the LT versions.
+#
+# The CVS version is usually the next intended release version with
+# the string "-cvs" appended.  The reason for this is that tests for a
+# specific feature can already be done under the assumption that the
+# CVS version is the most recent one in a branch.  To disable the CVS
+# version for the real release, just comment out the my_iscvs macro.
+# Note, that we are now using Subversion instead of CVS and append the
+# SVN revision number to the "cvs" suffix.  To make this most useful
+# for snapshot releases please do an "svn up" right before recreating
+# the configure script, so that a proper revision number for all files
+# is available when running a "make distcheck".
+m4_define(my_version, [1.1.1])
+#m4_define(my_iscvs, yes)
+AC_INIT([gpgme], my_version[]m4_ifdef([my_iscvs], [-cvs[]m4_translit(
+               [$Revision$],[Ra-z $:])]),
+               [bug-gpgme@gnupg.org])
+
 # LT Version numbers, remember to change them just *before* a release.
 #   (Code changed:                     REVISION++)
 #   (Interfaces added/removed/changed: CURRENT++, REVISION=0)
 #   (Interfaces added:                 AGE++)
 #   (Interfaces removed/changed:       AGE=0)
 #
-LIBGPGME_LT_CURRENT=16
+LIBGPGME_LT_CURRENT=17
 # Subtract 2 from this value if you want to make the LFS transition an
 # ABI break.  [Note to self: Remove this comment with the next regular break.]
-LIBGPGME_LT_AGE=5
+LIBGPGME_LT_AGE=7
 LIBGPGME_LT_REVISION=0
 
 # If the API is changed in an incompatible way: increment the next counter.
@@ -69,9 +86,6 @@ AH_VERBATIM([_REENTRANT],
 #endif])
 
 AC_PROG_CC
-AC_CHECK_TOOL(DLLTOOL, dlltool, :)
-AC_CHECK_TOOL(WINDRES, windres, :)
-
 
 AC_SUBST(LIBGPGME_LT_CURRENT)
 AC_SUBST(LIBGPGME_LT_AGE)
@@ -88,6 +102,8 @@ AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version of this package])
 
 # Don't default to build static libs.
 AC_DISABLE_STATIC
+AC_LIBTOOL_WIN32_DLL
+AC_LIBTOOL_RC
 AC_PROG_LIBTOOL
 
 # For now we hardcode the use of version scripts.  It would be better
@@ -147,6 +163,12 @@ if test "$have_w32_system" = yes; then
 fi
 AM_CONDITIONAL(HAVE_W32_SYSTEM, test "$have_w32_system" = yes)
 
+build_w32_glib=no
+AM_PATH_GLIB_2_0
+AC_ARG_ENABLE(w32-glib,
+           AC_HELP_STRING([--enable-w32-glib], [build GPGME Glib for W32]),
+           build_w32_glib=$withval)
+AM_CONDITIONAL(BUILD_W32_GLIB, test "$build_w32_glib" = yes)
 
 AM_CONDITIONAL(HAVE_PTH, test "$have_pth" = "yes")
 AM_CONDITIONAL(HAVE_PTHREAD, test "$have_pthread" = "yes")
@@ -157,6 +179,7 @@ AC_CHECK_HEADERS(sys/select.h)
 
 
 # Type checks.
+AC_C_INLINE
 AC_CHECK_SIZEOF(unsigned int)
 AC_SYS_LARGEFILE
 AC_TYPE_OFF_T
@@ -164,6 +187,9 @@ AC_TYPE_OFF_T
 # Checks for compiler features.
 if test "$GCC" = yes; then
     CFLAGS="$CFLAGS -Wall -Wcast-align -Wshadow -Wstrict-prototypes"
+    if test "$have_w32_system" = yes; then
+       CFLAGS="$CFLAGS -mms-bitfields"
+    fi
 fi
 
 
@@ -443,17 +469,18 @@ AM_CONDITIONAL(BUILD_COMPLUS, test "$component_system" = "COM+")
 GNUPG_FIX_HDR_VERSION(gpgme/gpgme.h, GPGME_VERSION)
 
 # Generate values for the DLL version info
+changequote(,)dnl 
+BUILD_REVISION="`echo '$Revision$' | sed 's/[^0-9]//g'`"
+changequote([,])dnl
+test -z "$BUILD_REVISION" && BUILD_REVISION="0"
 if test "$have_w32_system" = yes; then
     BUILD_TIMESTAMP=`date --iso-8601=minutes`
     changequote(,)dnl 
     BUILD_FILEVERSION=`echo "$VERSION" | sed 's/\([0-9.]*\).*/\1./;s/\./,/g'`
     changequote([,])dnl
-    case "$VERSION" in
-      *-cvs) BUILD_FILEVERSION="${BUILD_FILEVERSION}0" ;;
-      *-rc*) BUILD_FILEVERSION="${BUILD_FILEVERSION}1" ;;
-      *)     BUILD_FILEVERSION="${BUILD_FILEVERSION}2" ;;
-    esac
+    BUILD_FILEVERSION="${BUILD_FILEVERSION}${BUILD_REVISION}"
 fi
+AC_SUBST(BUILD_REVISION)
 AC_SUBST(BUILD_TIMESTAMP)
 AC_SUBST(BUILD_FILEVERSION)
 
@@ -480,6 +507,15 @@ AH_VERBATIM([SEPCONSTANTS],
 #endif
 ])
 
+AH_BOTTOM([
+/* Definition of GCC specific attributes.  */
+#if __GNUC__ > 2 
+# define GPGME_GCC_A_PURE  __attribute__ ((__pure__))
+#else
+# define GPGME_GCC_A_PURE
+#endif
+])
+
 
 # Substitution used for gpgme-config 
 GPGME_CONFIG_LIBS="-lgpgme"