[git] GPGME - branch, master, updated. gpgme-1.6.0-277-gb7d99e0

by Werner Koch cvs at cvs.gnupg.org
Wed Aug 10 16:35:49 CEST 2016


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GnuPG Made Easy".

The branch, master has been updated
       via  b7d99e02188b7907b09fec3032fc1fd82fc2668a (commit)
       via  48691db97b759d67aa7b49c36bb704b5806ade2e (commit)
      from  a9168185ba97aa1d827315cd8017899bf904aded (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit b7d99e02188b7907b09fec3032fc1fd82fc2668a
Author: Werner Koch <wk at gnupg.org>
Date:   Wed Aug 10 16:33:20 2016 +0200

    doc: Get rid of version.texi
    
    * configure.ac (CC_FOR_BUILD): New.
    * doc/mkdefsinc.c: New.  Taken from GnuPG and modified for gpgme.
    * doc/Makefile.am (EXTRA_DIST): Add defsincdate and mkdefsinc.c
    (BUILT_SOURCES): new.
    (gpgme.texi): New dependency.
    (mkdefsinc, defsincdate, defs.inc): New rules.
    (dist-hook): New.
    * doc/gpgme.texi: Include defs.inc.  Remove version.texi.
    --
    
    GnuPG-bug-id: 2352
    
    That new system should also yield more approriate date infos for the
    manual.

diff --git a/configure.ac b/configure.ac
index 105f80e..9eb55bb 100644
--- a/configure.ac
+++ b/configure.ac
@@ -127,6 +127,22 @@ VERSION_NUMBER=m4_esyscmd(printf "0x%02x%02x%02x" mym4_version_major \
                           mym4_version_minor mym4_version_micro)
 AC_SUBST(VERSION_NUMBER)
 
+# We need to compile and run a program on the build machine.  A
+# comment in libgpg-error says that the AC_PROG_CC_FOR_BUILD macro in
+# the AC archive is broken for autoconf 2.57.  Given that there is no
+# newer version of that macro, we assume that it is also broken for
+# autoconf 2.61 and thus we use a simple but usually sufficient
+# approach.
+AC_MSG_CHECKING(for cc for build)
+if test "$cross_compiling" = "yes"; then
+  CC_FOR_BUILD="${CC_FOR_BUILD-cc}"
+else
+  CC_FOR_BUILD="${CC_FOR_BUILD-$CC}"
+fi
+AC_MSG_RESULT($CC_FOR_BUILD)
+AC_ARG_VAR(CC_FOR_BUILD,[build system C compiler])
+
+
 # Don't default to build static libs.
 LT_PREREQ([2.2.6])
 LT_INIT([win32-dll disable-static])
diff --git a/doc/Makefile.am b/doc/Makefile.am
index 2df35b4..905f953 100644
--- a/doc/Makefile.am
+++ b/doc/Makefile.am
@@ -20,12 +20,38 @@
 ## Process this file with automake to produce Makefile.in
 
 DISTCLEANFILES = gpgme.tmp
+CLEANFILES = mkdefsinc defs.inc
+
+EXTRA_DIST = module-overview.sk HACKING DCO ChangeLog-2011 \
+             mkdefsinc.c defsincdate
+
+BUILT_SOURCES = defsincdate defs.inc
 
-EXTRA_DIST = module-overview.sk HACKING DCO ChangeLog-2011
 
 info_TEXINFOS = gpgme.texi
 gpgme_TEXINFOS = uiserver.texi lesser.texi gpl.texi
 
+gpgme.texi : defs.inc
+
+mkdefsinc: mkdefsinc.c Makefile ../config.h
+	$(CC_FOR_BUILD) -I. -I.. -I$(srcdir) $(AM_CPPFLAGS) \
+	   -o $@ $(srcdir)/mkdefsinc.c
+
+dist-hook: defsincdate
+
+defsincdate: $(gpgme_TEXINFOS)
+	: >defsincdate ; \
+	if test -e $(top_srcdir)/.git; then \
+	  (cd $(srcdir) && git log -1 --format='%ct' -- \
+             $(info_TEXINFOS) $(gpgme_TEXINFOS) 2>/dev/null) >>defsincdate; \
+	fi
+
+defs.inc: defsincdate Makefile mkdefsinc
+	incd="`test -f defsincdate || echo '$(srcdir)/'`defsincdate"; \
+	./mkdefsinc -C $(srcdir) --date "`cat $$incd 2>/dev/null`" \
+	    $(info_TEXINFOS) $(gpgme_TEXINFOS) >$@
+
+
 online: gpgme.html gpgme.pdf
 	set -e; \
 	echo "Uploading current manuals to www.gnupg.org ..."; \
diff --git a/doc/gpgme.texi b/doc/gpgme.texi
index 907099a..2bbed28 100644
--- a/doc/gpgme.texi
+++ b/doc/gpgme.texi
@@ -1,6 +1,7 @@
 \input texinfo                   @c -*- mode: texinfo; coding: utf-8; -*-
 @documentencoding UTF-8
 @setfilename gpgme.info
+ at include defs.inc
 @settitle The `GnuPG Made Easy' Reference Manual
 
 @dircategory GNU Libraries
@@ -30,8 +31,6 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 General Public License for more details.
 @end copying
 
- at include version.texi
-
 @c Macros used by the description of the UI server protocol
 @macro clnt
   @sc{c:} @c
diff --git a/doc/mkdefsinc.c b/doc/mkdefsinc.c
new file mode 100644
index 0000000..0f30d93
--- /dev/null
+++ b/doc/mkdefsinc.c
@@ -0,0 +1,310 @@
+/* mkdefsinc.c - Tool to create defs.inc
+ * Copyright (C) 2015 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
+ * modifications, as long as this notice is preserved.
+ *
+ * This file is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
+ * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ */
+
+/* This tool needs to be build with command line supplied -D options
+   for the various directory variables.  It is easier to do this in
+   build file than to use fragile make rules and a template file.  */
+
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <errno.h>
+#include <time.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
+
+#define PGM "mkdefsinc"
+
+/* We include config.h after all include files because the config.h
+   values are not valid for the build platform but we need some values
+   nevertheless.  */
+#include "config.h"
+
+
+static int verbose;
+
+
+/* The usual free wrapper.  */
+static void
+xfree (void *a)
+{
+  if (a)
+    free (a);
+}
+
+
+static char *
+xmalloc (size_t n)
+{
+  char *p;
+
+  p = malloc (n);
+  if (!p)
+    {
+      fputs (PGM ": out of core\n", stderr);
+      exit (1);
+    }
+  return p;
+}
+
+
+static char *
+xstrdup (const char *string)
+{
+  char *p;
+
+  p = xmalloc (strlen (string)+1);
+  strcpy (p, string);
+  return p;
+}
+
+
+/* Return a malloced string with the last modification date of the
+   FILES.  Returns NULL on error.  */
+static char *
+get_date_from_files (char **files)
+{
+  const char *file;
+  const char *usedfile = NULL;
+  struct stat sb;
+  struct tm *tp;
+  int errors = 0;
+  time_t stamp = 0;
+  char *result;
+
+  for (; (file = *files); files++)
+    {
+      if (!*file || !strcmp (file, ".") || !strcmp (file, ".."))
+        continue;
+      if (stat (file, &sb))
+        {
+          fprintf (stderr, PGM ": stat failed for '%s': %s\n",
+                   file, strerror (errno));
+          errors = 1;
+          continue;
+        }
+      if (sb.st_mtime > stamp)
+        {
+          stamp = sb.st_mtime;
+          usedfile = file;
+        }
+    }
+  if (errors)
+    exit (1);
+
+  if (usedfile)
+    fprintf (stderr, PGM ": taking date from '%s'\n", usedfile);
+
+  tp = gmtime (&stamp);
+  if (!tp)
+    return NULL;
+  result = xmalloc (4+1+2+1+2+1);
+  snprintf (result, 4+1+2+1+2+1, "%04d-%02d-%02d",
+            tp->tm_year + 1900, tp->tm_mon+1, tp->tm_mday);
+  return result;
+}
+
+
+/* We need to escape file names for Texinfo.  */
+static void
+print_filename (const char *prefix, const char *name)
+{
+  const char *s;
+
+  fputs (prefix, stdout);
+  for (s=name; *s; s++)
+    switch (*s)
+      {
+      case '@': fputs ("@atchar{}",        stdout); break;
+      case '{': fputs ("@lbracechar{}",    stdout); break;
+      case '}': fputs ("@rbracechar{}",    stdout); break;
+      case ',': fputs ("@comma{}",         stdout); break;
+      case '\\':fputs ("@backslashchar{}", stdout); break;
+      case '#': fputs ("@hashchar{}",      stdout); break;
+      default: putchar (*s); break;
+      }
+  putchar('\n');
+}
+
+
+int
+main (int argc, char **argv)
+{
+  int last_argc = -1;
+  char *opt_date = NULL;
+  int monthoff;
+  char *p, *pend;
+  size_t n;
+
+  /* Option parsing.  */
+  if (argc)
+    {
+      argc--; argv++;
+    }
+  while (argc && last_argc != argc )
+    {
+      last_argc = argc;
+      if (!strcmp (*argv, "--"))
+        {
+          argc--; argv++;
+          break;
+        }
+      else if (!strcmp (*argv, "--help"))
+        {
+          fputs ("Usage: " PGM " [OPTION] [FILES]\n"
+                 "Create defs.inc file.\nOptions:\n"
+                 "  -C DIR         Change to DIR before doing anything\n"
+                 "  --date STRING  Take publication date from STRING\n"
+                 "  --verbose      Enable extra informational output\n"
+                 "  --help         Display this help and exit\n"
+                 , stdout);
+          exit (0);
+        }
+      else if (!strcmp (*argv, "--verbose"))
+        {
+          verbose = 1;
+          argc--; argv++;
+        }
+      else if (!strcmp (*argv, "-C"))
+        {
+          argc--; argv++;
+          if (argc)
+            {
+              if (chdir (*argv))
+                {
+                  fprintf (stderr, PGM ": chdir to '%s' failed: %s\n",
+                           *argv, strerror (errno));
+                  exit (1);
+                }
+              argc--; argv++;
+            }
+        }
+      else if (!strcmp (*argv, "--date"))
+        {
+          argc--; argv++;
+          if (argc)
+            {
+              opt_date = xstrdup (*argv);
+              argc--; argv++;
+            }
+        }
+      else if (!strncmp (*argv, "--", 2))
+        {
+          fprintf (stderr, PGM ": unknown option '%s'\n", *argv);
+          exit (1);
+        }
+    }
+
+  if (opt_date && *opt_date)
+    {
+      time_t stamp;
+      struct tm *tp;
+
+      if (*opt_date == '2' && strlen (opt_date) >= 10
+          && opt_date[4] == '-' && opt_date[7] == '-')
+        {
+          opt_date[10] = 0;
+        }
+      else if ((stamp = strtoul (opt_date, NULL, 10)) > 0
+               && (tp = gmtime (&stamp)))
+        {
+          p = xmalloc (4+1+2+1+2+1);
+          snprintf (p, 4+1+2+1+2+1, "%04d-%02d-%02d",
+                    tp->tm_year + 1900, tp->tm_mon+1, tp->tm_mday);
+          xfree (opt_date);
+          opt_date = p;
+        }
+      else
+        {
+          fprintf (stderr, PGM ": bad date '%s'\n", opt_date);
+          exit (1);
+        }
+    }
+  else
+    {
+      xfree (opt_date);
+      opt_date = argc? get_date_from_files (argv) : NULL;
+    }
+  if (!opt_date)
+    {
+      opt_date = xstrdup ("unknown");
+      monthoff = 0;
+    }
+  else
+    {
+      const char *month = "?";
+
+      switch (atoi (opt_date+5))
+        {
+        case  1: month = "January"; break;
+        case  2: month = "February"; break;
+        case  3: month = "March"; break;
+        case  4: month = "April"; break;
+        case  5: month = "May"; break;
+        case  6: month = "June"; break;
+        case  7: month = "July"; break;
+        case  8: month = "August"; break;
+        case  9: month = "September"; break;
+        case 10: month = "October"; break;
+        case 11: month = "November"; break;
+        case 12: month = "December"; break;
+        }
+      n = strlen (opt_date) + strlen (month) + 2 + 1;
+      p = xmalloc (n);
+      snprintf (p, n, "%d %n%s %d",
+                atoi (opt_date+8), &monthoff, month, atoi (opt_date));
+      xfree (opt_date);
+      opt_date = p;
+    }
+
+
+  fputs ("@c defs.inc                         -*- texinfo -*-\n"
+         "@c Common and build specific constants for the manuals.\n"
+         "@c This file has been created by " PGM ".\n\n", stdout);
+
+  fputs ("@ifclear defsincincluded\n"
+         "@set defsincincluded 1\n\n", stdout);
+
+
+  fputs ("\n at c Flags\n\n", stdout);
+
+  fputs ("\n at c Directories\n\n", stdout);
+
+  /* print_filename ("@set BINDIR         ", GNUPG_BINDIR ); */
+
+  fputs ("\n at c Version information a la version.texi\n\n", stdout);
+
+  printf ("@set UPDATED %s\n", opt_date);
+  printf ("@set UPDATED-MONTH %s\n", opt_date + monthoff);
+  printf ("@set EDITION %s\n", PACKAGE_VERSION);
+  printf ("@set VERSION %s\n", PACKAGE_VERSION);
+
+  fputs ("\n at c Macros\n\n", stdout);
+
+  /* Trailer.  */
+  fputs ("\n"
+         "@end ifclear\n"
+         "\n"
+         "@c Loc" "al Variables:\n"
+         "@c buffer-read-only: t\n"
+         "@c End:\n", stdout);
+
+  if (ferror (stdout))
+    {
+      fprintf (stderr, PGM ": error writing to stdout: %s\n", strerror (errno));
+      return 1;
+    }
+
+  return 0;
+}

commit 48691db97b759d67aa7b49c36bb704b5806ade2e
Author: Werner Koch <wk at gnupg.org>
Date:   Wed Aug 10 16:28:36 2016 +0200

    build: Declare all languages for make dist.
    
    * lang/Makefile.am (DIST_SUBDIRS): New.
    
    Signed-off-by: Werner Koch <wk at gnupg.org>

diff --git a/configure.ac b/configure.ac
index 6a7df24..105f80e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -249,6 +249,9 @@ if test x$fixed_search_path != x ; then
                     [Locate binaries only via this PATH])
 fi
 
+
+# Note: You need to declare all possible langauges also in
+#       lang/Makefile.am's DIST_SUBDIRS.
 AC_ARG_ENABLE([languages],
               AC_HELP_STRING([--enable-languages=languages],
                              [enable only specific language bindings]),
diff --git a/lang/Makefile.am b/lang/Makefile.am
index bb75cf0..fd3ce4e 100644
--- a/lang/Makefile.am
+++ b/lang/Makefile.am
@@ -18,5 +18,6 @@
 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
 
 SUBDIRS = $(ENABLED_LANGUAGES)
+DIST_SUBDIRS = cl cpp qt python
 
 EXTRA_DIST = README

-----------------------------------------------------------------------

Summary of changes:
 configure.ac     |  19 ++++
 doc/Makefile.am  |  28 ++++-
 doc/gpgme.texi   |   3 +-
 doc/mkdefsinc.c  | 310 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
 lang/Makefile.am |   1 +
 5 files changed, 358 insertions(+), 3 deletions(-)
 create mode 100644 doc/mkdefsinc.c


hooks/post-receive
-- 
GnuPG Made Easy
http://git.gnupg.org




More information about the Gnupg-commits mailing list