2009-06-20 Marcus Brinkmann <marcus@g10code.com>
authorMarcus Brinkmann <mb@g10code.com>
Fri, 19 Jun 2009 22:53:27 +0000 (22:53 +0000)
committerMarcus Brinkmann <mb@g10code.com>
Fri, 19 Jun 2009 22:53:27 +0000 (22:53 +0000)
* m4/gpg4win.m4 (GPG4WIN_IPKG, GPG4WIN_SPKG, GPG4WIN_BPKG,
GPG4WIN_MPKG): Define new substitution variables
gpg4win_pkg_PKGNAME_deps, to transfer the knowledge of the
dependency tree to the Makefiles.
* src/gpg4win.mk.in (SPKG_template, BPKG_template): Wrap it in a
test for package name being NO.
(pkg_files): New variable, listing all package files.
(VERSIONINFO_macro): Removed.
(GETDEPS): New macro.
* src/Makefile.am (versioninfo.txt): Use pkg_files to create versioninfo.txt.

ChangeLog
m4/gpg4win.m4
src/gpg4win.mk.in

index 46adaab..6b9943a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2009-06-20  Marcus Brinkmann  <marcus@g10code.com>
+
+       * m4/gpg4win.m4 (GPG4WIN_IPKG, GPG4WIN_SPKG, GPG4WIN_BPKG,
+       GPG4WIN_MPKG): Define new substitution variables
+       gpg4win_pkg_PKGNAME_deps, to transfer the knowledge of the
+       dependency tree to the Makefiles.
+       * src/gpg4win.mk.in (SPKG_template, BPKG_template): Wrap it in a
+       test for package name being NO.
+       (pkg_files): New variable, listing all package files.
+       (VERSIONINFO_macro): Removed.
+       (GETDEPS): New macro.
+       * src/Makefile.am (versioninfo.txt): Use pkg_files to create versioninfo.txt.
+
 2009-06-20  Werner Koch  <wk@g10code.com>
 
        * packages/packages.current: Update GPA.
index 0ffe311..bc0a282 100644 (file)
@@ -1,5 +1,5 @@
 dnl gpg4win.m4 - macros to configure gpg4win.
-dnl Copyright (C) 2005 g10 Code GmbH
+dnl Copyright (C) 2005, 2009 g10 Code GmbH
 dnl
 dnl This file is part of GPG4Win.
 dnl
@@ -226,6 +226,10 @@ AC_DEFUN([GPG4WIN_IPKG],
     _gpg4win_pkg=$enableval,
     _gpg4win_pkg=yes)
 
+  # gpg4win_pkg_PKGNAME_deps=DEPS
+  gpg4win_pkg_[]m4_translit([$1],[A-Z+-],[a-z__])[]_deps="$2"
+  AC_SUBST(gpg4win_pkg_[]m4_translit([$1],[A-Z+-],[a-z__])[]_deps)
+
   AC_MSG_RESULT($_gpg4win_pkg)
 
   AS_IF([test "$_gpg4win_pkg" != no],
@@ -271,6 +275,10 @@ AC_DEFUN([GPG4WIN_SPKG],
   gpg4win_pkg_[]m4_translit([$1],[-+],[__])[]_version=$_gpg4win_version
   AC_SUBST(gpg4win_pkg_[]m4_translit([$1],[-+],[__])[]_version)
 
+  # gpg4win_pkg_PKGNAME_deps=DEPS
+  gpg4win_pkg_[]m4_translit([$1],[A-Z+-],[a-z__])[]_deps="$2"
+  AC_SUBST(gpg4win_pkg_[]m4_translit([$1],[A-Z+-],[a-z__])[]_deps)
+
   AS_IF([test "$_gpg4win_spkg" != no],
     _gpg4win_pkgs="$_gpg4win_pkgs $1"
     GPG4WIN_DEFINE(HAVE_PKG_[]m4_translit([$1],[a-z+-],[A-Z__]))
@@ -315,6 +323,10 @@ AC_DEFUN([GPG4WIN_BPKG_GNUWIN32],
   gpg4win_pkg_[]m4_translit([$1],[-+],[__])[]_version=$_gpg4win_version
   AC_SUBST(gpg4win_pkg_[]m4_translit([$1],[-+],[__])[]_version)
 
+  # gpg4win_pkg_PKGNAME_deps=DEPS
+  gpg4win_pkg_[]m4_translit([$1],[A-Z+-],[a-z__])[]_deps="$2"
+  AC_SUBST(gpg4win_pkg_[]m4_translit([$1],[A-Z+-],[a-z__])[]_deps)
+
   AS_IF([test $_gpg4win_bpkg != no],
     GPG4WIN_FIND($1-lib, [$1-\(.*\)-lib],,
                  $_gpg4win_pkg, _gpg4win_bpkg=$gpg4win_val,
@@ -428,6 +440,10 @@ AC_DEFUN([GPG4WIN_BPKG_GTK],
   gpg4win_pkg_[]m4_translit([$1],[-+],[__])[]_version=$_gpg4win_version
   AC_SUBST(gpg4win_pkg_[]m4_translit([$1],[-+],[__])[]_version)
 
+  # gpg4win_pkg_PKGNAME_deps=DEPS
+  gpg4win_pkg_[]m4_translit([$1],[A-Z+-],[a-z__])[]_deps="$2"
+  AC_SUBST(gpg4win_pkg_[]m4_translit([$1],[A-Z+-],[a-z__])[]_deps)
+
   AS_IF([test $_gpg4win_bpkg != no],
     [GPG4WIN_FIND($1,,tar, $_gpg4win_pkg, _gpg4win_bpkg=$gpg4win_val,
        AC_MSG_ERROR(can not find sources for package $1))]
@@ -480,6 +496,10 @@ AC_DEFUN([GPG4WIN_BPKG_GTK_DEV],
   gpg4win_pkg_[]m4_translit([$1],[-+],[__])[]_version=$_gpg4win_version
   AC_SUBST(gpg4win_pkg_[]m4_translit([$1],[-+],[__])[]_version)
 
+  # gpg4win_pkg_PKGNAME_deps=DEPS
+  gpg4win_pkg_[]m4_translit([$1],[A-Z+-],[a-z__])[]_deps="$2"
+  AC_SUBST(gpg4win_pkg_[]m4_translit([$1],[A-Z+-],[a-z__])[]_deps)
+
   AS_IF([test $_gpg4win_bpkg != no],
     [GPG4WIN_FIND($1-dev,,, $_gpg4win_pkg, _gpg4win_bpkg=$gpg4win_val,
        AC_MSG_ERROR(can not find development package for package $1))]
@@ -547,6 +567,10 @@ AC_DEFUN([GPG4WIN_BPKG_GNU],
   gpg4win_pkg_[]m4_translit([$1],[-+],[__])[]_version=$_gpg4win_version
   AC_SUBST(gpg4win_pkg_[]m4_translit([$1],[-+],[__])[]_version)
 
+  # gpg4win_pkg_PKGNAME_deps=DEPS
+  gpg4win_pkg_[]m4_translit([$1],[A-Z+-],[a-z__])[]_deps="$2"
+  AC_SUBST(gpg4win_pkg_[]m4_translit([$1],[A-Z+-],[a-z__])[]_deps)
+
   AS_IF([test $_gpg4win_bpkg != no],
     [GPG4WIN_FIND($1,,tar, $_gpg4win_pkg, _gpg4win_bpkg=$gpg4win_val,
        AC_MSG_ERROR(can not find sources for package $1))]
@@ -605,6 +629,10 @@ AC_DEFUN([GPG4WIN_BPKG_BINSRC],
   gpg4win_pkg_[]m4_translit([$1],[A-Z+-],[a-z__])[]_version=$_gpg4win_version
   AC_SUBST(gpg4win_pkg_[]m4_translit([$1],[A-Z+-],[a-z__])[]_version)
 
+  # gpg4win_pkg_PKGNAME_deps=DEPS
+  gpg4win_pkg_[]m4_translit([$1],[A-Z+-],[a-z__])[]_deps="$2"
+  AC_SUBST(gpg4win_pkg_[]m4_translit([$1],[A-Z+-],[a-z__])[]_deps)
+
   AS_IF([test $_gpg4win_bpkg != no],
     tmp_binsrc=yes
     GPG4WIN_FIND($1-src, [$1-\(.*\)-src],,
index 88a5174..e659ad8 100644 (file)
@@ -1,5 +1,5 @@
 # gpg4win.m4.in - Installer for GnuPG 4 Windows Makefile.   -*- makefile -*-
-# Copyright (C) 2005 g10 Code GmbH
+# Copyright (C) 2005, 2009 g10 Code GmbH
 # 
 # This file is part of GPG4Win.
 # 
@@ -29,6 +29,8 @@ ipdir := $(root)/install/pkgs
 tsdir := $(shell pwd)/${top_srcdir}
 pdir := $(shell pwd)/${top_srcdir}/patches
 
+# We collect the names of all pkg files used.
+pkg_files =
 
 # The playground area is our scratch area, where we unpack, build and
 # install the packages.
@@ -75,11 +77,6 @@ define SETVARS
        export CONFIG_SITE="$(tsdir)/src/config.site"
 endef
 
-# Support macro.  Record version number of file $(1).
-define VERSIONINFO_macro
-         $(SHA1SUM) "$(1)" >> "$(bdir)/versioninfo.txt" 
-endef
-
 # Support macro.  Unpack the archive $(1).
 define DEFLATE_macro
        case "$(1)" in                  \
@@ -104,15 +101,20 @@ define STRIP_macro
        fi
 endef
 
+define GETDEPS
+  $(addprefix stamps/stamp-final-, $(call GETVAR,gpg4win_pkg_$(1)_deps))
+endef
+
 
 # Template for source packages.
 
-define SPKG_template
+define SPKG_template_
+
+pkg_files += $(call GETVAR,gpg4win_pkg_$(1))
 
-stamps/stamp-$(1)-00-unpack: stamps/stamp-directories 
+stamps/stamp-$(1)-00-unpack: stamps/stamp-directories $(call GETDEPS,$(1))
        (cd $(bdir);                                    \
         $(call SETVARS,$(1));                          \
-        $(call VERSIONINFO_macro,$$$${pkg});           \
         $(call DEFLATE_macro,$$$${pkg}))
        touch stamps/stamp-$(1)-00-unpack
 
@@ -173,16 +175,22 @@ clean-$(1):
 
 endef
 
+define SPKG_template
+$(if $(filter-out no, $(call GETVAR,gpg4win_pkg_$(1))),
+  $(call SPKG_template_,$1))
+endef
+
 
 # Template for source packages using only make and no build
 # directory.
 
-define MPKG_template
+define MPKG_template_
+
+pkg_files += $(call GETVAR,gpg4win_pkg_$(1))
 
-stamps/stamp-$(1)-00-unpack: stamps/stamp-directories 
+stamps/stamp-$(1)-00-unpack: stamps/stamp-directories $(call GETDEPS,$(1))
        (cd $(bdir);                                    \
         $(call SETVARS,$(1));                          \
-        $(call VERSIONINFO_macro,$$$${pkg});           \
         $(call DEFLATE_macro,$$$${pkg}))
        touch stamps/stamp-$(1)-00-unpack
 
@@ -227,17 +235,24 @@ clean-$(1):
 
 endef
 
+define MPKG_template
+$(if $(filter-out no, $(call GETVAR,gpg4win_pkg_$(1))),
+  $(call MPKG_template_,$1))
+endef
+
 
 
 # Template for binary packages.
 
-define BPKG_template
+define BPKG_template_
 
-stamps/stamp-$(1)-00-install: stamps/stamp-directories 
+pkg_files += $(call GETVAR,gpg4win_pkg_$(1))
+pkg_files += $(call GETVAR,gpg4win_pkg_$(1)_dev)
+
+stamps/stamp-$(1)-00-install: stamps/stamp-directories $(call GETDEPS,$(1))
        ($(call SETVARS,$(1));                          \
         $(MKDIR) "$$$${pkgidir}";                      \
         cd $$$${pkgidir};                              \
-        $(call VERSIONINFO_macro,$$$${pkg});           \
         $(call DEFLATE_macro,$$$${pkg}))
        touch stamps/stamp-$(1)-00-install
 
@@ -247,7 +262,6 @@ stamps/stamp-$(1)-01-install-dev: stamps/stamp-$(1)-00-install
        ($(call SETVARS,$(1));                          \
         $(MKDIR) "$$$${pkgidir_dev}";                  \
         (cd $$$${pkgidir_dev};                         \
-          $(call VERSIONINFO_macro,$$$${pkg_dev});      \
          $(call DEFLATE_macro,$$$${pkg_dev}));         \
         $(call gpg4win_pkg_$(call FROB_macro,$(1))_post_install))
        touch stamps/stamp-$(1)-01-install-dev
@@ -278,12 +292,17 @@ clean-$(1):
 
 endef
 
+define BPKG_template
+$(if $(filter-out no, $(call GETVAR,gpg4win_pkg_$(1))),
+  $(call BPKG_template_,$1))
+endef
 
-# Template for source packages.
+
+# Template for internal packages.
 
 define IPKG_template
 
-stamps/stamp-final-$(1): stamps/stamp-directories 
+stamps/stamp-final-$(1): stamps/stamp-directories $(call GETDEPS,$(1))
        touch stamps/stamp-final-$(1)
 endef
 
@@ -304,6 +323,10 @@ stamps/stamp-final: stamps/stamp-directories
 stamps/stamp-final: $(addprefix stamps/stamp-final-,$(gpg4win_build_list))
        touch stamps/stamp-final
 
+$(bdir)/versioninfo.txt: stamps/stamp-final
+       touch $(bdir)/versioninfo.txt
+
+
 all-gpg4win: stamps/stamp-final
 
 # Just to check if we catched all stamps.