Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PATCH] makefile fixes for WinCE #14374

Closed
p5pRT opened this issue Dec 28, 2014 · 6 comments
Closed

[PATCH] makefile fixes for WinCE #14374

p5pRT opened this issue Dec 28, 2014 · 6 comments

Comments

@p5pRT
Copy link

p5pRT commented Dec 28, 2014

Migrated from rt.perl.org#123512 (status was 'open')

Searchable as RT123512$

@p5pRT
Copy link
Author

p5pRT commented Dec 28, 2014

From @bulk88

Created by @bulk88

See attached patch.

Perl Info

Flags:
                   category=core
                   severity=low

Site configuration information for perl 5.21.7:

Configured by Owner at Sat Nov 22 21:54:54 2014.

Summary of my perl5 (revision 5 version 21 subversion 7) configuration:
                 Local Commit: 1bce52df028aabe28c20b2d97949e35c17ea811e
                 Ancestor: 7072da8afeba4c87ae623cd913e274396ffcf1cd
                 Platform:
                   osname=MSWin32, osvers=5.1,
archname=MSWin32-x86-multi-thread
                   uname=''
                   config_args='undef'
                   hint=recommended, useposix=true, d_sigaction=undef
                   useithreads=define, usemultiplicity=define
                   use64bitint=undef, use64bitall=undef, uselongdouble=undef
                   usemymalloc=n, bincompat5005=undef
                 Compiler:
                   cc='cl', ccflags ='-nologo -GF -W3 -O1 -MD -Zi -DNDEBUG
-G7 -GL
-DWIN32 -D_CONSOLE -DNO_STRICT  -DPERL_TEXTMODE_SCRIPTS
-DPERL_HASH_FUNC_ONE_AT_A_TIME -DNO_MATHOMS -DPERL_IMPLICIT_CONTEXT
-DPERL_IMPLICIT_SYS -DUSE_PERLIO -D_USE_32BIT_TIME_T',
                   optimize='-O1 -MD -Zi -DNDEBUG -G7 -GL',
                   cppflags='-DWIN32'
                   ccversion='13.10.6030', gccversion='', gccosandvers=''
                   intsize=4, longsize=4, ptrsize=4, doublesize=8,
byteorder=1234,
doublekind=3
                   d_longlong=undef, longlongsize=8, d_longdbl=define,
longdblsize=8,
longdblkind=0
                   ivtype='long', ivsize=4, nvtype='double', nvsize=8,
Off_t='__int64',
lseeksize=8
                   alignbytes=8, prototype=define
                 Linker and Libraries:
                   ld='link', ldflags ='-nologo -nodefaultlib -debug
-opt:ref,icf
-ltcg  -libpath:"c:\perl521\lib\CORE"  -machine:x86'
                   libpth="C:\Program Files\Microsoft Visual Studio .NET
2003\VC7\lib"
                   libs=oldnames.lib kernel32.lib user32.lib gdi32.lib
winspool.lib
comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib
netapi32.lib uuid.lib ws2_32.lib mpr.lib winmm.lib  version.lib
odbc32.lib odbccp32.lib comctl32.lib msvcrt.lib
                   perllibs=oldnames.lib kernel32.lib user32.lib gdi32.lib
winspool.lib  comdlg32.lib advapi32.lib shell32.lib ole32.lib
oleaut32.lib  netapi32.lib uuid.lib ws2_32.lib mpr.lib winmm.lib
version.lib odbc32.lib odbccp32.lib comctl32.lib msvcrt.lib
                   libc=msvcrt.lib, so=dll, useshrplib=true,
libperl=perl521.lib
                   gnulibc_version=''
                 Dynamic Linking:
                   dlsrc=dl_win32.xs, dlext=dll, d_dlsymun=undef,
ccdlflags=' '
                   cccdlflags=' ', lddlflags='-dll -nologo -nodefaultlib
-debug
-opt:ref,icf -ltcg  -libpath:"c:\perl521\lib\CORE"  -machine:x86'

Locally applied patches:
                   ce7a4d57d0acca9f39a84d36d708c4505dfe45ca
                   ca0b263f4b167ddf97416f657d79ab5bd3344357
                   08919bf863666074243240abbd19cd1a74cc7b74
                   b8a043377dbf39548709b107a11e5cc2714c0e9a
                   efa855eb5cffb7739616c295dd968d1510efeeb0
                   1d47d0b810e26d9a2f9101fb813bd5b3dd332cc9
                   3faca062ddb056db54f73fa55b0a9d473675dd33
                   0b3e905bda3e75ad948a1213f620656b60807393
                   1b1efc719fde05d215e5a13fb38c03e12a3aab08
                   1bce52df028aabe28c20b2d97949e35c17ea811e


@INC for perl 5.21.7:
                   ..\lib
                   C:/perl521/srcnewb4opt/lib
                   .


Environment for perl 5.21.7:
                   HOME (unset)
                   LANG (unset)
                   LANGUAGE (unset)
                   LD_LIBRARY_PATH (unset)
                   LOGDIR (unset)
                   PATH=C:\WINDOWS\system32;C:\Program Files\Microsoft
Visual
Studio
.NET 2003\Vc7\bin;C:\Program Files\Microsoft Visual Studio .NET
2003\Common7\IDE;C:\WINDOWS;C:\Program Files\Git\cmd;C:\Program
Files\Microsoft Visual Studio .NET 2003\Common7\Tools\bin;C:\perl\bin
                   PERL_BADLANG (unset)
                   PERL_JSON_BACKEND=Cpanel::JSON::XS
                   PERL_YAML_BACKEND=YAML
                   SHELL (unset)



















@p5pRT
Copy link
Author

p5pRT commented Dec 28, 2014

From @bulk88

0001-makefile-fixes-for-WinCE.patch
From 6c9e05e04f42e7009fcdd7717a1e58b63eb65e90 Mon Sep 17 00:00:00 2001
From: Daniel Dragan <bulk88@hotmail.com>
Date: Sun, 28 Dec 2014 15:38:18 -0500
Subject: [PATCH] makefile fixes for WinCE

-OPTIMIZE makefile define was used by the ce makefile but never defined
 before, now its defined
-BUILDOPT contained CECFLAGS, but CFLAGS->DEFINES->CECFLAGS
 and the root define CFLAGS_O, contains $(CFLAGS) and $(BUILDOPT), CECFLAGS
 which 2-3 console lines long, was given to the CC twice, this give
 unecesserily long console output, so remove the duplicate CECFLAGS
-unblock Time::Piece, it got fixed for CE and applied to blead
-Win32CORE needs to be static like on desktop Perl
-remove unused PCHFLAGS define, it has never been used on desktop makefile
-remove comment from config.ce, that wasn't a comment! and went to linker
 cmd line
-add NO_MATHOMS, this is a resource limited device
---
 win32/Makefile.ce |   30 ++++++++++++++++++------------
 win32/config.ce   |    2 +-
 2 files changed, 19 insertions(+), 13 deletions(-)

diff --git a/win32/Makefile.ce b/win32/Makefile.ce
index e3fd4bf..2f8683c 100644
--- a/win32/Makefile.ce
+++ b/win32/Makefile.ce
@@ -387,23 +387,24 @@ CEDEFS    = -D_WINDOWS -D_WIN32_WCE=$(CEVersion) -DUNDER_CE=$(CEVersion) \
 CECFLAGS  = $(CEDEFS) -Zi
 
 !if "$(CFG)" == "DEBUG"
-CECFLAGS  = $(CECFLAGS) -Od
+OPTIMIZE        = -Od
 !endif
 
 !if "$(CFG)" == "RELEASE"
 # -O2 and -Ot give internal compiler error in perl.c and lexer.
 # Also the dll cannot be loaded by perl.exe...
 !if "$(CPU)" == "SH3"
+OPTIMIZE        = -Od
 !else
-CECFLAGS  = $(CECFLAGS) -O1
+OPTIMIZE        = -O1
 !endif
 !  IF "$(CCTYPE)" != "MSVC60"
 #turn on LTCG optimization for CCs that have it
-CECFLAGS	= $(CECFLAGS) -GL
+OPTIMIZE	= $(OPTIMIZE) -GL
 !  ENDIF
 !  IF "$(CCTYPE)" == "MSVC80" || "$(CCTYPE)" == "MSVC90"
 #no stack security cookie for CCs where its on by default
-CECFLAGS	= $(CECFLAGS) -GS-
+$(OPTIMIZE)	= $(OPTIMIZE) -GS-
 !  ENDIF
 !endif
 
@@ -432,7 +433,7 @@ RCDEFS    = /l 0x407 /r /d "UNICODE" /d UNDER_CE=$(CEVersion) \
 # Additional compiler flags can be specified here.
 #
 
-BUILDOPT	= $(BUILDOPT) $(CECFLAGS) -DUSE_CROSS_COMPILE
+BUILDOPT	= $(BUILDOPT) -DUSE_CROSS_COMPILE
 
 
 !IF "$(CRYPT_SRC)$(CRYPT_LIB)" == ""
@@ -510,7 +511,7 @@ LIB32		= $(LINK32) -lib
 RSC		= rc
 
 INCLUDES	= -I.\include -I. -I..
-DEFINES		= -DWIN32 -D_CONSOLE -DNO_STRICT $(CRYPT_FLAG) $(CECFLAGS)
+DEFINES		= -DWIN32 -D_CONSOLE -DNO_STRICT -DNO_MATHOMS $(CRYPT_FLAG) $(CECFLAGS)
 LOCDEFS		= -DPERLDLL -DPERL_CORE
 CXX_FLAG	= -TP
 
@@ -540,8 +541,8 @@ LIBBASEFILES	= $(CRYPT_LIB) $(CELIBS)
 
 LIBFILES	= $(LIBBASEFILES) $(LIBC)
 
-CFLAGS		= -nologo -GF -W3 $(INCLUDES) $(DEFINES) $(LOCDEFS) \
-		$(PCHFLAGS) $(OPTIMIZE)
+CFLAGS		= -nologo -GF -W3 $(INCLUDES) $(DEFINES) $(LOCDEFS)\
+		$(OPTIMIZE)
 
 LINK_FLAGS	= -nologo -debug -opt:ref,icf -machine:$(PROCESSOR_ARCHITECTURE)
 
@@ -732,7 +733,7 @@ DYNAMIC_EXT	= Socket IO Fcntl Opcode SDBM_File POSIX attributes B re \
 		Data/Dumper Devel/Peek ByteLoader Devel/DProf File/Glob \
 		Sys/Hostname
 
-STATIC_EXT	= DynaLoader
+STATIC_EXT	= DynaLoader Win32CORE
 
 DYNALOADER	= $(EXTDIR)\DynaLoader\DynaLoader
 
@@ -851,8 +852,12 @@ NOT_COMPILE_EXT = $(NOT_COMPILE_EXT) !XS/Typemap
 
 Extensions: ..\make_ext.pl $(CONFIGPM)
 	$(HPERL) -I..\lib -I. ..\make_ext.pl "MAKE=$(MAKE)" --dir=$(CPANDIR) --dir=$(DISTDIR) --dir=$(EXTDIR)  --all \
-	!POSIX !Win32 !Win32API/File !Time/HiRes !Time/Piece !re !SDBM_File $(NOT_COMPILE_EXT)
+	!POSIX !Win32 !Win32API/File !Time/HiRes !re !SDBM_File $(NOT_COMPILE_EXT)
 
+Extensions_static : ..\make_ext.pl ..\lib\buildcustomize.pl list_static_libs.pl $(PERLDEP) $(CONFIGPM) Extensions_nonxs
+	$(XCOPY) ..\*.h $(COREDIR)\*.*
+	$(HPERL) -I..\lib ..\make_ext.pl "MAKE=$(MAKE)" --dir=$(CPANDIR) --dir=$(DISTDIR) --dir=$(EXTDIR) --static
+	$(HPERL) -I..\lib list_static_libs.pl > Extensions_static
 
 Extensions_nonxs: ..\make_ext.pl ..\lib\buildcustomize.pl $(CONFIGPM) ..\pod\perlfunc.pod
 	$(XCOPY) ..\*.h $(COREDIR)\*.*
@@ -877,6 +882,7 @@ clean: Extensions_clean
 	-@$(DEL) ..\git_version.h
   -@$(DEL) config.h perl.res
   -@$(DEL) ..\t\test_state
+  -@$(DEL) Extensions_static
 
 XDLLOBJS = \
 $(DLLDIR)\av.obj \
@@ -974,11 +980,11 @@ perldll.def : $(HPERL) $(CONFIGPM) ..\embed.fnc ..\makedef.pl create_perllibst_h
 	$(HPERL) -I..\lib -w ..\makedef.pl PLATFORM=wince $(OPTIMIZE) $(DEFINES) $(BUILDOPT) \
 	    CCTYPE=$(CCTYPE) -DPERL_DLL=$(PERLDLL) TARG_DIR=..\ > perldll.def
 
-$(PERLDLL) : header_check lib_check $(DLLDIR) perldll.def $(XDLLOBJS) $(PERLDLL_RES)
+$(PERLDLL) : header_check lib_check $(DLLDIR) perldll.def $(XDLLOBJS) $(PERLDLL_RES) Extensions_static
 	$(LINK32) -dll -def:perldll.def -base:0x28000000 -out:$@ \
                   $(SUBSYS) $(LDLIBPATH) \
 		  $(LINK_FLAGS) $(LIBFILES) \
-		  $(XDLLOBJS) $(PERLDLL_RES)
+		  $(XDLLOBJS) @Extensions_static $(PERLDLL_RES)
 
 $(DLLDIR) :
 	if not exist "$(DLLDIR)" mkdir "$(DLLDIR)"
diff --git a/win32/config.ce b/win32/config.ce
index f49379f..1578171 100644
--- a/win32/config.ce
+++ b/win32/config.ce
@@ -11,7 +11,7 @@ RCSfile='$RCSfile'
 Revision='$Revision'
 Source=''
 State=''
-_a='.lib' # keep this for WinCE, as it is used by some mods...
+_a='.lib'
 _exe='.exe'
 _o='.obj'
 afs='false'
-- 
1.7.9.msysgit.0

@p5pRT
Copy link
Author

p5pRT commented Dec 30, 2014

From @steve-m-hay

The WinCE build currently doesn't work at all for me, with or without this patch :-/

I believe I have my WinCE build system set up correctly still from the last time I tried it, when your build instructions were added to README.ce sometime during 5.19.

I am following those instructions but I find that when I get to the "nmake -f Makefile.ce" step it starts by doing a "realclean" of the build tree, which wipes out the desktop perl that I've just built. It staggers on after that, but complaining at every step that perlglob.exe is missing (which it now is, since realclean just deleted it).

Makefile.ce's "all" target depends on "force_config_h", which runs "-@​$(MAKE) -f Makefile distclean" [sic]. That's the desktop perl's makefile, not Makefile.ce. Is that correct? My first thought was that maybe it should say Makefile.ce, but Makefile.ce doesn't have a "distclean" target.

It was added here​:

http​://perl5.git.perl.org/perl.git/commit/9f88ff7aa7617394415b4ce5793ea6f66905e4bd

@p5pRT
Copy link
Author

p5pRT commented Dec 30, 2014

The RT System itself - Status changed from 'new' to 'open'

@p5pRT
Copy link
Author

p5pRT commented Jan 7, 2015

From @tonycoz

On Sun Dec 28 12​:40​:50 2014, bulk88 wrote​:

See attached patch.

In addition to Steve's comments, this chunk looks wrong​:

#no stack security cookie for CCs where its on by default
-CECFLAGS = $(CECFLAGS) -GS-
+$(OPTIMIZE) = $(OPTIMIZE) -GS-
! ENDIF
!endif

Tony

@xenu
Copy link
Member

xenu commented Oct 22, 2019

We no longer support Windows CE, see 79c32fc.

@xenu xenu closed this as completed Oct 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants