enable building with automake 1.8.x
authorPaul Mangan <paul@claws-mail.org>
Tue, 17 Feb 2004 08:53:12 +0000 (08:53 +0000)
committerPaul Mangan <paul@claws-mail.org>
Tue, 17 Feb 2004 08:53:12 +0000 (08:53 +0000)
13 files changed:
m4/.cvsignore [new file with mode: 0644]
m4/Makefile.am [new file with mode: 0644]
m4/README [new file with mode: 0644]
m4/aclocal-include.m4 [new file with mode: 0644]
m4/aspell.m4 [new file with mode: 0644]
m4/check-type.m4 [new file with mode: 0644]
m4/gnupg-check-typedef.m4 [new file with mode: 0644]
m4/missing/gdk-pixbuf.m4 [new file with mode: 0644]
m4/missing/gettext.m4 [new file with mode: 0644]
m4/missing/gpgme.m4 [new file with mode: 0644]
m4/missing/imlib.m4 [new file with mode: 0644]
m4/openssl.m4 [new file with mode: 0644]
m4/spamassassin.m4 [new file with mode: 0644]

diff --git a/m4/.cvsignore b/m4/.cvsignore
new file mode 100644 (file)
index 0000000..282522d
--- /dev/null
@@ -0,0 +1,2 @@
+Makefile
+Makefile.in
diff --git a/m4/Makefile.am b/m4/Makefile.am
new file mode 100644 (file)
index 0000000..fe05a1a
--- /dev/null
@@ -0,0 +1,13 @@
+MACROS = \
+       aclocal-include.m4 \
+       check-type.m4 \
+       gnupg-check-typedef.m4 \
+       aspell.m4 \
+       openssl.m4 \
+       spamassassin.m4
+
+EXTRA_DIST = $(MACROS) \
+       missing/gdk-pixbuf.m4 \
+       missing/gettext.m4 \
+       missing/gpgme.m4 \
+       missing/imlib.m4
diff --git a/m4/README b/m4/README
new file mode 100644 (file)
index 0000000..39aab32
--- /dev/null
+++ b/m4/README
@@ -0,0 +1,6 @@
+If you encountered errors like:
+
+  aclocal: configure.in: ??: macro `AM_SOMETHING' not found in library
+
+when executing autogen.sh, copy the corresponding m4 files in the missing/
+directory into here (or install the development packages).
diff --git a/m4/aclocal-include.m4 b/m4/aclocal-include.m4
new file mode 100644 (file)
index 0000000..aac5f8a
--- /dev/null
@@ -0,0 +1,12 @@
+# aclocal-include.m4
+#
+# This macro adds the name macrodir to the set of directories
+# that `aclocal' searches for macros.
+
+dnl SYLPHEED_ACLOCAL_INCLUDE(macrodir)
+AC_DEFUN([SYLPHEED_ACLOCAL_INCLUDE],
+[
+       test -n "$ACLOCAL_FLAGS" && ACLOCAL="$ACLOCAL $ACLOCAL_FLAGS"
+
+       for k in $1 ; do ACLOCAL="$ACLOCAL -I $k" ; done
+])
diff --git a/m4/aspell.m4 b/m4/aspell.m4
new file mode 100644 (file)
index 0000000..040692d
--- /dev/null
@@ -0,0 +1,149 @@
+dnl Autoconf macros for libaspell
+dnl $Id$
+
+# Configure paths for ASPELL
+# Shamelessly stolen from the one of GPGME by Werner Koch 
+# Melvin Hadasht  2001-09-17, 2002
+
+dnl AM_PATH_ASPELL([MINIMUM-VERSION,
+dnl               [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND ]]])
+dnl Test for aspell, and define ASPELL_CFLAGS, ASPELL_LIBS and ASPELL_PATH
+dnl
+AC_DEFUN([AM_PATH_ASPELL],
+[dnl
+dnl Get the cflags and libraries from the aspell-config script
+dnl
+   AC_ARG_WITH(aspell-prefix,
+      [  --with-aspell-prefix=PFX           Prefix where aspell is installed (optional)],
+      aspell_prefix="$withval", aspell_prefix="")
+   AC_ARG_ENABLE(aspell-test,
+      [  --disable-aspell-test   Do not try to compile and run a test GNU/aspell program],
+      , enable_aspelltest=yes)
+   AC_ARG_WITH(aspell-libs,
+      [  --with-aspell-libs=LIBS            Where GNU/aspell library reside (/usr/local/lib)],
+      aspell_libs="$withval", aspell_libs="")
+   AC_ARG_WITH(aspell-includes,
+      [  --with-aspell-includes=INCLUDES    Where GNU/aspell headers reside (/usr/local/include)],
+      aspell_includes="$withval", aspell_includes="")
+
+  if test x$aspell_prefix != x ; then
+     if test x${ASPELL+set} != xset ; then
+        ASPELL=$aspell_prefix/bin/aspell
+     fi
+     if test x$aspell_includes = x ; then
+        aspell_includes=$aspell_prefix/include
+     fi
+     if test x$aspell_libs = x ; then
+        aspell_libs=$aspell_prefix/lib
+     fi
+     aspell_path=$aspell_prefix/lib/aspell
+  fi
+  if test x$aspell_includes = x ; then
+     aspell_includes=/usr/local/include
+  fi
+  if test x$aspell_libs = x ; then
+     aspell_libs=/usr/local/lib
+  fi
+  if test x$aspell_path = x ; then
+     aspell_path=/usr/local/lib/aspell
+  fi
+  if test "x$enable_aspelltest" != "xyes" ; then
+     echo "*** Disabling GNU/aspell tests upon user request" 
+     ASPELL_CFLAGS="-I$aspell_includes"
+     ASPELL_LIBS="-L$aspell_libs -laspell"
+     AC_DEFINE_UNQUOTED(ASPELL_PATH, "${aspell_path}/", Define ASPELL's default directory)
+     ifelse([$2], , :, [$2])
+  else   
+     AC_PATH_PROG(ASPELL, aspell, no)
+     min_aspell_version=ifelse([$1], ,.50,$1)
+     AC_MSG_CHECKING(for GNU/aspell - version >= $min_aspell_version)
+     no_aspell=""
+     if test "$ASPELL" = "no" ; then
+        echo "*** The aspell executable could not be found"
+        echo "*** If aspell was installed in PREFIX, make sure PREFIX/bin is in"
+        echo "*** your path, or set the ASPELL environment variable to the"
+        echo "*** full path to aspell or configure with --with-aspell-prefix=PREFIX."
+        ASPELL_CFLAGS=""
+        ASPELL_LIBS=""
+        ASPELL_PATH=""
+        no_aspell=yes
+        ifelse([$3], , :, [$3])
+     else
+        ASPELL_CFLAGS="-I$aspell_includes"
+        ASPELL_LIBS="-L$aspell_libs -laspell"
+        aspell_version=`$ASPELL version|sed -e "s/\(@(#) International Ispell Version 3.1.20 (but really Aspell \)\(.*\))/\2/"`
+        rm -f conf.aspelltest
+        AC_TRY_RUN([
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+int
+main ()
+{
+ system ("touch conf.aspelltest");
+ if(strcmp("$aspell_version","$min_aspell_version")<0){
+   return 1;
+   }
+ return 0;
+}
+        ],, no_aspell=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
+        rm -f conf.aspelltest
+       if test "x$no_aspell" = x ; then
+           AC_MSG_RESULT(yes)
+           AC_MSG_CHECKING(for GNU/aspell dictionaries location)
+           aspell_path="`$ASPELL config dict-dir`"
+           AC_DEFINE_UNQUOTED(ASPELL_PATH, "${aspell_path}/", Define ASPELL's default directory)
+           AC_MSG_RESULT($aspell_path)
+           AC_MSG_CHECKING(if GNU/aspell is correctly installed)
+           ac_save_CFLAGS="$CFLAGS"
+           ac_save_LIBS="$LIBS"
+           CFLAGS="$CFLAGS $ASPELL_CFLAGS"
+           LIBS="$LIBS $ASPELL_LIBS"
+           AC_TRY_RUN([
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <aspell.h>
+
+int
+main()
+{
+ AspellConfig * aspellconfig = new_aspell_config();
+ return 0;
+}
+           ],, aspell_failure=yes,)
+          rm -f conftest.c
+          CFLAGS="$ac_save_CFLAGS"
+           LIBS="$ac_save_LIBS"
+           if test "x$aspell_failure" = x ; then     
+              AC_MSG_RESULT(yes)
+              ifelse([$2], , :, [$2])
+           else
+             AC_MSG_RESULT(no)
+             echo "*** The GNU/aspell test program did not succeed. This usually means that "
+             echo "*** the headers and the libraries could not be found. Check config.log"
+             echo "*** for detailed error message and add the relevant options"
+             echo "*** --with-aspell-prefix, --with-aspell-includes or --with-aspell-libs"
+             echo "*** to the configure command."
+             echo "*** This can also mean that the library was not found at runtime. In that case"
+             echo "*** add its path to LD_LIBRARY_PATH environment variable or in /etc/ld.so.conf"
+             ASPELL_CFLAGS=""
+             ASPELL_LIBS=""
+             ASPELL_PATH=""
+             ifelse([$3], , :, [$3])
+          fi
+       else
+           AC_MSG_RESULT(no)
+           ASPELL_CFLAGS=""
+           ASPELL_LIBS=""
+           ASPELL_PATH=""
+           ifelse([$3], , :, [$3])
+       fi   
+     fi        
+  fi
+  AC_SUBST(ASPELL_CFLAGS)
+  AC_SUBST(ASPELL_LIBS)
+  AC_SUBST(ASPELL_PATH)
+])
+
diff --git a/m4/check-type.m4 b/m4/check-type.m4
new file mode 100644 (file)
index 0000000..e65ea03
--- /dev/null
@@ -0,0 +1,27 @@
+dnl SYLPHEED_CHECK_TYPE(TYPE, DEFAULT [, INCLUDES, COMMENT])
+dnl
+dnl Like AC_CHECK_TYPE, but in addition to `sys/types.h', `stdlib.h' and
+dnl `stddef.h' checks files included by INCLUDES, which should be a
+dnl series of #include statements.  If TYPE is not defined, define it
+dnl to DEFAULT.
+dnl
+AC_DEFUN([SYLPHEED_CHECK_TYPE],
+[AC_REQUIRE([AC_HEADER_STDC])dnl
+AC_MSG_CHECKING(for $1)
+AC_CACHE_VAL(sylpheed_cv_type_$1,
+[AC_TRY_COMPILE([
+#include <sys/types.h>
+#if STDC_HEADERS
+#include <stdlib.h>
+#include <stddef.h>
+#endif
+$3
+], [
+#undef $1
+int a = sizeof($1);
+], sylpheed_cv_type_$1=yes, sylpheed_cv_type_$1=no)])dnl
+AC_MSG_RESULT($sylpheed_cv_type_$1)
+if test $sylpheed_cv_type_$1 = no; then
+  AC_DEFINE($1, $2, $4)
+fi
+])
diff --git a/m4/gnupg-check-typedef.m4 b/m4/gnupg-check-typedef.m4
new file mode 100644 (file)
index 0000000..1dd7c47
--- /dev/null
@@ -0,0 +1,17 @@
+dnl GNUPG_CHECK_TYPEDEF(TYPE, HAVE_NAME [, COMMENT])
+dnl Check whether a typedef exists and create a #define $2 if it exists
+dnl
+AC_DEFUN([GNUPG_CHECK_TYPEDEF],
+  [ AC_MSG_CHECKING(for $1 typedef)
+    AC_CACHE_VAL(gnupg_cv_typedef_$1,
+    [AC_TRY_COMPILE([#include <stdlib.h>
+    #include <sys/types.h>], [
+    #undef $1
+    int a = sizeof($1);
+    ], gnupg_cv_typedef_$1=yes, gnupg_cv_typedef_$1=no )])
+    AC_MSG_RESULT($gnupg_cv_typedef_$1)
+    if test "$gnupg_cv_typedef_$1" = yes; then
+        AC_DEFINE($2, 1, $3)
+    fi
+  ])
+
diff --git a/m4/missing/gdk-pixbuf.m4 b/m4/missing/gdk-pixbuf.m4
new file mode 100644 (file)
index 0000000..581903e
--- /dev/null
@@ -0,0 +1,166 @@
+# Configure paths for gdk-pixbuf
+# Elliot Lee 2000-01-10
+# stolen from Raph Levien 98-11-18
+# stolen from Manish Singh    98-9-30
+# stolen back from Frank Belew
+# stolen from Manish Singh
+# Shamelessly stolen from Owen Taylor
+
+dnl AM_PATH_GDK_PIXBUF([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
+dnl Test for GDK_PIXBUF, and define GDK_PIXBUF_CFLAGS and GDK_PIXBUF_LIBS
+dnl
+AC_DEFUN([AM_PATH_GDK_PIXBUF],
+[dnl 
+dnl Get the cflags and libraries from the gdk-pixbuf-config script
+dnl
+AC_ARG_WITH(gdk-pixbuf-prefix,[  --with-gdk-pixbuf-prefix=PFX   Prefix where GDK_PIXBUF is installed (optional)],
+            gdk_pixbuf_prefix="$withval", gdk_pixbuf_prefix="")
+AC_ARG_WITH(gdk-pixbuf-exec-prefix,[  --with-gdk-pixbuf-exec-prefix=PFX Exec prefix where GDK_PIXBUF is installed (optional)],
+            gdk_pixbuf_exec_prefix="$withval", gdk_pixbuf_exec_prefix="")
+AC_ARG_ENABLE(gdk_pixbuftest, [  --disable-gdk_pixbuftest       Do not try to compile and run a test GDK_PIXBUF program],
+                   , enable_gdk_pixbuftest=yes)
+
+  if test x$gdk_pixbuf_exec_prefix != x ; then
+     gdk_pixbuf_args="$gdk_pixbuf_args --exec-prefix=$gdk_pixbuf_exec_prefix"
+     if test x${GDK_PIXBUF_CONFIG+set} = xset ; then
+        GDK_PIXBUF_CONFIG=$gdk_pixbuf_exec_prefix/gdk-pixbuf-config
+     fi
+  fi
+  if test x$gdk_pixbuf_prefix != x ; then
+     gdk_pixbuf_args="$gdk_pixbuf_args --prefix=$gdk_pixbuf_prefix"
+     if test x${GDK_PIXBUF_CONFIG+set} = xset ; then
+        GDK_PIXBUF_CONFIG=$gdk_pixbuf_prefix/bin/gdk-pixbuf-config
+     fi
+  fi
+
+  AC_PATH_PROG(GDK_PIXBUF_CONFIG, gdk-pixbuf-config, no)
+  min_gdk_pixbuf_version=ifelse([$1], ,0.2.5,$1)
+  AC_MSG_CHECKING(for GDK_PIXBUF - version >= $min_gdk_pixbuf_version)
+  no_gdk_pixbuf=""
+  if test "$GDK_PIXBUF_CONFIG" = "no" ; then
+    no_gdk_pixbuf=yes
+  else
+    GDK_PIXBUF_CFLAGS=`$GDK_PIXBUF_CONFIG $gdk_pixbufconf_args --cflags`
+    GDK_PIXBUF_LIBS=`$GDK_PIXBUF_CONFIG $gdk_pixbufconf_args --libs`
+
+    gdk_pixbuf_major_version=`$GDK_PIXBUF_CONFIG $gdk_pixbuf_args --version | \
+           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
+    gdk_pixbuf_minor_version=`$GDK_PIXBUF_CONFIG $gdk_pixbuf_args --version | \
+           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
+    gdk_pixbuf_micro_version=`$GDK_PIXBUF_CONFIG $gdk_pixbuf_config_args --version | \
+           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
+    if test "x$enable_gdk_pixbuftest" = "xyes" ; then
+      ac_save_CFLAGS="$CFLAGS"
+      ac_save_LIBS="$LIBS"
+      CFLAGS="$CFLAGS $GDK_PIXBUF_CFLAGS"
+      LIBS="$LIBS $GDK_PIXBUF_LIBS"
+dnl
+dnl Now check if the installed GDK_PIXBUF is sufficiently new. (Also sanity
+dnl checks the results of gdk-pixbuf-config to some extent
+dnl
+      rm -f conf.gdk_pixbuftest
+      AC_TRY_RUN([
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <gdk-pixbuf/gdk-pixbuf.h>
+
+char*
+my_strdup (char *str)
+{
+  char *new_str;
+  
+  if (str)
+    {
+      new_str = malloc ((strlen (str) + 1) * sizeof(char));
+      strcpy (new_str, str);
+    }
+  else
+    new_str = NULL;
+  
+  return new_str;
+}
+
+int main ()
+{
+  int major, minor, micro;
+  char *tmp_version;
+
+  system ("touch conf.gdk_pixbuftest");
+
+  /* HP/UX 9 (%@#!) writes to sscanf strings */
+  tmp_version = my_strdup("$min_gdk_pixbuf_version");
+  if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
+     printf("%s, bad version string\n", "$min_gdk_pixbuf_version");
+     exit(1);
+   }
+
+   if (($gdk_pixbuf_major_version > major) ||
+      (($gdk_pixbuf_major_version == major) && ($gdk_pixbuf_minor_version > minor)) ||
+      (($gdk_pixbuf_major_version == major) && ($gdk_pixbuf_minor_version == minor) && ($gdk_pixbuf_micro_version >= micro)))
+    {
+      return 0;
+    }
+  else
+    {
+      printf("\n*** 'gdk-pixbuf-config --version' returned %d.%d.%d, but the minimum version\n", $gdk_pixbuf_major_version, $gdk_pixbuf_minor_version, $gdk_pixbuf_micro_version);
+      printf("*** of GDK_PIXBUF required is %d.%d.%d. If gdk-pixbuf-config is correct, then it is\n", major, minor, micro);
+      printf("*** best to upgrade to the required version.\n");
+      printf("*** If gdk-pixbuf-config was wrong, set the environment variable GDK_PIXBUF_CONFIG\n");
+      printf("*** to point to the correct copy of gdk-pixbuf-config, and remove the file\n");
+      printf("*** config.cache before re-running configure\n");
+      return 1;
+    }
+}
+
+],, no_gdk_pixbuf=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
+       CFLAGS="$ac_save_CFLAGS"
+       LIBS="$ac_save_LIBS"
+     fi
+  fi
+  if test "x$no_gdk_pixbuf" = x ; then
+     AC_MSG_RESULT(yes)
+     ifelse([$2], , :, [$2])     
+  else
+     AC_MSG_RESULT(no)
+     if test "$GDK_PIXBUF_CONFIG" = "no" ; then
+       echo "*** The gdk-pixbuf-config script installed by GDK_PIXBUF could not be found"
+       echo "*** If GDK_PIXBUF was installed in PREFIX, make sure PREFIX/bin is in"
+       echo "*** your path, or set the GDK_PIXBUF_CONFIG environment variable to the"
+       echo "*** full path to gdk-pixbuf-config."
+     else
+       if test -f conf.gdk_pixbuftest ; then
+        :
+       else
+          echo "*** Could not run GDK_PIXBUF test program, checking why..."
+          CFLAGS="$CFLAGS $GDK_PIXBUF_CFLAGS"
+          LIBS="$LIBS $GDK_PIXBUF_LIBS"
+          AC_TRY_LINK([
+#include <stdio.h>
+#include <gdk-pixbuf/gdk-pixbuf.h>
+],      [ return 0; ],
+        [ echo "*** The test program compiled, but did not run. This usually means"
+          echo "*** that the run-time linker is not finding GDK_PIXBUF or finding the wrong"
+          echo "*** version of GDK_PIXBUF. If it is not finding GDK_PIXBUF, you'll need to set your"
+          echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
+          echo "*** to the installed location  Also, make sure you have run ldconfig if that"
+          echo "*** is required on your system"
+         echo "***"
+          echo "*** If you have an old version installed, it is best to remove it, although"
+          echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"],
+        [ echo "*** The test program failed to compile or link. See the file config.log for the"
+          echo "*** exact error that occured. This usually means GDK_PIXBUF was incorrectly installed"
+          echo "*** or that you have moved GDK_PIXBUF since it was installed. In the latter case, you"
+          echo "*** may want to edit the gdk-pixbuf-config script: $GDK_PIXBUF_CONFIG" ])
+          CFLAGS="$ac_save_CFLAGS"
+          LIBS="$ac_save_LIBS"
+       fi
+     fi
+     GDK_PIXBUF_CFLAGS=""
+     GDK_PIXBUF_LIBS=""
+     ifelse([$3], , :, [$3])
+  fi
+  AC_SUBST(GDK_PIXBUF_CFLAGS)
+  AC_SUBST(GDK_PIXBUF_LIBS)
+  rm -f conf.gdk_pixbuftest
+])
diff --git a/m4/missing/gettext.m4 b/m4/missing/gettext.m4
new file mode 100644 (file)
index 0000000..16070b4
--- /dev/null
@@ -0,0 +1,415 @@
+# gettext.m4 serial 20 (gettext-0.12)
+dnl Copyright (C) 1995-2003 Free Software Foundation, Inc.
+dnl This file is free software, distributed under the terms of the GNU
+dnl General Public License.  As a special exception to the GNU General
+dnl Public License, this file may be distributed as part of a program
+dnl that contains a configuration script generated by Autoconf, under
+dnl the same distribution terms as the rest of that program.
+dnl
+dnl This file can can be used in projects which are not available under
+dnl the GNU General Public License or the GNU Library General Public
+dnl License but which still want to provide support for the GNU gettext
+dnl functionality.
+dnl Please note that the actual code of the GNU gettext library is covered
+dnl by the GNU Library General Public License, and the rest of the GNU
+dnl gettext package package is covered by the GNU General Public License.
+dnl They are *not* in the public domain.
+
+dnl Authors:
+dnl   Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
+dnl   Bruno Haible <haible@clisp.cons.org>, 2000-2003.
+
+dnl Macro to add for using GNU gettext.
+
+dnl Usage: AM_GNU_GETTEXT([INTLSYMBOL], [NEEDSYMBOL], [INTLDIR]).
+dnl INTLSYMBOL can be one of 'external', 'no-libtool', 'use-libtool'. The
+dnl    default (if it is not specified or empty) is 'no-libtool'.
+dnl    INTLSYMBOL should be 'external' for packages with no intl directory,
+dnl    and 'no-libtool' or 'use-libtool' for packages with an intl directory.
+dnl    If INTLSYMBOL is 'use-libtool', then a libtool library
+dnl    $(top_builddir)/intl/libintl.la will be created (shared and/or static,
+dnl    depending on --{enable,disable}-{shared,static} and on the presence of
+dnl    AM-DISABLE-SHARED). If INTLSYMBOL is 'no-libtool', a static library
+dnl    $(top_builddir)/intl/libintl.a will be created.
+dnl If NEEDSYMBOL is specified and is 'need-ngettext', then GNU gettext
+dnl    implementations (in libc or libintl) without the ngettext() function
+dnl    will be ignored.  If NEEDSYMBOL is specified and is
+dnl    'need-formatstring-macros', then GNU gettext implementations that don't
+dnl    support the ISO C 99 <inttypes.h> formatstring macros will be ignored.
+dnl INTLDIR is used to find the intl libraries.  If empty,
+dnl    the value `$(top_builddir)/intl/' is used.
+dnl
+dnl The result of the configuration is one of three cases:
+dnl 1) GNU gettext, as included in the intl subdirectory, will be compiled
+dnl    and used.
+dnl    Catalog format: GNU --> install in $(datadir)
+dnl    Catalog extension: .mo after installation, .gmo in source tree
+dnl 2) GNU gettext has been found in the system's C library.
+dnl    Catalog format: GNU --> install in $(datadir)
+dnl    Catalog extension: .mo after installation, .gmo in source tree
+dnl 3) No internationalization, always use English msgid.
+dnl    Catalog format: none
+dnl    Catalog extension: none
+dnl If INTLSYMBOL is 'external', only cases 2 and 3 can occur.
+dnl The use of .gmo is historical (it was needed to avoid overwriting the
+dnl GNU format catalogs when building on a platform with an X/Open gettext),
+dnl but we keep it in order not to force irrelevant filename changes on the
+dnl maintainers.
+dnl
+AC_DEFUN([AM_GNU_GETTEXT],
+[
+  dnl Argument checking.
+  ifelse([$1], [], , [ifelse([$1], [external], , [ifelse([$1], [no-libtool], , [ifelse([$1], [use-libtool], ,
+    [errprint([ERROR: invalid first argument to AM_GNU_GETTEXT
+])])])])])
+  ifelse([$2], [], , [ifelse([$2], [need-ngettext], , [ifelse([$2], [need-formatstring-macros], ,
+    [errprint([ERROR: invalid second argument to AM_GNU_GETTEXT
+])])])])
+  define(gt_included_intl, ifelse([$1], [external], [no], [yes]))
+  define(gt_libtool_suffix_prefix, ifelse([$1], [use-libtool], [l], []))
+
+  AC_REQUIRE([AM_PO_SUBDIRS])dnl
+  ifelse(gt_included_intl, yes, [
+    AC_REQUIRE([AM_INTL_SUBDIR])dnl
+  ])
+
+  dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
+  AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
+  AC_REQUIRE([AC_LIB_RPATH])
+
+  dnl Sometimes libintl requires libiconv, so first search for libiconv.
+  dnl Ideally we would do this search only after the
+  dnl      if test "$USE_NLS" = "yes"; then
+  dnl        if test "$gt_cv_func_gnugettext_libc" != "yes"; then
+  dnl tests. But if configure.in invokes AM_ICONV after AM_GNU_GETTEXT
+  dnl the configure script would need to contain the same shell code
+  dnl again, outside any 'if'. There are two solutions:
+  dnl - Invoke AM_ICONV_LINKFLAGS_BODY here, outside any 'if'.
+  dnl - Control the expansions in more detail using AC_PROVIDE_IFELSE.
+  dnl Since AC_PROVIDE_IFELSE is only in autoconf >= 2.52 and not
+  dnl documented, we avoid it.
+  ifelse(gt_included_intl, yes, , [
+    AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
+  ])
+
+  dnl Set USE_NLS.
+  AM_NLS
+
+  ifelse(gt_included_intl, yes, [
+    BUILD_INCLUDED_LIBINTL=no
+    USE_INCLUDED_LIBINTL=no
+  ])
+  LIBINTL=
+  LTLIBINTL=
+  POSUB=
+
+  dnl If we use NLS figure out what method
+  if test "$USE_NLS" = "yes"; then
+    gt_use_preinstalled_gnugettext=no
+    ifelse(gt_included_intl, yes, [
+      AC_MSG_CHECKING([whether included gettext is requested])
+      AC_ARG_WITH(included-gettext,
+        [  --with-included-gettext use the GNU gettext library included here],
+        nls_cv_force_use_gnu_gettext=$withval,
+        nls_cv_force_use_gnu_gettext=no)
+      AC_MSG_RESULT($nls_cv_force_use_gnu_gettext)
+
+      nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
+      if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
+    ])
+        dnl User does not insist on using GNU NLS library.  Figure out what
+        dnl to use.  If GNU gettext is available we use this.  Else we have
+        dnl to fall back to GNU NLS library.
+
+        dnl Add a version number to the cache macros.
+        define([gt_api_version], ifelse([$2], [need-formatstring-macros], 3, ifelse([$2], [need-ngettext], 2, 1)))
+        define([gt_cv_func_gnugettext_libc], [gt_cv_func_gnugettext]gt_api_version[_libc])
+        define([gt_cv_func_gnugettext_libintl], [gt_cv_func_gnugettext]gt_api_version[_libintl])
+
+        AC_CACHE_CHECK([for GNU gettext in libc], gt_cv_func_gnugettext_libc,
+         [AC_TRY_LINK([#include <libintl.h>
+]ifelse([$2], [need-formatstring-macros],
+[#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
+#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
+#endif
+changequote(,)dnl
+typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
+changequote([,])dnl
+], [])[extern int _nl_msg_cat_cntr;
+extern int *_nl_domain_bindings;],
+            [bindtextdomain ("", "");
+return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_domain_bindings],
+            gt_cv_func_gnugettext_libc=yes,
+            gt_cv_func_gnugettext_libc=no)])
+
+        if test "$gt_cv_func_gnugettext_libc" != "yes"; then
+          dnl Sometimes libintl requires libiconv, so first search for libiconv.
+          ifelse(gt_included_intl, yes, , [
+            AM_ICONV_LINK
+          ])
+          dnl Search for libintl and define LIBINTL, LTLIBINTL and INCINTL
+          dnl accordingly. Don't use AC_LIB_LINKFLAGS_BODY([intl],[iconv])
+          dnl because that would add "-liconv" to LIBINTL and LTLIBINTL
+          dnl even if libiconv doesn't exist.
+          AC_LIB_LINKFLAGS_BODY([intl])
+          AC_CACHE_CHECK([for GNU gettext in libintl],
+            gt_cv_func_gnugettext_libintl,
+           [gt_save_CPPFLAGS="$CPPFLAGS"
+            CPPFLAGS="$CPPFLAGS $INCINTL"
+            gt_save_LIBS="$LIBS"
+            LIBS="$LIBS $LIBINTL"
+            dnl Now see whether libintl exists and does not depend on libiconv.
+            AC_TRY_LINK([#include <libintl.h>
+]ifelse([$2], [need-formatstring-macros],
+[#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
+#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
+#endif
+changequote(,)dnl
+typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
+changequote([,])dnl
+], [])[extern int _nl_msg_cat_cntr;
+extern
+#ifdef __cplusplus
+"C"
+#endif
+const char *_nl_expand_alias ();],
+              [bindtextdomain ("", "");
+return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_expand_alias (0)],
+              gt_cv_func_gnugettext_libintl=yes,
+              gt_cv_func_gnugettext_libintl=no)
+            dnl Now see whether libintl exists and depends on libiconv.
+            if test "$gt_cv_func_gnugettext_libintl" != yes && test -n "$LIBICONV"; then
+              LIBS="$LIBS $LIBICONV"
+              AC_TRY_LINK([#include <libintl.h>
+]ifelse([$2], [need-formatstring-macros],
+[#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
+#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
+#endif
+changequote(,)dnl
+typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
+changequote([,])dnl
+], [])[extern int _nl_msg_cat_cntr;
+extern
+#ifdef __cplusplus
+"C"
+#endif
+const char *_nl_expand_alias ();],
+                [bindtextdomain ("", "");
+return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_expand_alias (0)],
+               [LIBINTL="$LIBINTL $LIBICONV"
+                LTLIBINTL="$LTLIBINTL $LTLIBICONV"
+                gt_cv_func_gnugettext_libintl=yes
+               ])
+            fi
+            CPPFLAGS="$gt_save_CPPFLAGS"
+            LIBS="$gt_save_LIBS"])
+        fi
+
+        dnl If an already present or preinstalled GNU gettext() is found,
+        dnl use it.  But if this macro is used in GNU gettext, and GNU
+        dnl gettext is already preinstalled in libintl, we update this
+        dnl libintl.  (Cf. the install rule in intl/Makefile.in.)
+        if test "$gt_cv_func_gnugettext_libc" = "yes" \
+           || { test "$gt_cv_func_gnugettext_libintl" = "yes" \
+                && test "$PACKAGE" != gettext-runtime \
+                && test "$PACKAGE" != gettext-tools; }; then
+          gt_use_preinstalled_gnugettext=yes
+        else
+          dnl Reset the values set by searching for libintl.
+          LIBINTL=
+          LTLIBINTL=
+          INCINTL=
+        fi
+
+    ifelse(gt_included_intl, yes, [
+        if test "$gt_use_preinstalled_gnugettext" != "yes"; then
+          dnl GNU gettext is not found in the C library.
+          dnl Fall back on included GNU gettext library.
+          nls_cv_use_gnu_gettext=yes
+        fi
+      fi
+
+      if test "$nls_cv_use_gnu_gettext" = "yes"; then
+        dnl Mark actions used to generate GNU NLS library.
+        BUILD_INCLUDED_LIBINTL=yes
+        USE_INCLUDED_LIBINTL=yes
+        LIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LIBICONV"
+        LTLIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LTLIBICONV"
+        LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'`
+      fi
+
+      if test "$gt_use_preinstalled_gnugettext" = "yes" \
+         || test "$nls_cv_use_gnu_gettext" = "yes"; then
+        dnl Mark actions to use GNU gettext tools.
+        CATOBJEXT=.gmo
+      fi
+    ])
+
+    if test "$gt_use_preinstalled_gnugettext" = "yes" \
+       || test "$nls_cv_use_gnu_gettext" = "yes"; then
+      AC_DEFINE(ENABLE_NLS, 1,
+        [Define to 1 if translation of program messages to the user's native language
+   is requested.])
+    else
+      USE_NLS=no
+    fi
+  fi
+
+  AC_MSG_CHECKING([whether to use NLS])
+  AC_MSG_RESULT([$USE_NLS])
+  if test "$USE_NLS" = "yes"; then
+    AC_MSG_CHECKING([where the gettext function comes from])
+    if test "$gt_use_preinstalled_gnugettext" = "yes"; then
+      if test "$gt_cv_func_gnugettext_libintl" = "yes"; then
+        gt_source="external libintl"
+      else
+        gt_source="libc"
+      fi
+    else
+      gt_source="included intl directory"
+    fi
+    AC_MSG_RESULT([$gt_source])
+  fi
+
+  if test "$USE_NLS" = "yes"; then
+
+    if test "$gt_use_preinstalled_gnugettext" = "yes"; then
+      if test "$gt_cv_func_gnugettext_libintl" = "yes"; then
+        AC_MSG_CHECKING([how to link with libintl])
+        AC_MSG_RESULT([$LIBINTL])
+        AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCINTL])
+      fi
+
+      dnl For backward compatibility. Some packages may be using this.
+      AC_DEFINE(HAVE_GETTEXT, 1,
+       [Define if the GNU gettext() function is already present or preinstalled.])
+      AC_DEFINE(HAVE_DCGETTEXT, 1,
+       [Define if the GNU dcgettext() function is already present or preinstalled.])
+    fi
+
+    dnl We need to process the po/ directory.
+    POSUB=po
+  fi
+
+  ifelse(gt_included_intl, yes, [
+    dnl If this is used in GNU gettext we have to set BUILD_INCLUDED_LIBINTL
+    dnl to 'yes' because some of the testsuite requires it.
+    if test "$PACKAGE" = gettext-runtime || test "$PACKAGE" = gettext-tools; then
+      BUILD_INCLUDED_LIBINTL=yes
+    fi
+
+    dnl Make all variables we use known to autoconf.
+    AC_SUBST(BUILD_INCLUDED_LIBINTL)
+    AC_SUBST(USE_INCLUDED_LIBINTL)
+    AC_SUBST(CATOBJEXT)
+
+    dnl For backward compatibility. Some configure.ins may be using this.
+    nls_cv_header_intl=
+    nls_cv_header_libgt=
+
+    dnl For backward compatibility. Some Makefiles may be using this.
+    DATADIRNAME=share
+    AC_SUBST(DATADIRNAME)
+
+    dnl For backward compatibility. Some Makefiles may be using this.
+    INSTOBJEXT=.mo
+    AC_SUBST(INSTOBJEXT)
+
+    dnl For backward compatibility. Some Makefiles may be using this.
+    GENCAT=gencat
+    AC_SUBST(GENCAT)
+
+    dnl For backward compatibility. Some Makefiles may be using this.
+    if test "$USE_INCLUDED_LIBINTL" = yes; then
+      INTLOBJS="\$(GETTOBJS)"
+    fi
+    AC_SUBST(INTLOBJS)
+
+    dnl Enable libtool support if the surrounding package wishes it.
+    INTL_LIBTOOL_SUFFIX_PREFIX=gt_libtool_suffix_prefix
+    AC_SUBST(INTL_LIBTOOL_SUFFIX_PREFIX)
+  ])
+
+  dnl For backward compatibility. Some Makefiles may be using this.
+  INTLLIBS="$LIBINTL"
+  AC_SUBST(INTLLIBS)
+
+  dnl Make all documented variables known to autoconf.
+  AC_SUBST(LIBINTL)
+  AC_SUBST(LTLIBINTL)
+  AC_SUBST(POSUB)
+])
+
+
+dnl Checks for all prerequisites of the intl subdirectory,
+dnl except for INTL_LIBTOOL_SUFFIX_PREFIX (and possibly LIBTOOL), INTLOBJS,
+dnl            USE_INCLUDED_LIBINTL, BUILD_INCLUDED_LIBINTL.
+AC_DEFUN([AM_INTL_SUBDIR],
+[
+  AC_REQUIRE([AC_PROG_INSTALL])dnl
+  AC_REQUIRE([AM_MKINSTALLDIRS])dnl
+  AC_REQUIRE([AC_PROG_CC])dnl
+  AC_REQUIRE([AC_CANONICAL_HOST])dnl
+  AC_REQUIRE([AC_PROG_RANLIB])dnl
+  AC_REQUIRE([AC_ISC_POSIX])dnl
+  AC_REQUIRE([AC_HEADER_STDC])dnl
+  AC_REQUIRE([AC_C_CONST])dnl
+  AC_REQUIRE([AC_C_INLINE])dnl
+  AC_REQUIRE([AC_TYPE_OFF_T])dnl
+  AC_REQUIRE([AC_TYPE_SIZE_T])dnl
+  AC_REQUIRE([AC_FUNC_ALLOCA])dnl
+  AC_REQUIRE([AC_FUNC_MMAP])dnl
+  AC_REQUIRE([jm_GLIBC21])dnl
+  AC_REQUIRE([gt_INTDIV0])dnl
+  AC_REQUIRE([jm_AC_TYPE_UINTMAX_T])dnl
+  AC_REQUIRE([gt_HEADER_INTTYPES_H])dnl
+  AC_REQUIRE([gt_INTTYPES_PRI])dnl
+
+  AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h stddef.h \
+stdlib.h string.h unistd.h sys/param.h])
+  AC_CHECK_FUNCS([feof_unlocked fgets_unlocked getc_unlocked getcwd getegid \
+geteuid getgid getuid mempcpy munmap putenv setenv setlocale stpcpy \
+strcasecmp strdup strtoul tsearch __argz_count __argz_stringify __argz_next \
+__fsetlocking])
+
+  AM_ICONV
+  AM_LANGINFO_CODESET
+  if test $ac_cv_header_locale_h = yes; then
+    AM_LC_MESSAGES
+  fi
+
+  dnl intl/plural.c is generated from intl/plural.y. It requires bison,
+  dnl because plural.y uses bison specific features. It requires at least
+  dnl bison-1.26 because earlier versions generate a plural.c that doesn't
+  dnl compile.
+  dnl bison is only needed for the maintainer (who touches plural.y). But in
+  dnl order to avoid separate Makefiles or --enable-maintainer-mode, we put
+  dnl the rule in general Makefile. Now, some people carelessly touch the
+  dnl files or have a broken "make" program, hence the plural.c rule will
+  dnl sometimes fire. To avoid an error, defines BISON to ":" if it is not
+  dnl present or too old.
+  AC_CHECK_PROGS([INTLBISON], [bison])
+  if test -z "$INTLBISON"; then
+    ac_verc_fail=yes
+  else
+    dnl Found it, now check the version.
+    AC_MSG_CHECKING([version of bison])
+changequote(<<,>>)dnl
+    ac_prog_version=`$INTLBISON --version 2>&1 | sed -n 's/^.*GNU Bison.* \([0-9]*\.[0-9.]*\).*$/\1/p'`
+    case $ac_prog_version in
+      '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
+      1.2[6-9]* | 1.[3-9][0-9]* | [2-9].*)
+changequote([,])dnl
+         ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
+      *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
+    esac
+    AC_MSG_RESULT([$ac_prog_version])
+  fi
+  if test $ac_verc_fail = yes; then
+    INTLBISON=:
+  fi
+])
+
+
+dnl Usage: AM_GNU_GETTEXT_VERSION([gettext-version])
+AC_DEFUN([AM_GNU_GETTEXT_VERSION], [])
diff --git a/m4/missing/gpgme.m4 b/m4/missing/gpgme.m4
new file mode 100644 (file)
index 0000000..89b4aed
--- /dev/null
@@ -0,0 +1,170 @@
+dnl Autoconf macros for libgpgme
+dnl $Id$
+
+# Configure paths for GPGME
+# Shamelessly stolen from the one of XDELTA by Owen Taylor
+# Werner Koch  2000-11-17
+
+dnl AM_PATH_GPGME([MINIMUM-VERSION,
+dnl               [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND ]]])
+dnl Test for gpgme, and define GPGME_CFLAGS and GPGME_LIBS
+dnl
+AC_DEFUN([AM_PATH_GPGME],
+[dnl
+dnl Get the cflags and libraries from the gpgme-config script
+dnl
+  AC_ARG_WITH(gpgme-prefix,
+   [  --with-gpgme-prefix=PFX   Prefix where gpgme is installed (optional)],
+          gpgme_config_prefix="$withval", gpgme_config_prefix="")
+  AC_ARG_ENABLE(gpgmetest,
+   [  --disable-gpgmetest    Do not try to compile and run a test gpgme program],
+          , enable_gpgmetest=yes)
+
+  if test x$gpgme_config_prefix != x ; then
+     gpgme_config_args="$gpgme_config_args --prefix=$gpgme_config_prefix"
+     if test x${GPGME_CONFIG+set} != xset ; then
+        GPGME_CONFIG=$gpgme_config_prefix/bin/gpgme-config
+     fi
+  fi
+
+  AC_PATH_PROG(GPGME_CONFIG, gpgme-config, no)
+  min_gpgme_version=ifelse([$1], ,1.0.0,$1)
+  AC_MSG_CHECKING(for GPGME - version >= $min_gpgme_version)
+  no_gpgme=""
+  if test "$GPGME_CONFIG" = "no" ; then
+    no_gpgme=yes
+  else
+    GPGME_CFLAGS=`$GPGME_CONFIG $gpgme_config_args --cflags`
+    GPGME_LIBS=`$GPGME_CONFIG $gpgme_config_args --libs`
+    gpgme_config_version=`$GPGME_CONFIG $gpgme_config_args --version`
+    if test "x$enable_gpgmetest" = "xyes" ; then
+      ac_save_CFLAGS="$CFLAGS"
+      ac_save_LIBS="$LIBS"
+      CFLAGS="$CFLAGS $GPGME_CFLAGS"
+      LIBS="$LIBS $GPGME_LIBS"
+dnl
+dnl Now check if the installed gpgme is sufficiently new. Also sanity
+dnl checks the results of gpgme-config to some extent
+dnl
+      rm -f conf.gpgmetest
+      AC_TRY_RUN([
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <gpgme.h>
+
+int
+main ()
+{
+ system ("touch conf.gpgmetest");
+
+ if( strcmp( gpgme_check_version(NULL), "$gpgme_config_version" ) )
+ {
+   printf("\n"
+"*** 'gpgme-config --version' returned %s, but GPGME (%s) was found!\n",
+              "$gpgme_config_version", gpgme_check_version(NULL) );
+   printf(
+"*** If gpgme-config was correct, then it is best to remove the old\n"
+"*** version of GPGME.  You may also be able to fix the error\n"
+"*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n"
+"*** /etc/ld.so.conf.  Make sure you have run ldconfig if that is\n"
+"*** required on your system.\n"
+"*** If gpgme-config was wrong, set the environment variable GPGME_CONFIG\n"
+"*** to point to the correct copy of gpgme-config, \n"
+"*** and remove the file config.cache before re-running configure\n"
+        );
+ }
+ else if ( strcmp(gpgme_check_version(NULL), GPGME_VERSION ) )
+ {
+   printf("\n*** GPGME header file (version %s) does not match\n",
+            GPGME_VERSION);
+   printf("*** library (version %s)\n", gpgme_check_version(NULL) );
+ }
+ else
+ {
+        if ( gpgme_check_version( "$min_gpgme_version" ) )
+             return 0;
+  printf("no\n"
+"*** An old version of GPGME (%s) was found.\n", gpgme_check_version(NULL) );
+  printf(
+"*** You need a version of GPGME newer than %s.\n", "$min_gpgme_version" );
+  printf(
+"*** The latest version of GPGME is always available at\n"
+"***      ftp://ftp.gnupg.org/pub/gcrypt/alpha/gpgme/\n"
+"*** \n"
+"*** If you have already installed a sufficiently new version, this error\n"
+"*** probably means that the wrong copy of the gpgme-config shell script is\n"
+"*** being found. The easiest way to fix this is to remove the old version\n"
+"*** of GPGME, but you can also set the GPGME_CONFIG environment to point to\n"
+"*** the correct copy of gpgme-config. (In this case, you will have to\n"
+"*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n"
+"*** so that the correct libraries are found at run-time).\n"
+      );
+    }
+  return 1;
+}
+],, no_gpgme=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
+       CFLAGS="$ac_save_CFLAGS"
+       LIBS="$ac_save_LIBS"
+     fi
+  fi
+  if test "x$no_gpgme" = x ; then
+     AC_MSG_RESULT(yes)
+     ifelse([$2], , :, [$2])
+  else
+     if test -f conf.gpgmetest ; then
+        :
+     else
+        AC_MSG_RESULT(no)
+     fi
+     if test "$GPGME_CONFIG" = "no" ; then
+       echo "*** The gpgme-config script installed by GPGME could not be found"
+       echo "*** If GPGME was installed in PREFIX, make sure PREFIX/bin is in"
+       echo "*** your path, or set the GPGME_CONFIG environment variable to the"
+       echo "*** full path to gpgme-config."
+     else
+       if test -f conf.gpgmetest ; then
+        :
+       else
+          echo "*** Could not run gpgme test program, checking why..."
+          CFLAGS="$CFLAGS $GPGME_CFLAGS"
+          LIBS="$LIBS $GPGME_LIBS"
+          AC_TRY_LINK([
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <gpgme.h>
+],      [ gpgme_check_version(NULL); return 0 ],
+        [ 
+echo "*** The test program compiled, but did not run. This usually means"
+echo "*** that the run-time linker is not finding GPGME or finding the wrong"
+echo "*** version of GPGME. If it is not finding GPGME, you'll need to set your"
+echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
+echo "*** to the installed location  Also, make sure you have run ldconfig if"
+echo "*** that is required on your system"
+echo "***"
+echo "*** If you have an old version installed, it is best to remove it,"
+echo "*** although you may also be able to get things to work by"
+echo "*** modifying LD_LIBRARY_PATH"
+echo "***"
+        ],
+        [
+echo "*** The test program failed to compile or link. See the file config.log"
+echo "*** for the exact error that occured. This usually means GPGME was"
+echo "*** incorrectly installed or that you have moved GPGME since it was"
+echo "*** installed. In the latter case, you may want to edit the"
+echo "*** gpgme-config script: $GPGME_CONFIG" 
+        ])
+          CFLAGS="$ac_save_CFLAGS"
+          LIBS="$ac_save_LIBS"
+       fi
+     fi
+     GPGME_CFLAGS=""
+     GPGME_LIBS=""
+     ifelse([$3], , :, [$3])
+  fi
+  AC_SUBST(GPGME_CFLAGS)
+  AC_SUBST(GPGME_LIBS)
+  rm -f conf.gpgmetest
+])
+
diff --git a/m4/missing/imlib.m4 b/m4/missing/imlib.m4
new file mode 100644 (file)
index 0000000..8ce387a
--- /dev/null
@@ -0,0 +1,301 @@
+# Configure paths for IMLIB
+# Frank Belew     98-8-31
+# stolen from Manish Singh
+# Shamelessly stolen from Owen Taylor
+
+dnl AM_PATH_IMLIB([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
+dnl Test for IMLIB, and define IMLIB_CFLAGS and IMLIB_LIBS
+dnl
+AC_DEFUN([AM_PATH_IMLIB],
+[dnl 
+dnl Get the cflags and libraries from the imlib-config script
+dnl
+AC_ARG_WITH(imlib-prefix,[  --with-imlib-prefix=PFX   Prefix where IMLIB is installed (optional)],
+            imlib_prefix="$withval", imlib_prefix="")
+AC_ARG_WITH(imlib-exec-prefix,[  --with-imlib-exec-prefix=PFX Exec prefix where IMLIB is installed (optional)],
+            imlib_exec_prefix="$withval", imlib_exec_prefix="")
+AC_ARG_ENABLE(imlibtest, [  --disable-imlibtest       Do not try to compile and run a test IMLIB program],
+                   , enable_imlibtest=yes)
+
+  if test x$imlib_exec_prefix != x ; then
+     imlib_args="$imlib_args --exec-prefix=$imlib_exec_prefix"
+     if test x${IMLIB_CONFIG+set} != xset ; then
+        IMLIB_CONFIG=$imlib_exec_prefix/bin/imlib-config
+     fi
+  fi
+  if test x$imlib_prefix != x ; then
+     imlib_args="$imlib_args --prefix=$imlib_prefix"
+     if test x${IMLIB_CONFIG+set} != xset ; then
+        IMLIB_CONFIG=$imlib_prefix/bin/imlib-config
+     fi
+  fi
+
+  AC_PATH_PROG(IMLIB_CONFIG, imlib-config, no)
+  min_imlib_version=ifelse([$1], ,1.8.2,$1)
+  AC_MSG_CHECKING(for IMLIB - version >= $min_imlib_version)
+  no_imlib=""
+  if test "$IMLIB_CONFIG" = "no" ; then
+    no_imlib=yes
+  else
+    IMLIB_CFLAGS=`$IMLIB_CONFIG $imlibconf_args --cflags`
+    IMLIB_LIBS=`$IMLIB_CONFIG $imlibconf_args --libs`
+
+    imlib_major_version=`$IMLIB_CONFIG $imlib_args --version | \
+           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
+    imlib_minor_version=`$IMLIB_CONFIG $imlib_args --version | \
+           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
+    imlib_micro_version=`$IMLIB_CONFIG $imlib_args --version | \
+           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
+    if test "x$enable_imlibtest" = "xyes" ; then
+      ac_save_CFLAGS="$CFLAGS"
+      ac_save_LIBS="$LIBS"
+      CFLAGS="$CFLAGS $IMLIB_CFLAGS"
+      LIBS="$LIBS $IMLIB_LIBS"
+dnl
+dnl Now check if the installed IMLIB is sufficiently new. (Also sanity
+dnl checks the results of imlib-config to some extent
+dnl
+      rm -f conf.imlibtest
+      AC_TRY_RUN([
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <Imlib.h>
+
+char*
+my_strdup (char *str)
+{
+  char *new_str;
+  
+  if (str)
+    {
+      new_str = malloc ((strlen (str) + 1) * sizeof(char));
+      strcpy (new_str, str);
+    }
+  else
+    new_str = NULL;
+  
+  return new_str;
+}
+
+int main ()
+{
+  int major, minor, micro;
+  char *tmp_version;
+
+  system ("touch conf.imlibtest");
+
+  /* HP/UX 9 (%@#!) writes to sscanf strings */
+  tmp_version = my_strdup("$min_imlib_version");
+  if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
+     printf("%s, bad version string\n", "$min_imlib_version");
+     exit(1);
+   }
+
+    if (($imlib_major_version > major) ||
+        (($imlib_major_version == major) && ($imlib_minor_version > minor)) ||
+       (($imlib_major_version == major) && ($imlib_minor_version == minor) &&
+       ($imlib_micro_version >= micro)))
+    {
+      return 0;
+    }
+  else
+    {
+      printf("\n*** 'imlib-config --version' returned %d.%d, but the minimum version\n", $imlib_major_version, $imlib_minor_version);
+      printf("*** of IMLIB required is %d.%d. If imlib-config is correct, then it is\n", major, minor);
+      printf("*** best to upgrade to the required version.\n");
+      printf("*** If imlib-config was wrong, set the environment variable IMLIB_CONFIG\n");
+      printf("*** to point to the correct copy of imlib-config, and remove the file\n");
+      printf("*** config.cache before re-running configure\n");
+      return 1;
+    }
+}
+
+],, no_imlib=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
+       CFLAGS="$ac_save_CFLAGS"
+       LIBS="$ac_save_LIBS"
+     fi
+  fi
+  if test "x$no_imlib" = x ; then
+     AC_MSG_RESULT(yes)
+     ifelse([$2], , :, [$2])     
+  else
+     AC_MSG_RESULT(no)
+     if test "$IMLIB_CONFIG" = "no" ; then
+       echo "*** The imlib-config script installed by IMLIB could not be found"
+       echo "*** If IMLIB was installed in PREFIX, make sure PREFIX/bin is in"
+       echo "*** your path, or set the IMLIB_CONFIG environment variable to the"
+       echo "*** full path to imlib-config."
+     else
+       if test -f conf.imlibtest ; then
+        :
+       else
+          echo "*** Could not run IMLIB test program, checking why..."
+          CFLAGS="$CFLAGS $IMLIB_CFLAGS"
+          LIBS="$LIBS $IMLIB_LIBS"
+          AC_TRY_LINK([
+#include <stdio.h>
+#include <Imlib.h>
+],      [ return 0; ],
+        [ echo "*** The test program compiled, but did not run. This usually means"
+          echo "*** that the run-time linker is not finding IMLIB or finding the wrong"
+          echo "*** version of IMLIB. If it is not finding IMLIB, you'll need to set your"
+          echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
+          echo "*** to the installed location  Also, make sure you have run ldconfig if that"
+          echo "*** is required on your system"
+         echo "***"
+          echo "*** If you have an old version installed, it is best to remove it, although"
+          echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"],
+        [ echo "*** The test program failed to compile or link. See the file config.log for the"
+          echo "*** exact error that occured. This usually means IMLIB was incorrectly installed"
+          echo "*** or that you have moved IMLIB since it was installed. In the latter case, you"
+          echo "*** may want to edit the imlib-config script: $IMLIB_CONFIG" ])
+          CFLAGS="$ac_save_CFLAGS"
+          LIBS="$ac_save_LIBS"
+       fi
+     fi
+     IMLIB_CFLAGS=""
+     IMLIB_LIBS=""
+     ifelse([$3], , :, [$3])
+  fi
+  AC_SUBST(IMLIB_CFLAGS)
+  AC_SUBST(IMLIB_LIBS)
+  rm -f conf.imlibtest
+])
+
+# Check for gdk-imlib
+AC_DEFUN(AM_PATH_GDK_IMLIB,
+[dnl 
+dnl Get the cflags and libraries from the imlib-config script
+dnl
+AC_ARG_WITH(imlib-prefix,[  --with-imlib-prefix=PFX   Prefix where IMLIB is installed (optional)],
+            imlib_prefix="$withval", imlib_prefix="")
+AC_ARG_WITH(imlib-exec-prefix,[  --with-imlib-exec-prefix=PFX Exec prefix where IMLIB is installed (optional)],
+            imlib_exec_prefix="$withval", imlib_exec_prefix="")
+AC_ARG_ENABLE(imlibtest, [  --disable-imlibtest       Do not try to compile and run a test IMLIB program],
+                   , enable_imlibtest=yes)
+
+  if test x$imlib_exec_prefix != x ; then
+     imlib_args="$imlib_args --exec-prefix=$imlib_exec_prefix"
+     if test x${IMLIB_CONFIG+set} != xset ; then
+        IMLIB_CONFIG=$imlib_exec_prefix/bin/imlib-config
+     fi
+  fi
+  if test x$imlib_prefix != x ; then
+     imlib_args="$imlib_args --prefix=$imlib_prefix"
+     if test x${IMLIB_CONFIG+set} != xset ; then
+        IMLIB_CONFIG=$imlib_prefix/bin/imlib-config
+     fi
+  fi
+
+  AC_PATH_PROG(IMLIB_CONFIG, imlib-config, no)
+  min_imlib_version=ifelse([$1], ,1.8.2,$1)
+  AC_MSG_CHECKING(for IMLIB - version >= $min_imlib_version)
+  no_imlib=""
+  if test "$IMLIB_CONFIG" = "no" ; then
+    no_imlib=yes
+  else
+    GDK_IMLIB_CFLAGS=`$IMLIB_CONFIG $imlibconf_args --cflags-gdk`
+    GDK_IMLIB_LIBS=`$IMLIB_CONFIG $imlibconf_args --libs-gdk`
+
+    imlib_major_version=`$IMLIB_CONFIG $imlib_args --version | \
+           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
+    imlib_minor_version=`$IMLIB_CONFIG $imlib_args --version | \
+           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
+    if test "x$enable_imlibtest" = "xyes" ; then
+      ac_save_CFLAGS="$CFLAGS"
+      ac_save_LIBS="$LIBS"
+      CFLAGS="$CFLAGS $GDK_IMLIB_CFLAGS"
+      LIBS="$LIBS $GDK_IMLIB_LIBS"
+dnl
+dnl Now check if the installed IMLIB is sufficiently new. (Also sanity
+dnl checks the results of imlib-config to some extent
+dnl
+      rm -f conf.imlibtest
+      AC_TRY_RUN([
+#include <stdio.h>
+#include <stdlib.h>
+#include <gdk_imlib.h>
+
+int main ()
+{
+  int major, minor;
+  char *tmp_version;
+
+  system ("touch conf.gdkimlibtest");
+
+  /* HP/UX 9 (%@#!) writes to sscanf strings */
+  tmp_version = g_strdup("$min_imlib_version");
+  if (sscanf(tmp_version, "%d.%d", &major, &minor) != 2) {
+     printf("%s, bad version string\n", "$min_imlib_version");
+     exit(1);
+   }
+
+    if (($imlib_major_version > major) ||
+        (($imlib_major_version == major) && ($imlib_minor_version >= minor)))
+    {
+      return 0;
+    }
+  else
+    {
+      printf("\n*** 'imlib-config --version' returned %d.%d, but the minimum version\n", $imlib_major_version, $imlib_minor_version);
+      printf("*** of IMLIB required is %d.%d. If imlib-config is correct, then it is\n", major, minor);
+      printf("*** best to upgrade to the required version.\n");
+      printf("*** If imlib-config was wrong, set the environment variable IMLIB_CONFIG\n");
+      printf("*** to point to the correct copy of imlib-config, and remove the file\n");
+      printf("*** config.cache before re-running configure\n");
+      return 1;
+    }
+}
+
+],, no_imlib=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
+       CFLAGS="$ac_save_CFLAGS"
+       LIBS="$ac_save_LIBS"
+     fi
+  fi
+  if test "x$no_imlib" = x ; then
+     AC_MSG_RESULT(yes)
+     ifelse([$2], , :, [$2])     
+  else
+     AC_MSG_RESULT(no)
+     if test "$IMLIB_CONFIG" = "no" ; then
+       echo "*** The imlib-config script installed by IMLIB could not be found"
+       echo "*** If IMLIB was installed in PREFIX, make sure PREFIX/bin is in"
+       echo "*** your path, or set the IMLIB_CONFIG environment variable to the"
+       echo "*** full path to imlib-config."
+     else
+       if test -f conf.gdkimlibtest ; then
+        :
+       else
+          echo "*** Could not run IMLIB test program, checking why..."
+          CFLAGS="$CFLAGS $GDK_IMLIB_CFLAGS"
+          LIBS="$LIBS $GDK_IMLIB_LIBS"
+          AC_TRY_LINK([
+#include <stdio.h>
+#include <gdk_imlib.h>
+],      [ return 0; ],
+        [ echo "*** The test program compiled, but did not run. This usually means"
+          echo "*** that the run-time linker is not finding IMLIB or finding the wrong"
+          echo "*** version of IMLIB. If it is not finding IMLIB, you'll need to set your"
+          echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
+          echo "*** to the installed location  Also, make sure you have run ldconfig if that"
+          echo "*** is required on your system"
+         echo "***"
+          echo "*** If you have an old version installed, it is best to remove it, although"
+          echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"],
+        [ echo "*** The test program failed to compile or link. See the file config.log for the"
+          echo "*** exact error that occured. This usually means IMLIB was incorrectly installed"
+          echo "*** or that you have moved IMLIB since it was installed. In the latter case, you"
+          echo "*** may want to edit the imlib-config script: $IMLIB_CONFIG" ])
+          CFLAGS="$ac_save_CFLAGS"
+          LIBS="$ac_save_LIBS"
+       fi
+     fi
+     IMLIB_CFLAGS=""
+     IMLIB_LIBS=""
+     ifelse([$3], , :, [$3])
+  fi
+  AC_SUBST(GDK_IMLIB_CFLAGS)
+  AC_SUBST(GDK_IMLIB_LIBS)
+  rm -f conf.gdkimlibtest
+])
diff --git a/m4/openssl.m4 b/m4/openssl.m4
new file mode 100644 (file)
index 0000000..fea4649
--- /dev/null
@@ -0,0 +1,75 @@
+dnl ******************************
+dnl OpenSSL
+dnl ******************************
+
+AC_DEFUN([AM_PATH_OPENSSL],
+[dnl
+       USE_OPENSSL=0
+
+       AC_ARG_ENABLE(openssl, [  --enable-openssl        Attempt to use OpenSSL for SSL support.],
+               [ac_cv_enable_openssl=$enableval], [ac_cv_enable_openssl=no])
+
+       dnl detect OpenSSL
+       if test "x${ac_cv_enable_openssl}" != "xno"; then
+               AC_ARG_WITH(openssl-includes, [  --with-openssl-includes=PREFIX     Location of OpenSSL includes.],
+                       with_openssl_includes="$withval", with_openssl_includes="/usr/include")
+               have_openssl_includes="no"
+               if test "x${with_openssl_includes}" != "xno"; then
+                       CPPFLAGS_save="$CPPFLAGS"
+               
+                       AC_MSG_CHECKING(for OpenSSL includes)
+                       AC_MSG_RESULT("")
+               
+                       CPPFLAGS="$CPPFLAGS -I$with_openssl_includes"
+                       AC_CHECK_HEADERS(openssl/ssl.h openssl/x509.h, [ openssl_includes="yes" ])
+                       CPPFLAGS="$CPPFLAGS_save"
+               
+                       if test "x{$openssl_includes}" != "xno" -a "x{$openssl_includes}" != "x"; then
+                               have_openssl_includes="yes"
+                               OPENSSL_CFLAGS="-I$with_openssl_includes"
+                       else
+                               OPENSSL_CFLAGS=""
+                       fi
+               else
+                       AC_MSG_CHECKING(for OpenSSL includes)
+                       AC_MSG_RESULT(no)
+               fi
+       
+               AC_ARG_WITH(openssl-libs, [  --with-openssl-libs=PREFIX         Location of OpenSSL libs.],
+                       with_openssl_libs="$withval")
+               if test "x${with_openssl_libs}" != "xno" -a "x${have_openssl_includes}" != "xno"; then
+                       case $with_openssl_libs in
+                       ""|-L*) ;;
+                       *) with_openssl_libs="-L$with_openssl_libs" ;;
+                       esac
+       
+                       AC_CHECK_LIB(dl, dlopen, DL_LIBS="-ldl", DL_LIBS="")
+                       AC_CACHE_CHECK([for OpenSSL libraries], openssl_libs,
+                       [
+                               LIBS_save="$LIBS"
+                               LIBS="$LIBS $with_openssl_libs -lssl -lcrypto $DL_LIBS"
+                               AC_TRY_LINK_FUNC(SSL_read, openssl_libs="yes", openssl_libs="no")
+                               LIBS="$LIBS_save"
+                       ])
+                       if test "x${openssl_libs}" != "xno"; then
+                               AC_DEFINE(USE_OPENSSL, 1, [Define if you use OpenSSL to support SSL])
+                               USE_OPENSSL=1
+                               msg_ssl="yes (OpenSSL)"
+                               OPENSSL_LIBS="$with_openssl_libs -lssl -lcrypto $DL_LIBS"
+                       else
+                               OPENSSL_CFLAGS=""
+                               OPENSSL_LIBS=""
+                       fi
+               else
+                       AC_MSG_CHECKING(for OpenSSL libraries)
+                       AC_MSG_RESULT(no)
+               fi
+       else
+               OPENSSL_CFLAGS=""
+               OPENSSL_LIBS=""
+               ac_cv_enable_openssl="no"
+       fi
+
+       AC_SUBST(OPENSSL_CFLAGS)
+       AC_SUBST(OPENSSL_LIBS)
+])
\ No newline at end of file
diff --git a/m4/spamassassin.m4 b/m4/spamassassin.m4
new file mode 100644 (file)
index 0000000..fd5bcc1
--- /dev/null
@@ -0,0 +1,89 @@
+dnl check for libspamc required includes
+
+AC_DEFUN([AC_SPAMASSASSIN],
+[dnl
+
+AC_CHECK_HEADERS(sys/time.h syslog.h unistd.h errno.h sys/errno.h)
+AC_CHECK_HEADERS(time.h sysexits.h sys/socket.h netdb.h netinet/in.h)
+AC_CHECK_HEADERS(openssl/crypto.h)
+
+AC_CACHE_CHECK([for SHUT_RD],
+       shutrd, [
+                AC_TRY_COMPILE([#include <sys/types.h>
+#include <sys/socket.h>],
+                        [printf ("%d", SHUT_RD); return 0;],
+                                        [shutrd=yes],
+                                        [shutrd=no]),
+       ])
+if test $shutrd = yes ; then
+  AC_DEFINE(HAVE_SHUT_RD, 1, HAVE_SHUT_RD)
+fi
+
+dnl ----------------------------------------------------------------------
+
+AC_CHECK_FUNCS(socket strdup strtod strtol snprintf shutdown)
+
+dnl ----------------------------------------------------------------------
+
+AC_CACHE_CHECK([for h_errno],
+        herrno, [
+                AC_TRY_COMPILE([#include <netdb.h>],
+                        [printf ("%d", h_errno); return 0;],
+                                        [herrno=yes],
+                                        [herrno=no]),
+        ])
+if test $herrno = yes ; then
+  AC_DEFINE(HAVE_H_ERRNO, 1, HAVE_H_ERRNO)
+fi
+
+dnl ----------------------------------------------------------------------
+
+dnl ----------------------------------------------------------------------
+
+AC_CACHE_CHECK([for in_addr_t],
+        inaddrt, [
+                AC_TRY_COMPILE([#include <sys/types.h>
+#include <netinet/in.h>],
+                        [in_addr_t foo; return 0;],
+                                        [inaddrt=yes],
+                                        [inaddrt=no]),
+        ])
+if test $inaddrt = no ; then
+  AC_CHECK_TYPE(in_addr_t, unsigned long)
+fi
+
+dnl ----------------------------------------------------------------------
+
+AC_CACHE_CHECK([for INADDR_NONE],
+        haveinaddrnone, [
+                AC_TRY_COMPILE([#include <sys/types.h>
+#include <netinet/in.h>],
+                        [in_addr_t foo = INADDR_NONE; return 0;],
+                                        [haveinaddrnone=yes],
+                                        [haveinaddrnone=no]),
+        ])
+if test $haveinaddrnone = yes ; then
+  AC_DEFINE(HAVE_INADDR_NONE, 1, HAVE_INADDR_NONE)
+fi
+
+dnl ----------------------------------------------------------------------
+
+AC_CACHE_CHECK([for EX__MAX],
+        haveexmax, [
+                AC_TRY_COMPILE([#ifdef HAVE_SYSEXITS_H
+#include <sysexits.h>
+#endif
+#include <errno.h>],
+                        [int foo = EX__MAX; return 0;],
+                                        [haveexmax=yes],
+                                        [haveexmax=no]),
+        ])
+if test $haveexmax = yes ; then
+  AC_DEFINE(HAVE_EX__MAX, 1, HAVE_EX__MAX)
+fi
+
+if test "$USE_OPENSSL" -ne 0; then
+    AC_DEFINE(SPAMC_SSL, 1, Compile libspamc with OpenSSL support)
+fi
+
+])
\ No newline at end of file