The MinGW.org Windows System Libraries
修订版 | db8ea997ba5acef07b342ec43746a3ff42c10095 (tree) |
---|---|
时间 | 2019-02-03 08:50:04 |
作者 | Keith Marshall <keith@user...> |
Commiter | Keith Marshall |
Add build option for <features.h> sample distribution.
@@ -7,7 +7,7 @@ PACKAGE_TARNAME := @PACKAGE_TARNAME@ | ||
7 | 7 | PACKAGE_VERSION := @PACKAGE_VERSION@ |
8 | 8 | |
9 | 9 | # Written by Keith Marshall <keithmarshall@users.sourceforge.net> |
10 | -# Copyright (C) 2016, MinGW.org Project | |
10 | +# Copyright (C) 2016, 2019, MinGW.org Project | |
11 | 11 | # |
12 | 12 | # |
13 | 13 | # Permission is hereby granted, free of charge, to any person obtaining a |
@@ -35,6 +35,12 @@ PACKAGE_VERSION := @PACKAGE_VERSION@ | ||
35 | 35 | # |
36 | 36 | all: |
37 | 37 | |
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 | + | |
38 | 44 | # Configuration |
39 | 45 | # ------------- |
40 | 46 | # |
@@ -99,11 +105,47 @@ check-recursive: %: %-subdirs | ||
99 | 105 | MKDIR_P = @MKDIR_P@ |
100 | 106 | LN = @LN@ |
101 | 107 | |
102 | -dist: dist-subdirs | |
108 | +dist-prepare: | |
103 | 109 | $(RM) -r $@; $(MKDIR_P) $@ |
110 | + | |
111 | +dist: dist-prepare dist-subdirs dist-extra | |
104 | 112 | for file in $(addsuffix /$@/*,${subdirs}); do \ |
105 | 113 | test -f $$file && $(LN) $$file $@; done |
106 | 114 | |
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 | |
107 | 149 | |
108 | 150 | # Clean-up Rules |
109 | 151 | # -------------- |
@@ -6,7 +6,7 @@ | ||
6 | 6 | # $Id$ |
7 | 7 | # |
8 | 8 | # Written by Keith Marshall <keithmarshall@users.sourceforge.net> |
9 | -# Copyright (C) 2016, MinGW.org Project | |
9 | +# Copyright (C) 2016, 2019, MinGW.org Project | |
10 | 10 | # |
11 | 11 | # |
12 | 12 | # Permission is hereby granted, free of charge, to any person obtaining a |
@@ -34,6 +34,7 @@ | ||
34 | 34 | |
35 | 35 | AC_PROG_MKDIR_P |
36 | 36 | AC_PATH_PROG([LN],[ln],[ln]) |
37 | + AC_PATH_PROG([LUA],[lua]) | |
37 | 38 | |
38 | 39 | AC_CONFIG_SUBDIRS([mingwrt w32api]) |
39 | 40 | AC_CONFIG_FILES([Makefile]) |
@@ -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 | + | |
1 | 19 | 2019-01-22 Keith Marshall <keith@users.osdn.me> |
2 | 20 | |
3 | 21 | Prepare and publish MinGW.org WSL-5.2.1 release. |