code, and instead use it to generate a header at perl build time.
By removing uudmap from the interpreter structure we save 256 bytes
per child thread.
p4raw-id: //depot/perl@31059
fakesdio.h stdio in terms of PerlIO
fakethr.h Fake threads header
form.h Public declarations for formats
+generate_uudmap.c Generate uudmap.h, the uuencode decoding map
genpacksizetables.pl Generate the size tables for pack/unpack
globals.c File to declare global symbols (for shared library)
global.sym Symbols that need hiding when embedded
opmini\$(OBJ_EXT): opmini.c
\$(CCCMD) \$(PLDLFLAGS) $DPERL_EXTERNAL_GLOB opmini.c
+globals\$(OBJ_EXT): uudmap.h
+
+uudmap.h: generate_uudmap\$(EXE_EXT)
+ ./generate_uudmap\$(EXE_EXT) >uudmap.h
+
+generate_uudmap\$(EXE_EXT): generate_uudmap\$(OBJ_EXT)
+ \$(CC) -o generate_uudmap \$(LDFLAGS) generate_uudmap\$(OBJ_EXT) \$(libs)
+
!GROK!THIS!
$spitshell >>Makefile <<'!NO!SUBS!'
miniperlmain$(OBJ_EXT): miniperlmain.c patchlevel.h
# Do not 'make _mopup' directly.
_mopup:
- rm -f *$(OBJ_EXT) *$(LIB_EXT) all perlmain.c opmini.c
+ rm -f *$(OBJ_EXT) *$(LIB_EXT) all perlmain.c opmini.c uudmap.h generate_uudmap$(EXE_EXT)
-rmdir .depending
-@test -f extra.pods && rm -f `cat extra.pods`
-@test -f vms/README_vms.pod && rm -f vms/README_vms.pod
#define PL_utf8_xdigit (vTHX->Iutf8_xdigit)
#define PL_utf8cache (vTHX->Iutf8cache)
#define PL_utf8locale (vTHX->Iutf8locale)
-#define PL_uudmap (vTHX->Iuudmap)
#define PL_warnhook (vTHX->Iwarnhook)
#define PL_xmlfp (vTHX->Ixmlfp)
#define PL_Iutf8_xdigit PL_utf8_xdigit
#define PL_Iutf8cache PL_utf8cache
#define PL_Iutf8locale PL_utf8locale
-#define PL_Iuudmap PL_uudmap
#define PL_Iwarnhook PL_warnhook
#define PL_Ixmlfp PL_xmlfp
PERLVAR(Iparser, yy_parser *) /* current parser state */
-PERLVARA(Iuudmap,256, char)
PERLVAR(Ibitcount, char *)
PERLVAR(Ipsig_ptr, SV**)
EXTCONST char PL_uuemap[65]
INIT("`!\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_");
-
#ifdef DOINIT
+EXTCONST char PL_uudmap[256] =
+#include "uudmap.h"
+;
EXTCONST char* const PL_sig_name[] = { SIG_NAME };
EXTCONST int PL_sig_num[] = { SIG_NUM };
#else
+EXTCONST char PL_uudmap[256];
EXTCONST char* const PL_sig_name[];
EXTCONST int PL_sig_num[];
#endif
#define PL_utf8cache (*Perl_Iutf8cache_ptr(aTHX))
#undef PL_utf8locale
#define PL_utf8locale (*Perl_Iutf8locale_ptr(aTHX))
-#undef PL_uudmap
-#define PL_uudmap (*Perl_Iuudmap_ptr(aTHX))
#undef PL_warnhook
#define PL_warnhook (*Perl_Iwarnhook_ptr(aTHX))
#undef PL_xmlfp
break;
#endif
case 'u':
- /* MKS:
- * Initialise the decode mapping. By using a table driven
- * algorithm, the code will be character-set independent
- * (and just as fast as doing character arithmetic)
- */
- if (PL_uudmap[(U8)'M'] == 0) {
- size_t i;
-
- for (i = 0; i < sizeof(PL_uuemap); ++i)
- PL_uudmap[(U8)PL_uuemap[i]] = i;
- /*
- * Because ' ' and '`' map to the same value,
- * we need to decode them both the same.
- */
- PL_uudmap[(U8)' '] = 0;
- }
{
const STRLEN l = (STRLEN) (strend - s) * 3 / 4;
sv = sv_2mortal(newSV(l));
PL_glob_index = proto_perl->Iglob_index;
PL_srand_called = proto_perl->Isrand_called;
- PL_uudmap[(U32) 'M'] = 0; /* reinits on demand */
PL_bitcount = NULL; /* reinits on demand */
if (proto_perl->Ipsig_pend) {
$(DBG)perlshr$(E) : $(DBG)libperl$(OLB) $(extobj) $(DBG)perlshr_xtras.ts
Link $(LINKFLAGS)/Share=$(MMS$TARGET) $(extobj) []$(DBG)perlshr_bld.opt/Option, perlshr_attr.opt/Option
+globals$(O): uudmap.h
+
+uudmap.h: generate_uudmap.exe
+ MCR generate_uudmap.exe >uudmap.h
+
+generate_uudmap.exe: generate_uudmap$(O)
+ Link $(LINKFLAGS)/NoDebug/Trace/NoMap/NoFull/NoCross/Exe=$(MMS$TARGET) generate_uudmap$(O) $(CRTLOPTS)
+
# The following files are built in one go by gen_shrfls.pl:
# perlshr_attr.opt, $(DBG)perlshr_bld.opt - VAX and AXP
# perlshr_gbl*.mar, perlshr_gbl*$(O) - VAX only
- If F$Search("vmsish.h;-1").nes."" Then Purge/NoConfirm/Log vmsish.h
- If F$Search("vms.c;-1") .nes."" Then Purge/NoConfirm/Log vms.c
- If F$Search("perlmain.c;-1") .nes."" Then Purge/NoConfirm/Log perlmain.c
+ - If F$Search("uudmap.h;-1") .nes."" Then Purge/NoConfirm/Log uudmap.h
+ - If F$Search("generate_uudmap.exe;-1") .nes."" Then Purge/NoConfirm/Log generate_uudmap.exe
+ - If F$Search("generate_uudmap$(O);-1") .nes."" Then Purge/NoConfirm/Log generate_uudmap$(O)
- If F$Search("Perlshr_Gbl*.Mar;-1") .nes."" Then Purge/NoConfirm/Log Perlshr_Gbl*.Mar
- If F$Search("[.ext.DynaLoader]dl_vms$(O);-1").nes."" Then Purge/NoConfirm/Log [.ext.DynaLoader]dl_vms$(O)
- If F$Search("[.ext.DynaLoader]dl_vms.c;-1").nes."" Then Purge/NoConfirm/Log [.ext.DynaLoader]dl_vms.c
<<
$(EMBED_EXE_MANI)
+globals$(o) : uudmap.h
+
+uudmap.h: generate_uudmap.exe
+ generate_uudmap >uudmap.h
+
+generate_uudmap.exe : generate_uudmap$(o)
+ $(LINK32) -subsystem:console -out:$@ @<<
+ $(LINK_FLAGS) $(LIBFILES) generate_uudmap$(o)
+
perlmain.c : runperl.c
copy runperl.c perlmain.c
-@$(DEL) $(PERLSTATICLIB)
-@$(DEL) $(PERLDLL)
-@$(DEL) $(CORE_OBJ)
+ -@$(DEL) generate_uudmap.exe generate_uudmap$(o) uudmap.h
-if exist $(MINIDIR) rmdir /s /q $(MINIDIR)
-if exist $(UNIDATADIR1) rmdir /s /q $(UNIDATADIR1)
-if exist $(UNIDATADIR2) rmdir /s /q $(UNIDATADIR2)
$(EMBED_EXE_MANI)
.ENDIF
+globals$(o) : uudmap.h
+
+uudmap.h: generate_uudmap.exe
+ generate_uudmap >uudmap.h
+
+generate_uudmap.exe : generate_uudmap$(o)
+.IF "$(CCTYPE)" == "BORLAND"
+ $(LINK32) -Tpe -ap $(BLINK_FLAGS) \
+ @$(mktmp c0x32$(o) generate_uudmap$(o),$(@:s,\,$B,),,$(LIBFILES),)
+.ELIF "$(CCTYPE)" == "GCC"
+ $(LINK32) -v -o $@ $(BLINK_FLAGS) \
+ $(mktmp $(LKPRE) generate_uudmap$(o) $(LIBFILES) $(LKPOST))
+.ELSE
+ $(LINK32) -subsystem:console -out:$@ $(BLINK_FLAGS) \
+ @$(mktmp $(LIBFILES) generate_uudmap$(o))
+.ENDIF
+
perlmain.c : runperl.c
copy runperl.c perlmain.c
-@erase $(PERLSTATICLIB)
-@erase $(PERLDLL)
-@erase $(CORE_OBJ)
+ -@erase generate_uudmap.exe generate_uudmap$(o) uudmap.h
-if exist $(MINIDIR) rmdir /s /q $(MINIDIR)
-if exist $(UNIDATADIR1) rmdir /s /q $(UNIDATADIR1)
-if exist $(UNIDATADIR2) rmdir /s /q $(UNIDATADIR2)