In perl.git, the branch blead has been updated <http://perl5.git.perl.org/perl.git/commitdiff/517bb5c6f8501a4a11c30ba6d11dbc96cc1f5ce2?hp=cd88b75a7a5146fdb4fac022b6d4bd40ce4accfc>
- Log ----------------------------------------------------------------- commit 517bb5c6f8501a4a11c30ba6d11dbc96cc1f5ce2 Author: Konovalov, Vadim (Vadim)** CTR ** <vadim.konova...@alcatel-lucent.com> Date: Thu Nov 1 14:03:34 2012 +0000 Initial (incomplete) patch to start restoring WinCE build Subject: RE: status of WinCE Perl port in 2012 From: "Konovalov, Vadim (Vadim)** CTR **" <vadim.konova...@alcatel-lucent.com> Date: Tue, 23 Oct 2012 14:26:49 +0200 Message-ID: <35bf8d9716175c43bb9d67ca60cc345e028ee0c...@frmrssxchmbsc2.dc-m.alcatel-lucent.com> ----------------------------------------------------------------------- Summary of changes: win32/Makefile.ce | 44 ++++++++++++++++++++++++++------------------ win32/wince.c | 48 ++++++++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 72 insertions(+), 20 deletions(-) diff --git a/win32/Makefile.ce b/win32/Makefile.ce index 13c9dbe..8de0d3e 100644 --- a/win32/Makefile.ce +++ b/win32/Makefile.ce @@ -5,8 +5,7 @@ # SRCDIR = .. -PV = 59 -INST_VER = 5.17.6 +PV = 517 # INSTALL_ROOT specifies a path where this perl will be installed on CE device INSTALL_ROOT=/netzwerk/sprache/perl @@ -535,12 +534,18 @@ CONFIGPM = ..\xlib\$(CROSS_NAME)\Config.pm MINIMOD = ..\lib\ExtUtils\Miniperl.pm # Unicode data files generated by mktables +FIRSTUNIFILE = ..\lib\unicore\Decomposition.pl UNIDATAFILES = ..\lib\unicore\Decomposition.pl \ ..\lib\unicore\CombiningClass.pl ..\lib\unicore\Name.pl \ ..\lib\unicore\Heavy.pl ..\lib\unicore\mktables.lst \ ..\lib\unicore\UCD.pl ..\lib\unicore\Name.pm \ ..\lib\unicore\TestProp.pl +PERLEXE_MANIFEST= .\perlexe.manifest +PERLEXE_ICO = .\perlexe.ico +PERLEXE_RES = .\perlexe.res +PERLDLL_RES = + # Directories of Unicode data files generated by mktables UNIDATADIR1 = ..\lib\unicore\To UNIDATADIR2 = ..\lib\unicore\lib @@ -556,12 +561,6 @@ MAKE = nmake -nologo CFGSH_TMPL = config.ce CFGH_TMPL = config_H.ce -# -# filenames given to xsubpp must have forward slashes (since it puts -# full pathnames in #line strings) -XSUBPP = $(HPERL) -I..\..\lib -MCross=$(CROSS_NAME) ..\$(EXTUTILSDIR)\xsubpp \ - -C++ -prototypes - MICROCORE_SRC = \ ..\av.c \ ..\deb.c \ @@ -695,6 +694,16 @@ CFG_VARS = \ "LINK_FLAGS=$(LDLIBPATH) $(LINK_FLAGS) $(SUBSYS)" \ "optimize=$(OPTIMIZE)" +ICWD = -I..\dist\Cwd -I..\dist\Cwd\lib +ICWD1 = -I..\..\dist\Cwd -I..\..\dist\Cwd\lib + +# +# filenames given to xsubpp must have forward slashes (since it puts +# full pathnames in #line strings) +XSUBPP = $(HPERL) -I..\..\lib $(ICWD1) -MCross=$(CROSS_NAME) ..\$(EXTUTILSDIR)\xsubpp \ + -C++ -prototypes + + # # Top targets # @@ -703,8 +712,8 @@ all: hostminiperl $(MINIMOD) $(CONFIGPM) $(UNIDATAFILES) $(PERLEXE) MakePPPort E $(DYNALOADER)$(o) : $(DYNALOADER).c xconfig.h $(EXTDIR)\DynaLoader\dlutils.c -$(CONFIGPM) : $(HPERL) ..\config.sh .\xconfig.h config_h.PL ..\minimod.pl - cd .. && $(HPERL) configpm --cross=$(CROSS_NAME) --no-glossary +$(CONFIGPM) : $(HPERL) ..\config.sh config_h.PL ..\minimod.pl + cd .. && $(HPERL) -Ilib configpm --cross=$(CROSS_NAME) --no-glossary -mkdir $(XCOREDIR) $(XCOPY) ..\*.h $(XCOREDIR)\*.* $(XCOPY) ..\*.inc $(XCOREDIR)\*.* @@ -715,7 +724,7 @@ $(CONFIGPM) : $(HPERL) ..\config.sh .\xconfig.h config_h.PL ..\minimod.pl .\xconfig.h: -del /f xconfig.h -mkdir $(XCOREDIR) - -$(HPERL) -I..\lib -MCross=$(CROSS_NAME) config_h.PL "INST_VER=$(INST_VER)" "CORE_DIR=$(XCOREDIR)" "CONFIG_H=xconfig.h" + -$(HPERL) -I..\lib $(ICWD) -MCross=$(CROSS_NAME) config_h.PL "INST_VER=$(INST_VER)" "CORE_DIR=$(XCOREDIR)" "CONFIG_H=xconfig.h" $(XCOPY) xconfig.h $(XCOREDIR)\config.h ..\config.sh: config.ce config_sh.PL @@ -728,10 +737,8 @@ $(DYNALOADER).c: $(EXTDIR)\DynaLoader\dl_win32.xs $(CONFIGPM) if not exist $(AUTODIR) mkdir $(AUTODIR) cd $(EXTDIR)\$(*B) $(HPERL) -I..\..\lib -MCross=$(CROSS_NAME) $(*B)_pm.PL - $(HPERL) -I..\..\lib -MCross=$(CROSS_NAME) XSLoader_pm.PL cd ..\..\win32 $(XCOPY) $(EXTDIR)\$(*B)\$(*B).pm $(LIBDIR)\$(NULL) - $(XCOPY) $(EXTDIR)\$(*B)\XSLoader.pm $(LIBDIR)\$(NULL) cd $(EXTDIR)\$(*B) $(XSUBPP) dl_win32.xs > $(*B).c cd ..\..\win32 @@ -763,8 +770,8 @@ Extensions_clean: #---------------------------------------------------------------------------------- -$(PERLEXE_RES): perl.rc perl.ico - rc $(RCDEFS) perl.rc +$(PERLEXE_RES): perlexe.rc perl.rc $(PERLEXE_MANIFEST) $(PERLEXE_ICO) + rc $(RCDEFS) perlexe.rc clean: -rm -f $(MACHINE)/dll/* @@ -787,6 +794,7 @@ $(DLLDIR)\gv.obj \ $(DLLDIR)\mro.obj \ $(DLLDIR)\hv.obj \ $(DLLDIR)\locale.obj \ +$(DLLDIR)\keywords.obj \ $(DLLDIR)\mathoms.obj \ $(DLLDIR)\mg.obj \ $(DLLDIR)\numeric.obj \ @@ -846,8 +854,8 @@ $(DLLDIR)\perllib$(o) : perllib.c .\perlhost.h .\vdir.h .\vmem.h !ENDIF perldll.def : $(HPERL) $(CONFIGPM) ..\embed.fnc ..\makedef.pl create_perllibst_h.pl - $(HPERL) -MCross -I..\lib create_perllibst_h.pl - $(HPERL) -MCross -w ..\makedef.pl PLATFORM=wince $(OPTIMIZE) $(DEFINES) $(BUILDOPT) \ + $(HPERL) -I..\lib -MCross create_perllibst_h.pl + $(HPERL) -I..\lib -MCross -w ..\makedef.pl PLATFORM=wince $(OPTIMIZE) $(DEFINES) $(BUILDOPT) \ CCTYPE=$(CCTYPE) -DPERL_DLL=$(PERLDLL) TARG_DIR=..\ > perldll.def $(PERLDLL) : $(DLLDIR) perldll.def $(XDLLOBJS) $(PERLDLL_RES) @@ -914,7 +922,7 @@ install: all $(UNIDATAFILES) : $(HPERL) $(CONFIGPM) ..\lib\unicore\mktables cd ..\lib\unicore && \ - $(HPERL) -I.. mktables -P ..\..\pod -maketest -makelist -p + $(HPERL) -I.. -I..\..\lib $(ICWD1) -MCross=$(CROSS_NAME) mktables -P ..\..\pod -maketest -makelist -p -check $@ $(FIRSTUNIFILE) dist: all $(HPERL) -I..\lib -MCross=$(CROSS_NAME) ce-helpers\makedist.pl --distdir=dist-$(CROSS_NAME) --cross-name=$(CROSS_NAME) diff --git a/win32/wince.c b/win32/wince.c index d34a1db..b8be93d 100644 --- a/win32/wince.c +++ b/win32/wince.c @@ -261,8 +261,6 @@ win32_get_xlib(const char *pl, const char *xlib, const char *libname, dTHX; char regstr[40]; char pathstr[MAX_PATH+1]; - DWORD datalen; - int len, newsize; SV *sv1 = NULL; SV *sv2 = NULL; @@ -893,6 +891,52 @@ win32_longpath(char *path) return path; } +static void +out_of_memory(void) +{ + if (PL_curinterp) { + dTHX; + /* Can't use PerlIO to write as it allocates memory */ + PerlLIO_write(PerlIO_fileno(Perl_error_log), + PL_no_mem, strlen(PL_no_mem)); + my_exit(1); + } + exit(1); +} + +/* The win32_ansipath() function takes a Unicode filename and converts it + * into the current Windows codepage. If some characters cannot be mapped, + * then it will convert the short name instead. + * + * The buffer to the ansi pathname must be freed with win32_free() when it + * it no longer needed. + * + * The argument to win32_ansipath() must exist before this function is + * called; otherwise there is no way to determine the short path name. + * + * Ideas for future refinement: + * - Only convert those segments of the path that are not in the current + * codepage, but leave the other segments in their long form. + * - If the resulting name is longer than MAX_PATH, start converting + * additional path segments into short names until the full name + * is shorter than MAX_PATH. Shorten the filename part last! + */ +DllExport char * +win32_ansipath(const WCHAR *widename) +{ + char *name; + size_t widelen = wcslen(widename)+1; + int len = WideCharToMultiByte(CP_ACP, WC_NO_BEST_FIT_CHARS, widename, widelen, + NULL, 0, NULL, NULL); + name = win32_malloc(len); + if (!name) + out_of_memory(); + + WideCharToMultiByte(CP_ACP, WC_NO_BEST_FIT_CHARS, widename, widelen, + name, len, NULL, NULL); + return name; +} + DllExport char * win32_getenv(const char *name) { -- Perl5 Master Repository