• R/O
  • HTTP
  • SSH
  • HTTPS

提交

标签
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

The MinGW.org Windows System Libraries


Commit MetaInfo

修订版db8ea997ba5acef07b342ec43746a3ff42c10095 (tree)
时间2019-02-03 08:50:04
作者Keith Marshall <keith@user...>
CommiterKeith Marshall

Log Message

Add build option for <features.h> sample distribution.

更改概述

差异

--- a/Makefile.in
+++ b/Makefile.in
@@ -7,7 +7,7 @@ PACKAGE_TARNAME := @PACKAGE_TARNAME@
77 PACKAGE_VERSION := @PACKAGE_VERSION@
88
99 # Written by Keith Marshall <keithmarshall@users.sourceforge.net>
10-# Copyright (C) 2016, MinGW.org Project
10+# Copyright (C) 2016, 2019, MinGW.org Project
1111 #
1212 #
1313 # Permission is hereby granted, free of charge, to any person obtaining a
@@ -35,6 +35,12 @@ PACKAGE_VERSION := @PACKAGE_VERSION@
3535 #
3636 all:
3737
38+# Offer users the opportunity to assign boolean build-time options, from
39+# the command line, in the form 'option=NAME', or 'options="NAME ..."'
40+#
41+$(foreach opt,$(option) $(options),$(eval $(opt) = true))
42+
43+
3844 # Configuration
3945 # -------------
4046 #
@@ -99,11 +105,47 @@ check-recursive: %: %-subdirs
99105 MKDIR_P = @MKDIR_P@
100106 LN = @LN@
101107
102-dist: dist-subdirs
108+dist-prepare:
103109 $(RM) -r $@; $(MKDIR_P) $@
110+
111+dist: dist-prepare dist-subdirs dist-extra
104112 for file in $(addsuffix /$@/*,${subdirs}); do \
105113 test -f $$file && $(LN) $$file $@; done
106114
115+LUA = @LUA@
116+LUACMD = $(if $(LUA),$(LUA) -e,false)
117+
118+WSL_TMPDIR = $(CURDIR)/dist/var/lib/wsl
119+FEATURES_CFG = wsl-features-$(TODAY)-$(ISSUE)-mingw32-cfg.tar.xz
120+
121+TODAY = $(shell date +%Y%m%d)
122+ISSUE = $(if $(wildcard $@),$(shell awk '\
123+ { if( $$1 == $(TODAY) ) print $$2 + 1; else print 1; exit; \
124+ }' $@),1)
125+
126+dist-extra: $(if $(FEATURES),features.stamp)
127+features.unsupported:
128+ $(warning Lua does not appear to be installed on your system;)
129+ $(warning it is required to support the FEATURES distribution option.)
130+
131+vpath features.lua ${srcdir}/var
132+features.stamp: features.$(if $(LUA),lua,unsupported)
133+ $(RM) -r dist/var dist/include
134+ $(MKDIR_P) dist/include $(WSL_TMPDIR)/include && $(LN) $^ $(WSL_TMPDIR)
135+ MINGW32_SYSROOT=$(WSL_TMPDIR) $(LUACMD) '$(FEATURES_H_INITIALIZE)'
136+ cd dist && tar cf - var include | xz -c > $(FEATURES_CFG)
137+ echo $(TODAY) $(ISSUE) > $@
138+ $(RM) -r dist/var dist/include
139+
140+FEATURES_H_INITIALIZE = \
141+ sysroot = os.getenv( "MINGW32_SYSROOT" ) \
142+ if sysroot then \
143+ package.path = sysroot.."/?.lua;"..package.path \
144+ have_features, config = pcall( require, "features" ) \
145+ if have_features then \
146+ config.initialize( io.open( config.pathname(), "w" )) \
147+ end \
148+ end
107149
108150 # Clean-up Rules
109151 # --------------
--- a/configure.ac
+++ b/configure.ac
@@ -6,7 +6,7 @@
66 # $Id$
77 #
88 # Written by Keith Marshall <keithmarshall@users.sourceforge.net>
9-# Copyright (C) 2016, MinGW.org Project
9+# Copyright (C) 2016, 2019, MinGW.org Project
1010 #
1111 #
1212 # Permission is hereby granted, free of charge, to any person obtaining a
@@ -34,6 +34,7 @@
3434
3535 AC_PROG_MKDIR_P
3636 AC_PATH_PROG([LN],[ln],[ln])
37+ AC_PATH_PROG([LUA],[lua])
3738
3839 AC_CONFIG_SUBDIRS([mingwrt w32api])
3940 AC_CONFIG_FILES([Makefile])
--- a/mingwrt/ChangeLog
+++ b/mingwrt/ChangeLog
@@ -1,3 +1,21 @@
1+2019-02-02 Keith Marshall <keith@users.osdn.me>
2+
3+ Add build option for <features.h> sample distribution.
4+
5+ * configure.ac (lua): Add AC_PATH_PROG check; assign result to...
6+ (LUA): ...this new AC_SUBST propagated macro definition.
7+
8+ * Makefile.in (dist): Add dependencies on...
9+ (dist-prepare, dist-extra): ...these new goals; implement...
10+ (dist-prepare): ...to initialize an empty staging directory, and...
11+ (dist-extra): ...incorporate optional distributable components.
12+ (features.stamp): New optional goal; selected by definition of...
13+ (FEATURES): ...this user specified macro, nominally defined by...
14+ (option, options): ...evaluation of command line assignment.
15+ (features.lua, features.unsupported): New prerequisite goals.
16+ (WSL_TMPDIR, FEATURES_H_INITIALIZE, FEATURES_CFG, LUA, LUACMD)
17+ (TODAY, ISSUE): New supporting macros; define them.
18+
119 2019-01-22 Keith Marshall <keith@users.osdn.me>
220
321 Prepare and publish MinGW.org WSL-5.2.1 release.