summaryrefslogtreecommitdiff
path: root/Build/source/texk/web2c
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2008-03-25 16:51:09 +0000
committerKarl Berry <karl@freefriends.org>2008-03-25 16:51:09 +0000
commitbe2fb287d5b6b777928f0ee68ad319ccc24227e7 (patch)
treea9d82c7efdd72e37a596a27d9943321aa47ac3a6 /Build/source/texk/web2c
parent5daff30ff2064c85bad88beb411b247bd0ef17f3 (diff)
integrate pool into tex/mf/etex binaries; from akira
git-svn-id: svn://tug.org/texlive/trunk@7153 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/web2c')
-rw-r--r--Build/source/texk/web2c/ChangeLog12
-rw-r--r--Build/source/texk/web2c/Makefile.in57
-rw-r--r--Build/source/texk/web2c/etexdir/etex-binpool.ch75
-rw-r--r--Build/source/texk/web2c/etexdir/etex.mk12
-rw-r--r--Build/source/texk/web2c/mf-binpool.ch75
-rw-r--r--Build/source/texk/web2c/mf-mkcpool.c61
-rw-r--r--Build/source/texk/web2c/tex-binpool.ch75
-rw-r--r--Build/source/texk/web2c/tex-mkcpool.c60
-rw-r--r--Build/source/texk/web2c/tmf-pool.h17
-rwxr-xr-xBuild/source/texk/web2c/web2c/convert21
-rw-r--r--Build/source/texk/web2c/web2c/loadpool.defines7
11 files changed, 444 insertions, 28 deletions
diff --git a/Build/source/texk/web2c/ChangeLog b/Build/source/texk/web2c/ChangeLog
index 66387278de4..f3152a04c01 100644
--- a/Build/source/texk/web2c/ChangeLog
+++ b/Build/source/texk/web2c/ChangeLog
@@ -1,5 +1,17 @@
2008-03-25 Karl Berry <karl@tug.org>
+ * Makefile.in,
+ * tmf-pool.h,
+ * mf-binpool.ch,
+ * tex-mkcpool.c,
+ * mf-mkcpool.c,
+ * etexdir/etex.mk,
+ * etexdir/etex-binpool.ch,
+ * tex-binpool.ch,
+ * web2c/convert,
+ * web2c/loadpool.defines: integrate pool file in binary for
+ tex, mf, and etex. From Akira.
+
* tftopl.web: revised version 3.2 from Knuth.
2008-03-24 Karl Berry <karl@tug.org>
diff --git a/Build/source/texk/web2c/Makefile.in b/Build/source/texk/web2c/Makefile.in
index bd687a9ac8f..cfbe24a07d5 100644
--- a/Build/source/texk/web2c/Makefile.in
+++ b/Build/source/texk/web2c/Makefile.in
@@ -92,7 +92,7 @@ CTANGLE = @CTANGLE@
TIE = @TIE@
# Calling tangle
-tangle = WEBINPUTS=$(srcdir) $(TANGLE)
+tangle = WEBINPUTS=.:$(srcdir) $(TANGLE)
ctangle = $(CTANGLE)
tie = $(TIE)
@@ -428,8 +428,8 @@ dvitype_args = -output-level=2 -dpi=72.27 -page-start='*.*.*.*.*.*.*.*.*.*'
#
# Metafont
mf_c = mfini.c mf0.c mf1.c
-mf_o = mfini.o mf0.o mf1.o mfextra.o
-mfn_o = mfini.o mf0.o mf1.o mfnowin.o
+mf_o = mfini.o mf0.o mf1.o mf-pool.o mfextra.o
+mfn_o = mfini.o mf0.o mf1.o mf-pool.o mfnowin.o
mf: $(mf_o) $(windowlib)
$(kpathsea_link) $(mf_o) $(windowlink) $(LOADLIBES)
mf-nowin: $(mfn_o) window/trap.o
@@ -442,8 +442,10 @@ mfextra.c: lib/texmfmp.c
sed s/TEX-OR-MF-OR-MP/mf/ $(srcdir)/lib/texmfmp.c >$@
mfnowin.c: lib/texmfmp.c
sed s/TEX-OR-MF-OR-MP/mf/ $(srcdir)/lib/texmfmp.c >$@
-mf.p mf.pool: tangle mf.web mf.ch
- $(tangle) mf.web mf.ch
+mf.p mf.pool: tangle mf.web mf-final.ch
+ $(tangle) $(srcdir)/mf.web mf-final.ch
+mf-final.ch: $(TIE) mf.web mf.ch mf-binpool.ch
+ $(TIE) -c $@ $(srcdir)/mf.web $(srcdir)/mf.ch $(srcdir)/mf-binpool.ch
check: mf-check
mf-check: trap mf.base
./mf --progname=mf '&./mf \tracingstats:=1; end.'
@@ -489,15 +491,36 @@ kpse_include metapost.mk
#
# TeX
tex_c = texini.c tex0.c tex1.c tex2.c
-tex_o = texini.o tex0.o tex1.o tex2.o texextra.o
+tex_o = texini.o tex0.o tex1.o tex2.o tex-pool.o texextra.o
tex: $(tex_o)
$(kpathsea_link) $(tex_o) $(socketlibs) $(LOADLIBES)
$(tex_c) texcoerce.h texd.h: tex.p $(web2c_texmf)
$(web2c) tex
texextra.c: lib/texmfmp.c
sed s/TEX-OR-MF-OR-MP/tex/ $(srcdir)/lib/texmfmp.c >$@
-tex.p tex.pool: tangle tex.web tex.ch
- $(tangle) tex.web tex.ch
+tex.p tex.pool: tangle tex.web tex-final.ch
+ $(tangle) $(srcdir)/tex.web tex-final.ch
+tex-final.ch: $(TIE) tex.web tex.ch tex-binpool.ch
+ $(TIE) -c $@ $(srcdir)/tex.web $(srcdir)/tex.ch $(srcdir)/tex-binpool.ch
+#
+# tools to load pool for tex, etex and mf
+#
+tex-pool.c: tex.pool tex-mkcpool tmf-pool.h
+ ./tex-mkcpool tex.pool $(srcdir)/tmf-pool.h >tex-pool.c
+mf-pool.c: mf.pool mf-mkcpool tmf-pool.h
+ ./mf-mkcpool mf.pool $(srcdir)/tmf-pool.h >mf-pool.c
+mf-pool.o: mf-pool.c tmf-pool.h mfd.h
+# we include mfd.h, so need lots more includes.
+ $(CC) $(CFLAGS) -I. -I.. -I$(srcdir) -DMETA_FONT -c -o $@ mf-pool.c
+tex-mkcpool: tex-mkcpool.o
+ $(CC) $(CFLAGS) -o $@ tex-mkcpool.o
+tex-mkcpool.o: tex-mkcpool.c
+ $(CC) $(CFLAGS) -c -o $@ $(srcdir)/tex-mkcpool.c
+mf-mkcpool: mf-mkcpool.o
+ $(CC) $(CFLAGS) -o $@ mf-mkcpool.o
+mf-mkcpool.o: mf-mkcpool.c
+ $(CC) $(CFLAGS) -c -o $@ $(srcdir)/mf-mkcpool.c
+
check: tex-check
tex-check: trip tex.fmt
# Test truncation (but don't bother showing the warning msg).
@@ -600,7 +623,7 @@ tangle.c tangle.h: tangle.p
# which we use to make the other programs. We depend on tangleboot, even
# though we might not use it.
tangle.p: tangleboot tangle.web tangle.ch
- WEBINPUTS=$(srcdir) $(TANGLEBOOT) tangle tangle
+ WEBINPUTS=.:$(srcdir) $(TANGLEBOOT) tangle tangle
tangle.web:
@echo "You seem to be missing tangle.web, perhaps because you" >&2
@echo "didn't retrieve web.tar.gz, only web2c.tar.gz." >&2
@@ -628,7 +651,7 @@ stamp-tangle: tangleboot.p
# just touch tangleboot.p and build tangle.
tangleboot.p: tangle.web tangle.ch
if [ -r $(TANGLE) ] || [ -r $(TANGLE).exe ]; then \
- WEBINPUTS=$(srcdir) $(TANGLE) tangle tangle; \
+ $(tangle) tangle tangle; \
mv tangle.p tangleboot.p; \
elif [ -r tangleboot.p ]; then \
touch tangleboot.p; \
@@ -826,9 +849,9 @@ install-tex-exec: @FMU@ install-tex-links
install-mf-exec: @FMU@ install-mf-links
install-mpost-exec: @FMU@ install-mpost-links
-install-tex-data: install-tex-pool @FMU@ install-tex-dumps
-install-mf-data: install-mf-pool @FMU@ install-mf-dumps
-install-mpost-data: install-mpost-pool @FMU@ install-mpost-dumps
+install-tex-data: @FMU@ install-tex-dumps
+install-mf-data: @FMU@ install-mf-dumps
+install-mpost-data: @FMU@ install-mpost-dumps
install-tex-dumps: install-tex-fmts
install-mf-dumps: install-mf-bases
@@ -893,14 +916,6 @@ install-mpost-mems: mems $(memdir)
for f in $$mems; do base=`basename $$f .mem`; \
(cd $(bindir) && (rm -f $$base; $(LN) mpost $$base)); done
-install-tex-pool: tex.pool $(texpooldir)
- $(INSTALL_DATA) tex.pool $(texpooldir)/tex.pool
-install-mf-pool: mf.pool $(mfpooldir)
- $(INSTALL_DATA) mf.pool $(mfpooldir)/mf.pool
-install-mpost-pool: # no longer used, the strings are in the binary
-# install-mpost-pool: mp.pool $(mppooldir)
-# $(INSTALL_DATA) mp.pool $(mppooldir)/mp.pool
-
# Auxiliary files.
install-data:: $(web2cdir)
cd doc && $(MAKE) $(install_makeargs) install-data
diff --git a/Build/source/texk/web2c/etexdir/etex-binpool.ch b/Build/source/texk/web2c/etexdir/etex-binpool.ch
new file mode 100644
index 00000000000..ac959c7b3fb
--- /dev/null
+++ b/Build/source/texk/web2c/etexdir/etex-binpool.ch
@@ -0,0 +1,75 @@
+%
+% pool in binary
+%
+@x
+@ @d bad_pool(#)==begin wake_up_terminal; write_ln(term_out,#);
+ a_close(pool_file); get_strings_started:=false; return;
+ end
+@<Read the other strings...@>=
+name_length := strlen (pool_name);
+name_of_file := xmalloc_array (ASCII_code, name_length + 1);
+strcpy (stringcast(name_of_file+1), pool_name); {copy the string}
+if a_open_in (pool_file, kpse_texpool_format) then
+ begin c:=false;
+ repeat @<Read one string, but return |false| if the
+ string memory space is getting too tight for comfort@>;
+ until c;
+ a_close(pool_file); get_strings_started:=true;
+ end
+else bad_pool('! I can''t read ', pool_name, '; bad path?')
+@.I can't read TEX.POOL@>
+
+@ @<Read one string...@>=
+begin if eof(pool_file) then bad_pool('! ', pool_name, ' has no check sum.');
+@.TEX.POOL has no check sum@>
+read(pool_file,m); read(pool_file,n); {read two digits of string length}
+if m='*' then @<Check the pool check sum@>
+else begin if (xord[m]<"0")or(xord[m]>"9")or@|
+ (xord[n]<"0")or(xord[n]>"9") then
+ bad_pool('! ', pool_name, ' line doesn''t begin with two digits.');
+@.TEX.POOL line doesn't...@>
+ l:=xord[m]*10+xord[n]-"0"*11; {compute the length}
+ if pool_ptr+l+string_vacancies>pool_size then
+ bad_pool('! You have to increase POOLSIZE.');
+@.You have to increase POOLSIZE@>
+ for k:=1 to l do
+ begin if eoln(pool_file) then m:=' '@+else read(pool_file,m);
+ append_char(xord[m]);
+ end;
+ read_ln(pool_file); g:=make_string;
+ end;
+end
+
+@ The \.{WEB} operation \.{@@\$} denotes the value that should be at the
+end of this \.{TEX.POOL} file; any other value means that the wrong pool
+file has been loaded.
+@^check sum@>
+
+@<Check the pool check sum@>=
+begin a:=0; k:=1;
+loop@+ begin if (xord[n]<"0")or(xord[n]>"9") then
+ bad_pool('! ', pool_name, ' check sum doesn''t have nine digits.');
+@.TEX.POOL check sum...@>
+ a:=10*a+xord[n]-"0";
+ if k=9 then goto done;
+ incr(k); read(pool_file,n);
+ end;
+done: if a<>@$ then
+ bad_pool('! ', pool_name, ' doesn''t match; tangle me again (or fix the path).');
+@.TEX.POOL doesn't match@>
+c:=true;
+end
+@y
+@ @<Read the other strings...@>=
+ g := loadpoolstrings((pool_size-string_vacancies));
+ if g=0 then begin
+ wake_up_terminal; write_ln(term_out,'! You have to increase POOLSIZE.');
+ get_strings_started:=false;
+ return;
+ end;
+ get_strings_started:=true;
+
+@ Empty module
+
+@ Empty module
+@z
diff --git a/Build/source/texk/web2c/etexdir/etex.mk b/Build/source/texk/web2c/etexdir/etex.mk
index 592094f7ff8..b9115935be6 100644
--- a/Build/source/texk/web2c/etexdir/etex.mk
+++ b/Build/source/texk/web2c/etexdir/etex.mk
@@ -14,7 +14,7 @@ etexdir/etex.version: etexdir/etex.ch
# The C sources.
etex_c = etexini.c etex0.c etex1.c etex2.c
-etex_o = etexini.o etex0.o etex1.o etex2.o etexextra.o
+etex_o = etexini.o etex0.o etex1.o etex2.o etex-pool.o etexextra.o
# Making etex.
etex: $(etex_o)
@@ -44,13 +44,17 @@ etex_ch_srcs = etex.web \
$(srcdir)/etexdir/tex.ch0 \
$(srcdir)/tex.ch \
$(srcdir)/etexdir/tex.ch1 \
- $(srcdir)/etexdir/tex.ech
+ $(srcdir)/etexdir/tex.ech \
+ $(srcdir)/etexdir/etex-binpool.ch
# Rules:
etex.web: tie etexdir/etex.mk $(etex_web_srcs)
$(TIE) -m etex.web $(etex_web_srcs)
etex.ch: $(etex_ch_srcs)
$(TIE) -c etex.ch $(etex_ch_srcs)
+etex-pool.c: etex.pool tex-mkcpool tmf-pool.h
+ ./tex-mkcpool etex.pool tmf-pool.h >etex-pool.c
+
# Tests...
check: @ETEX@ etex-check
etex-check: etrip etex.fmt
@@ -186,7 +190,7 @@ latex.fmt: etex
# Install
install-etex: install-etex-exec install-etex-data
install-etex-exec: install-etex-programs install-etex-links
-install-etex-data: install-etex-pool @FMU@ install-etex-dumps
+install-etex-data: @FMU@ install-etex-dumps
install-etex-dumps: install-etex-fmts
install-programs: @ETEX@ install-etex-programs
@@ -207,7 +211,5 @@ install-etex-fmts: efmts $(efmtdir)
(cd $(bindir) && (rm -f $$base; $(LN) etex $$base)); done
install-data:: @ETEX@ install-etex-data
-install-etex-pool: etex.pool $(texpooldir)
- $(INSTALL_DATA) etex.pool $(texpooldir)/etex.pool
# end of etex.mk
diff --git a/Build/source/texk/web2c/mf-binpool.ch b/Build/source/texk/web2c/mf-binpool.ch
new file mode 100644
index 00000000000..f9a2f29ac4d
--- /dev/null
+++ b/Build/source/texk/web2c/mf-binpool.ch
@@ -0,0 +1,75 @@
+%
+% pool in binary
+%
+@x
+@ @d bad_pool(#)==begin wake_up_terminal; write_ln(term_out,#);
+ a_close(pool_file); get_strings_started:=false; return;
+ end
+@<Read the other strings...@>=
+name_length := strlen (pool_name);
+name_of_file := xmalloc_array (ASCII_code, 1 + name_length);
+strcpy (stringcast(name_of_file+1), pool_name); {copy the string}
+if a_open_in (pool_file, kpse_mfpool_format) then
+ begin c:=false;
+ repeat @<Read one string, but return |false| if the
+ string memory space is getting too tight for comfort@>;
+ until c;
+ a_close(pool_file); get_strings_started:=true;
+ end
+else bad_pool('! I can''t read ', pool_name, '; bad path?')
+@.I can't read MF.POOL@>
+
+@ @<Read one string...@>=
+begin if eof(pool_file) then bad_pool('! ', pool_name, ' has no check sum.');
+@.MF.POOL has no check sum@>
+read(pool_file,m); read(pool_file,n); {read two digits of string length}
+if m='*' then @<Check the pool check sum@>
+else begin if (xord[m]<"0")or(xord[m]>"9")or@|
+ (xord[n]<"0")or(xord[n]>"9") then
+ bad_pool('! ', pool_name, ' line doesn''t begin with two digits.');
+@.MF.POOL line doesn't...@>
+ l:=xord[m]*10+xord[n]-"0"*11; {compute the length}
+ if pool_ptr+l+string_vacancies>pool_size then
+ bad_pool('! You have to increase POOLSIZE.');
+@.You have to increase POOLSIZE@>
+ for k:=1 to l do
+ begin if eoln(pool_file) then m:=' '@+else read(pool_file,m);
+ append_char(xord[m]);
+ end;
+ read_ln(pool_file); g:=make_string; str_ref[g]:=max_str_ref;
+ end;
+end
+
+@ The \.{WEB} operation \.{@@\$} denotes the value that should be at the
+end of this \.{MF.POOL} file; any other value means that the wrong pool
+file has been loaded.
+@^check sum@>
+
+@<Check the pool check sum@>=
+begin a:=0; k:=1;
+loop@+ begin if (xord[n]<"0")or(xord[n]>"9") then
+ bad_pool('! ', pool_name, ' check sum doesn''t have nine digits.');
+@.MF.POOL check sum...@>
+ a:=10*a+xord[n]-"0";
+ if k=9 then goto done;
+ incr(k); read(pool_file,n);
+ end;
+done: if a<>@$ then
+ bad_pool('! ', pool_name, ' doesn''t match; tangle me again (or fix the path).');
+@.MF.POOL doesn't match@>
+c:=true;
+end
+@y
+@ @<Read the other strings...@>=
+ g := loadpoolstrings((pool_size-string_vacancies));
+ if g=0 then begin
+ wake_up_terminal; write_ln(term_out,'! You have to increase POOLSIZE.');
+ get_strings_started:=false;
+ return;
+ end;
+ get_strings_started:=true;
+
+@ Empty module
+
+@ Empty module
+@z
diff --git a/Build/source/texk/web2c/mf-mkcpool.c b/Build/source/texk/web2c/mf-mkcpool.c
new file mode 100644
index 00000000000..2b5e4018a1b
--- /dev/null
+++ b/Build/source/texk/web2c/mf-mkcpool.c
@@ -0,0 +1,61 @@
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+
+int main(int argc, char *argv[]) {
+ char *filename;
+ char *headername;
+ FILE *fh;
+ char data[1024];
+ if (argc!=3) {
+ puts("Need exactly two arguments: pool_name and header_name");
+ exit(1);
+ }
+ filename = argv[1];
+ headername = argv[2];
+ fh = fopen(filename,"r");
+ printf(
+ "/* This file is auto-generated by makecpool */\n"
+ "\n"
+ "#include <stdio.h>\n"
+ "#include \"%s\"\n"
+ "\n"
+ "static char *poolfilearr[] = {\n",headername);
+ while (fgets(data,1024,fh)) {
+ int len = strlen(data);
+ int o = 0; /* skip first o characters*/
+ int i;
+ if (data[len-1]=='\n') { /* chomp;*/
+ data[len-1] = 0;
+ len--;
+ }
+ if (data[0]=='*') break; /* last if !^\*!; */
+ if (data[0]>='0' && data[0]<='9' && data[1]>='0' && data[1]<='9') {
+ o=2; /* $data =~ s/^\d\d//; */
+ }
+ printf(" \"");
+ for (i=o; i<len; i++) {
+ if (data[i]=='"' || data[i]=='\\') putchar('\\');
+ if (data[i]=='?') printf("\" \""); /* suppress trigraphs */
+ putchar(data[i]);
+ } /* $data =~ s/(["\\])/\\$1/g; */
+ printf("\",\n");
+ }
+ fclose(fh);
+ printf(" NULL };\n"
+ "int loadpoolstrings (integer spare_size) {\n"
+ " strnumber g=0;\n"
+ " int i=0,j=0;\n"
+ " char *s;\n"
+ " while ((s = poolfilearr[j++])) {\n"
+ " int l = strlen (s);\n"
+ " i += l;\n"
+ " if (i>=spare_size) return 0;\n"
+ " while (l-- > 0) strpool[poolptr++] = *s++;\n"
+ " g = makestring();\n"
+ " strref[g]= 127;\n"
+ " }\n"
+ " return g;\n"
+ "}\n");
+ return 0;
+}
diff --git a/Build/source/texk/web2c/tex-binpool.ch b/Build/source/texk/web2c/tex-binpool.ch
new file mode 100644
index 00000000000..ac959c7b3fb
--- /dev/null
+++ b/Build/source/texk/web2c/tex-binpool.ch
@@ -0,0 +1,75 @@
+%
+% pool in binary
+%
+@x
+@ @d bad_pool(#)==begin wake_up_terminal; write_ln(term_out,#);
+ a_close(pool_file); get_strings_started:=false; return;
+ end
+@<Read the other strings...@>=
+name_length := strlen (pool_name);
+name_of_file := xmalloc_array (ASCII_code, name_length + 1);
+strcpy (stringcast(name_of_file+1), pool_name); {copy the string}
+if a_open_in (pool_file, kpse_texpool_format) then
+ begin c:=false;
+ repeat @<Read one string, but return |false| if the
+ string memory space is getting too tight for comfort@>;
+ until c;
+ a_close(pool_file); get_strings_started:=true;
+ end
+else bad_pool('! I can''t read ', pool_name, '; bad path?')
+@.I can't read TEX.POOL@>
+
+@ @<Read one string...@>=
+begin if eof(pool_file) then bad_pool('! ', pool_name, ' has no check sum.');
+@.TEX.POOL has no check sum@>
+read(pool_file,m); read(pool_file,n); {read two digits of string length}
+if m='*' then @<Check the pool check sum@>
+else begin if (xord[m]<"0")or(xord[m]>"9")or@|
+ (xord[n]<"0")or(xord[n]>"9") then
+ bad_pool('! ', pool_name, ' line doesn''t begin with two digits.');
+@.TEX.POOL line doesn't...@>
+ l:=xord[m]*10+xord[n]-"0"*11; {compute the length}
+ if pool_ptr+l+string_vacancies>pool_size then
+ bad_pool('! You have to increase POOLSIZE.');
+@.You have to increase POOLSIZE@>
+ for k:=1 to l do
+ begin if eoln(pool_file) then m:=' '@+else read(pool_file,m);
+ append_char(xord[m]);
+ end;
+ read_ln(pool_file); g:=make_string;
+ end;
+end
+
+@ The \.{WEB} operation \.{@@\$} denotes the value that should be at the
+end of this \.{TEX.POOL} file; any other value means that the wrong pool
+file has been loaded.
+@^check sum@>
+
+@<Check the pool check sum@>=
+begin a:=0; k:=1;
+loop@+ begin if (xord[n]<"0")or(xord[n]>"9") then
+ bad_pool('! ', pool_name, ' check sum doesn''t have nine digits.');
+@.TEX.POOL check sum...@>
+ a:=10*a+xord[n]-"0";
+ if k=9 then goto done;
+ incr(k); read(pool_file,n);
+ end;
+done: if a<>@$ then
+ bad_pool('! ', pool_name, ' doesn''t match; tangle me again (or fix the path).');
+@.TEX.POOL doesn't match@>
+c:=true;
+end
+@y
+@ @<Read the other strings...@>=
+ g := loadpoolstrings((pool_size-string_vacancies));
+ if g=0 then begin
+ wake_up_terminal; write_ln(term_out,'! You have to increase POOLSIZE.');
+ get_strings_started:=false;
+ return;
+ end;
+ get_strings_started:=true;
+
+@ Empty module
+
+@ Empty module
+@z
diff --git a/Build/source/texk/web2c/tex-mkcpool.c b/Build/source/texk/web2c/tex-mkcpool.c
new file mode 100644
index 00000000000..bd95e7f5994
--- /dev/null
+++ b/Build/source/texk/web2c/tex-mkcpool.c
@@ -0,0 +1,60 @@
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+
+int main(int argc, char *argv[]) {
+ char *filename;
+ char *headername;
+ FILE *fh;
+ char data[1024];
+ if (argc!=3) {
+ puts("Need exactly two arguments: pool_name and header_name");
+ exit(1);
+ }
+ filename = argv[1];
+ headername = argv[2];
+ fh = fopen(filename,"r");
+ printf(
+ "/* This file is auto-generated by makecpool */\n"
+ "\n"
+ "#include <stdio.h>\n"
+ "#include \"%s\"\n"
+ "\n"
+ "static char *poolfilearr[] = {\n",headername);
+ while (fgets(data,1024,fh)) {
+ int len = strlen(data);
+ int o = 0; /* skip first o characters*/
+ int i;
+ if (data[len-1]=='\n') { /* chomp;*/
+ data[len-1] = 0;
+ len--;
+ }
+ if (data[0]=='*') break; /* last if !^\*!; */
+ if (data[0]>='0' && data[0]<='9' && data[1]>='0' && data[1]<='9') {
+ o=2; /* $data =~ s/^\d\d//; */
+ }
+ printf(" \"");
+ for (i=o; i<len; i++) {
+ if (data[i]=='"' || data[i]=='\\') putchar('\\');
+ if (data[i]=='?') printf("\" \""); /* suppress trigraphs */
+ putchar(data[i]);
+ } /* $data =~ s/(["\\])/\\$1/g; */
+ printf("\",\n");
+ }
+ fclose(fh);
+ printf(" NULL };\n"
+ "int loadpoolstrings (integer spare_size) {\n"
+ " strnumber g=0;\n"
+ " int i=0,j=0;\n"
+ " char *s;\n"
+ " while ((s = poolfilearr[j++])) {\n"
+ " int l = strlen (s);\n"
+ " i += l;\n"
+ " if (i>=spare_size) return 0;\n"
+ " while (l-- > 0) strpool[poolptr++] = *s++;\n"
+ " g = makestring();\n"
+ " }\n"
+ " return g;\n"
+ "}\n");
+ return 0;
+}
diff --git a/Build/source/texk/web2c/tmf-pool.h b/Build/source/texk/web2c/tmf-pool.h
new file mode 100644
index 00000000000..cab97311570
--- /dev/null
+++ b/Build/source/texk/web2c/tmf-pool.h
@@ -0,0 +1,17 @@
+/* Copyright 2008 Akira Kakuto
+ You may freely use, modify and/or distribute this file. */
+
+#ifndef TMF_POOL_H
+#define TMF_POOL_H
+#ifndef META_FONT
+typedef int integer;
+typedef integer strnumber;
+typedef unsigned char packedASCIIcode;
+typedef integer poolpointer;
+extern packedASCIIcode *strpool;
+extern poolpointer poolptr;
+#else
+#define EXTERN extern
+#include "mfd.h"
+#endif
+#endif
diff --git a/Build/source/texk/web2c/web2c/convert b/Build/source/texk/web2c/web2c/convert
index 48d1f004304..c12b8a19b7d 100755
--- a/Build/source/texk/web2c/web2c/convert
+++ b/Build/source/texk/web2c/web2c/convert
@@ -52,6 +52,7 @@ case $basefile in
midcmd="| sed -f $srcdir/web2c/cvtbib.sed";;
mf) # MF and MP are almost the same.
more_defines="$srcdir/web2c/texmf.defines $srcdir/web2c/mfmp.defines"
+ more_defines="$more_defines $srcdir/web2c/loadpool.defines"
precmd="| sed -f $srcdir/web2c/cvtmf1.sed"
web2c_options="-m -c${basefile}coerce"
hfile=texmfmp.h
@@ -78,7 +79,23 @@ ${basefile}coerce.h"
output_files="$basefile[0-9].c ${basefile}ini.c ${basefile}d.h \
${basefile}coerce.h"
;;
- tex|eomega|etex|pdftex|pdfetex|omega|aleph|xetex)
+ tex|etex)
+ more_defines="$srcdir/web2c/texmf.defines"
+ more_defines="$more_defines $srcdir/web2c/loadpool.defines"
+ prog_defines="$srcdir/${basefile}dir/$basefile.defines"
+ if test -f $prog_defines; then
+ more_defines="$more_defines $prog_defines"
+ fi
+ web2c_options="-t -c${basefile}coerce"
+ hfile=texmfmp.h
+ fixwrites_options=-t
+ postcmd="| ./web2c/splitup $splitup_options ${basefile}"
+ cfile=${basefile}2.c # last output file, or thereabouts
+ output=
+ output_files="$basefile[0-9].c ${basefile}ini.c ${basefile}d.h \
+${basefile}coerce.h"
+ ;;
+ pdftex|pdfetex|omega|aleph|xetex)
more_defines="$srcdir/web2c/texmf.defines"
prog_defines="$srcdir/${basefile}dir/$basefile.defines"
if test -f $prog_defines; then
@@ -123,7 +140,7 @@ case $basefile in
sed -e 's/(buftype)//g' -e 's/(pdstype)//g' <bibtex.h >xbibtex.h
mv xbibtex.h bibtex.h
;;
- tex|eomega|etex|pdftex|pdfetex|omega|aleph|mf|mp|xetex)
+ tex|etex|pdftex|pdfetex|omega|aleph|mf|mp|xetex)
sleep 2 # so timestamps are definitely later, to avoid make weirdness
cat ${basefile}coerce.h $srcdir/web2c/coerce.h >x${basefile}coerce.h
mv x${basefile}coerce.h ${basefile}coerce.h
diff --git a/Build/source/texk/web2c/web2c/loadpool.defines b/Build/source/texk/web2c/web2c/loadpool.defines
new file mode 100644
index 00000000000..9811ffdb361
--- /dev/null
+++ b/Build/source/texk/web2c/web2c/loadpool.defines
@@ -0,0 +1,7 @@
+{ loadpool.defines
+
+}
+
+@define function loadpoolstrings();
+
+{ end of loadpool.defines }