diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 2005-01-15 21:30:44 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 2005-01-15 21:30:44 +0000 |
commit | c2276cd9a1ad823a3a292bd9ea5d0475bb983737 (patch) | |
tree | d3828d43e8271c783c6683783ad627b4232d3672 /gnu/usr.bin/perl/win32 | |
parent | c30a36e0c140753f3f773b400f5dbc777b344b8a (diff) |
sync in-tree perl with 5.8.6
Diffstat (limited to 'gnu/usr.bin/perl/win32')
-rw-r--r-- | gnu/usr.bin/perl/win32/Makefile | 10 | ||||
-rw-r--r-- | gnu/usr.bin/perl/win32/config_H.bc | 18 | ||||
-rw-r--r-- | gnu/usr.bin/perl/win32/config_H.gc | 18 | ||||
-rw-r--r-- | gnu/usr.bin/perl/win32/config_H.vc | 18 | ||||
-rw-r--r-- | gnu/usr.bin/perl/win32/dl_win32.xs | 11 | ||||
-rw-r--r-- | gnu/usr.bin/perl/win32/makefile.mk | 51 | ||||
-rw-r--r-- | gnu/usr.bin/perl/win32/perllib.c | 15 | ||||
-rw-r--r-- | gnu/usr.bin/perl/win32/pod.mak | 4 | ||||
-rw-r--r-- | gnu/usr.bin/perl/win32/win32.c | 47 | ||||
-rw-r--r-- | gnu/usr.bin/perl/win32/win32sck.c | 81 |
10 files changed, 203 insertions, 70 deletions
diff --git a/gnu/usr.bin/perl/win32/Makefile b/gnu/usr.bin/perl/win32/Makefile index e139903bbcf..9dc80ed8c29 100644 --- a/gnu/usr.bin/perl/win32/Makefile +++ b/gnu/usr.bin/perl/win32/Makefile @@ -32,7 +32,7 @@ INST_TOP = $(INST_DRV)\perl # versioned installation can be obtained by setting INST_TOP above to a
# path that includes an arbitrary version string.
#
-#INST_VER = \5.8.5
+#INST_VER = \5.8.6
#
# Comment this out if you DON'T want your perl installation to have
@@ -326,7 +326,7 @@ ARCHNAME = $(ARCHNAME)-thread # VC 6.0 can load the socket dll on demand. Makes the test suite
# run in about 10% less time.
-DELAYLOAD = -DELAYLOAD:wsock32.dll -DELAYLOAD:shell32.dll delayimp.lib
+DELAYLOAD = -DELAYLOAD:ws2_32.dll -DELAYLOAD:shell32.dll delayimp.lib
!ENDIF
ARCHDIR = ..\lib\$(ARCHNAME)
@@ -412,7 +412,7 @@ BUILDOPT = $(BUILDOPT) -DPERL_MSVCRT_READFIX LIBBASEFILES = $(CRYPT_LIB) \
oldnames.lib kernel32.lib user32.lib gdi32.lib winspool.lib \
comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib \
- netapi32.lib uuid.lib wsock32.lib mpr.lib winmm.lib \
+ netapi32.lib uuid.lib ws2_32.lib mpr.lib winmm.lib \
version.lib
# win64 doesn't have some libs
@@ -839,10 +839,10 @@ CFG_VARS = \ "libpth=$(CCLIBDIR:"=\");$(EXTRALIBDIRS:"=\")" \
"libc=$(LIBC)" \
"make=$(MAKE_BARE)" \
+ "static_ext=$(STATIC_EXT)" \
"usethreads=$(USE_ITHREADS)" \
"use5005threads=$(USE_5005THREADS)" \
"useithreads=$(USE_ITHREADS)" \
- "usethreads=$(USE_5005THREADS)" \
"usemultiplicity=$(USE_MULTI)" \
"useperlio=$(USE_PERLIO)" \
"uselargefiles=$(USE_LARGE_FILES)" \
@@ -1074,7 +1074,7 @@ utils: $(PERLEXE) $(X2P) copy ..\README.vms ..\pod\perlvms.pod
copy ..\README.vos ..\pod\perlvos.pod
copy ..\README.win32 ..\pod\perlwin32.pod
- copy ..\pod\perl585delta.pod ..\pod\perldelta.pod
+ copy ..\pod\perl586delta.pod ..\pod\perldelta.pod
$(MAKE) -f ..\win32\pod.mak converters
cd ..\lib
$(PERLEXE) lib_pm.PL
diff --git a/gnu/usr.bin/perl/win32/config_H.bc b/gnu/usr.bin/perl/win32/config_H.bc index 8f44ea486db..fc3b9e1dcd1 100644 --- a/gnu/usr.bin/perl/win32/config_H.bc +++ b/gnu/usr.bin/perl/win32/config_H.bc @@ -7,7 +7,7 @@ * that running config_h.SH again will wipe out any changes you've made. * For a more permanent change edit undef and rerun config_h.SH. * - * $Id: config_H.bc,v 1.7 2004/04/07 21:33:12 millert Exp $ + * $Id: config_H.bc,v 1.8 2004/08/09 18:10:39 millert Exp $ */ /* @@ -1344,7 +1344,7 @@ * This symbol contains the ~name expanded version of ARCHLIB, to be used * in programs that are not prepared to deal with ~ expansion at run-time. */ -#define ARCHLIB "c:\\perl\\5.8.5\\lib\\MSWin32-x86-multi-thread" /**/ +#define ARCHLIB "c:\\perl\\5.8.6\\lib\\MSWin32-x86-multi-thread" /**/ /*#define ARCHLIB_EXP "" /**/ /* BIN: @@ -1355,8 +1355,8 @@ * This symbol is the filename expanded version of the BIN symbol, for * programs that do not want to deal with that at run-time. */ -#define BIN "c:\\perl\\5.8.5\\bin\\MSWin32-x86-multi-thread" /**/ -#define BIN_EXP "c:\\perl\\5.8.5\\bin\\MSWin32-x86-multi-thread" /**/ +#define BIN "c:\\perl\\5.8.6\\bin\\MSWin32-x86-multi-thread" /**/ +#define BIN_EXP "c:\\perl\\5.8.6\\bin\\MSWin32-x86-multi-thread" /**/ /* PERL_INC_VERSION_LIST: * This variable specifies the list of subdirectories in over @@ -1393,8 +1393,8 @@ * This symbol contains the ~name expanded version of PRIVLIB, to be used * in programs that are not prepared to deal with ~ expansion at run-time. */ -#define PRIVLIB "c:\\perl\\5.8.5\\lib" /**/ -#define PRIVLIB_EXP (win32_get_privlib("5.8.5")) /**/ +#define PRIVLIB "c:\\perl\\5.8.6\\lib" /**/ +#define PRIVLIB_EXP (win32_get_privlib("5.8.6")) /**/ /* SITEARCH: * This symbol contains the name of the private library for this package. @@ -1411,7 +1411,7 @@ * This symbol contains the ~name expanded version of SITEARCH, to be used * in programs that are not prepared to deal with ~ expansion at run-time. */ -#define SITEARCH "c:\\perl\\site\\5.8.5\\lib\\MSWin32-x86-multi-thread" /**/ +#define SITEARCH "c:\\perl\\site\\5.8.6\\lib\\MSWin32-x86-multi-thread" /**/ /*#define SITEARCH_EXP "" /**/ /* SITELIB: @@ -1434,8 +1434,8 @@ * removed. The elements in inc_version_list (inc_version_list.U) can * be tacked onto this variable to generate a list of directories to search. */ -#define SITELIB "c:\\perl\\site\\5.8.5\\lib" /**/ -#define SITELIB_EXP (win32_get_sitelib("5.8.5")) /**/ +#define SITELIB "c:\\perl\\site\\5.8.6\\lib" /**/ +#define SITELIB_EXP (win32_get_sitelib("5.8.6")) /**/ #define SITELIB_STEM "" /**/ /* PERL_VENDORARCH: diff --git a/gnu/usr.bin/perl/win32/config_H.gc b/gnu/usr.bin/perl/win32/config_H.gc index 014f9db6849..dba32bd3ae3 100644 --- a/gnu/usr.bin/perl/win32/config_H.gc +++ b/gnu/usr.bin/perl/win32/config_H.gc @@ -7,7 +7,7 @@ * that running config_h.SH again will wipe out any changes you've made. * For a more permanent change edit undef and rerun config_h.SH. * - * $Id: config_H.gc,v 1.7 2004/04/07 21:33:12 millert Exp $ + * $Id: config_H.gc,v 1.8 2004/08/09 18:10:39 millert Exp $ */ /* @@ -1344,7 +1344,7 @@ * This symbol contains the ~name expanded version of ARCHLIB, to be used * in programs that are not prepared to deal with ~ expansion at run-time. */ -#define ARCHLIB "c:\\perl\\5.8.5\\lib\\MSWin32-x86-multi-thread" /**/ +#define ARCHLIB "c:\\perl\\5.8.6\\lib\\MSWin32-x86-multi-thread" /**/ /*#define ARCHLIB_EXP "" /**/ /* BIN: @@ -1355,8 +1355,8 @@ * This symbol is the filename expanded version of the BIN symbol, for * programs that do not want to deal with that at run-time. */ -#define BIN "c:\\perl\\5.8.5\\bin\\MSWin32-x86-multi-thread" /**/ -#define BIN_EXP "c:\\perl\\5.8.5\\bin\\MSWin32-x86-multi-thread" /**/ +#define BIN "c:\\perl\\5.8.6\\bin\\MSWin32-x86-multi-thread" /**/ +#define BIN_EXP "c:\\perl\\5.8.6\\bin\\MSWin32-x86-multi-thread" /**/ /* PERL_INC_VERSION_LIST: * This variable specifies the list of subdirectories in over @@ -1393,8 +1393,8 @@ * This symbol contains the ~name expanded version of PRIVLIB, to be used * in programs that are not prepared to deal with ~ expansion at run-time. */ -#define PRIVLIB "c:\\perl\\5.8.5\\lib" /**/ -#define PRIVLIB_EXP (win32_get_privlib("5.8.5")) /**/ +#define PRIVLIB "c:\\perl\\5.8.6\\lib" /**/ +#define PRIVLIB_EXP (win32_get_privlib("5.8.6")) /**/ /* SITEARCH: * This symbol contains the name of the private library for this package. @@ -1411,7 +1411,7 @@ * This symbol contains the ~name expanded version of SITEARCH, to be used * in programs that are not prepared to deal with ~ expansion at run-time. */ -#define SITEARCH "c:\\perl\\site\\5.8.5\\lib\\MSWin32-x86-multi-thread" /**/ +#define SITEARCH "c:\\perl\\site\\5.8.6\\lib\\MSWin32-x86-multi-thread" /**/ /*#define SITEARCH_EXP "" /**/ /* SITELIB: @@ -1434,8 +1434,8 @@ * removed. The elements in inc_version_list (inc_version_list.U) can * be tacked onto this variable to generate a list of directories to search. */ -#define SITELIB "c:\\perl\\site\\5.8.5\\lib" /**/ -#define SITELIB_EXP (win32_get_sitelib("5.8.5")) /**/ +#define SITELIB "c:\\perl\\site\\5.8.6\\lib" /**/ +#define SITELIB_EXP (win32_get_sitelib("5.8.6")) /**/ #define SITELIB_STEM "" /**/ /* PERL_VENDORARCH: diff --git a/gnu/usr.bin/perl/win32/config_H.vc b/gnu/usr.bin/perl/win32/config_H.vc index ec38924c9db..be4a7778a7d 100644 --- a/gnu/usr.bin/perl/win32/config_H.vc +++ b/gnu/usr.bin/perl/win32/config_H.vc @@ -7,7 +7,7 @@ * that running config_h.SH again will wipe out any changes you've made. * For a more permanent change edit undef and rerun config_h.SH. * - * $Id: config_H.vc,v 1.7 2004/04/07 21:33:12 millert Exp $ + * $Id: config_H.vc,v 1.8 2004/08/09 18:10:39 millert Exp $ */ /* @@ -1344,7 +1344,7 @@ * This symbol contains the ~name expanded version of ARCHLIB, to be used * in programs that are not prepared to deal with ~ expansion at run-time. */ -#define ARCHLIB "c:\\perl\\5.8.5\\lib\\MSWin32-x86-multi-thread" /**/ +#define ARCHLIB "c:\\perl\\5.8.6\\lib\\MSWin32-x86-multi-thread" /**/ /*#define ARCHLIB_EXP "" /**/ /* BIN: @@ -1355,8 +1355,8 @@ * This symbol is the filename expanded version of the BIN symbol, for * programs that do not want to deal with that at run-time. */ -#define BIN "c:\\perl\\5.8.5\\bin\\MSWin32-x86-multi-thread" /**/ -#define BIN_EXP "c:\\perl\\5.8.5\\bin\\MSWin32-x86-multi-thread" /**/ +#define BIN "c:\\perl\\5.8.6\\bin\\MSWin32-x86-multi-thread" /**/ +#define BIN_EXP "c:\\perl\\5.8.6\\bin\\MSWin32-x86-multi-thread" /**/ /* PERL_INC_VERSION_LIST: * This variable specifies the list of subdirectories in over @@ -1393,8 +1393,8 @@ * This symbol contains the ~name expanded version of PRIVLIB, to be used * in programs that are not prepared to deal with ~ expansion at run-time. */ -#define PRIVLIB "c:\\perl\\5.8.5\\lib" /**/ -#define PRIVLIB_EXP (win32_get_privlib("5.8.5")) /**/ +#define PRIVLIB "c:\\perl\\5.8.6\\lib" /**/ +#define PRIVLIB_EXP (win32_get_privlib("5.8.6")) /**/ /* SITEARCH: * This symbol contains the name of the private library for this package. @@ -1411,7 +1411,7 @@ * This symbol contains the ~name expanded version of SITEARCH, to be used * in programs that are not prepared to deal with ~ expansion at run-time. */ -#define SITEARCH "c:\\perl\\site\\5.8.5\\lib\\MSWin32-x86-multi-thread" /**/ +#define SITEARCH "c:\\perl\\site\\5.8.6\\lib\\MSWin32-x86-multi-thread" /**/ /*#define SITEARCH_EXP "" /**/ /* SITELIB: @@ -1434,8 +1434,8 @@ * removed. The elements in inc_version_list (inc_version_list.U) can * be tacked onto this variable to generate a list of directories to search. */ -#define SITELIB "c:\\perl\\site\\5.8.5\\lib" /**/ -#define SITELIB_EXP (win32_get_sitelib("5.8.5")) /**/ +#define SITELIB "c:\\perl\\site\\5.8.6\\lib" /**/ +#define SITELIB_EXP (win32_get_sitelib("5.8.6")) /**/ #define SITELIB_STEM "" /**/ /* PERL_VENDORARCH: diff --git a/gnu/usr.bin/perl/win32/dl_win32.xs b/gnu/usr.bin/perl/win32/dl_win32.xs index 69910dd5390..4ff00a1f8ef 100644 --- a/gnu/usr.bin/perl/win32/dl_win32.xs +++ b/gnu/usr.bin/perl/win32/dl_win32.xs @@ -68,7 +68,7 @@ static int dl_static_linked(char *filename) { char **p; - char* ptr; + char *ptr, *hptr; static char subStr[] = "/auto/"; char szBuffer[MAX_PATH]; @@ -90,7 +90,14 @@ dl_static_linked(char *filename) ptr = szBuffer; for (p = staticlinkmodules; *p;p++) { - if (strstr(ptr, *p)) return 1; + if (hptr = strstr(ptr, *p)) { + /* found substring, need more detailed check if module name match */ + if (hptr==ptr) { + return strcmp(ptr, *p)==0; + } + if (hptr[strlen(*p)] == 0) + return hptr[-1]=='/'; + } }; return 0; } diff --git a/gnu/usr.bin/perl/win32/makefile.mk b/gnu/usr.bin/perl/win32/makefile.mk index 701c69fe768..a6b1776f0b8 100644 --- a/gnu/usr.bin/perl/win32/makefile.mk +++ b/gnu/usr.bin/perl/win32/makefile.mk @@ -34,7 +34,7 @@ INST_TOP *= $(INST_DRV)\perl # versioned installation can be obtained by setting INST_TOP above to a
# path that includes an arbitrary version string.
#
-#INST_VER *= \5.8.5
+#INST_VER *= \5.8.6
#
# Comment this out if you DON'T want your perl installation to have
@@ -165,7 +165,14 @@ CRYPT_SRC *= fcrypt.c # extensions if you change the default. Currently, this cannot be enabled
# if you ask for USE_IMP_SYS above.
#
-#PERL_MALLOC *= define
+PERL_MALLOC *= define
+
+#
+# set this to enable debugging mstats
+# This must be enabled to use the Devel::Peek::mstat() function. This cannot
+# be enabled without PERL_MALLOC as well.
+#
+DEBUG_MSTATS = define
#
# set the install locations of the compiler include/libraries
@@ -255,6 +262,19 @@ USE_PERLIO *= undef USE_LARGE_FILES *= undef
USE_PERLCRT *= undef
+.IF "$(PERL_MALLOC)" == "undef"
+PERL_MALLOC = undef
+DEBUG_MSTATS = undef
+.ENDIF
+
+.IF "$(DEBUG_MSTATS)" == "undef"
+DEBUG_MSTATS = undef
+.ENDIF
+
+.IF "$(DEBUG_MSTATS)" == "define"
+BUILDOPT += -DPERL_DEBUGGING_MSTATS
+.ENDIF
+
.IF "$(USE_IMP_SYS)$(USE_MULTI)$(USE_5005THREADS)" == "defineundefundef"
USE_MULTI != define
.ENDIF
@@ -309,7 +329,7 @@ ARCHNAME !:= $(ARCHNAME)-thread # VC 6.0 can load the socket dll on demand. Makes the test suite
# run in about 10% less time.
-DELAYLOAD *= -DELAYLOAD:wsock32.dll -DELAYLOAD:shell32.dll delayimp.lib
+DELAYLOAD *= -DELAYLOAD:ws2_32.dll -DELAYLOAD:shell32.dll delayimp.lib
.IF "$(CFG)" == "Debug"
.ELSE
@@ -419,7 +439,7 @@ LIBC = -lmsvcrt LIBFILES = $(CRYPT_LIB) $(LIBC) \
-lmoldname -lkernel32 -luser32 -lgdi32 \
-lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 \
- -loleaut32 -lnetapi32 -luuid -lwsock32 -lmpr \
+ -loleaut32 -lnetapi32 -luuid -lws2_32 -lmpr \
-lwinmm -lversion -lodbc32
.IF "$(CFG)" == "Debug"
@@ -503,7 +523,7 @@ BUILDOPT += -DPERL_MSVCRT_READFIX LIBBASEFILES = $(CRYPT_LIB) \
oldnames.lib kernel32.lib user32.lib gdi32.lib winspool.lib \
comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib \
- netapi32.lib uuid.lib wsock32.lib mpr.lib winmm.lib \
+ netapi32.lib uuid.lib ws2_32.lib mpr.lib winmm.lib \
version.lib
# win64 doesn't have some libs
@@ -858,7 +878,6 @@ CFG_VARS = \ usethreads=$(USE_ITHREADS) ~ \
use5005threads=$(USE_5005THREADS) ~ \
useithreads=$(USE_ITHREADS) ~ \
- usethreads=$(USE_5005THREADS) ~ \
usemultiplicity=$(USE_MULTI) ~ \
useperlio=$(USE_PERLIO) ~ \
uselargefiles=$(USE_LARGE_FILES) ~ \
@@ -1014,9 +1033,9 @@ $(MINIWIN32_OBJ) : $(CORE_NOCFG_H) perllib$(o) : perllib.c .\perlhost.h .\vdir.h .\vmem.h
.IF "$(USE_IMP_SYS)" == "define"
- $(CC) -c -I. $(CFLAGS_O) $(CXX_FLAG) $(OBJOUT_FLAG)$@ perllib.c
+ $(CC) -c -I. -DWITH_STATIC $(CFLAGS_O) $(CXX_FLAG) $(OBJOUT_FLAG)$@ perllib.c
.ELSE
- $(CC) -c -I. $(CFLAGS_O) $(OBJOUT_FLAG)$@ perllib.c
+ $(CC) -c -I. -DWITH_STATIC $(CFLAGS_O) $(OBJOUT_FLAG)$@ perllib.c
.ENDIF
# 1. we don't want to rebuild miniperl.exe when config.h changes
@@ -1032,10 +1051,11 @@ $(DLL_OBJ) : $(CORE_H) $(X2P_OBJ) : $(CORE_H)
perldll.def : $(MINIPERL) $(CONFIGPM) ..\global.sym ..\pp.sym ..\makedef.pl
+ $(MINIPERL) -I..\lib buildext.pl --create-perllibst-h $(STATIC_EXT)
$(MINIPERL) -w ..\makedef.pl PLATFORM=win32 $(OPTIMIZE) $(DEFINES) \
$(BUILDOPT) CCTYPE=$(CCTYPE) > perldll.def
-$(PERLDLL): perldll.def $(PERLDLL_OBJ) $(PERLDLL_RES)
+$(PERLDLL): perldll.def $(PERLDLL_OBJ) $(PERLDLL_RES) Extensions_static
.IF "$(CCTYPE)" == "BORLAND"
$(LINK32) -Tpd -ap $(BLINK_FLAGS) \
@$(mktmp c0d32$(o) $(PERLDLL_OBJ:s,\,\\)\n \
@@ -1056,11 +1076,13 @@ $(PERLDLL): perldll.def $(PERLDLL_OBJ) $(PERLDLL_RES) perl.exp $(LKPOST))
.ELSE
$(LINK32) -dll -def:perldll.def -out:$@ \
+ $(shell $(MINIPERL) -I..\lib buildext.pl --list-static-libs) \
@$(mktmp -base:0x28000000 $(BLINK_FLAGS) $(DELAYLOAD) $(LIBFILES) \
$(PERLDLL_RES) $(PERLDLL_OBJ:s,\,\\))
.ENDIF
$(XCOPY) $(PERLIMPLIB) $(COREDIR)
+
$(PERLEXE_ICO): $(MINIPERL) makeico.pl
$(MINIPERL) makeico.pl > $@
@@ -1136,8 +1158,12 @@ $(EXTDIR)\DynaLoader\dl_win32.xs: dl_win32.xs #----------------------------------------------------------------------------------
Extensions : buildext.pl $(PERLDEP) $(CONFIGPM)
- $(MINIPERL) -I..\lib buildext.pl $(MAKE) $(PERLDEP) $(EXTDIR)
- $(MINIPERL) -I..\lib buildext.pl $(MAKE) $(PERLDEP) ext
+ $(MINIPERL) -I..\lib buildext.pl $(MAKE) $(PERLDEP) $(EXTDIR) --dynamic
+ $(MINIPERL) -I..\lib buildext.pl $(MAKE) $(PERLDEP) ext --dynamic
+
+Extensions_static : buildext.pl
+ $(MINIPERL) -I..\lib buildext.pl $(MAKE) $(PERLDEP) ext --static
+ $(MINIPERL) -I..\lib buildext.pl $(MAKE) $(PERLDEP) $(EXTDIR) --static
# Note: The next two targets explicitly remove a "blibdirs.exists" file that
# currerntly gets left behind, until CPAN RT Ticket #5616 is resolved.
@@ -1201,7 +1227,7 @@ utils: $(PERLEXE) $(X2P) copy ..\README.vms ..\pod\perlvms.pod
copy ..\README.vos ..\pod\perlvos.pod
copy ..\README.win32 ..\pod\perlwin32.pod
- copy ..\pod\perl585delta.pod ..\pod\perldelta.pod
+ copy ..\pod\perl586delta.pod ..\pod\perldelta.pod
cd ..\pod && $(MAKE) -f ..\win32\pod.mak converters
cd ..\lib && $(PERLEXE) lib_pm.PL
$(PERLEXE) $(PL2BAT) $(UTILS)
@@ -1280,6 +1306,7 @@ distclean: realclean -del /f ..\config.sh ..\splittree.pl perlmain.c dlutils.c config.h.new
-del /f $(CONFIGPM)
-del /f bin\*.bat
+ -del /f perllibst.h
-del /f $(PERLEXE_ICO) perl.base
-cd .. && del /s *$(a) *.map *.pdb *.ilk *.bs *$(o) .exists pm_to_blib
-cd $(EXTDIR) && del /s *.def Makefile Makefile.old
diff --git a/gnu/usr.bin/perl/win32/perllib.c b/gnu/usr.bin/perl/win32/perllib.c index 4aeb7413dad..b4237366f13 100644 --- a/gnu/usr.bin/perl/win32/perllib.c +++ b/gnu/usr.bin/perl/win32/perllib.c @@ -16,10 +16,20 @@ /* Register any extra external extensions */ char *staticlinkmodules[] = { "DynaLoader", + /* other similar records will be included from "perllibst.h" */ +#ifdef WITH_STATIC +#define STATIC1 +#include "perllibst.h" +#endif NULL, }; EXTERN_C void boot_DynaLoader (pTHX_ CV* cv); +/* other similar records will be included from "perllibst.h" */ +#ifdef WITH_STATIC +#define STATIC2 +#include "perllibst.h" +#endif static void xs_init(pTHX) @@ -27,6 +37,11 @@ xs_init(pTHX) char *file = __FILE__; dXSUB_SYS; newXS("DynaLoader::boot_DynaLoader", boot_DynaLoader, file); + /* other similar records will be included from "perllibst.h" */ +#ifdef WITH_STATIC +#define STATIC3 +#include "perllibst.h" +#endif } #ifdef PERL_IMPLICIT_SYS diff --git a/gnu/usr.bin/perl/win32/pod.mak b/gnu/usr.bin/perl/win32/pod.mak index 88abdeb4990..031079e419c 100644 --- a/gnu/usr.bin/perl/win32/pod.mak +++ b/gnu/usr.bin/perl/win32/pod.mak @@ -29,6 +29,7 @@ POD = \ perl583delta.pod \ perl584delta.pod \ perl585delta.pod \ + perl586delta.pod \ perl58delta.pod \ perlapi.pod \ perlapio.pod \ @@ -130,6 +131,7 @@ MAN = \ perl583delta.man \ perl584delta.man \ perl585delta.man \ + perl586delta.man \ perl58delta.man \ perlapi.man \ perlapio.man \ @@ -231,6 +233,7 @@ HTML = \ perl583delta.html \ perl584delta.html \ perl585delta.html \ + perl586delta.html \ perl58delta.html \ perlapi.html \ perlapio.html \ @@ -332,6 +335,7 @@ TEX = \ perl583delta.tex \ perl584delta.tex \ perl585delta.tex \ + perl586delta.tex \ perl58delta.tex \ perlapi.tex \ perlapio.tex \ diff --git a/gnu/usr.bin/perl/win32/win32.c b/gnu/usr.bin/perl/win32/win32.c index 23e9e7f5386..b01e46a9fed 100644 --- a/gnu/usr.bin/perl/win32/win32.c +++ b/gnu/usr.bin/perl/win32/win32.c @@ -4155,7 +4155,6 @@ static char *base = NULL; /* XXX threadead */ static char *reserved = NULL; /* XXX threadead */ static char *brk = NULL; /* XXX threadead */ static DWORD pagesize = 0; /* XXX threadead */ -static DWORD allocsize = 0; /* XXX threadead */ void * sbrk(ptrdiff_t need) @@ -4168,28 +4167,34 @@ sbrk(ptrdiff_t need) * call the OS to commit just one page ... */ pagesize = info.dwPageSize << 3; - allocsize = info.dwAllocationGranularity; } - /* This scheme fails eventually if request for contiguous - * block is denied so reserve big blocks - this is only - * address space not memory ... - */ if (brk+need >= reserved) { - DWORD size = 64*1024*1024; + DWORD size = brk+need-reserved; char *addr; + char *prev_committed = NULL; if (committed && reserved && committed < reserved) { /* Commit last of previous chunk cannot span allocations */ addr = (char *) VirtualAlloc(committed,reserved-committed,MEM_COMMIT,PAGE_READWRITE); if (addr) + { + /* Remember where we committed from in case we want to decommit later */ + prev_committed = committed; committed = reserved; + } } /* Reserve some (more) space + * Contiguous blocks give us greater efficiency, so reserve big blocks - + * this is only address space not memory... * Note this is a little sneaky, 1st call passes NULL as reserved * so lets system choose where we start, subsequent calls pass * the old end address so ask for a contiguous block */ +sbrk_reserve: + if (size < 64*1024*1024) + size = 64*1024*1024; + size = ((size + pagesize - 1) / pagesize) * pagesize; addr = (char *) VirtualAlloc(reserved,size,MEM_RESERVE,PAGE_NOACCESS); if (addr) { @@ -4201,6 +4206,19 @@ sbrk(ptrdiff_t need) if (!brk) brk = committed; } + else if (reserved) + { + /* The existing block could not be extended far enough, so decommit + * anything that was just committed above and start anew */ + if (prev_committed) + { + if (!VirtualFree(prev_committed,reserved-prev_committed,MEM_DECOMMIT)) + return (void *) -1; + } + reserved = base = committed = brk = NULL; + size = need; + goto sbrk_reserve; + } else { return (void *) -1; @@ -4211,11 +4229,12 @@ sbrk(ptrdiff_t need) if (brk > committed) { DWORD size = ((brk-committed + pagesize -1)/pagesize) * pagesize; - char *addr = (char *) VirtualAlloc(committed,size,MEM_COMMIT,PAGE_READWRITE); + char *addr; + if (committed+size > reserved) + size = reserved-committed; + addr = (char *) VirtualAlloc(committed,size,MEM_COMMIT,PAGE_READWRITE); if (addr) - { - committed += size; - } + committed += size; else return (void *) -1; } @@ -4807,13 +4826,15 @@ XS(w32_GetFullPathName) SV *fullpath; char *filepart; DWORD len; + STRLEN filename_len; + char *filename_p; if (items != 1) Perl_croak(aTHX_ "usage: Win32::GetFullPathName($filename)"); filename = ST(0); - fullpath = sv_mortalcopy(filename); - SvUPGRADE(fullpath, SVt_PV); + filename_p = SvPV(filename, filename_len); + fullpath = sv_2mortal(newSVpvn(filename_p, filename_len)); if (!SvPVX(fullpath) || !SvLEN(fullpath)) XSRETURN_UNDEF; diff --git a/gnu/usr.bin/perl/win32/win32sck.c b/gnu/usr.bin/perl/win32/win32sck.c index 9f47f50208c..e751dcd3cae 100644 --- a/gnu/usr.bin/perl/win32/win32sck.c +++ b/gnu/usr.bin/perl/win32/win32sck.c @@ -16,6 +16,8 @@ #define Win32_Winsock #endif #include <windows.h> +#include <ws2spi.h> + #include "EXTERN.h" #include "perl.h" @@ -86,11 +88,11 @@ start_sockets(void) * initalize the winsock interface and insure that it is * cleaned up at exit. */ - version = 0x101; + version = 0x2; if(ret = WSAStartup(version, &retdata)) Perl_croak_nocontext("Unable to locate winsock library!\n"); if(retdata.wVersion != version) - Perl_croak_nocontext("Could not find version 1.1 of winsock dll\n"); + Perl_croak_nocontext("Could not find version 2.0 of winsock dll\n"); /* atexit((void (*)(void)) EndSockets); */ wsock_started = 1; @@ -103,14 +105,6 @@ set_socktype(void) #if defined(USE_5005THREADS) || defined(USE_ITHREADS) dTHX; if (!w32_init_socktype) { -#endif - int iSockOpt = SO_SYNCHRONOUS_NONALERT; - /* - * Enable the use of sockets as filehandles - */ - setsockopt(INVALID_SOCKET, SOL_SOCKET, SO_OPENTYPE, - (char *)&iSockOpt, sizeof(iSockOpt)); -#if defined(USE_5005THREADS) || defined(USE_ITHREADS) w32_init_socktype = 1; } #endif @@ -399,6 +393,70 @@ win32_closesocket(SOCKET s) return r; } +#ifdef USE_SOCKETS_AS_HANDLES +#define WIN32_OPEN_SOCKET(af, type, protocol) open_ifs_socket(af, type, protocol) + +void +convert_proto_info_w2a(WSAPROTOCOL_INFOW *in, WSAPROTOCOL_INFOA *out) +{ + Copy(in, out, 1, WSAPROTOCOL_INFOA); + wcstombs(out->szProtocol, in->szProtocol, sizeof(out->szProtocol)); +} + +SOCKET +open_ifs_socket(int af, int type, int protocol) +{ + dTHX; + char *s; + unsigned long proto_buffers_len = 0; + int error_code; + SOCKET out = INVALID_SOCKET; + + if ((s = PerlEnv_getenv("PERL_ALLOW_NON_IFS_LSP")) && atoi(s)) + return WSASocket(af, type, protocol, NULL, 0, 0); + + if (WSCEnumProtocols(NULL, NULL, &proto_buffers_len, &error_code) == SOCKET_ERROR + && error_code == WSAENOBUFS) + { + WSAPROTOCOL_INFOW *proto_buffers; + int protocols_available = 0; + + New(1, proto_buffers, proto_buffers_len / sizeof(WSAPROTOCOL_INFOW), + WSAPROTOCOL_INFOW); + + if ((protocols_available = WSCEnumProtocols(NULL, proto_buffers, + &proto_buffers_len, &error_code)) != SOCKET_ERROR) + { + int i; + for (i = 0; i < protocols_available; i++) + { + WSAPROTOCOL_INFOA proto_info; + + if ((af != AF_UNSPEC && af != proto_buffers[i].iAddressFamily) + || (type != proto_buffers[i].iSocketType) + || (protocol != 0 && protocol != proto_buffers[i].iProtocol)) + continue; + + if ((proto_buffers[i].dwServiceFlags1 & XP1_IFS_HANDLES) == 0) + continue; + + convert_proto_info_w2a(&(proto_buffers[i]), &proto_info); + + out = WSASocket(af, type, protocol, &proto_info, 0, 0); + break; + } + } + + Safefree(proto_buffers); + } + + return out; +} + +#else +#define WIN32_OPEN_SOCKET(af, type, protocol) socket(af, type, protocol) +#endif + SOCKET win32_socket(int af, int type, int protocol) { @@ -408,7 +466,8 @@ win32_socket(int af, int type, int protocol) SOCKET_TEST(s = socket(af, type, protocol), INVALID_SOCKET); #else StartSockets(); - if((s = socket(af, type, protocol)) == INVALID_SOCKET) + + if((s = WIN32_OPEN_SOCKET(af, type, protocol)) == INVALID_SOCKET) errno = WSAGetLastError(); else s = OPEN_SOCKET(s); |