OSDN Git Service

Enforce consistent specification of package version.
authorKeith Marshall <keithmarshall@users.sourceforge.net>
Tue, 3 May 2016 17:40:54 +0000 (18:40 +0100)
committerKeith Marshall <keithmarshall@users.sourceforge.net>
Tue, 3 May 2016 17:40:54 +0000 (18:40 +0100)
--HG--
rename : mingwrt/include/_mingw.h => mingwrt/include/_mingw.h.in
rename : w32api/include/w32api.h => w32api/include/w32api.h.in

mingwrt/ChangeLog
mingwrt/Makefile.in
mingwrt/configure.ac
mingwrt/include/_mingw.h.in [moved from mingwrt/include/_mingw.h with 97% similarity]
w32api/ChangeLog
w32api/Makefile.in
w32api/configure.ac
w32api/include/w32api.h.in [moved from w32api/include/w32api.h with 93% similarity]

index 836d084..7d9c574 100644 (file)
@@ -1,3 +1,26 @@
+2016-05-03  Keith Marshall  <keithmarshall@users.sourceforge.net>
+
+       Enforce consistent specification of package version.
+
+       * include/_mingw.h: Rename as...
+       * include/_mingw.h.in: ...this build-time template file.
+       (__MINGW32_VERSION): Redefine it, in terms of...
+       (%PACKAGE_VERSION_LONG%): ...this substitution template.
+       (__MINGW32_MAJOR_VERSION, __MINGW32_MINOR_VERSION)
+       (__MINGW32_PATCHLEVEL): Likewise, redefine them in terms of...
+       (%PACKAGE_VERSION_MAJOR%, %PACKAGE_VERSION_MINOR%)
+       (%PACKAGE_VERSION_PATCH%): ...these.
+
+       * configure.ac (AC_CONFIG_SRCDIR): Adjust for renamed file.
+       (MINGW_AC_CONFIG_EXTRA_SRCDIR): Likewise, for similarly renamed
+       w32api/include/w32api.h.in file.
+
+       * Makefile.in (all-mingwrt-stage-1-only): Add dependency on...
+       (_mingw.h, w32api.h): ...these; add rule to generate them, using...
+       (PACKAGE_VERSION_SCRIPT, PACKAGE_VERSION_FORMAT): ...these new macros;
+       they apply appropriate substitutions to the renamed template files.
+       (install-mingwrt-headers): Explicitly add _mingwrt.h
+
 2016-04-30  Keith Marshall  <keithmarshall@users.sourceforge.net>
 
        Make strnlen() available for all MSVCRT.DLL versions.
index b2ec873..9da8d14 100644 (file)
@@ -7,7 +7,7 @@ PACKAGE_TARNAME := @PACKAGE_TARNAME@
 PACKAGE_VERSION := @PACKAGE_VERSION@
 
 # Written by Keith Marshall <keithmarshall@users.sourceforge.net>
-# Copyright (C) 2014, 2015, MinGW.org Project
+# Copyright (C) 2014-2016, MinGW.org Project
 #
 #
 # Permission is hereby granted, free of charge, to any person obtaining a
@@ -70,6 +70,7 @@ STRIP = @STRIP@
 NM = @NM@
 
 all: @DEFAULT_MAKECMDGOALS@
+all-mingwrt-stage-1-only: _mingw.h w32api.h
 all-mingwrt-stage-1-only: all-mingwrt-objects all-mingwrt-libs
 all-mingwrt-stage-1-and-2: all-mingwrt-stage-1-only all-mingwrt-dll
 all-mingwrt: all-mingwrt-stage-1-and-2
@@ -140,6 +141,27 @@ vpath configure.ac ${top_srcdir}
 configure: configure.ac aclocal.m4
        cd ${top_srcdir}; autoconf
 
+# Propagate package version, as configured, consistently throughout
+# the package build.
+#
+vpath _mingw.h.in ${top_srcdir}/include
+vpath w32api.h.in ${w32api_srcdir}/include
+
+_mingw.h w32api.h: configure.ac
+
+PACKAGE_VERSION_SCRIPT = sed \
+  -e s"`$(call PACKAGE_VERSION_FORMAT,LONG,%d,$$3+1000*($$2+1000*$$1))`" \
+  -e s"`$(call PACKAGE_VERSION_FORMAT,MAJOR,%7d,$$1)`" \
+  -e s"`$(call PACKAGE_VERSION_FORMAT,MINOR,%7d,$$2)`" \
+  -e s"`$(call PACKAGE_VERSION_FORMAT,PATCH,%7d,$$3)`"
+
+PACKAGE_VERSION_FORMAT = echo $(PACKAGE_VERSION).0.0 | awk -F. '{ \
+  printf ",%%PACKAGE_VERSION_$1%%,$2,", $3; \
+}'
+
+_mingw.h w32api.h: %.h: %.h.in
+       $(PACKAGE_VERSION_SCRIPT) $< > $@
+
 # Capture dependencies conveyed within source files, ensuring that
 # header files are taken from our working source tree, and not from
 # the build-time compiler's installation path.  (Note: we use -MD,
@@ -698,7 +720,8 @@ mingwrt-includedirs: includedir $(eval mingwrt_include_subdirs=sys parts)
 SUB_HEADERS_PRESENT = echo $1/include/$2/*.h | grep -v '[*]' > /dev/null
 INSTALL_SUB_HEADERS = $(call INSTALL_DATA,$1/include/$2/*.h,${includedir}/$2)
 
-install-mingwrt-headers: mingwrt-includedirs
+install-mingwrt-headers: _mingw.h mingwrt-includedirs
+       $(call INSTALL_DATA,_mingw.h,${includedir})
        $(call INSTALL_DATA,${mingwrt_srcdir}/include/*.h,${includedir})
        for dir in $(mingwrt_include_subdirs); do \
          if $(call SUB_HEADERS_PRESENT,${mingwrt_srcdir},$$dir); then \
index a6ba253..3bc73a4 100644 (file)
@@ -6,7 +6,7 @@
 # $Id$
 #
 # Written by Keith Marshall <keithmarshall@users.sourceforge.net>
-# Copyright (C) 2014, 2015, MinGW.org Project
+# Copyright (C) 2014-2016, MinGW.org Project
 #
 #
 # Permission is hereby granted, free of charge, to any person obtaining a
 # DEALINGS IN THE SOFTWARE.
 #
   AC_PREREQ([2.64])
-  AC_INIT([MinGW Runtime],[3.21.1],[http://mingw.org/Reporting_Bugs],[mingwrt])
+  AC_INIT([MinGW C Runtime],[3.21.2],[http://mingw.org/Reporting_Bugs],[mingwrt])
 
   AC_PREFIX_DEFAULT([/mingw])
-  AC_CONFIG_SRCDIR([include/_mingw.h])
-  MINGW_AC_CONFIG_EXTRA_SRCDIR([w32api],[include/w32api.h])
+  AC_CONFIG_SRCDIR([include/_mingw.h.in])
+  MINGW_AC_CONFIG_EXTRA_SRCDIR([w32api],[include/w32api.h.in])
   MINGW_AC_PROG_CC_COMPILE_ONLY
   MINGW_AC_PROG_COMPILE_SX
 
similarity index 97%
rename from mingwrt/include/_mingw.h
rename to mingwrt/include/_mingw.h.in
index a2b8cb8..8328298 100644 (file)
  * which encodes the version as a long integer value, expressing:
  *
  *   __MINGW32_VERSION = 1,000,000 * major + 1,000 * minor + patch
+ *
+ * DO NOT EDIT these package version assignments manually; they are
+ * derived from the package version specification within configure.ac,
+ * whence they are propagated automatically, at package build time.
  */
-#define __MINGW32_VERSION           3021001L
-#define __MINGW32_MAJOR_VERSION           3
-#define __MINGW32_MINOR_VERSION          21
-#define __MINGW32_PATCHLEVEL              1
+#define __MINGW32_VERSION           %PACKAGE_VERSION_LONG%L
+#define __MINGW32_MAJOR_VERSION     %PACKAGE_VERSION_MAJOR%
+#define __MINGW32_MINOR_VERSION     %PACKAGE_VERSION_MINOR%
+#define __MINGW32_PATCHLEVEL        %PACKAGE_VERSION_PATCH%
 
 #if __GNUC__ >= 3 && ! defined __PCC__
 #pragma GCC system_header
index e18f6e4..4dbed4e 100644 (file)
@@ -1,3 +1,26 @@
+2016-05-03  Keith Marshall  <keithmarshall@users.sourceforge.net>
+
+       Enforce consistent specification of package version.
+
+       * include/w32api.h: Rename as...
+       * include/w32api.h.in: ...this build-time template file.
+       (__W32API_VERSION): Redefine it, in terms of...
+       (%PACKAGE_VERSION_LONG%): ...this substitution template.
+       (__W32API_MAJOR_VERSION, __W32API_MINOR_VERSION)
+       (__W32API_PATCHLEVEL): Likewise, redefine them in terms of...
+       (%PACKAGE_VERSION_MAJOR%, %PACKAGE_VERSION_MINOR%)
+       (%PACKAGE_VERSION_PATCH%): ...these.
+
+       * configure.ac (AC_CONFIG_SRCDIR): Adjust for renamed file.
+       (MINGW_AC_CONFIG_EXTRA_SRCDIR): Likewise, for similarly renamed
+       mingwrt/include/_mingw.h.in file.
+
+       * Makefile.in (all-w32api-libs): Add dependency on...
+       (w32api.h, _mingw.h): ...these; add rule to generate them, using...
+       (PACKAGE_VERSION_SCRIPT, PACKAGE_VERSION_FORMAT): ...these new macros;
+       they apply appropriate substitutions to the renamed template files.
+       (install-w32api-headers): Explicitly add w32api.h
+
 2015-11-14  Keith Marshall  <keithmarshall@users.sourceforge.net>
 
        Refactor for Windows DDK synchronization; fix MinGW-Bug [#1954].
index 11dfb3a..56c4c73 100644 (file)
@@ -7,7 +7,7 @@ PACKAGE_TARNAME := @PACKAGE_TARNAME@
 PACKAGE_VERSION := @PACKAGE_VERSION@
 
 # Written by Keith Marshall <keithmarshall@users.sourceforge.net>
-# Copyright (C) 2014, 2015, MinGW.org Project
+# Copyright (C) 2014-2016, MinGW.org Project
 #
 #
 # Permission is hereby granted, free of charge, to any person obtaining a
@@ -113,6 +113,27 @@ vpath configure.ac ${top_srcdir}
 configure: configure.ac aclocal.m4
        cd ${top_srcdir}; autoconf
 
+# Propagate package version, as configured, consistently throughout
+# the package build.
+#
+vpath w32api.h.in ${top_srcdir}/include
+vpath _mingw.h.in ${mingwrt_srcdir}/include
+
+w32api.h _mingw.h: configure.ac
+
+PACKAGE_VERSION_SCRIPT = sed \
+  -e s"`$(call PACKAGE_VERSION_FORMAT,LONG,%d,$$3+1000*($$2+1000*$$1))`" \
+  -e s"`$(call PACKAGE_VERSION_FORMAT,MAJOR,%7d,$$1)`" \
+  -e s"`$(call PACKAGE_VERSION_FORMAT,MINOR,%7d,$$2)`" \
+  -e s"`$(call PACKAGE_VERSION_FORMAT,PATCH,%7d,$$3)`"
+
+PACKAGE_VERSION_FORMAT = echo $(PACKAGE_VERSION).0.0 | awk -F. '{ \
+  printf ",%%PACKAGE_VERSION_$1%%,$2,", $3; \
+}'
+
+w32api.h _mingw.h: %.h: %.h.in
+       $(PACKAGE_VERSION_SCRIPT) $< > $@
+
 # Capture dependencies conveyed within source files, ensuring that
 # header files are taken from our working source tree, and not from
 # the build-time compiler's installation path.  (Note: we use -MD,
@@ -136,6 +157,7 @@ deffiles = $(eval vpath %.def $1)$(notdir $(wildcard $1/*.def))
 implibfiles = $(addprefix lib,$(subst .def,.a,$(call deffiles,$1)))
 
 all: all-w32api-libs
+all-w32api-libs: w32api.h _mingw.h
 all-w32api-libs install-w32api-libs: $(call implibfiles,${srcdir}/lib)
 all-w32api-libs install-w32api-libs: $(call implibfiles,${srcdir}/lib/directx)
 all-w32api-libs install-w32api-libs: $(call implibfiles,${srcdir}/lib/ddk)
@@ -238,8 +260,8 @@ w32api-include-dirs: includedir
 w32api-lib-dirs: libdir
 
 install-headers: install-w32api-headers
-install-w32api-headers: w32api-include-dirs
-       $(call INSTALL_DATA,${srcdir}/include/*.h,${includedir})
+install-w32api-headers: w32api.h w32api-include-dirs
+       $(call INSTALL_DATA,w32api.h ${srcdir}/include/*.h,${includedir})
        for dir in $(w32api_extra_include_dirs); do \
          $(call INSTALL_DATA,${srcdir}/include/$$dir/*.h,${includedir}); \
          done
index 28e4050..c3cc008 100644 (file)
@@ -6,7 +6,7 @@
 # $Id$
 #
 # Written by Keith Marshall <keithmarshall@users.sourceforge.net>
-# Copyright (C) 2015, MinGW.org Project
+# Copyright (C) 2015, 2016, MinGW.org Project
 #
 #
 # Permission is hereby granted, free of charge, to any person obtaining a
 # DEALINGS IN THE SOFTWARE.
 #
   AC_PREREQ([2.64])
-  AC_INIT([Win32 API],[3.18],[http://mingw.org/Reporting_Bugs],[w32api])
+  AC_INIT([MinGW Win32 API],[3.18],[http://mingw.org/Reporting_Bugs],[w32api])
 
   AC_PREFIX_DEFAULT([/mingw])
-  AC_CONFIG_SRCDIR([include/w32api.h])
-  MINGW_AC_CONFIG_EXTRA_SRCDIR([mingwrt],[include/_mingw.h])
+  AC_CONFIG_SRCDIR([include/w32api.h.in])
+  MINGW_AC_CONFIG_EXTRA_SRCDIR([mingwrt],[include/_mingw.h.in])
 
   MINGW_AC_PROG_CC_COMPILE_ONLY
 
similarity index 93%
rename from w32api/include/w32api.h
rename to w32api/include/w32api.h.in
index b9d9564..e7ebf5b 100644 (file)
@@ -7,7 +7,7 @@
  * $Id$
  *
  * Written by Earnie Boyd  <earnie@users.sourceforge.net>
- * Copyright (C) 2001-2011, 2015, MinGW.org Project
+ * Copyright (C) 2001-2011, 2015, 2016, MinGW.org Project
  *
  *
  * Permission is hereby granted, free of charge, to any person obtaining a
  * expressing:
  *
  *   __W32API_VERSION = 1,000,000 * major + 1,000 * minor + patch
+ *
+ * DO NOT EDIT these package version assignments manually; they are
+ * derived from the package version specification within configure.ac,
+ * whence they are propagated automatically, at package build time.
  */
-#define __W32API_VERSION               3017000L
-#define __W32API_MAJOR_VERSION               3
-#define __W32API_MINOR_VERSION              17
-#define __W32API_PATCH_LEVEL                 0
+#define __W32API_VERSION           %PACKAGE_VERSION_LONG%L
+#define __W32API_MAJOR_VERSION     %PACKAGE_VERSION_MAJOR%
+#define __W32API_MINOR_VERSION     %PACKAGE_VERSION_MINOR%
+#define __W32API_PATCHLEVEL        %PACKAGE_VERSION_PATCH%
 
 /* The underlying operating system platform version, and its
  * identifying macros for application support, are established by: