[Gpa-commits] r976 - in trunk: . src

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Sun Mar 29 21:24:57 CEST 2009


Author: moritzs
Date: 2009-03-29 21:24:56 +0200 (Sun, 29 Mar 2009)
New Revision: 976

Added:
   trunk/gpadefs.h.in
Modified:
   trunk/ChangeLog
   trunk/Makefile.am
   trunk/configure.ac
   trunk/src/ChangeLog
   trunk/src/gpa.h
Log:
ChangeLog:

2009-03-29  Moritz  <moritz at gnu.org>

	* Makefile.am: Added rules for generating gpadefs.h from
	gpadefs.h.in at make-time.
	(EXTRA_DIST): Added gpadefs.h.in.
	* configure.ac: Trigger AC_MSG_ERROR in case directory for
	keyserver helpers could not figured out.
	Call AC_DEFINE_UNQUOTED to define KEYSERVER_HELPERS_DIR in
	config.h.
	Remove generation of gpadefs.h through AC_CONFIG_COMMANDS.

src/ChangeLog:

2009-03-29  Moritz  <moritz at gnu.org>

	* gpa.h: Do not include gpadefs.h.



Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	2009-03-29 17:05:56 UTC (rev 975)
+++ trunk/ChangeLog	2009-03-29 19:24:56 UTC (rev 976)
@@ -1,3 +1,14 @@
+2009-03-29  Moritz  <moritz at gnu.org>
+
+	* Makefile.am: Added rules for generating gpadefs.h from
+	gpadefs.h.in at make-time.
+	(EXTRA_DIST): Added gpadefs.h.in.
+	* configure.ac: Trigger AC_MSG_ERROR in case directory for
+	keyserver helpers could not figured out.
+	Call AC_DEFINE_UNQUOTED to define KEYSERVER_HELPERS_DIR in
+	config.h.
+	Remove generation of gpadefs.h through AC_CONFIG_COMMANDS.
+
 2009-03-10  Werner Koch  <wk at g10code.com>
 
 	* configure.ac (AC_CONFIG_COMMANDS): Remove GPA_LOCALEDIR.
@@ -6,7 +17,7 @@
 
 	* configure.ac (BUILD_CARD_MANAGER): Define as AC_DEFINE and
 	AM_CONDITIONAL.
-	
+
 2009-02-07  Moritz  <moritz at gnu.org>
 
 	* TODO: New item.

Modified: trunk/Makefile.am
===================================================================
--- trunk/Makefile.am	2009-03-29 17:05:56 UTC (rev 975)
+++ trunk/Makefile.am	2009-03-29 19:24:56 UTC (rev 976)
@@ -1,9 +1,9 @@
-
 ACLOCAL_AMFLAGS = -I m4
 AUTOMAKE_OPTIONS = dist-bzip2
 
 SUBDIRS = m4 src po pixmaps
-EXTRA_DIST = config.rpath  TODO README-alpha to-utf8 autogen.sh gpa.spec gpa.desktop gpa.png
+EXTRA_DIST = config.rpath  TODO README-alpha to-utf8 autogen.sh gpa.spec \
+ gpa.desktop gpa.png gpadefs.h.in
 DISTCLEANFILES = gpadefs.h 
 
 desktopdir = $(datadir)/applications/
@@ -14,6 +14,19 @@
 
 pkgdata_DATA = gpa.png
 
+edit = sed \
+        -e 's|@datadir[@]|$(pkgdatadir)|g' \
+        -e 's|@prefix[@]|$(prefix)|g'
+
+gpadefs.h: Makefile
+	rm -f $@ $@.tmp
+	$(edit) '$(srcdir)/$@.in' >$@.tmp
+	mv $@.tmp $@
+
+gpadefs.h: $(srcdir)/gpadefs.h.in
+
+all: gpadefs.h
+
 # Create a VERSION file which we need for the Prereq: patch file trick.
 dist-hook:
 	@set -e; echo "$(VERSION)" > $(distdir)/VERSION

Modified: trunk/configure.ac
===================================================================
--- trunk/configure.ac	2009-03-29 17:05:56 UTC (rev 975)
+++ trunk/configure.ac	2009-03-29 19:24:56 UTC (rev 976)
@@ -160,10 +160,18 @@
 AC_PATH_PROG(GPGKEYS_LDAP, gpgkeys_ldap, [${libexecdir}/gnupg/gpgkeys_ldap],
              [$PATH:/usr/libexec/gnupg/:/usr/lib/gnupg/])
 KEYSERVER_HELPERS_DIR=`dirname $GPGKEYS_LDAP`
+if test -z "$KEYSERVER_HELPERS_DIR"; then
+       AC_MSG_ERROR([[
+***
+*** Keyserver helpers not found. They should be contained in the GnuPG package.
+***
+  ]])
+fi
 
 AC_DEFINE_UNQUOTED(GPG_PATH, "$GPG", [Path to the gpg binary.])
+AC_DEFINE_UNQUOTED(KEYSERVER_HELPERS_DIR,
+		   "$KEYSERVER_HELPERS_DIR", [Path to keyserver helper tools])
 
-
 dnl
 dnl Checks for compiler features
 dnl
@@ -298,40 +306,6 @@
 fi
 
 
-AC_CONFIG_COMMANDS(gpadefs.h,[[
-cat >gpadefs.tmp <<GPAEOF
-/* Generated automatically by configure */
-#ifdef HAVE_DRIVE_LETTERS
-  /* These W32 locations are fallbacks 
-     and not used with current gpg installations. */
-  #define GPA_DATADIR   "c:/lib/gnupg"
-  #define GPG_PROGRAM   "c:/gnupg/gpg"
-  #define GPA_KEYSERVER_HELPERS_DIR "c:/gnupg"
-#else
-  #define GPA_DATADIR   "${datadir}/gpa"
-  #define GPG_PROGRAM   "${GPG}"
-  #define GPA_KEYSERVER_HELPERS_DIR "$KEYSERVER_HELPERS_DIR"
-#endif
-GPAEOF
-if cmp -s gpadefs.h gpadefs.tmp 2>/dev/null; then
-    echo "gpadefs.h is unchanged"
-    rm -f gpadefs.tmp
-else
-    rm -f gpadefs.h
-    mv gpadefs.tmp gpadefs.h
-    echo "gpadefs.h created"
-fi
-]],[[
-prefix=$prefix
-exec_prefix=$exec_prefix
-libdir=$libdir
-KEYSERVER_HELPERS_DIR=$KEYSERVER_HELPERS_DIR
-datadir=$datadir
-localedir=$localedir
-GPG=$GPG
-]])
-
-
 #
 # Print errors here so that they are visible all
 # together and the user can acquire them all together.

Added: trunk/gpadefs.h.in
===================================================================
--- trunk/gpadefs.h.in	2009-03-29 17:05:56 UTC (rev 975)
+++ trunk/gpadefs.h.in	2009-03-29 19:24:56 UTC (rev 976)
@@ -0,0 +1,17 @@
+/* Generated automatically by make from gpadefs.h.in.  */
+
+/* This file is expected to be included by config.h only.  It's
+   purpose is to provide parameters (e.g. "datadir") whose final
+   values are determined at make-time, not at configure-time.  */
+
+#ifdef HAVE_DRIVE_LETTERS
+/* These W32 locations are fallbacks and not used with current gpg
+   installations. */
+# define GPA_DATADIR   "c:/lib/gnupg"
+# define GPG_PROGRAM   "c:/gnupg/gpg"
+# define GPA_KEYSERVER_HELPERS_DIR "c:/gnupg"
+#else
+# define GPA_DATADIR   "@datadir@"
+# define GPG_PROGRAM   GPG_PATH
+# define GPA_KEYSERVER_HELPERS_DIR KEYSERVER_HELPERS_DIR
+#endif

Modified: trunk/src/ChangeLog
===================================================================
--- trunk/src/ChangeLog	2009-03-29 17:05:56 UTC (rev 975)
+++ trunk/src/ChangeLog	2009-03-29 19:24:56 UTC (rev 976)
@@ -1,3 +1,7 @@
+2009-03-29  Moritz  <moritz at gnu.org>
+
+	* gpa.h: Do not include gpadefs.h.
+
 2009-03-23  Werner Koch  <wk at g10code.com>
 
 	* gpgmetools.c (gpg_simple_stderr_cb): Use GString and skip

Modified: trunk/src/gpa.h
===================================================================
--- trunk/src/gpa.h	2009-03-29 17:05:56 UTC (rev 975)
+++ trunk/src/gpa.h	2009-03-29 19:24:56 UTC (rev 976)
@@ -1,6 +1,6 @@
 /* gpa.h  -  main header
    Copyright (C) 2000, 2001 G-N-U GmbH.
-   Copyright (C) 2008 g10 Code GmbH.
+   Copyright (C) 2008, 2009 g10 Code GmbH.
 
    This file is part of GPA.
 
@@ -28,7 +28,6 @@
 #include <string.h>
 #include <assuan.h>
 
-#include "gpadefs.h"
 #include "gpgmetools.h"
 #include "options.h"
 #include "icons.h"



More information about the Gpa-commits mailing list