• R/O
  • SSH
  • HTTPS

tsukurimashou: Commit


Commit MetaInfo

Revision670 (tree)
Time2017-11-22 06:36:42
Authormskala

Log Message

build system fixes for some of the issues discovered in packaging 0.10

Change Summary

Incremental Difference

--- trunk/Makefile.am (revision 669)
+++ trunk/Makefile.am (revision 670)
@@ -420,11 +420,13 @@
420420 $(AM_V_at)'$(PERL)' -CSD -ne $(jnames_encode_script) \
421421 $(mvp)/txt/jnames.txt > hamlog/jnames.hl
422422
423+if COND_KANJIDIC2
423424 hamlog/kddata.hl: tools/make-kddata $(KANJIDIC2) hamlog/.dirstamp
424425 $(TSU_V_PERL)
425426 $(AM_V_at)'$(GZIP)' -cd $(KANJIDIC2) \
426427 | $(PERL) -CSD $(mvp)/tools/make-kddata \
427428 > hamlog/kddata.hl
429+endif
428430
429431 hamlog/macdep.ecl: tools/autodep hamlog/.dirstamp \
430432 $(sort $(wildcard $(mvp)/mp/*.mp) $(wildcard ./mp/*.mp))
--- trunk/m4/tsu_fix_makefile.m4 (revision 0)
+++ trunk/m4/tsu_fix_makefile.m4 (revision 670)
@@ -0,0 +1,82 @@
1+#
2+# SYNOPSIS
3+#
4+# TSU_FIX_MAKEFILE(EXTRA_PERL,EXTRA_COMMANDS,INIT_COMMANDS)
5+#
6+# DESCRIPTION
7+#
8+# Alter the Automake-generated Makefile to do certain things needed by
9+# Tsukurimashou that don't seem to be achievable in any simpler way.
10+# This works by adding a "fix-makefile" tag to config.status and
11+# making other changes to make sure that this tag will be executed any
12+# time the Makefile is rebuilt.
13+#
14+# This code uses a perl -pe loop over the Makefile, and additional hacks
15+# on the Makefile may be done by passing suitable Perl code in the
16+# EXTRA_PERL argument. Further shell commands that won't fit in that
17+# context may be added in the EXTRA_COMMANDS argument.
18+#
19+# Any shell commands given in INIT_COMMANDS are added to the
20+# corresponding argument of AC_CONFIG_COMMANDS.
21+#
22+# TSU_FIX_MAKEFILE must be used early in the configure.ac, in particular
23+# before anything that causes Autoconf to include stuff related to the
24+# C compiler.
25+#
26+# To make it more secure that the fix-makefile commands really will
27+# be executed, include a line like this one in Makefile.am:
28+# $(error This Makefile must be edited by Perl code in config.status before use)
29+# The default fix-makefile loop will remove it, but when present this
30+# line prevents anyone from using a Makefile that might somehow have
31+# been created and not processed by fix-makefile.
32+#
33+# The regular expression /ZZZZHACKZZZZ\s*=\s*/ will be removed from
34+# Makefile lines. This behaviour can be used to make a line of
35+# something other than variable definitions *look* like a variable
36+# definition, so that Automake will include it early in the generated
37+# Makefile, among the variable definitions.
38+#
39+# LICENSE
40+#
41+# This macro is released to the public domain by its author,
42+# Matthew Skala <mskala@ansuz.sooke.bc.ca>.
43+
44+#serial 1
45+
46+AC_DEFUN([TSU_FIX_MAKEFILE], [
47+ AC_CONFIG_COMMANDS([fix-makefile],
48+ [patsubst(["$PERL" -i -pe 'dnl
49+dnl
50+dnl Remove ZZZZHACKZZZZ= to allow forcing lines to be early
51+s/ZZZZHACKZZZZ\s*=\s*//;dnl
52+dnl
53+dnl Remove Makefile poison pill (to prevent user from overriding us)
54+$_="" if /\$\(error This Makefile must be /;dnl
55+dnl
56+dnl Any time the Makefile wants to run automake --foreign and not us,
57+dnl also run ourselves
58+s#(\$\(AUTOMAKE\) --foreign( Makefile)?)(?! && (\S+\s+)?./config)#dnl
59+\1 && \$(SHELL) ./config.status fix-makefile#;dnl
60+dnl
61+dnl Any time it wants to run config_status in the way that Automake does
62+dnl it to invoke depfiles, also run ourselves
63+s#config\.status \$\@ \$\(am__depfiles_maybe\)#dnl
64+config.status \$\@ fix-makefile \$(am__depfiles_maybe)#;dnl
65+dnl
66+dnl Change lines that look like Automake's "make clean" recipes, to
67+dnl use our pretty output format.
68+s#\t-\@?(test -z.* || )?rm -(r?)f (.*)#dnl
69+\t\$(TSU_V_RM) '"'"'\3'"'"' \$(TSU_V_CHOPPER)\ndnl
70+\t-\$(A''M_V_at)\1rm -\2f \3#;dnl
71+dnl
72+dnl Similar change for the VPATH-only files
73+s#\t-\@?(test \. =.* || test -z.* || )rm -(r?)f (.*)#dnl
74+\t-@\1(\$(TSU_V_RM) '"'"'\3'"'"' \$(TSU_V_CHOPPER) ; dnl
75+rm -\2f \3)#;dnl
76+dnl
77+$1' Makefile
78+$2],[dnl.*
79+],[])],
80+ [PERL=$PERL
81+$3])
82+])
--- trunk/ocr/m4/tsu_fix_makefile.m4 (revision 0)
+++ trunk/ocr/m4/tsu_fix_makefile.m4 (revision 670)
@@ -0,0 +1,82 @@
1+#
2+# SYNOPSIS
3+#
4+# TSU_FIX_MAKEFILE(EXTRA_PERL,EXTRA_COMMANDS,INIT_COMMANDS)
5+#
6+# DESCRIPTION
7+#
8+# Alter the Automake-generated Makefile to do certain things needed by
9+# Tsukurimashou that don't seem to be achievable in any simpler way.
10+# This works by adding a "fix-makefile" tag to config.status and
11+# making other changes to make sure that this tag will be executed any
12+# time the Makefile is rebuilt.
13+#
14+# This code uses a perl -pe loop over the Makefile, and additional hacks
15+# on the Makefile may be done by passing suitable Perl code in the
16+# EXTRA_PERL argument. Further shell commands that won't fit in that
17+# context may be added in the EXTRA_COMMANDS argument.
18+#
19+# Any shell commands given in INIT_COMMANDS are added to the
20+# corresponding argument of AC_CONFIG_COMMANDS.
21+#
22+# TSU_FIX_MAKEFILE must be used early in the configure.ac, in particular
23+# before anything that causes Autoconf to include stuff related to the
24+# C compiler.
25+#
26+# To make it more secure that the fix-makefile commands really will
27+# be executed, include a line like this one in Makefile.am:
28+# $(error This Makefile must be edited by Perl code in config.status before use)
29+# The default fix-makefile loop will remove it, but when present this
30+# line prevents anyone from using a Makefile that might somehow have
31+# been created and not processed by fix-makefile.
32+#
33+# The regular expression /ZZZZHACKZZZZ\s*=\s*/ will be removed from
34+# Makefile lines. This behaviour can be used to make a line of
35+# something other than variable definitions *look* like a variable
36+# definition, so that Automake will include it early in the generated
37+# Makefile, among the variable definitions.
38+#
39+# LICENSE
40+#
41+# This macro is released to the public domain by its author,
42+# Matthew Skala <mskala@ansuz.sooke.bc.ca>.
43+
44+#serial 1
45+
46+AC_DEFUN([TSU_FIX_MAKEFILE], [
47+ AC_CONFIG_COMMANDS([fix-makefile],
48+ [patsubst(["$PERL" -i -pe 'dnl
49+dnl
50+dnl Remove ZZZZHACKZZZZ= to allow forcing lines to be early
51+s/ZZZZHACKZZZZ\s*=\s*//;dnl
52+dnl
53+dnl Remove Makefile poison pill (to prevent user from overriding us)
54+$_="" if /\$\(error This Makefile must be /;dnl
55+dnl
56+dnl Any time the Makefile wants to run automake --foreign and not us,
57+dnl also run ourselves
58+s#(\$\(AUTOMAKE\) --foreign( Makefile)?)(?! && (\S+\s+)?./config)#dnl
59+\1 && \$(SHELL) ./config.status fix-makefile#;dnl
60+dnl
61+dnl Any time it wants to run config_status in the way that Automake does
62+dnl it to invoke depfiles, also run ourselves
63+s#config\.status \$\@ \$\(am__depfiles_maybe\)#dnl
64+config.status \$\@ fix-makefile \$(am__depfiles_maybe)#;dnl
65+dnl
66+dnl Change lines that look like Automake's "make clean" recipes, to
67+dnl use our pretty output format.
68+s#\t-\@?(test -z.* || )?rm -(r?)f (.*)#dnl
69+\t\$(TSU_V_RM) '"'"'\3'"'"' \$(TSU_V_CHOPPER)\ndnl
70+\t-\$(A''M_V_at)\1rm -\2f \3#;dnl
71+dnl
72+dnl Similar change for the VPATH-only files
73+s#\t-\@?(test \. =.* || test -z.* || )rm -(r?)f (.*)#dnl
74+\t-@\1(\$(TSU_V_RM) '"'"'\3'"'"' \$(TSU_V_CHOPPER) ; dnl
75+rm -\2f \3)#;dnl
76+dnl
77+$1' Makefile
78+$2],[dnl.*
79+],[])],
80+ [PERL=$PERL
81+$3])
82+])
--- trunk/ocr/configure.ac (revision 669)
+++ trunk/ocr/configure.ac (revision 670)
@@ -192,18 +192,12 @@
192192 parallel-tests silent-rules])
193193 AC_CONFIG_SRCDIR([msk-ocra.mp])
194194 AC_CONFIG_MACRO_DIR([m4])
195-AC_REVISION([$Id: configure.ac 5785 2017-11-18 23:17:22Z mskala $])
195+AC_REVISION([$Id: configure.ac 5795 2017-11-21 21:32:34Z mskala $])
196196 AC_COPYRIGHT([public domain])
197197 AC_SUBST([release_date],["March 7, 2013"])
198+# this must be early so it will happen before depfiles
199+TSU_FIX_MAKEFILE
198200 AM_SILENT_RULES
199-# this must be early so it will happen before depfiles
200-AC_CONFIG_COMMANDS([fix-makefile],
201- ["$PERL" -i -pe \
202-'s#\t-\@?(test -z.* || )?rm -(r?)f (.*)#'\
203-'\t\$(TSU_V_RM) '"'"'\3'"'"' \$(TSU_V_CHOPPER)\n'\
204-'\t-\$(A''M_V_at)\1rm -\2f \3#;' \
205- Makefile],
206- [PERL=$PERL])
207201 #
208202 ############################################################################
209203 #
@@ -244,23 +238,6 @@
244238 #
245239 ############################################################################
246240 #
247-# Check for parasite build
248-#
249-AC_MSG_CHECKING([whether we are building as a parasite])
250-AM_CONDITIONAL([COND_PARASITE],
251- [grep Tsukurimashou ../Makefile > /dev/null 2> /dev/null])
252-AM_COND_IF([COND_PARASITE],
253- [AC_MSG_RESULT([yes])
254- T1ASM=../t1asm/t1asm
255- parasite=yes],
256- [AC_MSG_RESULT([no])
257- AC_PATH_PROG([T1ASM],[t1asm])
258- parasite=no])
259-AC_SUBST([T1ASM])
260-AC_SUBST([parasite])
261-#
262-############################################################################
263-#
264241 # Checks for system services
265242 #
266243 AC_SYS_LONG_FILE_NAMES
@@ -275,15 +252,23 @@
275252 AC_ARG_ENABLE([colour-build],
276253 [AS_HELP_STRING([--disable-colour-build],
277254 [turn off ANSI colour in build scripts])],
278- [],
279- [enable_colour_build=yes])
255+ [],
256+ [enable_colour_build=yes])
280257 AC_ARG_ENABLE([color-build],[dnl],[],[enable_color_build=yes])
258+# ]
259+#
281260 AC_ARG_ENABLE([docs],
282261 [AS_HELP_STRING([--disable-docs],
283262 [turn off PDF documentation])],
284- [],
285- [enable_docs=yes])
263+ [],
264+ [enable_docs=yes])
286265 #
266+AC_ARG_ENABLE([parasite],
267+ [AS_HELP_STRING([--enable-parasite=[yes|no|auto]],
268+ [build as a parasite [auto]])],
269+ [],
270+ [enable_parasite=auto])
271+#
287272 # Process user options
288273 #
289274 tsu_colour=yes
@@ -314,6 +299,25 @@
314299 #
315300 ############################################################################
316301 #
302+# Check for parasite build
303+#
304+AC_MSG_CHECKING([whether we are building as a parasite])
305+AS_IF([test "x$enable_parasite" = "xauto"],
306+ [AS_IF([grep Tsukurimashou ../Makefile > /dev/null 2> /dev/null],
307+ [enable_parasite=yes],
308+ [enable_parasite=no])])
309+AC_MSG_RESULT([$enable_parasite])
310+AM_CONDITIONAL([COND_PARASITE],[test "x$enable_parasite" = "xyes"])
311+AM_COND_IF([COND_PARASITE],
312+ [T1ASM=../t1asm/t1asm
313+ parasite=yes],
314+ [AC_PATH_PROG([T1ASM],[t1asm])
315+ parasite=no])
316+AC_SUBST([T1ASM])
317+AC_SUBST([parasite])
318+#
319+############################################################################
320+#
317321 # Generate output
318322 #
319323 AC_SUBST([andt],[])
@@ -373,3 +377,6 @@
373377 AS_ECHO(["is quite likely to fail. It would be better to eliminate all illegal"])
374378 AS_ECHO(["characters from pathnames before continuing."])
375379 ])
380+AS_IF([test "x$parasite" = "xyes"],
381+ [TSU_COLOURISE([Parasite build enabled.],[6])
382+ AS_ECHO([])])
--- trunk/ocr/Makefile.am (revision 669)
+++ trunk/ocr/Makefile.am (revision 670)
@@ -31,6 +31,8 @@
3131 comma:=,
3232 percent=%
3333
34+$(error This Makefile must be edited by Perl code in config.status before use)
35+
3436 SHELL=$(if $(wildcard @KLEKNEV@),@KLEKNEV@,$(if \
3537 $(wildcard /bin/bash),/bin/bash,/bin/sh))
3638
@@ -200,7 +202,8 @@
200202 (cd $*.tmp ; $(expect_start)'$(MPOST)' $*.mp$(expect_end) ) ; \
201203 if '$(GREP)' -q '^! ' $*.tmp/$*.log ; then exit 1 ; fi ; \
202204 $(TSU_V_NAPERL) \
203- '$(PERL)' -CSD mp2pf $*.tmp/$* $(TSU_V_REDIR) ; \
205+ '$(PERL)' -CSD $(if $(filter no,@parasite@),$(mvp)/)mp2pf \
206+ $*.tmp/$* $(TSU_V_REDIR) ; \
204207 (cd $*.tmp ; '$(realpath @T1ASM@)' -b $*.p $*.pfb ) ; \
205208 if test -r $*.tmp/$*.pfb \
206209 && '$(GREP)' -q 'output files\? written' $*.tmp/$*.log; then \
@@ -329,7 +332,7 @@
329332 # TESTING
330333
331334 TESTS = $(dist_otf_DATA) $(dist_ttf_DATA) $(dist_type1_DATA)
332-LOG_COMPILER = '$(FONTANVIL)' -lang=ff -script fontlint.pe
335+LOG_COMPILER = '$(FONTANVIL)' -lang=ff -script $(mvp)/fontlint.pe
333336
334337 ############################################################################
335338
@@ -378,6 +381,9 @@
378381 m4/tsu_colourise.m4: ../m4/tsu_colourise.m4
379382 $(TSU_V_CP) cp $< $@
380383
384+m4/tsu_fix_makefile.m4: ../m4/tsu_fix_makefile.m4
385+ $(TSU_V_CP) cp $< $@
386+
381387 mp2pf: ../tools/mp2pf
382388 $(TSU_V_CP) cp $< $@
383389
--- trunk/idsgrep/Makefile.am (revision 669)
+++ trunk/idsgrep/Makefile.am (revision 670)
@@ -217,7 +217,7 @@
217217
218218 CLEANFILES = \
219219 $(if $(filter yes,@parasite@),$(STANDALONE_QVFG) $(STANDALONE_FPEVCGF)) \
220- chise.errs edict.eids kanjivg.eids tsukurimashou.eids \
220+ chise.errs cjkvi-?.eids edict.eids kanjivg.eids tsukurimashou.eids \
221221 widthtab.h
222222
223223 DISTCLEANFILES = \
@@ -237,6 +237,10 @@
237237 idsgrep.pdf: idsgrep.tex mitsuba.cls mitsuba.cfg idsgrep.bib \
238238 @with_tsuku_build@/otf/TsukurimashouMincho.otf
239239 $(AM_V_at)rm -f idsgrep.aux
240+ $(AM_V_at)if test '!' -r idsgrep.tex ; then \
241+ cp $(mvp)/idsgrep.tex . ; fi
242+ $(AM_V_at)if test '!' -r mitsuba.cls ; then \
243+ cp $(mvp)/mitsuba.cls . ; fi
240244 $(AM_V_at)I=1;$(TSU_V_TEXL) \
241245 $(expect_start)'$(XELATEX)' $(mvp)/idsgrep.tex $(expect_end) ; \
242246 export BIBINPUTS=$(mvp) ; bibtex idsgrep.aux $(TSU_V_REDIR) ; \
@@ -365,6 +369,9 @@
365369 m4/tsu_colourise.m4: ../m4/tsu_colourise.m4
366370 $(TSU_V_CP) cp $< $@
367371
372+m4/tsu_fix_makefile.m4: ../m4/tsu_fix_makefile.m4
373+ $(TSU_V_CP) cp $< $@
374+
368375 UnicodeData.txt: $(wildcard ../fontanvil/dat/UnicodeData.txt)
369376 $(TSU_V_CP) if test -s ../fontanvil/dat/UnicodeData.txt ; \
370377 then cp ../fontanvil/dat/UnicodeData.txt $@ ; fi
--- trunk/idsgrep/m4/tsu_fix_makefile.m4 (revision 0)
+++ trunk/idsgrep/m4/tsu_fix_makefile.m4 (revision 670)
@@ -0,0 +1,82 @@
1+#
2+# SYNOPSIS
3+#
4+# TSU_FIX_MAKEFILE(EXTRA_PERL,EXTRA_COMMANDS,INIT_COMMANDS)
5+#
6+# DESCRIPTION
7+#
8+# Alter the Automake-generated Makefile to do certain things needed by
9+# Tsukurimashou that don't seem to be achievable in any simpler way.
10+# This works by adding a "fix-makefile" tag to config.status and
11+# making other changes to make sure that this tag will be executed any
12+# time the Makefile is rebuilt.
13+#
14+# This code uses a perl -pe loop over the Makefile, and additional hacks
15+# on the Makefile may be done by passing suitable Perl code in the
16+# EXTRA_PERL argument. Further shell commands that won't fit in that
17+# context may be added in the EXTRA_COMMANDS argument.
18+#
19+# Any shell commands given in INIT_COMMANDS are added to the
20+# corresponding argument of AC_CONFIG_COMMANDS.
21+#
22+# TSU_FIX_MAKEFILE must be used early in the configure.ac, in particular
23+# before anything that causes Autoconf to include stuff related to the
24+# C compiler.
25+#
26+# To make it more secure that the fix-makefile commands really will
27+# be executed, include a line like this one in Makefile.am:
28+# $(error This Makefile must be edited by Perl code in config.status before use)
29+# The default fix-makefile loop will remove it, but when present this
30+# line prevents anyone from using a Makefile that might somehow have
31+# been created and not processed by fix-makefile.
32+#
33+# The regular expression /ZZZZHACKZZZZ\s*=\s*/ will be removed from
34+# Makefile lines. This behaviour can be used to make a line of
35+# something other than variable definitions *look* like a variable
36+# definition, so that Automake will include it early in the generated
37+# Makefile, among the variable definitions.
38+#
39+# LICENSE
40+#
41+# This macro is released to the public domain by its author,
42+# Matthew Skala <mskala@ansuz.sooke.bc.ca>.
43+
44+#serial 1
45+
46+AC_DEFUN([TSU_FIX_MAKEFILE], [
47+ AC_CONFIG_COMMANDS([fix-makefile],
48+ [patsubst(["$PERL" -i -pe 'dnl
49+dnl
50+dnl Remove ZZZZHACKZZZZ= to allow forcing lines to be early
51+s/ZZZZHACKZZZZ\s*=\s*//;dnl
52+dnl
53+dnl Remove Makefile poison pill (to prevent user from overriding us)
54+$_="" if /\$\(error This Makefile must be /;dnl
55+dnl
56+dnl Any time the Makefile wants to run automake --foreign and not us,
57+dnl also run ourselves
58+s#(\$\(AUTOMAKE\) --foreign( Makefile)?)(?! && (\S+\s+)?./config)#dnl
59+\1 && \$(SHELL) ./config.status fix-makefile#;dnl
60+dnl
61+dnl Any time it wants to run config_status in the way that Automake does
62+dnl it to invoke depfiles, also run ourselves
63+s#config\.status \$\@ \$\(am__depfiles_maybe\)#dnl
64+config.status \$\@ fix-makefile \$(am__depfiles_maybe)#;dnl
65+dnl
66+dnl Change lines that look like Automake's "make clean" recipes, to
67+dnl use our pretty output format.
68+s#\t-\@?(test -z.* || )?rm -(r?)f (.*)#dnl
69+\t\$(TSU_V_RM) '"'"'\3'"'"' \$(TSU_V_CHOPPER)\ndnl
70+\t-\$(A''M_V_at)\1rm -\2f \3#;dnl
71+dnl
72+dnl Similar change for the VPATH-only files
73+s#\t-\@?(test \. =.* || test -z.* || )rm -(r?)f (.*)#dnl
74+\t-@\1(\$(TSU_V_RM) '"'"'\3'"'"' \$(TSU_V_CHOPPER) ; dnl
75+rm -\2f \3)#;dnl
76+dnl
77+$1' Makefile
78+$2],[dnl.*
79+],[])],
80+ [PERL=$PERL
81+$3])
82+])
--- trunk/idsgrep/configure.ac (revision 669)
+++ trunk/idsgrep/configure.ac (revision 670)
@@ -168,16 +168,9 @@
168168 AC_REVISION([$Id: configure.ac 1015 2011-12-15 22:24:32Z mskala $])
169169 AC_COPYRIGHT([Copyright (C) 2012, 2013, 2014 Matthew Skala])
170170 AC_SUBST([release_date],["March 27, 2014"])
171+# this must be early so it will happen before depfiles
172+TSU_FIX_MAKEFILE
171173 AM_SILENT_RULES
172-# this must be early so it will happen before depfiles
173-AC_CONFIG_COMMANDS([fix-makefile],
174- ["$PERL" -i -pe \
175-'$_="" if /\$\(error This Makefile must be /;'\
176-'s#\t-\@?(test -z.* || )?rm -(r?)f (.*)#'\
177-'\t\$(TSU_V_RM) '"'"'\3'"'"' \$(TSU_V_CHOPPER)\n'\
178-'\t-\$(A''M_V_at)\1rm -\2f \3#;' \
179- Makefile],
180- [PERL=$PERL])
181174 #
182175 ############################################################################
183176 #
@@ -231,20 +224,6 @@
231224 #
232225 ############################################################################
233226 #
234-# Check for parasite build
235-#
236-AC_MSG_CHECKING([whether we are building as a parasite])
237-AM_CONDITIONAL([COND_PARASITE],
238- [grep Tsukurimashou ../Makefile > /dev/null 2> /dev/null])
239-AM_COND_IF([COND_PARASITE],
240- [AC_MSG_RESULT([yes])
241- parasite=yes],
242- [AC_MSG_RESULT([no])
243- parasite=no])
244-AC_SUBST([parasite])
245-#
246-############################################################################
247-#
248227 # Checks for libraries.
249228 #
250229 AX_PERL_MODULE_VERSION([XML::Parser 2.36],[have_perlxml=yes],
@@ -353,9 +332,9 @@
353332 AS_IF([test "x$prefix" = "xNONE"],[prefix="$ac_default_prefix"])
354333 AC_ARG_WITH([edict2],
355334 [AS_HELP_STRING([--with-edict2=PATH],
356- [EDICT2 database [auto]])],
357- [],
358- [with_edict2=auto])
335+ [EDICT2 database [auto]])],
336+ [],
337+ [with_edict2=auto])
359338 AS_IF([test "x$with_edict2" = "xauto"],[
360339 AC_MSG_CHECKING([for EDICT2])
361340 m4_foreach_w([edcheckpath],m4_expand([$srcdir dnl
@@ -379,8 +358,8 @@
379358 AC_ARG_WITH([kanjivg],
380359 [AS_HELP_STRING([--with-kanjivg=PATH],
381360 [KanjiVG database [auto]])],
382- [],
383- [with_kanjivg=auto])
361+ [],
362+ [with_kanjivg=auto])
384363 AS_IF([test "x$with_kanjivg" = "xauto"],[
385364 AC_MSG_CHECKING([for KanjiVG])
386365 m4_foreach_w([kvcheckpath],m4_expand([$srcdir dnl
@@ -403,8 +382,8 @@
403382 AC_ARG_WITH([tsuku-build],
404383 [AS_HELP_STRING([--with-tsuku-build=PATH],
405384 [Tsukurimashou build dir [auto]])],
406- [],
407- [with_tsuku_build=auto])
385+ [],
386+ [with_tsuku_build=auto])
408387 AS_IF([test "x$with_tsuku_build" = "xauto"],[
409388 AC_MSG_CHECKING([for Tsukurimashou build dir])
410389 m4_foreach_w([tbcheckname],m4_expand([tsukurimashou dnl
@@ -427,22 +406,23 @@
427406 AC_ARG_ENABLE([cjkvi-style],
428407 [AS_HELP_STRING([--enable-cjkvi-style=[[gtjkvxhau]]],
429408 [which CJKVI dictionaries to build [j]])],
430- [],
431- [enable_cjkvi_style=j])
409+ [],
410+ [enable_cjkvi_style=j])
432411 AC_SUBST([enable_cjkvi_style])
433412 #
434413 AC_ARG_ENABLE([colour-build],
435414 [AS_HELP_STRING([--disable-colour-build],
436415 [turn off ANSI colour in build scripts])],
437- [],
438- [enable_colour_build=yes])
416+ [],
417+ [enable_colour_build=yes])
439418 AC_ARG_ENABLE([color-build],[dnl],[],[enable_color_build=yes])
419+# ]
440420 #
441421 AC_ARG_ENABLE([docs],
442422 [AS_HELP_STRING([--disable-docs],
443423 [turn off PDF documentation])],
444- [],
445- [enable_docs=yes])
424+ [],
425+ [enable_docs=yes])
446426 #
447427 AC_ARG_ENABLE([edict-decomp],
448428 [AS_HELP_STRING([--enable-edict-decomp[[=cjkvi-X|chise|kanjivg|tsuku]]],
@@ -465,11 +445,17 @@
465445 [edict_decomp=])
466446 AC_SUBST([edict_decomp])
467447 #
448+AC_ARG_ENABLE([parasite],
449+ [AS_HELP_STRING([--enable-parasite=[yes|no|auto]],
450+ [build as a parasite [auto]])],
451+ [],
452+ [enable_parasite=auto])
453+#
468454 AC_ARG_WITH([valgrind],
469455 [AS_HELP_STRING([--with-valgrind],
470456 [use Valgrind for tests if available])],
471- [],
472- [with_valgrind=no])
457+ [],
458+ [with_valgrind=no])
473459 #
474460 # Process user options
475461 #
@@ -492,6 +478,22 @@
492478 #
493479 ############################################################################
494480 #
481+# Check for parasite build
482+#
483+AC_MSG_CHECKING([whether we are building as a parasite])
484+AS_IF([test "x$enable_parasite" = "xauto"],
485+ [AS_IF([grep Tsukurimashou ../Makefile > /dev/null 2> /dev/null],
486+ [enable_parasite=yes],
487+ [enable_parasite=no])])
488+AC_MSG_RESULT([$enable_parasite])
489+AM_CONDITIONAL([COND_PARASITE],[test "x$enable_parasite" = "xyes"])
490+AM_COND_IF([COND_PARASITE],
491+ [parasite=yes],
492+ [parasite=no])
493+AC_SUBST([parasite])
494+#
495+############################################################################
496+#
495497 # Generate output
496498 #
497499 AC_SUBST([flat_dictdir])
@@ -616,3 +618,6 @@
616618 AS_ECHO(["is quite likely to fail. It would be better to eliminate all illegal"])
617619 AS_ECHO(["characters from pathnames before continuing."])
618620 ])
621+AS_IF([test "x$parasite" = "xyes"],
622+ [TSU_COLOURISE([Parasite build enabled.],[6])
623+ AS_ECHO([])])
--- trunk/beikaitoru/Makefile.am (revision 669)
+++ trunk/beikaitoru/Makefile.am (revision 670)
@@ -45,6 +45,8 @@
4545 comma:=,
4646 percent=%
4747
48+$(error This Makefile must be edited by Perl code in config.status before use)
49+
4850 SHELL=$(if $(wildcard @KLEKNEV@),@KLEKNEV@,$(if \
4951 $(wildcard /bin/bash),/bin/bash,/bin/sh))
5052
@@ -246,7 +248,8 @@
246248 (cd $(1).tmp ; $$(expect_start)'$$(MPOST)' subfont.mp$$(expect_end) ) ; \
247249 if '$$(GREP)' -q '^! ' $(1).tmp/subfont.log ; then exit 1 ; fi ; \
248250 $$(TSU_V_NAPERL) \
249- '$$(PERL)' -CSD mp2pf $(1).tmp/subfont $$(TSU_V_REDIR) ; \
251+ '$$(PERL)' -CSD $(if $(filter no,@parasite@),$(mvp)/)mp2pf \
252+ $(1).tmp/subfont $$(TSU_V_REDIR) ; \
250253 (cd $(1).tmp ; '$$(realpath @T1ASM@)' -b subfont.p subfont.pfb ) ; \
251254 if test -r $(1).tmp/subfont.pfb \
252255 && '$$(GREP)' -q 'output files\? written' $(1).tmp/subfont.log; then \
@@ -260,11 +263,10 @@
260263 fi
261264
262265 pfb/$(1).pfb: pfbtmp/$(1).pfb pfb/.dirstamp pe/rmo.pe
263- $$(AM_V_at)if test '!' -r pe/rmo.pe ; then \
264- $$(MKDIR_P) pe ; cp $$(mvp)/pe/rmo.pe pe/ ; fi
265266 $$(AM_V_at)$$(TSU_V_RMO) \
266267 '$$(FONTANVIL)' -lang=ff -script \
267- pe/rmo.pe pfbtmp/$(1).pfb pfb/$(1).pfb \
268+ $$(if $$(filter no,@parasite@),$$(mvp)/)pe/rmo.pe \
269+ pfbtmp/$(1).pfb pfb/$(1).pfb \
268270 $$(TSU_V_REDIR)
269271 endef
270272
@@ -418,6 +420,9 @@
418420 m4/tsu_colourise.m4: ../m4/tsu_colourise.m4
419421 $(TSU_V_CP) cp $< $@
420422
423+m4/tsu_fix_makefile.m4: ../m4/tsu_fix_makefile.m4
424+ $(TSU_V_CP) cp $< $@
425+
421426 mp2pf: ../tools/mp2pf
422427 $(TSU_V_CP) cp $< $@
423428
--- trunk/beikaitoru/m4/tsu_fix_makefile.m4 (revision 0)
+++ trunk/beikaitoru/m4/tsu_fix_makefile.m4 (revision 670)
@@ -0,0 +1,82 @@
1+#
2+# SYNOPSIS
3+#
4+# TSU_FIX_MAKEFILE(EXTRA_PERL,EXTRA_COMMANDS,INIT_COMMANDS)
5+#
6+# DESCRIPTION
7+#
8+# Alter the Automake-generated Makefile to do certain things needed by
9+# Tsukurimashou that don't seem to be achievable in any simpler way.
10+# This works by adding a "fix-makefile" tag to config.status and
11+# making other changes to make sure that this tag will be executed any
12+# time the Makefile is rebuilt.
13+#
14+# This code uses a perl -pe loop over the Makefile, and additional hacks
15+# on the Makefile may be done by passing suitable Perl code in the
16+# EXTRA_PERL argument. Further shell commands that won't fit in that
17+# context may be added in the EXTRA_COMMANDS argument.
18+#
19+# Any shell commands given in INIT_COMMANDS are added to the
20+# corresponding argument of AC_CONFIG_COMMANDS.
21+#
22+# TSU_FIX_MAKEFILE must be used early in the configure.ac, in particular
23+# before anything that causes Autoconf to include stuff related to the
24+# C compiler.
25+#
26+# To make it more secure that the fix-makefile commands really will
27+# be executed, include a line like this one in Makefile.am:
28+# $(error This Makefile must be edited by Perl code in config.status before use)
29+# The default fix-makefile loop will remove it, but when present this
30+# line prevents anyone from using a Makefile that might somehow have
31+# been created and not processed by fix-makefile.
32+#
33+# The regular expression /ZZZZHACKZZZZ\s*=\s*/ will be removed from
34+# Makefile lines. This behaviour can be used to make a line of
35+# something other than variable definitions *look* like a variable
36+# definition, so that Automake will include it early in the generated
37+# Makefile, among the variable definitions.
38+#
39+# LICENSE
40+#
41+# This macro is released to the public domain by its author,
42+# Matthew Skala <mskala@ansuz.sooke.bc.ca>.
43+
44+#serial 1
45+
46+AC_DEFUN([TSU_FIX_MAKEFILE], [
47+ AC_CONFIG_COMMANDS([fix-makefile],
48+ [patsubst(["$PERL" -i -pe 'dnl
49+dnl
50+dnl Remove ZZZZHACKZZZZ= to allow forcing lines to be early
51+s/ZZZZHACKZZZZ\s*=\s*//;dnl
52+dnl
53+dnl Remove Makefile poison pill (to prevent user from overriding us)
54+$_="" if /\$\(error This Makefile must be /;dnl
55+dnl
56+dnl Any time the Makefile wants to run automake --foreign and not us,
57+dnl also run ourselves
58+s#(\$\(AUTOMAKE\) --foreign( Makefile)?)(?! && (\S+\s+)?./config)#dnl
59+\1 && \$(SHELL) ./config.status fix-makefile#;dnl
60+dnl
61+dnl Any time it wants to run config_status in the way that Automake does
62+dnl it to invoke depfiles, also run ourselves
63+s#config\.status \$\@ \$\(am__depfiles_maybe\)#dnl
64+config.status \$\@ fix-makefile \$(am__depfiles_maybe)#;dnl
65+dnl
66+dnl Change lines that look like Automake's "make clean" recipes, to
67+dnl use our pretty output format.
68+s#\t-\@?(test -z.* || )?rm -(r?)f (.*)#dnl
69+\t\$(TSU_V_RM) '"'"'\3'"'"' \$(TSU_V_CHOPPER)\ndnl
70+\t-\$(A''M_V_at)\1rm -\2f \3#;dnl
71+dnl
72+dnl Similar change for the VPATH-only files
73+s#\t-\@?(test \. =.* || test -z.* || )rm -(r?)f (.*)#dnl
74+\t-@\1(\$(TSU_V_RM) '"'"'\3'"'"' \$(TSU_V_CHOPPER) ; dnl
75+rm -\2f \3)#;dnl
76+dnl
77+$1' Makefile
78+$2],[dnl.*
79+],[])],
80+ [PERL=$PERL
81+$3])
82+])
--- trunk/beikaitoru/configure.ac (revision 669)
+++ trunk/beikaitoru/configure.ac (revision 670)
@@ -206,17 +206,11 @@
206206 parallel-tests silent-rules])
207207 AC_CONFIG_SRCDIR([subfont.mp])
208208 AC_CONFIG_MACRO_DIR([m4])
209-AC_REVISION([$Id: configure.ac 5785 2017-11-18 23:17:22Z mskala $])
209+AC_REVISION([$Id: configure.ac 5795 2017-11-21 21:32:34Z mskala $])
210210 AC_COPYRIGHT([Copyright (C) 2013 Matthew Skala])
211211 AC_SUBST([release_date],["March 7, 2013"])
212212 # this must be early so it will happen before depfiles
213-AC_CONFIG_COMMANDS([fix-makefile],
214- ["$PERL" -i -pe \
215-'s#\t-\@?(test -z.* || )?rm -(r?)f (.*)#'\
216-'\t\$(TSU_V_RM) '"'"'\3'"'"' \$(TSU_V_CHOPPER)\n'\
217-'\t-\$(A''M_V_at)\1rm -\2f \3#;' \
218- Makefile],
219- [PERL=$PERL])
213+TSU_FIX_MAKEFILE
220214 AM_SILENT_RULES
221215 #
222216 ############################################################################
@@ -258,23 +252,6 @@
258252 #
259253 ############################################################################
260254 #
261-# Check for parasite build
262-#
263-AC_MSG_CHECKING([whether we are building as a parasite])
264-AM_CONDITIONAL([COND_PARASITE],
265- [grep Tsukurimashou ../Makefile > /dev/null 2> /dev/null])
266-AM_COND_IF([COND_PARASITE],
267- [AC_MSG_RESULT([yes])
268- T1ASM=../t1asm/t1asm
269- parasite=yes],
270- [AC_MSG_RESULT([no])
271- AC_PATH_PROG([T1ASM],[t1asm])
272- parasite=no])
273-AC_SUBST([T1ASM])
274-AC_SUBST([parasite])
275-#
276-############################################################################
277-#
278255 # Checks for system services
279256 #
280257 AC_SYS_LONG_FILE_NAMES
@@ -289,14 +266,20 @@
289266 AC_ARG_ENABLE([colour-build],
290267 [AS_HELP_STRING([--disable-colour-build],
291268 [turn off ANSI colour in build scripts])],
292- [],
293- [enable_colour_build=yes])
269+ [],
270+ [enable_colour_build=yes])
294271 AC_ARG_ENABLE([color-build],[dnl],[],[enable_color_build=yes])
272+#]
295273 AC_ARG_ENABLE([docs],
296274 [AS_HELP_STRING([--disable-docs],
297275 [turn off PDF documentation])],
298- [],
299- [enable_docs=yes])
276+ [],
277+ [enable_docs=yes])
278+AC_ARG_ENABLE([parasite],
279+ [AS_HELP_STRING([--enable-parasite=[yes|no|auto]],
280+ [build as a parasite [auto]])],
281+ [],
282+ [enable_parasite=auto])
300283 #
301284 # Process user options
302285 #
@@ -328,6 +311,25 @@
328311 #
329312 ############################################################################
330313 #
314+# Check for parasite build
315+#
316+AC_MSG_CHECKING([whether we are building as a parasite])
317+AS_IF([test "x$enable_parasite" = "xauto"],
318+ [AS_IF([grep Tsukurimashou ../Makefile > /dev/null 2> /dev/null],
319+ [enable_parasite=yes],
320+ [enable_parasite=no])])
321+AC_MSG_RESULT([$enable_parasite])
322+AM_CONDITIONAL([COND_PARASITE],[test "x$enable_parasite" = "xyes"])
323+AM_COND_IF([COND_PARASITE],
324+ [T1ASM=../t1asm/t1asm
325+ parasite=yes],
326+ [AC_PATH_PROG([T1ASM],[t1asm])
327+ parasite=no])
328+AC_SUBST([T1ASM])
329+AC_SUBST([parasite])
330+#
331+############################################################################
332+#
331333 # Generate output
332334 #
333335 AC_SUBST([andt],[])
@@ -387,3 +389,6 @@
387389 AS_ECHO(["is quite likely to fail. It would be better to eliminate all illegal"])
388390 AS_ECHO(["characters from pathnames before continuing."])
389391 ])
392+AS_IF([test "x$parasite" = "xyes"],
393+ [TSU_COLOURISE([Parasite build enabled.],[6])
394+ AS_ECHO([])])
--- trunk/icemap/m4/tsu_fix_makefile.m4 (revision 0)
+++ trunk/icemap/m4/tsu_fix_makefile.m4 (revision 670)
@@ -0,0 +1,82 @@
1+#
2+# SYNOPSIS
3+#
4+# TSU_FIX_MAKEFILE(EXTRA_PERL,EXTRA_COMMANDS,INIT_COMMANDS)
5+#
6+# DESCRIPTION
7+#
8+# Alter the Automake-generated Makefile to do certain things needed by
9+# Tsukurimashou that don't seem to be achievable in any simpler way.
10+# This works by adding a "fix-makefile" tag to config.status and
11+# making other changes to make sure that this tag will be executed any
12+# time the Makefile is rebuilt.
13+#
14+# This code uses a perl -pe loop over the Makefile, and additional hacks
15+# on the Makefile may be done by passing suitable Perl code in the
16+# EXTRA_PERL argument. Further shell commands that won't fit in that
17+# context may be added in the EXTRA_COMMANDS argument.
18+#
19+# Any shell commands given in INIT_COMMANDS are added to the
20+# corresponding argument of AC_CONFIG_COMMANDS.
21+#
22+# TSU_FIX_MAKEFILE must be used early in the configure.ac, in particular
23+# before anything that causes Autoconf to include stuff related to the
24+# C compiler.
25+#
26+# To make it more secure that the fix-makefile commands really will
27+# be executed, include a line like this one in Makefile.am:
28+# $(error This Makefile must be edited by Perl code in config.status before use)
29+# The default fix-makefile loop will remove it, but when present this
30+# line prevents anyone from using a Makefile that might somehow have
31+# been created and not processed by fix-makefile.
32+#
33+# The regular expression /ZZZZHACKZZZZ\s*=\s*/ will be removed from
34+# Makefile lines. This behaviour can be used to make a line of
35+# something other than variable definitions *look* like a variable
36+# definition, so that Automake will include it early in the generated
37+# Makefile, among the variable definitions.
38+#
39+# LICENSE
40+#
41+# This macro is released to the public domain by its author,
42+# Matthew Skala <mskala@ansuz.sooke.bc.ca>.
43+
44+#serial 1
45+
46+AC_DEFUN([TSU_FIX_MAKEFILE], [
47+ AC_CONFIG_COMMANDS([fix-makefile],
48+ [patsubst(["$PERL" -i -pe 'dnl
49+dnl
50+dnl Remove ZZZZHACKZZZZ= to allow forcing lines to be early
51+s/ZZZZHACKZZZZ\s*=\s*//;dnl
52+dnl
53+dnl Remove Makefile poison pill (to prevent user from overriding us)
54+$_="" if /\$\(error This Makefile must be /;dnl
55+dnl
56+dnl Any time the Makefile wants to run automake --foreign and not us,
57+dnl also run ourselves
58+s#(\$\(AUTOMAKE\) --foreign( Makefile)?)(?! && (\S+\s+)?./config)#dnl
59+\1 && \$(SHELL) ./config.status fix-makefile#;dnl
60+dnl
61+dnl Any time it wants to run config_status in the way that Automake does
62+dnl it to invoke depfiles, also run ourselves
63+s#config\.status \$\@ \$\(am__depfiles_maybe\)#dnl
64+config.status \$\@ fix-makefile \$(am__depfiles_maybe)#;dnl
65+dnl
66+dnl Change lines that look like Automake's "make clean" recipes, to
67+dnl use our pretty output format.
68+s#\t-\@?(test -z.* || )?rm -(r?)f (.*)#dnl
69+\t\$(TSU_V_RM) '"'"'\3'"'"' \$(TSU_V_CHOPPER)\ndnl
70+\t-\$(A''M_V_at)\1rm -\2f \3#;dnl
71+dnl
72+dnl Similar change for the VPATH-only files
73+s#\t-\@?(test \. =.* || test -z.* || )rm -(r?)f (.*)#dnl
74+\t-@\1(\$(TSU_V_RM) '"'"'\3'"'"' \$(TSU_V_CHOPPER) ; dnl
75+rm -\2f \3)#;dnl
76+dnl
77+$1' Makefile
78+$2],[dnl.*
79+],[])],
80+ [PERL=$PERL
81+$3])
82+])
--- trunk/icemap/configure.ac (revision 669)
+++ trunk/icemap/configure.ac (revision 670)
@@ -125,15 +125,9 @@
125125 AC_REVISION([$Id: configure.ac 1015 2011-12-15 22:24:32Z mskala $])
126126 AC_COPYRIGHT([Copyright (C) 2014 Matthew Skala])
127127 AC_SUBST([release_date],["November 1, 2014"])
128+# this must be early so it will happen before depfiles
129+TSU_FIX_MAKEFILE
128130 AM_SILENT_RULES
129-# this must be early so it will happen before depfiles
130-AC_CONFIG_COMMANDS([fix-makefile],
131- ["$PERL" -i -pe \
132-'s#\t-\@?(test -z.* || )?rm -(r?)f (.*)#'\
133-'\t\$(TSU_V_RM) '"'"'\3'"'"' \$(TSU_V_CHOPPER)\n'\
134-'\t-\$(A''M_V_at)\1rm -\2f \3#;' \
135- Makefile],
136- [PERL=$PERL])
137131 #
138132 ############################################################################
139133 #
@@ -162,25 +156,6 @@
162156 #
163157 ############################################################################
164158 #
165-# Check for parasite build
166-#
167-AC_MSG_CHECKING([whether we are building as a parasite])
168-AM_CONDITIONAL([COND_PARASITE],
169- [grep Tsukurimashou ../Makefile > /dev/null 2> /dev/null])
170-AM_COND_IF([COND_PARASITE],
171- [AC_MSG_RESULT([yes])],
172- [AC_MSG_RESULT([no])])
173-AM_CONDITIONAL([COND_PARASITE],
174- [grep Tsukurimashou ../Makefile > /dev/null 2> /dev/null])
175-AM_COND_IF([COND_PARASITE],
176- [AC_MSG_RESULT([yes])
177- parasite=yes],
178- [AC_MSG_RESULT([no])
179- parasite=no])
180-AC_SUBST([parasite])
181-#
182-############################################################################
183-#
184159 # Checks for libraries.
185160 #
186161 AC_CHECK_LIB([bdd],[bdd_init],[
@@ -250,17 +225,24 @@
250225 AC_ARG_ENABLE([gcov],
251226 [AS_HELP_STRING([--enable-gcov],
252227 [use Gcov to test the test suite])],
253- [],
254- [enable_gcov=no])
228+ [],
229+ [enable_gcov=no])
255230 AM_CONDITIONAL([COND_GCOV],[test '!' "$enable_gcov" = no])
256231 #
257232 AC_ARG_ENABLE([colour-build],
258233 [AS_HELP_STRING([--disable-colour-build],
259234 [turn off ANSI colour in build scripts])],
260- [],
261- [enable_colour_build=yes])
235+ [],
236+ [enable_colour_build=yes])
262237 AC_ARG_ENABLE([color-build],[dnl],[],[enable_color_build=yes])
238+# ]
263239 #
240+AC_ARG_ENABLE([parasite],
241+ [AS_HELP_STRING([--enable-parasite=[yes|no|auto]],
242+ [build as a parasite [auto]])],
243+ [],
244+ [enable_parasite=auto])
245+#
264246 # Process user options
265247 #
266248 tsu_colour=yes
@@ -276,6 +258,22 @@
276258 #
277259 ############################################################################
278260 #
261+# Check for parasite build
262+#
263+AC_MSG_CHECKING([whether we are building as a parasite])
264+AS_IF([test "x$enable_parasite" = "xauto"],
265+ [AS_IF([grep Tsukurimashou ../Makefile > /dev/null 2> /dev/null],
266+ [enable_parasite=yes],
267+ [enable_parasite=no])])
268+AC_MSG_RESULT([$enable_parasite])
269+AM_CONDITIONAL([COND_PARASITE],[test "x$enable_parasite" = "xyes"])
270+AM_COND_IF([COND_PARASITE],
271+ [parasite=yes],
272+ [parasite=no])
273+AC_SUBST([parasite])
274+#
275+############################################################################
276+#
279277 # Generate output
280278 #
281279 AC_SUBST([andt],[])
@@ -308,3 +306,6 @@
308306 AS_ECHO(["is quite likely to fail. It would be better to eliminate all illegal"])
309307 AS_ECHO(["characters from pathnames before continuing."])
310308 ])
309+AS_IF([test "x$parasite" = "xyes"],
310+ [AS_ECHO(["Parasite build enabled."])
311+ AS_ECHO([])])
--- trunk/icemap/Makefile.am (revision 669)
+++ trunk/icemap/Makefile.am (revision 670)
@@ -36,6 +36,8 @@
3636 comma:=,
3737 percent=%
3838
39+$(error This Makefile must be edited by Perl code in config.status before use)
40+
3941 SHELL=$(if $(wildcard @KLEKNEV@),@KLEKNEV@,$(if \
4042 $(wildcard /bin/bash),/bin/bash,/bin/sh))
4143
@@ -256,6 +258,9 @@
256258 m4/tsu_colourise.m4: ../m4/tsu_colourise.m4
257259 $(TSU_V_CP) cp $< $@
258260
261+m4/tsu_fix_makefile.m4: ../m4/tsu_fix_makefile.m4
262+ $(TSU_V_CP) cp $< $@
263+
259264 endif
260265
261266 ############################################################################
--- trunk/kleknev/Makefile.am (revision 669)
+++ trunk/kleknev/Makefile.am (revision 670)
@@ -36,6 +36,8 @@
3636 comma:=,
3737 percent=%
3838
39+$(error This Makefile must be edited by Perl code in config.status before use)
40+
3941 SHELL=$(if $(wildcard @KLEKNEV@),@KLEKNEV@,$(if \
4042 $(wildcard /bin/bash),/bin/bash,/bin/sh))
4143
@@ -239,6 +241,9 @@
239241 m4/tsu_colourise.m4: ../m4/tsu_colourise.m4
240242 $(TSU_V_CP) cp $< $@
241243
244+m4/tsu_fix_makefile.m4: ../m4/tsu_fix_makefile.m4
245+ $(TSU_V_CP) cp $< $@
246+
242247 endif
243248
244249 ############################################################################
--- trunk/kleknev/m4/tsu_fix_makefile.m4 (revision 0)
+++ trunk/kleknev/m4/tsu_fix_makefile.m4 (revision 670)
@@ -0,0 +1,82 @@
1+#
2+# SYNOPSIS
3+#
4+# TSU_FIX_MAKEFILE(EXTRA_PERL,EXTRA_COMMANDS,INIT_COMMANDS)
5+#
6+# DESCRIPTION
7+#
8+# Alter the Automake-generated Makefile to do certain things needed by
9+# Tsukurimashou that don't seem to be achievable in any simpler way.
10+# This works by adding a "fix-makefile" tag to config.status and
11+# making other changes to make sure that this tag will be executed any
12+# time the Makefile is rebuilt.
13+#
14+# This code uses a perl -pe loop over the Makefile, and additional hacks
15+# on the Makefile may be done by passing suitable Perl code in the
16+# EXTRA_PERL argument. Further shell commands that won't fit in that
17+# context may be added in the EXTRA_COMMANDS argument.
18+#
19+# Any shell commands given in INIT_COMMANDS are added to the
20+# corresponding argument of AC_CONFIG_COMMANDS.
21+#
22+# TSU_FIX_MAKEFILE must be used early in the configure.ac, in particular
23+# before anything that causes Autoconf to include stuff related to the
24+# C compiler.
25+#
26+# To make it more secure that the fix-makefile commands really will
27+# be executed, include a line like this one in Makefile.am:
28+# $(error This Makefile must be edited by Perl code in config.status before use)
29+# The default fix-makefile loop will remove it, but when present this
30+# line prevents anyone from using a Makefile that might somehow have
31+# been created and not processed by fix-makefile.
32+#
33+# The regular expression /ZZZZHACKZZZZ\s*=\s*/ will be removed from
34+# Makefile lines. This behaviour can be used to make a line of
35+# something other than variable definitions *look* like a variable
36+# definition, so that Automake will include it early in the generated
37+# Makefile, among the variable definitions.
38+#
39+# LICENSE
40+#
41+# This macro is released to the public domain by its author,
42+# Matthew Skala <mskala@ansuz.sooke.bc.ca>.
43+
44+#serial 1
45+
46+AC_DEFUN([TSU_FIX_MAKEFILE], [
47+ AC_CONFIG_COMMANDS([fix-makefile],
48+ [patsubst(["$PERL" -i -pe 'dnl
49+dnl
50+dnl Remove ZZZZHACKZZZZ= to allow forcing lines to be early
51+s/ZZZZHACKZZZZ\s*=\s*//;dnl
52+dnl
53+dnl Remove Makefile poison pill (to prevent user from overriding us)
54+$_="" if /\$\(error This Makefile must be /;dnl
55+dnl
56+dnl Any time the Makefile wants to run automake --foreign and not us,
57+dnl also run ourselves
58+s#(\$\(AUTOMAKE\) --foreign( Makefile)?)(?! && (\S+\s+)?./config)#dnl
59+\1 && \$(SHELL) ./config.status fix-makefile#;dnl
60+dnl
61+dnl Any time it wants to run config_status in the way that Automake does
62+dnl it to invoke depfiles, also run ourselves
63+s#config\.status \$\@ \$\(am__depfiles_maybe\)#dnl
64+config.status \$\@ fix-makefile \$(am__depfiles_maybe)#;dnl
65+dnl
66+dnl Change lines that look like Automake's "make clean" recipes, to
67+dnl use our pretty output format.
68+s#\t-\@?(test -z.* || )?rm -(r?)f (.*)#dnl
69+\t\$(TSU_V_RM) '"'"'\3'"'"' \$(TSU_V_CHOPPER)\ndnl
70+\t-\$(A''M_V_at)\1rm -\2f \3#;dnl
71+dnl
72+dnl Similar change for the VPATH-only files
73+s#\t-\@?(test \. =.* || test -z.* || )rm -(r?)f (.*)#dnl
74+\t-@\1(\$(TSU_V_RM) '"'"'\3'"'"' \$(TSU_V_CHOPPER) ; dnl
75+rm -\2f \3)#;dnl
76+dnl
77+$1' Makefile
78+$2],[dnl.*
79+],[])],
80+ [PERL=$PERL
81+$3])
82+])
--- trunk/kleknev/configure.ac (revision 669)
+++ trunk/kleknev/configure.ac (revision 670)
@@ -125,15 +125,9 @@
125125 AC_REVISION([$Id: configure.ac 1015 2011-12-15 22:24:32Z mskala $])
126126 AC_COPYRIGHT([Copyright (C) 2013 Matthew Skala])
127127 AC_SUBST([release_date],["March 7, 2013"])
128+# this must be early so it will happen before depfiles
129+TSU_FIX_MAKEFILE
128130 AM_SILENT_RULES
129-# this must be early so it will happen before depfiles
130-AC_CONFIG_COMMANDS([fix-makefile],
131- ["$PERL" -i -pe \
132-'s#\t-\@?(test -z.* || )?rm -(r?)f (.*)#'\
133-'\t\$(TSU_V_RM) '"'"'\3'"'"' \$(TSU_V_CHOPPER)\n'\
134-'\t-\$(A''M_V_at)\1rm -\2f \3#;' \
135- Makefile],
136- [PERL=$PERL])
137131 #
138132 ############################################################################
139133 #
@@ -166,20 +160,6 @@
166160 #
167161 ############################################################################
168162 #
169-# Check for parasite build
170-#
171-AC_MSG_CHECKING([whether we are building as a parasite])
172-AM_CONDITIONAL([COND_PARASITE],
173- [grep Tsukurimashou ../Makefile > /dev/null 2> /dev/null])
174-AM_COND_IF([COND_PARASITE],
175- [AC_MSG_RESULT([yes])
176- parasite=yes],
177- [AC_MSG_RESULT([no])
178- parasite=no])
179-AC_SUBST([parasite])
180-#
181-############################################################################
182-#
183163 # Checks for libraries.
184164 #
185165 AX_PERL_MODULE_VERSION([XML::Parser 2.36],[have_perlxml=yes],
@@ -223,23 +203,30 @@
223203 AC_ARG_ENABLE([gcov],
224204 [AS_HELP_STRING([--enable-gcov],
225205 [use Gcov to test the test suite])],
226- [],
227- [enable_gcov=no])
206+ [],
207+ [enable_gcov=no])
228208 AM_CONDITIONAL([COND_GCOV],[test '!' "$enable_gcov" = no])
229209 #
230210 AC_ARG_ENABLE([colour-build],
231211 [AS_HELP_STRING([--disable-colour-build],
232212 [turn off ANSI colour in build scripts])],
233- [],
234- [enable_colour_build=yes])
213+ [],
214+ [enable_colour_build=yes])
235215 AC_ARG_ENABLE([color-build],[dnl],[],[enable_color_build=yes])
216+# ]
236217 #
237218 AC_ARG_ENABLE([docs],
238219 [AS_HELP_STRING([--disable-docs],
239220 [turn off PDF documentation])],
240- [],
241- [enable_docs=yes])
221+ [],
222+ [enable_docs=yes])
242223 #
224+AC_ARG_ENABLE([parasite],
225+ [AS_HELP_STRING([--enable-parasite=[yes|no|auto]],
226+ [build as a parasite [auto]])],
227+ [],
228+ [enable_parasite=auto])
229+#
243230 # Process user options
244231 #
245232 tsu_colour=yes
@@ -259,6 +246,22 @@
259246 #
260247 ############################################################################
261248 #
249+# Check for parasite build
250+#
251+AC_MSG_CHECKING([whether we are building as a parasite])
252+AS_IF([test "x$enable_parasite" = "xauto"],
253+ [AS_IF([grep Tsukurimashou ../Makefile > /dev/null 2> /dev/null],
254+ [enable_parasite=yes],
255+ [enable_parasite=no])])
256+AC_MSG_RESULT([$enable_parasite])
257+AM_CONDITIONAL([COND_PARASITE],[test "x$enable_parasite" = "xyes"])
258+AM_COND_IF([COND_PARASITE],
259+ [parasite=yes],
260+ [parasite=no])
261+AC_SUBST([parasite])
262+#
263+############################################################################
264+#
262265 # Generate output
263266 #
264267 AC_SUBST([andt],[])
@@ -297,3 +300,6 @@
297300 AS_ECHO(["is quite likely to fail. It would be better to eliminate all illegal"])
298301 AS_ECHO(["characters from pathnames before continuing."])
299302 ])
303+AS_IF([test "x$parasite" = "xyes"],
304+ [TSU_COLOURISE([Parasite build enabled.],[6])
305+ AS_ECHO([])])
--- trunk/fontanvil/configure.ac (revision 669)
+++ trunk/fontanvil/configure.ac (revision 670)
@@ -141,21 +141,14 @@
141141 AC_REVISION([$Id: configure.ac 2831 2014-03-02 07:18:54Z mskala $])
142142 AC_COPYRIGHT([Copyright (C) 2014, 2015 Matthew Skala])
143143 AC_SUBST([release_date],["December 8, 2015"])
144-AC_CONFIG_COMMANDS([fix-makefile],
144+# this must be early so it will happen before depfiles
145+TSU_FIX_MAKEFILE([],
145146 [if test '!' "x$ICEMAP" = "x" ; then "$PERL" -i -pe \
146147 's/^(@<:@a-z\-@:>@+:) (\$\(BUILT_SOURCES\))/'\
147-'\1\n\t@\$(MAKE) -q \2 || \$(MAKE) \$(AM_MAKEFLAGS) \2/;' Makefile ; fi ; \
148-"$PERL" -i -pe \
149-'$_="" if /\$\(error This Makefile must be /;'\
150-'s#\t-\@?(test -z.* || )?rm -(r?)f (.*)#'\
151-'\t\$(TSU_V_RM) '"'"'\3'"'"' \$(TSU_V_CHOPPER)\n'\
152-'\t-\$(A''M_V_at)\1rm -\2f \3#;' \
153- Makefile],
154- [PERL=$PERL
155- ICEMAP=$ICEMAP])
148+'\1\n\t@\$(MAKE) -q \2 || \$(MAKE) \$(AM_MAKEFLAGS) \2/;' Makefile ; fi],
149+ [ICEMAP=$ICEMAP])
156150 AM_SILENT_RULES
157151 AC_USE_SYSTEM_EXTENSIONS
158-# this must be early so it will happen before depfiles
159152 #
160153 ############################################################################
161154 #
@@ -250,25 +243,6 @@
250243 #
251244 ############################################################################
252245 #
253-# Check for parasite build
254-#
255-AC_MSG_CHECKING([whether we are building as a parasite])
256-AM_CONDITIONAL([COND_PARASITE],
257- [grep Tsukurimashou ../Makefile > /dev/null 2> /dev/null])
258-AM_COND_IF([COND_PARASITE],
259- [AC_MSG_RESULT([yes])
260- AS_IF([test "x$ICEMAP" = "x"],
261- [AC_MSG_WARN([Depending on locally-built Icemap])
262- ICEMAP=$PWD/../icemap/icemap])
263- parasite=yes],
264- [AC_MSG_RESULT([no])
265- parasite=no])
266-AC_SUBST([parasite])
267-AS_IF([test "x$ICEMAP" = "x"],[ICEMAP=no])
268-AM_CONDITIONAL([COND_ICEMAP],[test '!' "x$ICEMAP" = "xno"])
269-#
270-############################################################################
271-#
272246 # Checks for libraries.
273247 #
274248 AC_SEARCH_LIBS([cos],[m])
@@ -514,8 +488,8 @@
514488 AC_ARG_ENABLE([colour-build],
515489 [AS_HELP_STRING([--disable-colour-build],
516490 [turn off ANSI colour in build scripts])],
517- [],
518- [enable_colour_build=yes])
491+ [],
492+ [enable_colour_build=yes])
519493 AC_ARG_ENABLE([color-build],[dnl],[],[enable_color_build=yes])
520494 #
521495 AC_ARG_ENABLE([debug],
@@ -528,14 +502,20 @@
528502 AC_ARG_ENABLE([download],
529503 [AS_HELP_STRING([--enable-download=[yes|no]],
530504 [automatically download Unicode data from UNICODE_URL [no]])],
531- [],
532- [enable_download=no])
505+ [],
506+ [enable_download=no])
533507 #
508+AC_ARG_ENABLE([parasite],
509+ [AS_HELP_STRING([--enable-parasite=[yes|no|auto]],
510+ [build as a parasite [auto]])],
511+ [],
512+ [enable_parasite=auto])
513+#
534514 AC_ARG_WITH([valgrind],
535515 [AS_HELP_STRING([--with-valgrind],
536516 [use Valgrind for tests if available])],
537- [],
538- [with_valgrind=no])
517+ [],
518+ [with_valgrind=no])
539519 #
540520 # Process user options
541521 #
@@ -556,6 +536,28 @@
556536 #
557537 ############################################################################
558538 #
539+# Check for parasite build
540+#
541+AC_MSG_CHECKING([whether we are building as a parasite])
542+AS_IF([test "x$enable_parasite" = "xauto"],
543+ [AS_IF([grep Tsukurimashou ../Makefile > /dev/null 2> /dev/null],
544+ [enable_parasite=yes],
545+ [enable_parasite=no])])
546+AC_MSG_RESULT([$enable_parasite])
547+AM_CONDITIONAL([COND_PARASITE],[test "x$enable_parasite" = "xyes"])
548+AM_COND_IF([COND_PARASITE],
549+ [AC_MSG_RESULT([yes])
550+ AS_IF([test "x$ICEMAP" = "x"],
551+ [AC_MSG_WARN([Depending on locally-built Icemap])
552+ ICEMAP=$PWD/../icemap/icemap])
553+ parasite=yes],
554+ [parasite=no])
555+AC_SUBST([parasite])
556+AS_IF([test "x$ICEMAP" = "x"],[ICEMAP=no])
557+AM_CONDITIONAL([COND_ICEMAP],[test '!' "x$ICEMAP" = "xno"])
558+#
559+############################################################################
560+#
559561 # Generate output
560562 #
561563 AH_TOP([#ifndef _FF_CONFIG_H
@@ -715,3 +717,6 @@
715717 AS_ECHO(["is quite likely to fail. It would be better to eliminate all illegal"])
716718 AS_ECHO(["characters from pathnames before continuing."])
717719 ])
720+AS_IF([test "x$parasite" = "xyes"],
721+ [TSU_COLOURISE([Parasite build enabled.],[6])
722+ AS_ECHO([])])
--- trunk/fontanvil/Makefile.am (revision 669)
+++ trunk/fontanvil/Makefile.am (revision 670)
@@ -473,7 +473,8 @@
473473 doc/fontanvil.pdf: $(texfiles) doc/mitsuba.cls \
474474 doc/quixote-dore.jpg doc/quixote-daumier.jpg
475475 $(AM_V_at)rm -f fontanvil.aux
476- $(AM_V_at)if test '!' "x$(VPATH)" = "x" ; then \
476+ $(AM_V_at)if test '!' "$(realpath $(mvp)/doc)" = \
477+ "$(realpath ./doc)" ; then \
477478 cp $(mvp)/doc/*.tex $(mvp)/doc/*.jpg doc/ ; fi
478479 $(AM_V_at)I=1;$(TSU_V_TEXL) cd doc ; \
479480 '$(PDFLATEX)' fontanvil.tex $(TSU_V_REDIR)
@@ -505,7 +506,7 @@
505506 DISTCLEANFILES = \
506507 aminclude.am _stdint.h \
507508 inc/fontanvil-config.h inc/stamp-h1 \
508- $(filter-out dat/glyphlist.txt,$(wildcard dat/*)) \
509+ $(filter-out $(dist_noinst_DATA),$(wildcard dat/*)) \
509510 */.dirstamp
510511
511512 distclean-local:
@@ -594,6 +595,9 @@
594595 m4/tsu_colourise.m4: ../m4/tsu_colourise.m4
595596 $(TSU_V_CP) cp $< $@
596597
598+m4/tsu_fix_makefile.m4: ../m4/tsu_fix_makefile.m4
599+ $(TSU_V_CP) cp $< $@
600+
597601 dat/UnicodeData.txt: $(wildcard ../idsgrep/UnicodeData.txt)
598602 $(MKDIR_P) dat
599603 $(TSU_V_CP) if test -s ../idsgrep/UnicodeData.txt ; \
--- trunk/fontanvil/m4/tsu_fix_makefile.m4 (revision 0)
+++ trunk/fontanvil/m4/tsu_fix_makefile.m4 (revision 670)
@@ -0,0 +1,82 @@
1+#
2+# SYNOPSIS
3+#
4+# TSU_FIX_MAKEFILE(EXTRA_PERL,EXTRA_COMMANDS,INIT_COMMANDS)
5+#
6+# DESCRIPTION
7+#
8+# Alter the Automake-generated Makefile to do certain things needed by
9+# Tsukurimashou that don't seem to be achievable in any simpler way.
10+# This works by adding a "fix-makefile" tag to config.status and
11+# making other changes to make sure that this tag will be executed any
12+# time the Makefile is rebuilt.
13+#
14+# This code uses a perl -pe loop over the Makefile, and additional hacks
15+# on the Makefile may be done by passing suitable Perl code in the
16+# EXTRA_PERL argument. Further shell commands that won't fit in that
17+# context may be added in the EXTRA_COMMANDS argument.
18+#
19+# Any shell commands given in INIT_COMMANDS are added to the
20+# corresponding argument of AC_CONFIG_COMMANDS.
21+#
22+# TSU_FIX_MAKEFILE must be used early in the configure.ac, in particular
23+# before anything that causes Autoconf to include stuff related to the
24+# C compiler.
25+#
26+# To make it more secure that the fix-makefile commands really will
27+# be executed, include a line like this one in Makefile.am:
28+# $(error This Makefile must be edited by Perl code in config.status before use)
29+# The default fix-makefile loop will remove it, but when present this
30+# line prevents anyone from using a Makefile that might somehow have
31+# been created and not processed by fix-makefile.
32+#
33+# The regular expression /ZZZZHACKZZZZ\s*=\s*/ will be removed from
34+# Makefile lines. This behaviour can be used to make a line of
35+# something other than variable definitions *look* like a variable
36+# definition, so that Automake will include it early in the generated
37+# Makefile, among the variable definitions.
38+#
39+# LICENSE
40+#
41+# This macro is released to the public domain by its author,
42+# Matthew Skala <mskala@ansuz.sooke.bc.ca>.
43+
44+#serial 1
45+
46+AC_DEFUN([TSU_FIX_MAKEFILE], [
47+ AC_CONFIG_COMMANDS([fix-makefile],
48+ [patsubst(["$PERL" -i -pe 'dnl
49+dnl
50+dnl Remove ZZZZHACKZZZZ= to allow forcing lines to be early
51+s/ZZZZHACKZZZZ\s*=\s*//;dnl
52+dnl
53+dnl Remove Makefile poison pill (to prevent user from overriding us)
54+$_="" if /\$\(error This Makefile must be /;dnl
55+dnl
56+dnl Any time the Makefile wants to run automake --foreign and not us,
57+dnl also run ourselves
58+s#(\$\(AUTOMAKE\) --foreign( Makefile)?)(?! && (\S+\s+)?./config)#dnl
59+\1 && \$(SHELL) ./config.status fix-makefile#;dnl
60+dnl
61+dnl Any time it wants to run config_status in the way that Automake does
62+dnl it to invoke depfiles, also run ourselves
63+s#config\.status \$\@ \$\(am__depfiles_maybe\)#dnl
64+config.status \$\@ fix-makefile \$(am__depfiles_maybe)#;dnl
65+dnl
66+dnl Change lines that look like Automake's "make clean" recipes, to
67+dnl use our pretty output format.
68+s#\t-\@?(test -z.* || )?rm -(r?)f (.*)#dnl
69+\t\$(TSU_V_RM) '"'"'\3'"'"' \$(TSU_V_CHOPPER)\ndnl
70+\t-\$(A''M_V_at)\1rm -\2f \3#;dnl
71+dnl
72+dnl Similar change for the VPATH-only files
73+s#\t-\@?(test \. =.* || test -z.* || )rm -(r?)f (.*)#dnl
74+\t-@\1(\$(TSU_V_RM) '"'"'\3'"'"' \$(TSU_V_CHOPPER) ; dnl
75+rm -\2f \3)#;dnl
76+dnl
77+$1' Makefile
78+$2],[dnl.*
79+],[])],
80+ [PERL=$PERL
81+$3])
82+])
--- trunk/configure.ac (revision 669)
+++ trunk/configure.ac (revision 670)
@@ -190,7 +190,7 @@
190190 # Autoconf initialization
191191 #
192192 AC_PREREQ([2.67])
193-AC_INIT([Tsukurimashou],[0.10],[mskala@ansuz.sooke.bc.ca],[tsukurimashou],
193+AC_INIT([Tsukurimashou],[0.11pre],[mskala@ansuz.sooke.bc.ca],[tsukurimashou],
194194 [[http://tsukurimashou.osdn.jp/]])
195195 AC_PRESERVE_HELP_ORDER
196196 AM_INIT_AUTOMAKE([foreign check-news color-tests dist-zip no-dist-gzip
@@ -199,26 +199,15 @@
199199 AC_CONFIG_SRCDIR([hamlog/hamlog])
200200 AC_CONFIG_HEADERS([config.h])
201201 AC_CONFIG_MACRO_DIR([m4])
202-AC_REVISION([$Id: configure.ac 5782 2017-11-18 20:45:53Z mskala $])
202+AC_REVISION([$Id: configure.ac 5795 2017-11-21 21:32:34Z mskala $])
203203 AC_COPYRIGHT([Copyright (C) 2011, 2012, 2013, 2014, 2015, 2016, 2017 Matthew Skala])
204204 AC_SUBST([release_date],["November 17, 2017"])
205+# this must be early so it will happen before depfiles
206+TSU_FIX_MAKEFILE([dnl
207+ s#TESTS = #TESTS = \$(otf_DATA) #;dnl
208+ s#^all: config.h#all: kill-empty config.h#],
209+ [rm -f pfb-stamp* chl-stamp])
205210 AM_SILENT_RULES
206-# this must be early so it will happen before depfiles
207-AC_CONFIG_COMMANDS([fix-makefile],
208- ["$PERL" -i -pe \
209-'s/ZZZZHACKZZZZ\s*=\s*//;$_="" if /\$\(error This Makefile must be /;'\
210-'s#(\$\(AUTOMAKE\) --foreign( Makefile)?)(?! && ./config)#'\
211-'\1 && \$(SHELL) ./config.status fix-makefile#;'\
212-'s#config\.status \$\@ \$\(am__depfiles_maybe\)#'\
213-'config.status \$\@ fix-makefile \$(am__depfiles_maybe)#;'\
214-'s#TESTS = #TESTS = \$(otf_DATA) #;'\
215-'s#^all: config.h#all: kill-empty config.h#;'\
216-'s#\t-\@?(test -z.* || )?rm -(r?)f (.*)#'\
217-'\t\$(TSU_V_RM) '"'"'\3'"'"' \$(TSU_V_CHOPPER)\n'\
218-'\t-\$(A''M_V_at)\1rm -\2f \3#;' \
219- Makefile
220- rm -f pfb-stamp* chl-stamp],
221- [PERL=$PERL])
222211 #
223212 ############################################################################
224213 #
@@ -358,80 +347,80 @@
358347 AC_ARG_ENABLE([bitmap-kludge],
359348 [AS_HELP_STRING([--enable-bitmap-kludge],
360349 [generate bitmaps in 1000-glyph blocks])],
361- [enable_bitmap_kludge=yes],
362- [enable_bitmap_kludge=no])
350+ [],
351+ [enable_bitmap_kludge=no])
363352 AC_ARG_ENABLE([build-hacking],
364353 [AS_HELP_STRING([--disable-build-hacking],
365354 [turn off Autotools compatibility test])],
366- [],
367- [enable_build_hacking="test "])
355+ [],
356+ [enable_build_hacking="test "])
368357 AC_ARG_ENABLE([chars],
369358 [AS_HELP_STRING([--enable-chars[=TAGS]],
370359 [character set(s) to build [all]])],
371- [],
372- [enable_chars=all])
360+ [],
361+ [enable_chars=all])
373362 AC_ARG_ENABLE([colour-build],
374363 [AS_HELP_STRING([--disable-colour-build],
375364 [turn off ANSI colour in build scripts])],
376- [],
377- [enable_colour_build=yes])
365+ [],
366+ [enable_colour_build=yes])
378367 AC_ARG_ENABLE([color-build],[dnl],[],[enable_color_build=yes])
379368 AC_ARG_ENABLE([docs],
380369 [AS_HELP_STRING([--disable-docs],
381370 [turn off PDF documentation])],
382- [],
383- [enable_docs=yes])
371+ [],
372+ [enable_docs=yes])
384373 AC_ARG_ENABLE([download],
385374 [AS_HELP_STRING([--enable-download=[yes|no]],
386375 [automatically download Unicode data from UNICODE_URL [no]])],
387- [],
388- [enable_download=no])
376+ [],
377+ [enable_download=no])
389378 AC_ARG_ENABLE([ff-debug],
390379 [AS_HELP_STRING([--disable-ff-debug],
391380 [turn off FontAnvil debuggery warning])],
392- [],
393- [enable_ff_debug="test "])
381+ [],
382+ [enable_ff_debug="test "])
394383 AC_ARG_ENABLE([kanji-chart],
395384 [AS_HELP_STRING([--enable-kanji-chart],
396385 [kanji coverage chart [auto]])],
397- [],
398- [enable_kanji_chart=auto])
386+ [],
387+ [enable_kanji_chart=auto])
399388 AC_ARG_ENABLE([ot-features],
400389 [AS_HELP_STRING([--enable-ot-features[=TAGS]],
401390 [OpenType feature(s) to include [all,-pfed]])],
402- [],
403- [ot_feature_default_warn=yes
404- enable_ot_features='all,-pfed'])
391+ [],
392+ [ot_feature_default_warn=yes
393+ enable_ot_features='all,-pfed'])
405394 AC_ARG_ENABLE([parasites],
406395 [AS_HELP_STRING([--enable-parasites[=TAGS]],
407396 [Parasite package(s) to build [auto]])],
408- [],
409- [enable_parasites='auto'])
397+ [],
398+ [enable_parasites='auto'])
410399 AC_ARG_ENABLE([proofs],
411400 [AS_HELP_STRING([--enable-proofs=[yes|no|book]],
412401 [proofs and pretty-printed source [no]])],
413- [],
414- [enable_proofs=no])
402+ [],
403+ [enable_proofs=no])
415404 AC_ARG_ENABLE([proportional],
416405 [AS_HELP_STRING([--disable-proportional],
417406 [turn off proportionally spaced, kerned fonts])],
418- [],
419- [enable_proportional=yes])
407+ [],
408+ [enable_proportional=yes])
420409 AC_ARG_ENABLE([styles],
421410 [AS_HELP_STRING([--enable-styles[=TAGS]],
422411 [type style(s) to build [tsuku&normal,mg&el,mg&eq]])],
423- [],
424- [enable_styles="tsuku&normal,mg&el,mg&eq"])
412+ [],
413+ [enable_styles="tsuku&normal,mg&el,mg&eq"])
425414 AC_ARG_WITH([kanjidic2],
426415 [AS_HELP_STRING([--with-kanjidic2=PATH],
427416 [gzipped KANJIDIC2 database [auto]])],
428- [],
429- [with_kanjidic2=auto])
417+ [],
418+ [with_kanjidic2=auto])
430419 AC_ARG_WITH([prolog],
431420 [AS_HELP_STRING([--with-prolog=PATH],
432421 [Prolog interpreter [auto]])],
433- [],
434- [with_prolog=auto])
422+ [],
423+ [with_prolog=auto])
435424 #
436425 # Process user options
437426 #
@@ -486,13 +475,13 @@
486475 AC_MSG_RESULT([$with_kanjidic2])
487476 ])
488477 ])
489-AM_CONDITIONAL([COND_KANJIDIC2], [test '!' "$with_kanjidic2" = no])
478+AM_CONDITIONAL([COND_KANJIDIC2], [test '!' "x$with_kanjidic2" = "xno"])
490479 AC_SUBST([with_kanjidic2])
491480 #
492481 AS_IF([test "x$enable_kanji_chart" = "xauto"],
493- [AS_IF([test "$with_kanjidic2" = "no"],
482+ [AS_IF([test "x$with_kanjidic2" = "xno"],
494483 [enable_kanji_chart=no],[enable_kanji_chart=yes])])
495-AM_CONDITIONAL([COND_KANJI_CHART], [test '!' "$enable_kanji_chart" = no])
484+AM_CONDITIONAL([COND_KANJI_CHART], [test '!' "x$enable_kanji_chart" = "xno"])
496485 AC_SUBST([enable_kanji_chart])
497486 #
498487 AS_IF([test "x$enable_silent_rules" = "x"],
--- trunk/genjimon/Makefile.am (revision 669)
+++ trunk/genjimon/Makefile.am (revision 670)
@@ -45,6 +45,8 @@
4545 comma:=,
4646 percent=%
4747
48+$(error This Makefile must be edited by Perl code in config.status before use)
49+
4850 SHELL=$(if $(wildcard @KLEKNEV@),@KLEKNEV@,$(if \
4951 $(wildcard /bin/bash),/bin/bash,/bin/sh))
5052
@@ -205,7 +207,8 @@
205207 (cd $*.tmp ; $(expect_start)'$(MPOST)' $*.mp$(expect_end) ) ; \
206208 if '$(GREP)' -q '^! ' $*.tmp/$*.log ; then exit 1 ; fi ; \
207209 $(TSU_V_NAPERL) \
208- '$(PERL)' -CSD mp2pf $*.tmp/$* $(TSU_V_REDIR) ; \
210+ '$(PERL)' -CSD $(if $(filter no,@parasite@),$(mvp)/)mp2pf \
211+ $*.tmp/$* $(TSU_V_REDIR) ; \
209212 (cd $*.tmp ; '$(realpath @T1ASM@)' -b $*.p $*.pfb ) ; \
210213 if test -r $*.tmp/$*.pfb \
211214 && '$(GREP)' -q 'output files\? written' $*.tmp/$*.log; then \
@@ -271,10 +274,14 @@
271274 genjimon.pdf: genjimon.tex mitsuba.cls \
272275 GenjimonMedium.ttf GenjimonReverse.ttf GenjimonWhite.ttf GenjimonBlack.ttf
273276 $(AM_V_at)rm -f genjimon.aux
277+ $(AM_V_at)if test '!' -r genjimon.tex ; then \
278+ cp $(mvp)/genjimon.tex . ; fi
279+ $(AM_V_at)if test '!' -r mitsuba.cls ; then \
280+ cp $(mvp)/mitsuba.cls . ; fi
274281 $(AM_V_at)$(TSU_V_TEX)$(expect_start)'$(XELATEX)' \
275- $(mvp)/genjimon$(expect_end)
282+ genjimon$(expect_end)
276283 $(AM_V_at)$(TSU_V_TEX)$(expect_start)'$(XELATEX)' \
277- $(mvp)/genjimon$(expect_end)
284+ genjimon$(expect_end)
278285
279286 ############################################################################
280287
@@ -282,7 +289,7 @@
282289
283290 TESTS = $(dist_ttf_DATA)
284291 TEST_EXTENSIONS = .ttf
285-TTF_LOG_COMPILER = '$(FONTANVIL)' -lang=ff -script fontlint.pe
292+TTF_LOG_COMPILER = '$(FONTANVIL)' -lang=ff -script $(mvp)/fontlint.pe
286293
287294 ############################################################################
288295
@@ -337,6 +344,9 @@
337344 m4/tsu_colourise.m4: ../m4/tsu_colourise.m4
338345 $(TSU_V_CP) cp $< $@
339346
347+m4/tsu_fix_makefile.m4: ../m4/tsu_fix_makefile.m4
348+ $(TSU_V_CP) cp $< $@
349+
340350 mp2pf: ../tools/mp2pf
341351 $(TSU_V_CP) cp $< $@
342352
--- trunk/genjimon/m4/tsu_fix_makefile.m4 (revision 0)
+++ trunk/genjimon/m4/tsu_fix_makefile.m4 (revision 670)
@@ -0,0 +1,82 @@
1+#
2+# SYNOPSIS
3+#
4+# TSU_FIX_MAKEFILE(EXTRA_PERL,EXTRA_COMMANDS,INIT_COMMANDS)
5+#
6+# DESCRIPTION
7+#
8+# Alter the Automake-generated Makefile to do certain things needed by
9+# Tsukurimashou that don't seem to be achievable in any simpler way.
10+# This works by adding a "fix-makefile" tag to config.status and
11+# making other changes to make sure that this tag will be executed any
12+# time the Makefile is rebuilt.
13+#
14+# This code uses a perl -pe loop over the Makefile, and additional hacks
15+# on the Makefile may be done by passing suitable Perl code in the
16+# EXTRA_PERL argument. Further shell commands that won't fit in that
17+# context may be added in the EXTRA_COMMANDS argument.
18+#
19+# Any shell commands given in INIT_COMMANDS are added to the
20+# corresponding argument of AC_CONFIG_COMMANDS.
21+#
22+# TSU_FIX_MAKEFILE must be used early in the configure.ac, in particular
23+# before anything that causes Autoconf to include stuff related to the
24+# C compiler.
25+#
26+# To make it more secure that the fix-makefile commands really will
27+# be executed, include a line like this one in Makefile.am:
28+# $(error This Makefile must be edited by Perl code in config.status before use)
29+# The default fix-makefile loop will remove it, but when present this
30+# line prevents anyone from using a Makefile that might somehow have
31+# been created and not processed by fix-makefile.
32+#
33+# The regular expression /ZZZZHACKZZZZ\s*=\s*/ will be removed from
34+# Makefile lines. This behaviour can be used to make a line of
35+# something other than variable definitions *look* like a variable
36+# definition, so that Automake will include it early in the generated
37+# Makefile, among the variable definitions.
38+#
39+# LICENSE
40+#
41+# This macro is released to the public domain by its author,
42+# Matthew Skala <mskala@ansuz.sooke.bc.ca>.
43+
44+#serial 1
45+
46+AC_DEFUN([TSU_FIX_MAKEFILE], [
47+ AC_CONFIG_COMMANDS([fix-makefile],
48+ [patsubst(["$PERL" -i -pe 'dnl
49+dnl
50+dnl Remove ZZZZHACKZZZZ= to allow forcing lines to be early
51+s/ZZZZHACKZZZZ\s*=\s*//;dnl
52+dnl
53+dnl Remove Makefile poison pill (to prevent user from overriding us)
54+$_="" if /\$\(error This Makefile must be /;dnl
55+dnl
56+dnl Any time the Makefile wants to run automake --foreign and not us,
57+dnl also run ourselves
58+s#(\$\(AUTOMAKE\) --foreign( Makefile)?)(?! && (\S+\s+)?./config)#dnl
59+\1 && \$(SHELL) ./config.status fix-makefile#;dnl
60+dnl
61+dnl Any time it wants to run config_status in the way that Automake does
62+dnl it to invoke depfiles, also run ourselves
63+s#config\.status \$\@ \$\(am__depfiles_maybe\)#dnl
64+config.status \$\@ fix-makefile \$(am__depfiles_maybe)#;dnl
65+dnl
66+dnl Change lines that look like Automake's "make clean" recipes, to
67+dnl use our pretty output format.
68+s#\t-\@?(test -z.* || )?rm -(r?)f (.*)#dnl
69+\t\$(TSU_V_RM) '"'"'\3'"'"' \$(TSU_V_CHOPPER)\ndnl
70+\t-\$(A''M_V_at)\1rm -\2f \3#;dnl
71+dnl
72+dnl Similar change for the VPATH-only files
73+s#\t-\@?(test \. =.* || test -z.* || )rm -(r?)f (.*)#dnl
74+\t-@\1(\$(TSU_V_RM) '"'"'\3'"'"' \$(TSU_V_CHOPPER) ; dnl
75+rm -\2f \3)#;dnl
76+dnl
77+$1' Makefile
78+$2],[dnl.*
79+],[])],
80+ [PERL=$PERL
81+$3])
82+])
--- trunk/genjimon/configure.ac (revision 669)
+++ trunk/genjimon/configure.ac (revision 670)
@@ -2,7 +2,7 @@
22
33 #
44 # Configuration source for Genjimon fonts
5-# Copyright (C) 2011, 2012 Matthew Skala
5+# Copyright (C) 2011, 2012, 2017 Matthew Skala
66 #
77 # This program is free software: you can redistribute it and/or modify
88 # it under the terms of the GNU General Public License as published by
@@ -197,18 +197,12 @@
197197 parallel-tests silent-rules])
198198 AC_CONFIG_SRCDIR([genjimon-black.mp])
199199 AC_CONFIG_MACRO_DIR([m4])
200-AC_REVISION([$Id: configure.ac 5785 2017-11-18 23:17:22Z mskala $])
200+AC_REVISION([$Id: configure.ac 5795 2017-11-21 21:32:34Z mskala $])
201201 AC_COPYRIGHT([Copyright (C) 2011, 2012 Matthew Skala])
202202 AC_SUBST([release_date],["March 7, 2013"])
203+# this must be early so it will happen before depfiles
204+TSU_FIX_MAKEFILE
203205 AM_SILENT_RULES
204-# this must be early so it will happen before depfiles
205-AC_CONFIG_COMMANDS([fix-makefile],
206- ["$PERL" -i -pe \
207-'s#\t-\@?(test -z.* || )?rm -(r?)f (.*)#'\
208-'\t\$(TSU_V_RM) '"'"'\3'"'"' \$(TSU_V_CHOPPER)\n'\
209-'\t-\$(A''M_V_at)\1rm -\2f \3#;' \
210- Makefile],
211- [PERL=$PERL])
212206 #
213207 ############################################################################
214208 #
@@ -249,23 +243,6 @@
249243 #
250244 ############################################################################
251245 #
252-# Check for parasite build
253-#
254-AC_MSG_CHECKING([whether we are building as a parasite])
255-AM_CONDITIONAL([COND_PARASITE],
256- [grep Tsukurimashou ../Makefile > /dev/null 2> /dev/null])
257-AM_COND_IF([COND_PARASITE],
258- [AC_MSG_RESULT([yes])
259- T1ASM=../t1asm/t1asm
260- parasite=yes],
261- [AC_MSG_RESULT([no])
262- AC_PATH_PROG([T1ASM],[t1asm])
263- parasite=no])
264-AC_SUBST([T1ASM])
265-AC_SUBST([parasite])
266-#
267-############################################################################
268-#
269246 # Checks for system services
270247 #
271248 AC_SYS_LONG_FILE_NAMES
@@ -280,14 +257,19 @@
280257 AC_ARG_ENABLE([colour-build],
281258 [AS_HELP_STRING([--disable-colour-build],
282259 [turn off ANSI colour in build scripts])],
283- [],
284- [enable_colour_build=yes])
260+ [],
261+ [enable_colour_build=yes])
285262 AC_ARG_ENABLE([color-build],[dnl],[],[enable_color_build=yes])
286263 AC_ARG_ENABLE([docs],
287264 [AS_HELP_STRING([--disable-docs],
288265 [turn off PDF documentation])],
289- [],
290- [enable_docs=yes])
266+ [],
267+ [enable_docs=yes])
268+AC_ARG_ENABLE([parasite],
269+ [AS_HELP_STRING([--enable-parasite=[yes|no|auto]],
270+ [build as a parasite [auto]])],
271+ [],
272+ [enable_parasite=auto])
291273 #
292274 # Process user options
293275 #
@@ -310,6 +292,25 @@
310292 #
311293 ############################################################################
312294 #
295+# Check for parasite build
296+#
297+AC_MSG_CHECKING([whether we are building as a parasite])
298+AS_IF([test "x$enable_parasite" = "xauto"],
299+ [AS_IF([grep Tsukurimashou ../Makefile > /dev/null 2> /dev/null],
300+ [enable_parasite=yes],
301+ [enable_parasite=no])])
302+AC_MSG_RESULT([$enable_parasite])
303+AM_CONDITIONAL([COND_PARASITE],[test "x$enable_parasite" = "xyes"])
304+AM_COND_IF([COND_PARASITE],
305+ [T1ASM=../t1asm/t1asm
306+ parasite=yes],
307+ [AC_PATH_PROG([T1ASM],[t1asm])
308+ parasite=no])
309+AC_SUBST([T1ASM])
310+AC_SUBST([parasite])
311+#
312+############################################################################
313+#
313314 # Generate output
314315 #
315316 AC_SUBST([andt],[])
@@ -369,3 +370,6 @@
369370 AS_ECHO(["is quite likely to fail. It would be better to eliminate all illegal"])
370371 AS_ECHO(["characters from pathnames before continuing."])
371372 ])
373+AS_IF([test "x$parasite" = "xyes"],
374+ [TSU_COLOURISE([Parasite build enabled.],[6])
375+ AS_ECHO([])])
Show on old repository browser