summaryrefslogtreecommitdiff
path: root/win32
diff options
context:
space:
mode:
authorPerl 5 Porters <perl5-porters@africa.nicoh.com>1997-04-15 00:00:00 +1200
committerChip Salzenberg <chip@atlantic.net>1997-04-15 00:00:00 +1200
commit137443ea0a858c43f5a720730cac6209a7d41948 (patch)
treeea114bc1f5281a6ec91ebc67e34ed7f30571daee /win32
parent683d4eee6f3b749aec29cc849f45404c6acda85e (diff)
downloadperl-137443ea0a858c43f5a720730cac6209a7d41948.tar.gz
[inseparable changes from patch from perl-5.003_97d to perl-5.003_97e]perl-5.003_97e
CORE LANGUAGE CHANGES Subject: New operator: sysseek() From: Chip Salzenberg <chip@perl.com> Files: doio.c ext/Opcode/Makefile.PL ext/Opcode/Opcode.pm global.sym keywords.pl opcode.pl pod/perldelta.pod pod/perlfunc.pod pp_sys.c t/op/sysio.t toke.c Subject: Allow recursive substitution again From: Chip Salzenberg <chip@perl.com> Files: pod/perldelta.pod pod/perldiag.pod pp_hot.c CORE PORTABILITY Subject: Use size_t for socket size parameters of GNU libc From: Chip Salzenberg <chip@perl.com> Files: doio.c pp_sys.c Subject: Win32 update (four patches) From: Gurusamy Sarathy <gsar@engin.umich.edu> Files: MANIFEST README.win32 dosish.h ext/SDBM_File/Makefile.PL ext/SDBM_File/sdbm/Makefile.PL ext/SDBM_File/sdbm/sdbm.c ext/SDBM_File/sdbm/sdbm.h lib/ExtUtils/MM_Unix.pm perl.c utils/perlbug.PL utils/perldoc.PL win32/Makefile win32/TEST win32/config.H win32/config.w32 win32/config_h.PL win32/config_sh.PL win32/perllib.c win32/runperl.c win32/win32.c win32/win32io.c win32/win32sck.c DOCUMENTATION Subject: Add CGI to perldelta.pod and improve its description in MANIFEST From: Chip Salzenberg <chip@perl.com> Files: MANIFEST pod/perldelta.pod Subject: Describe probs with majordomo 1.94.1 From: Chip Salzenberg <chip@perl.com> Files: pod/perldelta.pod Subject: Fix description of /\G/g From: Chip Salzenberg <chip@perl.com> Files: pod/perlop.pod Subject: Mention '...' operator in precedence table Date: Sun, 13 Apr 1997 11:24:16 -0600 From: Tom Christiansen <tchrist@perl.com> Files: pod/perlop.pod private-msgid: 199704131724.LAA23120@jhereg.perl.com OTHER CORE CHANGES Subject: New API function: perl_eval_pv() Date: Mon, 14 Apr 1997 17:13:41 -0400 From: Doug MacEachern <dougm@opengroup.org> Files: perl.c pod/perlcall.pod pod/perldelta.pod pod/perlembed.pod pod/perlguts.pod proto.h private-msgid: 199704142113.RAA06823@postman.osf.org Subject: Fix C< s//whatever/ >, which reuses old pattern From: Chip Salzenberg <chip@perl.com> Files: pp_hot.c regexec.c
Diffstat (limited to 'win32')
-rw-r--r--win32/Makefile347
-rw-r--r--win32/TEST4
-rw-r--r--win32/config.H17
-rw-r--r--win32/config.w3278
-rw-r--r--win32/config_h.PL89
-rw-r--r--win32/config_sh.PL13
-rw-r--r--win32/perllib.c1
-rw-r--r--win32/runperl.c12
-rw-r--r--win32/win32.c10
-rw-r--r--win32/win32io.c8
-rw-r--r--win32/win32sck.c149
11 files changed, 443 insertions, 285 deletions
diff --git a/win32/Makefile b/win32/Makefile
index 3da20e77aa..0e7068fa6d 100644
--- a/win32/Makefile
+++ b/win32/Makefile
@@ -5,25 +5,81 @@
# This is set up to build a perl.exe that runs off a shared library
# (perl.dll). Also makes individual DLLs for the XS extensions.
#
-# There's no support for building an all-static perl yet.
-# Doesn't build any of the stuff in ..\utils yet.
-# No support for installing documentation, uh, yet.
+
+#
+# Set these to wherever you want "nmake install" to put your
+# newly built perl.
#
+INST_DRV=c:
+INST_TOP=$(INST_DRV)\perl
+
+
+##################### CHANGE THESE ONLY IF YOU MUST #####################
+
+#
+# Programs to compile, build .lib files and link
+#
+CC=cl.exe
+LINK32=link.exe
+LIB32=$(LINK32) -lib
#
-# Set this to wherever you want "nmake install" to put your
-# newly built perl. If you change this, you better change
-# all occurrences of this prefix in $(INST_TOP)\lib\Config.pm
-# as well.
+# Options
+#
+PERLDLL = -D "PERLDLL"
+RUNTIME = -MD
+INCLUDES = -I ".\include" -I "." -I ".."
+#PCHFLAGS = -Fp"$(INTDIR)/modules.pch" -YX
+DEFINES = -D "WIN32" -D "_CONSOLE" -D "PERLDLL"
+SUBSYS = console
+LIBFILES = kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib \
+ advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib
+
+!IF "$(RUNTIME)" == "-MD"
+WINIOMAYBE =
+!ELSE
+WINIOMAYBE = win32io.obj
+!ENDIF
+
+!IF "$(CFG)" == "Debug"
+! IF "$(CCTYPE)" == "MSVC20"
+OPTIMIZE = -Od $(RUNTIME) -Z7 -D "_DEBUG"
+! ELSE
+OPTIMIZE = -Od $(RUNTIME)d -Z7 -D "_DEBUG"
+! ENDIF
+LINK_DBG = -pdb:$(*B).pdb
+!ELSE
+! IF "$(CCTYPE)" == "MSVC20"
+OPTIMIZE = -Od $(RUNTIME) -D "NDEBUG"
+! ELSE
+OPTIMIZE = -O2 $(RUNTIME) -D "NDEBUG"
+! ENDIF
+LINK_DBG = -release
+!ENDIF
-INST_TOP=C:\perl
+CFLAGS = -nologo -W3 $(INCLUDES) $(DEFINES) $(PCHFLAGS) $(OPTIMIZE)
+LINK_FLAGS = -nologo $(LIBFILES) $(LINK_DBG) -machine:I386
+
+#################### do not edit below this line #######################
+############# NO USER-SERVICEABLE PARTS BEYOND THIS POINT ##############
+
+#
+# Rules
+#
+.SUFFIXES :
+.SUFFIXES : .c .obj .dll .lib .exe
+
+.c.obj:
+ $(CC) -c $(CFLAGS) -Fo$@ $<
+
+.obj.dll:
+ $(LINK32) -dll -subsystem:windows -implib:$(*B).lib -def:$(*B).def -out:$@ $(LINK_FLAGS) $< $(LIBPERL)
-#################### do not edit below this line ########################
#
INST_BIN=$(INST_TOP)\bin
INST_LIB=$(INST_TOP)\lib
-INST_POD=$(INST_TOP)\pod
+INST_POD=$(INST_LIB)\pod
INST_HTML=$(INST_POD)\html
LIBDIR=..\lib
EXTDIR=..\ext
@@ -32,25 +88,24 @@ EXTUTILSDIR=$(LIBDIR)\extutils
#
# various targets
-PERLLIB=..\libperl.lib
PERLIMPLIB=..\perl.lib
MINIPERL=..\miniperl.exe
PERLDLL=..\perl.dll
PERLEXE=..\perl.exe
GLOBEXE=..\perlglob.exe
+CONFIGPM=..\lib\Config.pm
PL2BAT=bin\PL2BAT.BAT
-MAKE=nmake /nologo
+MAKE=nmake -nologo
XCOPY=xcopy /i /d /f /r
NULL=
#
# filenames given to xsubpp must have forward slashes (since it puts
# full pathnames in #line strings)
-XSUBPP=..\$(MINIPERL) ..\$(EXTUTILSDIR)\xsubpp -C++ -prototypes
+XSUBPP=..\$(MINIPERL) -I..\..\lib ..\$(EXTUTILSDIR)\xsubpp -C++ -prototypes
-CORE_C= \
- ..\av.c \
+CORE_C= ..\av.c \
..\deb.c \
..\doio.c \
..\doop.c \
@@ -77,6 +132,78 @@ CORE_C= \
..\universal.c \
..\util.c
+CORE_OBJ=..\av.obj \
+ ..\deb.obj \
+ ..\doio.obj \
+ ..\doop.obj \
+ ..\dump.obj \
+ ..\globals.obj \
+ ..\gv.obj \
+ ..\hv.obj \
+ ..\mg.obj \
+ ..\op.obj \
+ ..\perl.obj \
+ ..\perlio.obj \
+ ..\perly.obj \
+ ..\pp.obj \
+ ..\pp_ctl.obj \
+ ..\pp_hot.obj \
+ ..\pp_sys.obj \
+ ..\regcomp.obj \
+ ..\regexec.obj \
+ ..\run.obj \
+ ..\scope.obj \
+ ..\sv.obj \
+ ..\taint.obj \
+ ..\toke.obj \
+ ..\universal.obj \
+ ..\util.obj
+
+WIN32_C = perllib.c \
+ win32.c \
+ win32io.c \
+ win32sck.c \
+
+WIN32_OBJ = win32.obj \
+ win32io.obj \
+ win32sck.obj \
+
+DLL_OBJ = perllib.obj $(DYNALOADER).obj
+
+CORE_H = "..\av.h"\
+ "..\cop.h"\
+ "..\cv.h"\
+ "..\dosish.h"\
+ "..\embed.h"\
+ "..\form.h"\
+ "..\gv.h"\
+ "..\handy.h"\
+ "..\hv.h"\
+ "..\mg.h"\
+ "..\nostdio.h"\
+ "..\op.h"\
+ "..\opcode.h"\
+ "..\perl.h"\
+ "..\perlio.h"\
+ "..\perlsdio.h"\
+ "..\perlsfio.h"\
+ "..\perly.h"\
+ "..\pp.h"\
+ "..\proto.h"\
+ "..\regexp.h"\
+ "..\scope.h"\
+ "..\sv.h"\
+ "..\unixish.h"\
+ "..\util.h"\
+ "..\XSUB.h"\
+ ".\config.h"\
+ "..\EXTERN.h"\
+ ".\include\dirent.h"\
+ ".\include\netdb.h"\
+ ".\include\sys\socket.h"\
+ ".\win32.h"
+
+
EXTENSIONS=DynaLoader Socket IO Fcntl Opcode SDBM_File
DYNALOADER=$(EXTDIR)\DynaLoader\DynaLoader
@@ -105,54 +232,72 @@ POD2MAN=$(PODDIR)\pod2man
POD2LATEX=$(PODDIR)\pod2latex
POD2TEXT=$(PODDIR)\pod2text
-ALL: $(PERLEXE) $(GLOBEXE) $(DYNALOADMODULES)
+#
+# Top targets
+#
-!IF "$(CFG)" ==""
-CFG=Release
-!ENDIF
+ALL: $(PERLEXE) $(GLOBEXE) $(DYNALOADMODULES)
-modules.lib : $(DYNALOADER).c
- $(MAKE) -A -f modules.mak CFG="modules - Win32 $(CFG)"
+$(DYNALOADER).obj : $(DYNALOADER).c $(CORE_H) $(EXTDIR)\DynaLoader\dlutils.c
-$(GLOBEXE):
- $(MAKE) -f perlglob.mak CFG="perlglob - Win32 Release"
+#------------------------------------------------------------
-$(PERLLIB): $(CORE_C)
- $(MAKE) -f libperl.mak CFG="libperl - Win32 $(CFG)"
+$(GLOBEXE): perlglob.obj
+ $(LINK32) $(LINK_FLAGS) -out:$@ -subsystem:$(SUBSYS) perlglob.obj setargv.obj
-$(MINIPERL): $(PERLLIB)
- $(MAKE) -A -f miniperl.mak CFG="miniperl - Win32 $(CFG)"
- copy config.w32 ..\config.sh
- cd ..
- miniperl configpm
- cd win32
+perlglob.obj : perlglob.c
+
+..\miniperlmain.obj : ..\miniperlmain.c $(CORE_H)
+
+..\config.sh : config.w32 $(MINIPERL) config_sh.PL
+ $(MINIPERL) -I..\lib config_sh.PL "INST_DRV=$(INST_DRV)" "INST_TOP=$(INST_TOP)"\
+ "cc=$(CC)" "ccflags=$(RUNTIME) -DWIN32" config.w32 > ..\config.sh
+
+$(CONFIGPM) : $(MINIPERL) ..\config.sh config_h.PL
+ cd .. && miniperl configpm
if exist lib\* $(XCOPY) /e lib\*.* ..\lib\$(NULL)
- copy bin\test.bat ..\t
+ $(XCOPY) ..\*.h ..\lib\CORE\*.*
+ $(XCOPY) *.h ..\lib\CORE\*.*
+ $(XCOPY) /S include ..\lib\CORE\*.*
+ $(MINIPERL) -I..\lib config_h.PL || $(MAKE) RUNTIME=$(RUNTIME) CFG=$(CFG) $(CONFIGPM)
+
+$(MINIPERL) : ..\miniperlmain.obj $(CORE_OBJ) $(WIN32_OBJ)
+ $(LINK32) -subsystem:console -out:$@ @<<
+ $(LINK_FLAGS) ..\miniperlmain.obj $(CORE_OBJ) $(WIN32_OBJ)
+<<
+
+$(WIN32_OBJ) : $(CORE_H)
+$(CORE_OBJ) : $(CORE_H)
+$(DLL_OBJ) : $(CORE_H)
-$(PERLDLL): $(MINIPERL) $(PERLLIB)
+perldll.def : $(MINIPERL) $(CONFIGPM)
$(MINIPERL) -w makedef.pl > perldll.def
- $(MAKE) -A -f perldll.mak CFG="perldll - Win32 $(CFG)"
-$(PERLEXE): $(MINIPERL) modules.lib $(PERLDLL)
-# $(MINIPERL) makemain.pl $(STATICLINKMODUES) > perlmain.c
-# $(MINIPERL) makeperldef.pl $(STATICLINKMODUES) > perl.def
- $(MINIPERL) makeperldef.pl $(NULL) > perl.def
+$(PERLDLL): perldll.def $(CORE_OBJ) $(WIN32_OBJ) $(DLL_OBJ)
+ $(LINK32) -dll -def:perldll.def -out:$@ @<<
+ $(LINK_FLAGS) $(CORE_OBJ) $(WIN32_OBJ) $(DLL_OBJ)
+<<
+ $(XCOPY) $(PERLIMPLIB) ..\lib\CORE
+
+perl.def : $(MINIPERL) makeperldef.pl
+ $(MINIPERL) -I..\lib makeperldef.pl $(NULL) > perl.def
+
+perlmain.c : runperl.c
copy runperl.c perlmain.c
- $(MAKE) -A -f perl.mak CFG="perl - Win32 $(CFG)"
- copy ..\_perl.exe $(PERLEXE)
- del ..\_perl.exe
- del ..\*.exp
+
+perlmain.obj : perlmain.c
+ $(CC) $(CFLAGS) -U "PERLDLL" -c perlmain.c
+
+$(PERLEXE): $(PERLDLL) $(CONFIGPM) perlmain.obj
+ $(LINK32) -subsystem:console -out:perl.exe $(LINK_FLAGS) perlmain.obj $(WINIOMAYBE) $(PERLIMPLIB)
+ copy perl.exe $@
+ del perl.exe
copy splittree.pl ..
- $(MINIPERL) ..\splittree.pl "../LIB" "../LIB/auto"
+ $(MINIPERL) -I..\lib ..\splittree.pl "../LIB" "../LIB/auto"
attrib -r ..\t\*.*
copy test ..\t
- $(XCOPY) ..\*.h ..\lib\CORE\*.*
- $(XCOPY) $(PERLIMPLIB) ..\lib\CORE
- $(XCOPY) $(PERLLIB) ..\lib\CORE
- $(XCOPY) *.h ..\lib\CORE
- $(XCOPY) /S include ..\lib\CORE
-$(DYNALOADER).c: $(EXTDIR)\DynaLoader\dl_win32.xs
+$(DYNALOADER).c: $(MINIPERL) $(EXTDIR)\DynaLoader\dl_win32.xs $(CONFIGPM)
if not exist ..\lib\auto md ..\lib\auto
$(XCOPY) $(EXTDIR)\$(*B)\$(*B).pm $(LIBDIR)\$(NULL)
cd $(EXTDIR)\$(*B)
@@ -162,67 +307,40 @@ $(DYNALOADER).c: $(EXTDIR)\DynaLoader\dl_win32.xs
$(EXTDIR)\DynaLoader\dl_win32.xs: dl_win32.xs
copy dl_win32.xs $(EXTDIR)\DynaLoader\dl_win32.xs
-$(SOCKET).c: $(SOCKET).xs
- if not exist ..\lib\auto\$(*B) md ..\lib\auto\$(*B)
- $(MINIPERL) genxsdef.pl $(*B) > $(*B).def
- $(XCOPY) $(EXTDIR)\$(*B)\$(*B).pm $(LIBDIR)\$(NULL)
+$(IO_DLL): $(PERLEXE) $(CONFIGPM) $(IO).xs
cd $(EXTDIR)\$(*B)
- $(XSUBPP) $(*B).xs > $(*B).c
+ ..\..\miniperl -I..\..\lib Makefile.PL INSTALLDIRS=perl
+ $(MAKE)
cd ..\..\win32
-$(IO).c: $(IO).xs
- if not exist ..\lib\auto\$(*B) md ..\lib\auto\$(*B)
- $(MINIPERL) genxsdef.pl $(*B) > $(*B).def
- $(XCOPY) $(EXTDIR)\$(*B)\$(*B).pm $(LIBDIR)\$(NULL)
- $(XCOPY) /s $(EXTDIR)\$(*B)\lib\*.* $(LIBDIR)
+$(SDBM_FILE_DLL) : $(PERLEXE) $(SDBM_FILE).xs
cd $(EXTDIR)\$(*B)
- $(XSUBPP) $(*B).xs > $(*B).c
+ ..\..\miniperl -I..\..\lib Makefile.PL INSTALLDIRS=perl
+ $(MAKE)
cd ..\..\win32
-$(SDBM_FILE).c: $(SDBM_FILE).xs
- if not exist ..\lib\auto\$(*B) md ..\lib\auto\$(*B)
- $(MINIPERL) genxsdef.pl $(*B) > $(*B).def
- $(XCOPY) $(EXTDIR)\$(*B)\$(*B).pm $(LIBDIR)\$(NULL)
+$(FCNTL_DLL): $(PERLEXE) $(FCNTL).xs
cd $(EXTDIR)\$(*B)
- $(XSUBPP) -typemap ./typemap $(*B).xs > $(*B).c
+ ..\..\miniperl -I..\..\lib Makefile.PL INSTALLDIRS=perl
+ $(MAKE)
cd ..\..\win32
-$(FCNTL).c: $(FCNTL).xs
- if not exist ..\lib\auto\$(*B) md ..\lib\auto\$(*B)
- $(MINIPERL) genxsdef.pl $(*B) > $(*B).def
- $(XCOPY) $(EXTDIR)\$(*B)\$(*B).pm $(LIBDIR)\$(NULL)
+$(OPCODE_DLL): $(PERLEXE) $(OPCODE).xs
cd $(EXTDIR)\$(*B)
- $(XSUBPP) $(*B).xs > $(*B).c
+ ..\..\miniperl -I..\..\lib Makefile.PL INSTALLDIRS=perl
+ $(MAKE)
cd ..\..\win32
-$(OPCODE).c: $(OPCODE).xs
- if not exist ..\lib\auto\$(*B) md ..\lib\auto\$(*B)
- $(MINIPERL) genxsdef.pl $(*B) > $(*B).def
- $(XCOPY) $(EXTDIR)\$(*B)\$(*B).pm $(LIBDIR)\$(NULL)
- $(XCOPY) $(EXTDIR)\$(*B)\*.pm $(LIBDIR)\$(NULL)
+$(SOCKET_DLL): $(SOCKET).xs $(PERLEXE)
cd $(EXTDIR)\$(*B)
- $(XSUBPP) $(*B).xs > $(*B).c
+ ..\..\miniperl -I..\..\lib Makefile.PL INSTALLDIRS=perl
+ $(MAKE)
cd ..\..\win32
-$(SOCKET_DLL): $(SOCKET).c $(PERLDLL)
- $(MAKE) -f $(*B).mak CFG="$(*B) - Win32 $(CFG)"
-
-$(IO_DLL): $(IO).c $(PERLDLL)
- $(MAKE) -f $(*B).mak CFG="$(*B) - Win32 $(CFG)"
-
-$(SDBM_FILE_DLL): $(SDBM_FILE).c $(PERLDLL)
- $(MAKE) -f $(*B).mak CFG="$(*B) - Win32 $(CFG)"
-
-$(FCNTL_DLL): $(FCNTL).c $(PERLDLL)
- $(MAKE) -f $(*B).mak CFG="$(*B) - Win32 $(CFG)"
-
-$(OPCODE_DLL): $(OPCODE).c $(PERLDLL)
- $(MAKE) -f $(*B).mak CFG="$(*B) - Win32 $(CFG)"
-
doc: $(PERLEXE)
- cd $(PODDIR)
- nmake -f ../win32/pod.mak
- cd ..\win32
+ cd $(PODDIR)
+ nmake -f ../win32/pod.mak
+ cd ..\win32
utils: $(PERLEXE)
cd ..\utils
@@ -232,9 +350,9 @@ utils: $(PERLEXE)
$(XCOPY) *.bat ..\win32\bin\*.*
cd ..\win32
-distclean:
- -del /f $(MINIPERL) $(PERLEXE) $(PERLDLL) $(GLOBEXE) $(PERLLIB) \
- $(PERLIMPLIB) ..\miniperl.lib modules.lib
+distclean: clean
+ -del /f $(MINIPERL) $(PERLEXE) $(PERLDLL) $(GLOBEXE) \
+ $(PERLIMPLIB) ..\miniperl.lib
-del /f *.def
-del /f $(SOCKET_DLL) $(IO_DLL) $(SDBM_FILE_DLL) $(FCNTL_DLL) \
$(OPCODE_DLL)
@@ -244,7 +362,6 @@ distclean:
-del /f $(PODDIR)\*.bat
-rmdir /s /q ..\lib\auto
-rmdir /s /q ..\lib\CORE
- -rmdir /s /q release
-rmdir /s /q debug
install : ALL doc utils
@@ -259,15 +376,41 @@ install : ALL doc utils
$(XCOPY) ..\pod\*.pod $(INST_POD)\*.*
$(XCOPY) ..\pod\*.html $(INST_HTML)\*.*
-inst_lib :
+inst_lib : $(CONFIGPM)
copy splittree.pl ..
- $(MINIPERL) ..\splittree.pl "../LIB" "../LIB/auto"
+ $(MINIPERL) -I..\lib ..\splittree.pl "../LIB" "../LIB/auto"
$(XCOPY) /e ..\lib $(INST_LIB)\*.*
+minitest : $(MINIPERL) $(GLOBEXE) $(CONFIGPM)
+ $(XCOPY) $(MINIPERL) ..\t\perl.exe
+ $(XCOPY) $(GLOBEXE) ..\t\$(NULL)
+ attrib -r ..\t\*.*
+ copy test ..\t
+ cd ..\t
+ $(MINIPERL) -I..\lib test base/*.t comp/*.t cmd/*.t io/*.t op/*.t pragma/*.t
+ cd ..\win32
+
test : all
$(XCOPY) $(PERLEXE) ..\t\$(NULL)
$(XCOPY) $(PERLDLL) ..\t\$(NULL)
$(XCOPY) $(GLOBEXE) ..\t\$(NULL)
- cd ..\t
- $(PERLEXE) test
+ cd ..\t
+ $(PERLEXE) -I..\lib harness
cd ..\win32
+
+clean :
+ -@erase miniperlmain.obj
+ -@erase $(MINIPERL)
+ -@erase perlglob.obj
+ -@erase perlmain.obj
+ -@erase $(GLOBEXE)
+ -@erase $(PERLEXE)
+ -@erase $(PERLDLL)
+ -@erase $(CORE_OBJ)
+ -@erase $(WIN32_OBJ)
+ -@erase $(DLL_OBJ)
+ -@erase ..\*.obj *.obj ..\*.lib ..\*.exp
+ -@erase *.ilk
+ -@erase *.pdb
+
+
diff --git a/win32/TEST b/win32/TEST
index a7e074ed9c..1bda4ef793 100644
--- a/win32/TEST
+++ b/win32/TEST
@@ -33,6 +33,10 @@ if ($ARGV[0] eq '') {
grep( s/.*t\\//, @ARGV );
# @ARGV = split(/[ \n]/,
# `echo base/*.t comp/*.t cmd/*.t io/*.t; echo op/*.t pragma/*.t lib/*.t`);
+} else {
+
+@ARGV = map(glob($_),@ARGV);
+
}
if ($^O eq 'os2' || $^O eq 'MSWin32' || $^O eq 'qnx' || 1) {
diff --git a/win32/config.H b/win32/config.H
index fc70d4dd47..37b50a5efd 100644
--- a/win32/config.H
+++ b/win32/config.H
@@ -1,6 +1,7 @@
/*
- * This file was produced by running the config_h.SH script, on a UNIX machine
- * with config.sh set to conif.w32 from this directory
+ * This file was produced by running the config_h.SH script, which
+ * gets its values from config.sh, which is generally produced by
+ * running Configure.
*
* Feel free to modify any of this as the need arises. Note, however,
* that running config_h.SH again will wipe out any changes you've made.
@@ -1412,11 +1413,8 @@
* 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.
*/
-/* This added by hand */
-#define APPLLIB_EXP (win32PerlLibPath())
-
#define ARCHLIB "C:\\perl\\lib" /**/
-/* #define ARCHLIB_EXP "C:\\perl\\lib" /**/
+#define ARCHLIB_EXP "C:\\perl\\lib" /**/
/* BINCOMPAT3:
* This symbol, if defined, indicates that Perl 5.004 should be
@@ -1672,7 +1670,7 @@
* /bin/pdksh, /bin/ash, /bin/bash, or even something such as
* D:/bin/sh.exe.
*/
-#define SH_PATH "/bin/sh" /**/
+#define SH_PATH "cmd /c" /**/
/* SIG_NAME:
* This symbol contains a list of signal names in order of
@@ -1719,7 +1717,7 @@
* in programs that are not prepared to deal with ~ expansion at run-time.
*/
#define SITEARCH "C:\\perl\\lib\\site" /**/
-/* #define SITEARCH_EXP "C:\\perl\\lib\\site" /**/
+#define SITEARCH_EXP "C:\\perl\\lib\\site" /**/
/* SITELIB:
* This symbol contains the name of the private library for this package.
@@ -1776,7 +1774,8 @@
#define M_VOID /* Xenix strikes again */
#endif
+#endif
#include <win32.h>
+#define ARCHLIBEXP (win32PerlLibPath())
#define DEBUGGING
#define MULTIPLCITY
-#endif
diff --git a/win32/config.w32 b/win32/config.w32
index cadbdfa80f..95697fca50 100644
--- a/win32/config.w32
+++ b/win32/config.w32
@@ -5,22 +5,22 @@
## Target system: WIN32
#
-archlibexp='C:\perl\lib'
+archlibexp='~INST_TOP~\lib'
archname='MSWin32'
cc='cl'
-ccflags=''
-cppflags=''
+ccflags='-MD -DWIN32'
+cppflags='-DWIN32'
dlsrc='dl_win32.xs'
dynamic_ext='Fcntl IO Opcode SDBM_File Socket'
extensions='Fcntl IO Opcode SDBM_File Socket'
-installarchlib='C:\perl\lib'
-installprivlib='C:\perl\lib'
+installarchlib='~INST_TOP~\lib'
+installprivlib='~INST_TOP~\lib'
libpth=''
libs=''
osname='MSWin32'
osvers='4.0'
-prefix='C:'
-privlibexp='C:\perl\lib'
+prefix='~INST_DRV~'
+privlibexp='~INST_TOP~\lib'
sharpbang='#!'
shsharp='true'
sig_name='ZERO HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM USR1 USR2 CHLD PWR WINCH URG IO STOP TSTP CONT TTIN TTOU VTALRM PROF XCPU XFSZ WAITING LWP FREEZE THAW RTMIN NUM37 NUM38 NUM39 NUM40 NUM41 NUM42 RTMAX IOT CLD POLL'
@@ -46,13 +46,13 @@ afs='false'
alignbytes='8'
aphostname=''
ar='ar'
-archlib='C:\perl\lib'
+archlib='~INST_TOP~\lib'
archobjs=''
awk='awk'
baserev='5.0'
bash=''
-bin='C:\perl\bin'
-binexp='C:\perl\bin'
+bin='~INST_TOP~\bin'
+binexp='~INST_TOP~\bin'
bison=''
byacc='byacc'
byteorder='1234'
@@ -208,7 +208,7 @@ d_setreuid='undef'
d_setrgid='undef'
d_setruid='undef'
d_setsid='undef'
-d_sfio='undef';
+d_sfio='undef'
d_shm='undef'
d_shmat='undef'
d_shmatprototype='undef'
@@ -311,7 +311,7 @@ i_locale='define'
i_malloc='define'
i_math='define'
i_memory='undef'
-i_ndbm='define'
+i_ndbm='undef'
i_neterrno='undef'
i_niin='undef'
i_pwd='undef'
@@ -350,12 +350,12 @@ i_varhdr='varargs.h'
i_vfork='undef'
incpath=''
inews=''
-installbin='C:\perl\bin'
-installman1dir='C:\perl\man\man1'
-installman3dir='C:\perl\lib\perl5\man\man3'
-installscript='C:\perl\bin'
-installsitearch='C:\perl\lib\site'
-installsitelib='C:\perl\lib\site'
+installbin='~INST_TOP~\bin'
+installman1dir='~INST_TOP~\man\man1'
+installman3dir='~INST_TOP~\man\man3'
+installscript='~INST_TOP~\bin'
+installsitearch='~INST_TOP~\lib\site'
+installsitelib='~INST_TOP~\lib\site'
intsize='4'
known_extensions='DB_File Fcntl GDBM_File NDBM_File ODBM_File Opcode POSIX SDBM_File Socket'
ksh=''
@@ -365,7 +365,7 @@ lddlflags='-dll'
ldflags='-nologo -subsystem:windows'
less='less'
lib_ext='.lib'
-libc='/lib/libc.so.1.9.2'
+libc='msvcrt.lib'
libswanted='net socket inet nsl nm ndbm gdbm dbm db malloc dl dld ld sun m c cposix posix ndir dir crypt ucb bsd BSD PW x'
line='line'
lint=''
@@ -385,11 +385,11 @@ make='nmake'
mallocobj='malloc.o'
mallocsrc='malloc.c'
malloctype='void *'
-man1dir='C:\perl\man\man1'
-man1direxp='C:\perl\man\man1'
+man1dir='~INST_TOP~\man\man1'
+man1direxp='~INST_TOP~\man\man1'
man1ext='1'
-man3dir='C:\perl\lib\perl5\man\man3'
-man3direxp='C:\perl\lib\perl5\man\man3'
+man3dir='~INST_TOP~\man\man3'
+man3direxp='~INST_TOP~\man\man3'
man3ext='3'
medium=''
mips=''
@@ -397,7 +397,7 @@ mips_type=''
mkdir='mkdir'
models='none'
modetype='mode_t'
-more='more'
+more='more /e'
mv=''
myarchname='MSWin32'
mydomain=''
@@ -406,7 +406,7 @@ myuname=''
n='-n'
nm_opt=''
nm_so_opt=''
-nroff='nroff'
+nroff=''
o_nonblock='O_NONBLOCK'
obj_ext='.obj'
oldarchlib=''
@@ -414,20 +414,20 @@ oldarchlibexp=''
optimize='-O'
orderlib='false'
package='perl5'
-pager='cmd /c more'
+pager='more /e'
passcat=''
patchlevel='2'
path_sep=';'
perl='perl'
perladmin=''
-perlpath='C:\perl\bin\perl.exe'
+perlpath='~INST_TOP~\bin\perl.exe'
pg='pg'
phostname='hostname'
plibpth=''
pmake=''
pr=''
-prefixexp='C:'
-privlib='C:\perl\lib'
+prefixexp='~INST_DRV~'
+privlib='~INST_TOP~\lib'
prototype='define'
randbits='15'
ranlib=''
@@ -435,22 +435,22 @@ rd_nodata='-1'
rm='rm'
rmail=''
runnm='true'
-scriptdir='C:\perl\bin'
-scriptdirexp='C:\perl\bin'
+scriptdir='~INST_TOP~\bin'
+scriptdirexp='~INST_TOP~\bin'
sed='sed'
selecttype='int *'
sendmail='blat'
-sh='cmd /c'
+sh='cmd /x /c'
shar=''
shmattype='void *'
shortsize='2'
shrpdir='none'
sig_num='0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 6 18 22'
signal_t='void'
-sitearch='C:\perl\lib\site'
-sitearchexp='C:\perl\lib\site'
-sitelib='C:\perl\lib\site'
-sitelibexp='C:\perl\lib\site'
+sitearch='~INST_TOP~\lib\site'
+sitearchexp='~INST_TOP~\lib\site'
+sitelib='~INST_TOP~\lib\site'
+sitelibexp='~INST_TOP~\lib\site'
sizetype='size_t'
sleep=''
smail=''
@@ -484,12 +484,12 @@ uidtype='uid_t'
uname='uname'
uniq='uniq'
usedl='define'
-usemymalloc='y'
-usenm='true'
+usemymalloc='n'
+usenm='false'
useperlio='undef'
useposix='true'
usesafe='true'
-usevfork='true'
+usevfork='false'
usrinc='/usr/include'
uuname=''
vi=''
diff --git a/win32/config_h.PL b/win32/config_h.PL
new file mode 100644
index 0000000000..d266f6557f
--- /dev/null
+++ b/win32/config_h.PL
@@ -0,0 +1,89 @@
+#
+use Config;
+use File::Compare qw(compare);
+use File::Copy qw(copy);
+my $name = $0;
+$name =~ s#^(.*)\.PL$#../$1.SH#;
+open(SH,"<$name") || die "Cannot open $name:$!";
+while (<SH>)
+ {
+ last if /^sed/;
+ }
+($term,$file,$pat) = /^sed\s+<<(\S+)\s+>(\S+)\s+(.*)$/;
+
+my $str = "sub munge\n{\n";
+
+while ($pat =~ s/-e\s+'([^']*)'\s*//)
+ {
+ my $e = $1;
+ $e =~ s/\\([\(\)])/$1/g;
+ $e =~ s/\\(\d)/\$$1/g;
+ $str .= "$e;\n";
+ }
+$str .= "}\n";
+
+eval $str;
+
+die "$str:$@" if $@;
+
+open(H,">$file.new") || die "Cannot open $file.new:$!";
+while (<SH>)
+ {
+ last if /^$term$/o;
+ s/\$([\w_]+)/Config($1)/eg;
+ s/`([^\`]*)`/BackTick($1)/eg;
+ munge();
+ s/\\\$/\$/g;
+ s#/[ *\*]*\*/#/**/#;
+ if (/#define\s+ARCHLIBEXP/)
+ {
+ }
+ print H;
+ }
+print H "#include <win32.h>
+#define ARCHLIBEXP (win32PerlLibPath())
+#define DEBUGGING
+";
+close(H);
+close(SH);
+
+
+chmod(0666,"../lib/CORE/config.h");
+copy("$file.new","../lib/CORE/config.h") || die "Cannot copy:$!";
+chmod(0444,"../lib/CORE/config.h");
+
+if (compare("$file.new",$file))
+ {
+ warn "$file has changed\n";
+ chmod(0666,$file);
+ unlink($file);
+ rename("$file.new",$file);
+ chmod(0444,$file);
+ exit(1);
+ }
+
+sub Config
+{
+ my $var = shift;
+ my $val = $Config{$var};
+ $val = 'undef' unless defined $val;
+ $val =~ s/\\/\\\\/g;
+ return $val;
+}
+
+sub BackTick
+{
+ my $cmd = shift;
+ if ($cmd =~ /^echo\s+(.*?)\s*\|\s+sed\s+'(.*)'\s*$/)
+ {
+ local ($data,$pat) = ($1,$2);
+ $data =~ s/\s+/ /g;
+ eval "\$data =~ $pat";
+ return $data;
+ }
+ else
+ {
+ die "Cannot handle \`$cmd\`";
+ }
+ return $cmd;
+}
diff --git a/win32/config_sh.PL b/win32/config_sh.PL
new file mode 100644
index 0000000000..d397a1b53b
--- /dev/null
+++ b/win32/config_sh.PL
@@ -0,0 +1,13 @@
+my %opt;
+while (@ARGV && $ARGV[0] =~ /^([\w_]+)=(.*)$/)
+ {
+ $opt{$1}=$2;
+ shift(@ARGV);
+ }
+while (<>)
+ {
+ s/~([\w_]+)~/$opt{$1}/g;
+ $_ = "$1='$opt{$1}'\n" if (/^([\w_]+)=/ && exists($opt{$1}));
+ print;
+ }
+
diff --git a/win32/perllib.c b/win32/perllib.c
index 9d2aaa9e2b..9d24a2ac18 100644
--- a/win32/perllib.c
+++ b/win32/perllib.c
@@ -65,7 +65,6 @@ xs_init()
{
char *file = __FILE__;
dXSUB_SYS;
-
newXS("DynaLoader::boot_DynaLoader", boot_DynaLoader, file);
}
diff --git a/win32/runperl.c b/win32/runperl.c
index 507b3831f5..07e2bd6f83 100644
--- a/win32/runperl.c
+++ b/win32/runperl.c
@@ -1,10 +1,18 @@
#include <stdio.h>
#include <win32io.h>
-extern WIN32_IOSUBSYSTEM win32stdio;
+#ifndef _DLL
+extern WIN32_IOSUBSYSTEM win32stdio;
+#endif
+
extern int RunPerl(int argc, char **argv, char **env, void *iosubsystem);
+int
main(int argc, char **argv, char **env)
{
- return (RunPerl(argc, argv, env, &win32stdio));
+#ifdef _DLL
+ return (RunPerl(argc, argv, env, NULL));
+#else
+ return (RunPerl(argc, argv, env, &win32stdio));
+#endif
}
diff --git a/win32/win32.c b/win32/win32.c
index ed24251ba6..909036477d 100644
--- a/win32/win32.c
+++ b/win32/win32.c
@@ -54,22 +54,18 @@ IsWinNT(void) {
void *
SetIOSubSystem(void *p)
{
+ PWIN32_IOSUBSYSTEM old = pIOSubSystem;
if (p) {
PWIN32_IOSUBSYSTEM pio = (PWIN32_IOSUBSYSTEM)p;
-
if (pio->signature_begin == 12345678L
&& pio->signature_end == 87654321L) {
- PWIN32_IOSUBSYSTEM pold = pIOSubSystem;
pIOSubSystem = pio;
- return pold;
}
}
else {
- /* re-assign our stuff */
-/* pIOSubSystem = &win32stdio; */
- pIOSubSystem = NULL;
+ pIOSubSystem = &win32stdio;
}
- return pIOSubSystem;
+ return old;
}
char *
diff --git a/win32/win32io.c b/win32/win32io.c
index c9cc8e24e2..e75754abb9 100644
--- a/win32/win32io.c
+++ b/win32/win32io.c
@@ -65,6 +65,12 @@ dummy_globalmode(int mode)
return o;
}
+#ifdef _DLL
+/* It may or may not be fixed (ok on NT), but DLL runtime
+ does not export the functions used in the workround
+*/
+#define WIN95_OSFHANDLE_FIXED
+#endif
#if defined(_WIN32) && !defined(WIN95_OSFHANDLE_FIXED) && defined(_M_IX86)
@@ -172,7 +178,7 @@ my_open_osfhandle(long osfhandle, int flags)
#else
int __cdecl
-stolen_open_osfhandle(long osfhandle, int flags)
+my_open_osfhandle(long osfhandle, int flags)
{
return _open_osfhandle(osfhandle, flags);
}
diff --git a/win32/win32sck.c b/win32/win32sck.c
index 7acb02871c..45f7ac1cbf 100644
--- a/win32/win32sck.c
+++ b/win32/win32sck.c
@@ -22,13 +22,8 @@
#ifdef USE_SOCKETS_AS_HANDLES
/* thanks to Beverly Brown (beverly@datacube.com) */
-# if defined(_WIN32) && !defined(WIN95_OSFHANDLE_FIXED) && defined(_M_IX86)
-/*# define OPEN_SOCKET(x) _patch_open_osfhandle(x, _O_RDWR | _O_BINARY) */
-# define OPEN_SOCKET(x) _open_osfhandle(x,_O_RDWR|_O_BINARY)
-# else
-# define OPEN_SOCKET(x) _open_osfhandle(x,_O_RDWR|_O_BINARY)
-# endif
-# define TO_SOCKET(x) _get_osfhandle(x)
+#define OPEN_SOCKET(x) _open_osfhandle(x,_O_RDWR|_O_BINARY)
+#define TO_SOCKET(x) _get_osfhandle(x)
#else
@@ -37,123 +32,9 @@
#endif /* USE_SOCKETS_AS_HANDLES */
-/*
- * This is a clone of fdopen so that we can handle the version of
- * sockets that NT gets to use.
- *
- * The problem is that sockets are not real file handles and
- * cannot be fdopen'ed. This causes problems in the do_socket
- * routine in doio.c, since it tries to create two file pointers
- * for the socket just created. We'll fake out an fdopen and see
- * if we can prevent perl from trying to do stdio on sockets.
- */
-
-#if defined(_WIN32) && !defined(WIN95_OSFHANDLE_FIXED) && defined(_M_IX86)
-
-# ifdef __cplusplus
-#define EXT_C_FUNC extern "C"
-# else
-#define EXT_C_FUNC extern
-# endif
-
-EXT_C_FUNC int __cdecl _alloc_osfhnd(void);
-EXT_C_FUNC int __cdecl _set_osfhnd(int fh, long value);
-EXT_C_FUNC void __cdecl _lock_fhandle(int);
-EXT_C_FUNC void __cdecl _unlock_fhandle(int);
-EXT_C_FUNC void __cdecl _unlock(int);
-EXT_C_FUNC struct servent* win32_savecopyservent(struct servent*d,
- struct servent*s, const char *proto);
-
-#if (_MSC_VER >= 1000)
-typedef struct {
- long osfhnd; /* underlying OS file HANDLE */
- char osfile; /* attributes of file (e.g., open in text mode?) */
- char pipech; /* one char buffer for handles opened on pipes */
-#if defined (_MT) && !defined (DLL_FOR_WIN32S)
- int lockinitflag;
- CRITICAL_SECTION lock;
-#endif /* defined (_MT) && !defined (DLL_FOR_WIN32S) */
-} ioinfo;
-
-EXT_C_FUNC ioinfo * __pioinfo[];
-
-#define IOINFO_L2E 5
-#define IOINFO_ARRAY_ELTS (1 << IOINFO_L2E)
-#define _pioinfo(i) (__pioinfo[i >> IOINFO_L2E] + (i & (IOINFO_ARRAY_ELTS - 1)))
-#define _osfile(i) (_pioinfo(i)->osfile)
-#else /* (_MSC_VER >= 1000) */
- extern char _osfile[];
-#endif /* (_MSC_VER >= 1000) */
-
-#define FOPEN 0x01 /* file handle open */
-#define FAPPEND 0x20 /* file handle opened O_APPEND */
-#define FDEV 0x40 /* file handle refers to device */
-#define FTEXT 0x80 /* file handle is in text mode */
-
-#define _STREAM_LOCKS 26 /* Table of stream locks */
-#define _LAST_STREAM_LOCK (_STREAM_LOCKS+_NSTREAM_-1) /* Last stream lock */
-#define _FH_LOCKS (_LAST_STREAM_LOCK+1) /* Table of fh locks */
-
-/***
-*int _patch_open_osfhandle(long osfhandle, int flags) - open C Runtime file handle
-*
-*Purpose:
-* This function allocates a free C Runtime file handle and associates
-* it with the Win32 HANDLE specified by the first parameter. This is a
-* temperary fix for WIN95's brain damage GetFileType() error on socket
-* we just bypass that call for socket
-*
-*Entry:
-* long osfhandle - Win32 HANDLE to associate with C Runtime file handle.
-* int flags - flags to associate with C Runtime file handle.
-*
-*Exit:
-* returns index of entry in fh, if successful
-* return -1, if no free entry is found
-*
-*Exceptions:
-*
-*******************************************************************************/
-
-int __cdecl
-_patch_open_osfhandle(long osfhandle, int flags)
-{
- int fh;
- char fileflags; /* _osfile flags */
-
- /* copy relevant flags from second parameter */
- fileflags = FDEV;
-
- if(flags & _O_APPEND)
- fileflags |= FAPPEND;
-
- if(flags & _O_TEXT)
- fileflags |= FTEXT;
-
- /* attempt to allocate a C Runtime file handle */
- if((fh = _alloc_osfhnd()) == -1) {
- errno = EMFILE; /* too many open files */
- _doserrno = 0L; /* not an OS error */
- return -1; /* return error to caller */
- }
-
- /* the file is open. now, set the info in _osfhnd array */
- _set_osfhnd(fh, osfhandle);
-
- fileflags |= FOPEN; /* mark as open */
-
-#if (_MSC_VER >= 1000)
- _osfile(fh) = fileflags; /* set osfile entry */
- _unlock_fhandle(fh);
-#else
- _osfile[fh] = fileflags; /* set osfile entry */
- _unlock(fh+_FH_LOCKS); /* unlock handle */
-#endif
-
- return fh; /* return handle */
-}
-#endif /* _M_IX86 */
-
+static struct servent* win32_savecopyservent(struct servent*d,
+ struct servent*s,
+ const char *proto);
#define SOCKETAPI PASCAL
typedef SOCKET (SOCKETAPI *LPSOCKACCEPT)(SOCKET, struct sockaddr *, int *);
@@ -806,4 +687,24 @@ win32_setservent(int stayopen)
CROAK("setservent not implemented!\n");
}
+#define WIN32IO_IS_STDIO
+#include <io.h>
+#include "win32iop.h"
+
+static struct servent*
+win32_savecopyservent(struct servent*d, struct servent*s, const char *proto)
+{
+ d->s_name = s->s_name;
+ d->s_aliases = s->s_aliases;
+ d->s_port = s->s_port;
+ if (!IsWin95() && s->s_proto && strlen(s->s_proto))
+ d->s_proto = s->s_proto;
+ else if (proto && strlen(proto))
+ d->s_proto = (char *)proto;
+ else
+ d->s_proto = "tcp";
+
+ return d;
+}
+