summaryrefslogtreecommitdiff
path: root/win32
diff options
context:
space:
mode:
authorDaniel Dragan <bulk88@hotmail.com>2013-10-09 03:33:47 -0400
committerSteve Hay <steve.m.hay@googlemail.com>2013-10-21 17:27:58 +0100
commit27329181e393b988b7745c51463210b270f51c87 (patch)
tree19de20700825bb674713eeb07ccaffd9f2ef414a /win32
parent9d176cd8dda1d6b2f98386843a92abe96e8a328e (diff)
downloadperl-27329181e393b988b7745c51463210b270f51c87.tar.gz
WinCE Makefile and make_ext.pl general and XS fixes
On a WinCE build. On the 2nd nmake run, using Makefile.ce, eventually calls the Extensions target which calls make_ext.pl. What happens is nmake for CE for each module is called on the Desktop per module makefile from the earlier Desktop build. Since the Desktop Perl already was built sucessfully, all rules/deps are met in the Desktop per module makefile, and nothing happens during the module building phase for a CE build. Previously I used external file management tools to delete the per module Makefiles before running Makefile.ce. *make_ext.pl - implement deleting and rebuilding the per module makefile on a Cross build - use constants for constant folding, there are opportunities for other variables to be converted to constants in the future - fix a bug from commit baff067e71 where unlink() on a file with an open handle ($mfh) didn't delete the file from disk and a new per module makefile would be not be built by make_ext.pl later since the per module makefile was still on disk. This was observed on Win32. Also harden the unlink code with a new _unlink sub that is fatal if the file is still on disk after unlink supposedly deleted it. - var $header and the quotemeta is because of an issue in Perl #119793 *Makefile.ce - bring the debugging symbol generation flags and optimization flags to be closer to a Dekstop VC Perl build - ICWD is obsolete as of commit f6b3c354c9 , remove it - MINIMOD is obsolete as of commit 7b4d95f74b , remove it - make a poisoned config.h so if there is a XS building mixup between a desktop and CE perl, the poisoned config.h for CE will stop the build gracefully - $(MINIPERL) has never been defined in Makefile.ce from day 1 (10 years) replace with $(HPERL) everywhere, this was causing things to not run silently since $(MINIPERL) was empty string. Use HPERL instead of MINIPERL to allow flexibility to use the full perl binary if necessery one day - better cleaning on root makefile clean target *win32/win32.h *win32/win32iop.h - silence alot of redefinition warnings which gave pages of warnings on each WinCE compliand *mg.c - win32_get_errno is only on WIN32 build not WINCE a "nmake -f Makefile.ce all" will now build the CE interp and all modules in 1 shot with no user intervention
Diffstat (limited to 'win32')
-rw-r--r--win32/Makefile.ce47
-rw-r--r--win32/win32.h3
-rw-r--r--win32/win32iop.h153
3 files changed, 175 insertions, 28 deletions
diff --git a/win32/Makefile.ce b/win32/Makefile.ce
index 1df3bb6768..4ac1e495d0 100644
--- a/win32/Makefile.ce
+++ b/win32/Makefile.ce
@@ -354,10 +354,10 @@ STARTOBJS = $(CECONSOLEDIR)/$(MACHINE)/wmain.obj \
CEDEFS = -D_WINDOWS -D_WIN32_WCE=$(CEVersion) -DUNDER_CE=$(CEVersion) \
$(MCFLAGS) -D PERL -GS-
-CECFLAGS = $(CEDEFS)
+CECFLAGS = $(CEDEFS) -Zi
!if "$(CFG)" == "DEBUG"
-CECFLAGS = $(CECFLAGS) -Zi -Od
+CECFLAGS = $(CECFLAGS) -Od
!endif
!if "$(CFG)" == "RELEASE"
@@ -365,7 +365,7 @@ CECFLAGS = $(CECFLAGS) -Zi -Od
# Also the dll cannot be loaded by perl.exe...
!if "$(CPU)" == "SH3"
!else
-CECFLAGS = $(CECFLAGS) -O2 -Ot
+CECFLAGS = $(CECFLAGS) -O1 -GL
!endif
!endif
@@ -373,7 +373,7 @@ CECFLAGS = $(CECFLAGS) -O2 -Ot
RCDEFS = /l 0x407 /r /d "UNICODE" /d UNDER_CE=$(CEVersion) \
/d _WIN32_WCE=$(CEVersion)
-PATH=$(CEPATH);$(PATH)
+#PATH=$(CEPATH);$(PATH)
# attention, for eVC 4, these paths are not generated correctly since the
# WinCE SDK is organized differently from eVC 3, replace the next 2 macros
@@ -506,13 +506,7 @@ LIBFILES = $(LIBBASEFILES) $(LIBC)
CFLAGS = -nologo -GF -W3 $(INCLUDES) $(DEFINES) $(LOCDEFS) \
$(PCHFLAGS) $(OPTIMIZE)
-LINK_FLAGS = -nologo -opt:ref,icf -machine:$(PROCESSOR_ARCHITECTURE)
-
-!if "$(CFG)" == "DEBUG"
-LINK_FLAGS = $(LINK_FLAGS) -debug
-!else
-LINK_FLAGS = $(LINK_FLAGS) -release
-!endif
+LINK_FLAGS = -nologo -debug -opt:ref,icf -machine:$(PROCESSOR_ARCHITECTURE)
OBJOUT_FLAG = -Fo
EXEOUT_FLAG = -Fe
@@ -553,7 +547,6 @@ DLLDIR = $(MACHINE)\dll
PERLEXE = $(MACHINE)\perl.exe
CONFIGPM = ..\xlib\$(CROSS_NAME)\Config.pm
-MINIMOD = ..\lib\ExtUtils\Miniperl.pm
# Unicode data files generated by mktables
FIRSTUNIFILE = ..\lib\unicore\Decomposition.pl
@@ -732,13 +725,10 @@ CFG_VARS = \
"optimize=$(OPTIMIZE)" \
"WIN64=$(WIN64)"
-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 \
+XSUBPP = $(HPERL) -I..\..\lib -MCross=$(CROSS_NAME) ..\$(EXTUTILSDIR)\xsubpp \
-C++ -prototypes
@@ -746,14 +736,14 @@ XSUBPP = $(HPERL) -I..\..\lib $(ICWD1) -MCross=$(CROSS_NAME) ..\$(EXTUTILSDIR)\
# Top targets
#
-all: hostminiperl $(MINIMOD) $(CONFIGPM) $(UNIDATAFILES) $(PERLEXE) MakePPPort Extensions
+all: hostminiperl $(CONFIGPM) $(UNIDATAFILES) $(PERLEXE) MakePPPort Extensions
$(DYNALOADER)$(o) : $(DYNALOADER).c xconfig.h $(EXTDIR)\DynaLoader\dlutils.c
#convenience target
configpm_targ : $(CONFIGPM)
-$(CONFIGPM) : $(HPERL) ..\Cross\config-$(MACHINE).sh config_h.PL ..\minimod.pl
+$(CONFIGPM) : $(HPERL) ..\Cross\config-$(MACHINE).sh config_h.PL
cd .. && $(HPERL) -Ilib configpm --cross=$(CROSS_NAME) --no-glossary
-mkdir $(XCOREDIR)
$(XCOPY) ..\*.h $(XCOREDIR)\*.*
@@ -764,16 +754,16 @@ $(CONFIGPM) : $(HPERL) ..\Cross\config-$(MACHINE).sh config_h.PL ..\minimod.pl
.\xconfig.h:
-del /f xconfig.h
-mkdir $(XCOREDIR)
- -$(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
+ -$(HPERL) -I..\lib -MCross=$(CROSS_NAME) config_h.PL "INST_VER=$(INST_VER)" "CORE_DIR=$(XCOREDIR)" "CONFIG_H=xconfig.h"
+#prevent accidents where the desktop config.h is used
+ $(DEL) $(XCOREDIR)\config.h
+ echo "#error This is a cross build. Use xconfig.h. \
+" > $(XCOREDIR)\config.h
..\Cross\config-$(MACHINE).sh: config.ce config_sh.PL
$(HPERL) -I..\lib -I. config_sh.PL $(CFG_VARS) config.ce > ..\Cross\config-$(MACHINE).sh
-$(MINIMOD) : ..\minimod.pl
- cd .. && $(HPERL) minimod.pl > lib\ExtUtils\Miniperl.pm
-
-MakePPPort: $(MINIPERL) $(CONFIGPM)
+MakePPPort: $(HPERL) $(CONFIGPM)
$(HPERL) -I..\lib -MCross=$(CROSS_NAME) ..\mkppport
MakePPPort_clean:
@@ -790,17 +780,17 @@ NOT_COMPILE_EXT = $(NOT_COMPILE_EXT) !XS/Typemap
Extensions: ..\make_ext.pl $(CONFIGPM)
$(HPERL) -I..\lib -I. -MCross=$(CROSS_NAME) ..\make_ext.pl "MAKE=$(MAKE)" --dir=$(CPANDIR) --dir=$(DISTDIR) --dir=$(EXTDIR) --all \
- !POSIX !Errno !Win32 !Win32API/File !Socket !Time/HiRes !Time/Piece !re $(NOT_COMPILE_EXT)
+ !POSIX !Errno !Win32 !Win32API/File !Time/HiRes !Time/Piece !re !SDBM_File $(NOT_COMPILE_EXT)
Extensions_clean:
- -if exist $(MINIPERL) $(MINIPERL) -I..\lib ..\make_ext.pl "MAKE=$(MAKE)" --all --target=clean
+ -if exist $(HPERL) $(HPERL) -I..\lib ..\make_ext.pl "MAKE=$(MAKE)" --dir=$(CPANDIR) --dir=$(DISTDIR) --dir=$(EXTDIR) --all --target=clean
#----------------------------------------------------------------------------------
$(PERLEXE_RES): perlexe.rc perl.rc $(PERLEXE_MANIFEST) $(PERLEXE_ICO)
rc $(RCDEFS) perlexe.rc
-clean:
+clean: Extensions_clean
-if exist .\$(MACHINE)\dll rmdir /s /q .\$(MACHINE)\dll
-@$(DEL) .\$(MACHINE)\*.obj
-@$(DEL) .\$(MACHINE)\*.exe
@@ -810,6 +800,7 @@ clean:
-@$(DEL) .\$(MACHINE)\*.pdb
-@$(DEL) ..\Cross\config-$(MACHINE).sh ..\lib\Config.pm
-if exist ..\xlib rmdir /s /q ..\xlib
+ -if exist .\$(MACHINE) rmdir /s /q .\$(MACHINE)
-@$(DEL) config.h xconfig.h perl.res
-@$(DEL) ..\t\test_state
@@ -955,7 +946,7 @@ install: all
$(UNIDATAFILES) : $(HPERL) $(CONFIGPM) ..\lib\unicore\mktables
cd ..\lib\unicore && \
- $(HPERL) -I.. -I..\..\lib $(ICWD1) -MCross=$(CROSS_NAME) mktables -P ..\..\pod -maketest -makelist -p -check $@ $(FIRSTUNIFILE)
+ $(HPERL) -I.. -I..\..\lib -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/win32.h b/win32/win32.h
index 79fe071351..832ebda866 100644
--- a/win32/win32.h
+++ b/win32/win32.h
@@ -243,6 +243,9 @@ typedef unsigned short mode_t;
#pragma warning(disable: 4102) /* "unreferenced label" */
#define isnan _isnan
+#ifdef UNDER_CE /* revisit what function this becomes celib vs corelibc, prv warning here*/
+# undef snprintf
+#endif
#define snprintf _snprintf
#define vsnprintf _vsnprintf
diff --git a/win32/win32iop.h b/win32/win32iop.h
index 207c9176e5..11d4219fc2 100644
--- a/win32/win32iop.h
+++ b/win32/win32iop.h
@@ -207,75 +207,210 @@ END_EXTERN_C
*/
#undef fprintf
#define fprintf win32_fprintf
+#ifdef UNDER_CE /* celib also makes these be macros to celib's x* symbols */
+# undef vfprintf
+#endif
#define vfprintf win32_vfprintf
+#ifdef UNDER_CE
+# undef printf
+#endif
#define printf win32_printf
+#ifdef UNDER_CE
+# undef vprintf
+#endif
#define vprintf win32_vprintf
+#ifdef UNDER_CE
+# undef fread
+#endif
#define fread(buf,size,count,f) win32_fread(buf,size,count,f)
+#ifdef UNDER_CE
+# undef fwrite
+#endif
#define fwrite(buf,size,count,f) win32_fwrite(buf,size,count,f)
+#ifdef UNDER_CE
+# undef fopen
+#endif
#define fopen win32_fopen
#undef fdopen
#define fdopen win32_fdopen
+#ifdef UNDER_CE
+# undef freopen
+#endif
#define freopen win32_freopen
#define fclose(f) win32_fclose(f)
+#ifdef UNDER_CE
+# undef fputs
+#endif
#define fputs(s,f) win32_fputs(s,f)
+#ifdef UNDER_CE
+# undef fputc
+#endif
#define fputc(c,f) win32_fputc(c,f)
+#ifdef UNDER_CE
+# undef ungetc
+#endif
#define ungetc(c,f) win32_ungetc(c,f)
#undef getc
#define getc(f) win32_getc(f)
+#ifdef UNDER_CE
+# undef fileno
+#endif
#define fileno(f) win32_fileno(f)
+#ifdef UNDER_CE
+# undef clearerr
+#endif
#define clearerr(f) win32_clearerr(f)
+#ifdef UNDER_CE
+# undef fflush
+#endif
#define fflush(f) win32_fflush(f)
+#ifdef UNDER_CE
+# undef ftell
+#endif
#define ftell(f) win32_ftell(f)
+#ifdef UNDER_CE
+# undef fseek
+#endif
#define fseek(f,o,w) win32_fseek(f,o,w)
+#ifdef UNDER_CE
+# undef fgetpos
+#endif
#define fgetpos(f,p) win32_fgetpos(f,p)
+#ifdef UNDER_CE
+# undef fsetpos
+#endif
#define fsetpos(f,p) win32_fsetpos(f,p)
+#ifdef UNDER_CE
+# undef rewind
+#endif
#define rewind(f) win32_rewind(f)
#define tmpfile() win32_tmpfile()
+#ifdef UNDER_CE
+# undef abort
+#endif
#define abort() win32_abort()
+#ifdef UNDER_CE
+# undef fstat
+#endif
#define fstat(fd,bufptr) win32_fstat(fd,bufptr)
+#ifdef UNDER_CE
+# undef stat
+#endif
#define stat(pth,bufptr) win32_stat(pth,bufptr)
#define longpath(pth) win32_longpath(pth)
#define ansipath(pth) win32_ansipath(pth)
+#ifdef UNDER_CE
+# undef rename
+#endif
#define rename(old,new) win32_rename(old,new)
+#ifdef UNDER_CE
+# undef setmode
+#endif
#define setmode(fd,mode) win32_setmode(fd,mode)
#define chsize(fd,sz) win32_chsize(fd,sz)
+#ifdef UNDER_CE
+# undef lseek
+#endif
#define lseek(fd,offset,orig) win32_lseek(fd,offset,orig)
#define tell(fd) win32_tell(fd)
+#ifdef UNDER_CE
+# undef dup
+#endif
#define dup(fd) win32_dup(fd)
+#ifdef UNDER_CE
+# undef dup2
+#endif
#define dup2(fd1,fd2) win32_dup2(fd1,fd2)
+#ifdef UNDER_CE
+# undef open
+#endif
#define open win32_open
+#ifdef UNDER_CE
+# undef close
+#endif
#define close(fd) win32_close(fd)
#define eof(fd) win32_eof(fd)
+#ifdef UNDER_CE
+# undef isatty
+#endif
#define isatty(fd) win32_isatty(fd)
+#ifdef UNDER_CE
+# undef read
+#endif
#define read(fd,b,s) win32_read(fd,b,s)
+#ifdef UNDER_CE
+# undef write
+#endif
#define write(fd,b,s) win32_write(fd,b,s)
#define _open_osfhandle win32_open_osfhandle
+#ifdef UNDER_CE
+# undef _get_osfhandle
+#endif
#define _get_osfhandle win32_get_osfhandle
#define spawnvp win32_spawnvp
+#ifdef UNDER_CE
+# undef mkdir
+#endif
#define mkdir win32_mkdir
+#ifdef UNDER_CE
+# undef rmdir
+#endif
#define rmdir win32_rmdir
+#ifdef UNDER_CE
+# undef chdir
+#endif
#define chdir win32_chdir
#define flock(fd,o) win32_flock(fd,o)
+#ifdef UNDER_CE
+# undef execv
+#endif
#define execv win32_execv
+#ifdef UNDER_CE
+# undef execvp
+#endif
#define execvp win32_execvp
+#ifdef UNDER_CE
+# undef perror
+#endif
#define perror win32_perror
#define setbuf win32_setbuf
+#ifdef UNDER_CE
+# undef setvbuf
+#endif
#define setvbuf win32_setvbuf
#undef flushall
#define flushall win32_flushall
#undef fcloseall
#define fcloseall win32_fcloseall
+#ifdef UNDER_CE
+# undef fgets
+#endif
#define fgets win32_fgets
+#ifdef UNDER_CE
+# undef gets
+#endif
#define gets win32_gets
+#ifdef UNDER_CE
+# undef fgetc
+#endif
#define fgetc win32_fgetc
#undef putc
#define putc win32_putc
+#ifdef UNDER_CE
+# undef puts
+#endif
#define puts win32_puts
#undef getchar
#define getchar win32_getchar
#undef putchar
#define putchar win32_putchar
+#ifdef UNDER_CE
+# undef access
+#endif
#define access(p,m) win32_access(p,m)
+#ifdef UNDER_CE
+# undef chmod
+#endif
#define chmod(p,m) win32_chmod(p,m)
@@ -302,19 +437,37 @@ END_EXTERN_C
#define link win32_link
#define unlink win32_unlink
#define utime win32_utime
+#ifdef UNDER_CE
+# undef gettimeofday
+#endif
#define gettimeofday win32_gettimeofday
#define uname win32_uname
#define wait win32_wait
#define waitpid win32_waitpid
+#ifdef UNDER_CE
+# undef kill
+#endif
#define kill win32_kill
+#ifdef UNDER_CE
+# undef opendir
+#endif
#define opendir win32_opendir
+#ifdef UNDER_CE
+# undef readdir
+#endif
#define readdir win32_readdir
#define telldir win32_telldir
#define seekdir win32_seekdir
#define rewinddir win32_rewinddir
+#ifdef UNDER_CE
+# undef closedir
+#endif
#define closedir win32_closedir
#define os_id win32_os_id
+#ifdef UNDER_CE
+# undef getpid
+#endif
#define getpid win32_getpid
#undef crypt