summaryrefslogtreecommitdiff
path: root/gnu/usr.bin/perl/win32
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>1999-04-29 22:53:00 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>1999-04-29 22:53:00 +0000
commitc25c5c3c87d89b68324dc98b7c8aaabc750c7cec (patch)
tree2943af9b1f84d88d863a9ba36a234877561bf5f0 /gnu/usr.bin/perl/win32
parent37583d269f066aa8aa04ea18126b188d12257e6d (diff)
perl5.005_03 (stock)
Diffstat (limited to 'gnu/usr.bin/perl/win32')
-rw-r--r--gnu/usr.bin/perl/win32/Makefile1476
-rw-r--r--gnu/usr.bin/perl/win32/bin/pl2bat.pl195
-rw-r--r--gnu/usr.bin/perl/win32/bin/search.pl5
-rw-r--r--gnu/usr.bin/perl/win32/config.bc255
-rw-r--r--gnu/usr.bin/perl/win32/config.vc253
-rw-r--r--gnu/usr.bin/perl/win32/config_H.bc1570
-rw-r--r--gnu/usr.bin/perl/win32/config_H.vc1572
-rw-r--r--gnu/usr.bin/perl/win32/config_h.PL39
-rw-r--r--gnu/usr.bin/perl/win32/config_sh.PL28
-rw-r--r--gnu/usr.bin/perl/win32/dl_win32.xs74
-rw-r--r--gnu/usr.bin/perl/win32/include/dirent.h12
-rw-r--r--gnu/usr.bin/perl/win32/include/sys/socket.h67
-rw-r--r--gnu/usr.bin/perl/win32/makedef.pl358
-rw-r--r--gnu/usr.bin/perl/win32/makefile.mk1728
-rw-r--r--gnu/usr.bin/perl/win32/perlglob.c4
-rw-r--r--gnu/usr.bin/perl/win32/perllib.c31
-rw-r--r--gnu/usr.bin/perl/win32/pod.mak85
-rw-r--r--gnu/usr.bin/perl/win32/runperl.c96
-rw-r--r--gnu/usr.bin/perl/win32/win32.c1942
-rw-r--r--gnu/usr.bin/perl/win32/win32.h381
-rw-r--r--gnu/usr.bin/perl/win32/win32iop.h269
-rw-r--r--gnu/usr.bin/perl/win32/win32sck.c501
22 files changed, 7187 insertions, 3754 deletions
diff --git a/gnu/usr.bin/perl/win32/Makefile b/gnu/usr.bin/perl/win32/Makefile
index 7a98f84c2cb..6481d735cda 100644
--- a/gnu/usr.bin/perl/win32/Makefile
+++ b/gnu/usr.bin/perl/win32/Makefile
@@ -1,517 +1,959 @@
-#
-# Makefile to build perl on Windowns NT using Microsoft NMAKE.
-#
-#
-# 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.
-#
-
-#
-# Set these to wherever you want "nmake install" to put your
-# newly built perl.
-INST_DRV=c:
-INST_TOP=$(INST_DRV)\perl
-
-#
-# uncomment next line if you are using Visual C++ 2.x
-#CCTYPE=MSVC20
-
-#
-# uncomment next line if you want debug version of perl (big,slow)
-#CFG=Debug
-
-#
-# set the install locations of the compiler include/libraries
-#CCHOME = f:\msvc20
-CCHOME = $(MSVCDIR)
-CCINCDIR = $(CCHOME)\include
-CCLIBDIR = $(CCHOME)\lib
-
-#
-# set this to your email address (perl will guess a value from
-# from your loginname and your hostname, which may not be right)
-#EMAIL =
-
-##################### CHANGE THESE ONLY IF YOU MUST #####################
-
-#
-# Programs to compile, build .lib files and link
-#
-
-CC=cl.exe
-LINK32=link.exe
-LIB32=$(LINK32) -lib
-#
-# Options
-#
-!IF "$(RUNTIME)" == ""
-RUNTIME = -MD
-!ENDIF
-INCLUDES = -I.\include -I. -I..
-#PCHFLAGS = -Fp"$(INTDIR)/modules.pch" -YX
-DEFINES = -DWIN32 -D_CONSOLE -DPERLDLL
-SUBSYS = console
-
-!IF "$(RUNTIME)" == "-MD"
-LIBC = msvcrt.lib
-WINIOMAYBE =
-!ELSE
-LIBC = libcmt.lib
-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 = -debug -pdb:none
-!ELSE
-! IF "$(CCTYPE)" == "MSVC20"
-OPTIMIZE = -Od $(RUNTIME) -DNDEBUG
-! ELSE
-OPTIMIZE = -Od $(RUNTIME) -DNDEBUG
-! ENDIF
-LINK_DBG = -release
-!ENDIF
-
-# we don't add LIBC here, the compiler do it based on -MD/-MT
-LIBFILES = 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 \
- version.lib odbc32.lib odbccp32.lib
-
-CFLAGS = -nologo -W3 $(INCLUDES) $(DEFINES) $(PCHFLAGS) $(OPTIMIZE)
-LINK_FLAGS = -nologo $(LIBFILES) $(LINK_DBG) -machine:I386
-OBJOUT_FLAG = -Fo
-
-#################### 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) $(OBJOUT_FLAG)$@ $<
-
-.obj.dll:
- $(LINK32) -dll -subsystem:windows -implib:$(*B).lib -def:$(*B).def \
- -out:$@ $(LINK_FLAGS) $< $(LIBPERL)
-
-#
-INST_BIN=$(INST_TOP)\bin
-INST_LIB=$(INST_TOP)\lib
-INST_POD=$(INST_LIB)\pod
-INST_HTML=$(INST_POD)\html
-LIBDIR=..\lib
-EXTDIR=..\ext
-PODDIR=..\pod
-EXTUTILSDIR=$(LIBDIR)\extutils
-
-#
-# various targets
-PERLIMPLIB=..\perl.lib
-MINIPERL=..\miniperl.exe
-PERLDLL=..\perl.dll
-PERLEXE=..\perl.exe
-GLOBEXE=..\perlglob.exe
-CONFIGPM=..\lib\Config.pm
-MINIMOD=..\lib\ExtUtils\Miniperl.pm
-
-PL2BAT=bin\pl2bat.pl
-GLOBBAT = bin\perlglob.bat
-
-MAKE=nmake -nologo
-CFGSH_TMPL = config.vc
-CFGH_TMPL = config_H.vc
-PERL95EXE=..\perl95.exe
-XCOPY=xcopy /f /r /i /d
-RCOPY=xcopy /f /r /i /e /d
-NULL=
-
-#
-# filenames given to xsubpp must have forward slashes (since it puts
-# full pathnames in #line strings)
-XSUBPP=..\$(MINIPERL) -I..\..\lib ..\$(EXTUTILSDIR)\xsubpp -C++ -prototypes
-
-CORE_C= ..\av.c \
- ..\deb.c \
- ..\doio.c \
- ..\doop.c \
- ..\dump.c \
- ..\globals.c \
- ..\gv.c \
- ..\hv.c \
- ..\mg.c \
- ..\op.c \
- ..\perl.c \
- ..\perlio.c \
- ..\perly.c \
- ..\pp.c \
- ..\pp_ctl.c \
- ..\pp_hot.c \
- ..\pp_sys.c \
- ..\regcomp.c \
- ..\regexec.c \
- ..\run.c \
- ..\scope.c \
- ..\sv.c \
- ..\taint.c \
- ..\toke.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
-
-PERL95_OBJ = perl95.obj \
- win32mt.obj \
- win32iomt.obj \
- win32sckmt.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
-SOCKET=$(EXTDIR)\Socket\Socket
-FCNTL=$(EXTDIR)\Fcntl\Fcntl
-OPCODE=$(EXTDIR)\Opcode\Opcode
-SDBM_FILE=$(EXTDIR)\SDBM_File\SDBM_File
-IO=$(EXTDIR)\IO\IO
-
-SOCKET_DLL=..\lib\auto\Socket\Socket.dll
-FCNTL_DLL=..\lib\auto\Fcntl\Fcntl.dll
-OPCODE_DLL=..\lib\auto\Opcode\Opcode.dll
-SDBM_FILE_DLL=..\lib\auto\SDBM_File\SDBM_File.dll
-IO_DLL=..\lib\auto\IO\IO.dll
-
-STATICLINKMODULES=DynaLoader
-DYNALOADMODULES= \
- $(SOCKET_DLL) \
- $(FCNTL_DLL) \
- $(OPCODE_DLL) \
- $(SDBM_FILE_DLL)\
- $(IO_DLL)
-
-POD2HTML=$(PODDIR)\pod2html
-POD2MAN=$(PODDIR)\pod2man
-POD2LATEX=$(PODDIR)\pod2latex
-POD2TEXT=$(PODDIR)\pod2text
-
-#
-# Top targets
-#
-
-all: $(PERLEXE) $(PERL95EXE) $(GLOBEXE) $(DYNALOADMODULES) $(MINIMOD) $(GLOBBAT)
-
-$(DYNALOADER).obj : $(DYNALOADER).c $(CORE_H) $(EXTDIR)\DynaLoader\dlutils.c
-
-#------------------------------------------------------------
-
-$(GLOBEXE): perlglob.obj
- $(LINK32) $(LINK_FLAGS) -out:$@ -subsystem:$(SUBSYS) perlglob.obj setargv.obj
-
-$(GLOBBAT) : ..\lib\File\DosGlob.pm $(MINIPERL)
- $(MINIPERL) $(PL2BAT) - < ..\lib\File\DosGlob.pm > $(GLOBBAT)
-
-perlglob.obj : perlglob.c
-
-..\miniperlmain.obj : ..\miniperlmain.c $(CORE_H)
-
-config.w32 : $(CFGSH_TMPL)
- copy $(CFGSH_TMPL) config.w32
-
-.\config.h : $(CFGSH_TMPL)
- -del /f config.h
- copy $(CFGH_TMPL) config.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" \
- "cf_email=$(EMAIL)" "libs=$(LIBFILES)" "incpath=$(CCINCDIR)" \
- "libpth=$(CCLIBDIR)" "libc=$(LIBC)" \
- config.w32 > ..\config.sh
-
-$(CONFIGPM) : $(MINIPERL) ..\config.sh config_h.PL ..\minimod.pl
- cd .. && miniperl configpm
- if exist lib\* $(RCOPY) lib\*.* ..\lib\$(NULL)
- $(XCOPY) ..\*.h ..\lib\CORE\*.*
- $(XCOPY) *.h ..\lib\CORE\*.*
- $(RCOPY) include ..\lib\CORE\*.*
- $(MINIPERL) -I..\lib config_h.PL || $(MAKE) CCTYPE=$(CCTYPE) \
- 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.def : $(MINIPERL) $(CONFIGPM)
- $(MINIPERL) -w makedef.pl $(CCTYPE) > perldll.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
-
-$(MINIMOD) : $(MINIPERL) ..\minimod.pl
- cd .. && miniperl minimod.pl > lib\ExtUtils\Miniperl.pm
-
-perlmain.c : runperl.c
- copy runperl.c perlmain.c
-
-perlmain.obj : perlmain.c
- $(CC) $(CFLAGS) -UPERLDLL -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) -I..\lib ..\splittree.pl "../LIB" "../LIB/auto"
- attrib -r ..\t\*.*
- copy test ..\t
-
-perl95.c : runperl.c
- copy runperl.c perl95.c
-
-perl95.obj : perl95.c
- $(CC) $(CFLAGS) -MT -UPERLDLL -c perl95.c
-
-win32iomt.obj : win32io.c
- $(CC) $(CFLAGS) -MT -c $(OBJOUT_FLAG)win32iomt.obj win32io.c
-
-win32sckmt.obj : win32sck.c
- $(CC) $(CFLAGS) -MT -c $(OBJOUT_FLAG)win32sckmt.obj win32sck.c
-
-win32mt.obj : win32.c
- $(CC) $(CFLAGS) -MT -c $(OBJOUT_FLAG)win32mt.obj win32.c
-
-$(PERL95EXE): $(PERLDLL) $(CONFIGPM) $(PERL95_OBJ)
- $(LINK32) -subsystem:console -out:perl95.exe $(LINK_FLAGS) \
- $(PERL95_OBJ) $(PERLIMPLIB)
- copy perl95.exe $@
- del perl95.exe
-
-$(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)
- $(XSUBPP) dl_win32.xs > $(*B).c
- cd ..\..\win32
-
-$(EXTDIR)\DynaLoader\dl_win32.xs: dl_win32.xs
- copy dl_win32.xs $(EXTDIR)\DynaLoader\dl_win32.xs
-
-$(IO_DLL): $(PERLEXE) $(CONFIGPM) $(IO).xs
- cd $(EXTDIR)\$(*B)
- ..\..\miniperl -I..\..\lib Makefile.PL INSTALLDIRS=perl
- $(MAKE)
- cd ..\..\win32
-
-$(SDBM_FILE_DLL) : $(PERLEXE) $(SDBM_FILE).xs
- cd $(EXTDIR)\$(*B)
- ..\..\miniperl -I..\..\lib Makefile.PL INSTALLDIRS=perl
- $(MAKE)
- cd ..\..\win32
-
-$(FCNTL_DLL): $(PERLEXE) $(FCNTL).xs
- cd $(EXTDIR)\$(*B)
- ..\..\miniperl -I..\..\lib Makefile.PL INSTALLDIRS=perl
- $(MAKE)
- cd ..\..\win32
-
-$(OPCODE_DLL): $(PERLEXE) $(OPCODE).xs
- cd $(EXTDIR)\$(*B)
- ..\..\miniperl -I..\..\lib Makefile.PL INSTALLDIRS=perl
- $(MAKE)
- cd ..\..\win32
-
-$(SOCKET_DLL): $(SOCKET).xs $(PERLEXE)
- cd $(EXTDIR)\$(*B)
- ..\..\miniperl -I..\..\lib Makefile.PL INSTALLDIRS=perl
- $(MAKE)
- cd ..\..\win32
-
-doc: $(PERLEXE)
- cd ..\pod
- $(MAKE) -f ..\win32\pod.mak checkpods pod2html pod2latex \
- pod2man pod2text
- $(XCOPY) *.bat ..\win32\bin\*.*
- cd ..\win32
- copy ..\README.win32 ..\pod\perlwin32.pod
- $(PERLEXE) ..\installhtml --podroot=.. --htmldir=./html \
- --podpath=pod:lib:ext:utils --htmlroot="//$(INST_HTML::=|)" \
- --libpod=perlfunc:perlguts:perlvar:perlrun:perlop --recurse
-
-utils: $(PERLEXE)
- cd ..\utils
- nmake PERL=$(MINIPERL)
- $(PERLEXE) ..\win32\$(PL2BAT) h2ph splain perlbug pl2pm c2ph
- $(PERLEXE) ..\win32\$(PL2BAT) h2xs perldoc pstruct
- $(XCOPY) *.bat ..\win32\bin\*.*
- cd ..\win32
- $(PERLEXE) $(PL2BAT) bin\network.pl bin\www.pl bin\runperl.pl \
- bin\pl2bat.pl
-
-distclean: clean
- -del /f $(MINIPERL) $(PERLEXE) $(PERLDLL) $(GLOBEXE) \
- $(PERLIMPLIB) ..\miniperl.lib $(MINIMOD)
- -del /f *.def *.map
- -del /f $(SOCKET_DLL) $(IO_DLL) $(SDBM_FILE_DLL) $(FCNTL_DLL) \
- $(OPCODE_DLL)
- -del /f $(SOCKET).c $(IO).c $(SDBM_FILE).c $(FCNTL).c $(OPCODE).c \
- $(DYNALOADER).c
- -del /f $(PODDIR)\*.html
- -del /f $(PODDIR)\*.bat
- -del /f ..\config.sh ..\splittree.pl perlmain.c dlutils.c \
- config.h.new perl95.c
- -del /f bin\*.bat
- -rmdir /s /q ..\lib\auto
- -rmdir /s /q ..\lib\CORE
- cd $(EXTDIR)
- -del /s *.lib *.def *.map *.bs Makefile *.obj pm_to_blib
- cd ..\win32
-
-install : all doc utils
- if not exist $(INST_TOP) mkdir $(INST_TOP)
- echo I $(INST_TOP) L $(LIBDIR)
- $(XCOPY) $(PERLEXE) $(INST_BIN)\*.*
- $(XCOPY) $(PERL95EXE) $(INST_BIN)\*.*
- $(XCOPY) $(GLOBEXE) $(INST_BIN)\*.*
- $(XCOPY) $(PERLDLL) $(INST_BIN)\*.*
- $(XCOPY) bin\*.bat $(INST_BIN)\*.*
- $(RCOPY) ..\lib $(INST_LIB)\*.*
- $(XCOPY) ..\pod\*.bat $(INST_BIN)\*.*
- $(XCOPY) ..\pod\*.pod $(INST_POD)\*.*
- $(RCOPY) html\*.* $(INST_HTML)\*.*
-
-inst_lib : $(CONFIGPM)
- copy splittree.pl ..
- $(MINIPERL) -I..\lib ..\splittree.pl "../LIB" "../LIB/auto"
- $(RCOPY) ..\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-prep : all
- $(XCOPY) $(PERLEXE) ..\t\$(NULL)
- $(XCOPY) $(PERLDLL) ..\t\$(NULL)
- $(XCOPY) $(GLOBEXE) ..\t\$(NULL)
-
-test : test-prep
- cd ..\t
- $(PERLEXE) -I..\lib harness
- cd ..\win32
-
-test-notty : test-prep
- set PERL_SKIP_TTY_TEST=1
- cd ..\t
- $(PERLEXE) -I..\lib harness
- cd ..\win32
-
-clean :
- -@erase miniperlmain.obj
- -@erase $(MINIPERL)
- -@erase perlglob.obj
- -@erase perlmain.obj
- -@erase config.w32
- -@erase /f config.h
- -@erase $(GLOBEXE)
- -@erase $(PERLEXE)
- -@erase $(PERLDLL)
- -@erase $(CORE_OBJ)
- -@erase $(WIN32_OBJ)
- -@erase $(DLL_OBJ)
- -@erase ..\*.obj ..\*.lib ..\*.exp *.obj *.lib *.exp
- -@erase ..\t\*.exe ..\t\*.dll ..\t\*.bat
- -@erase *.ilk
- -@erase *.pdb
-
-
+#
+# Makefile to build perl on Windows NT using Microsoft NMAKE.
+#
+# 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.
+#
+
+##
+## Make sure you read README.win32 *before* you mess with anything here!
+##
+
+##
+## Build configuration. Edit the values below to suit your needs.
+##
+
+#
+# Set these to wherever you want "nmake install" to put your
+# newly built perl.
+#
+INST_DRV = c:
+INST_TOP = $(INST_DRV)\perl
+
+#
+# Comment this out if you DON'T want your perl installation to be versioned.
+# This means that the new installation will overwrite any files from the
+# old installation at the same INST_TOP location. Leaving it enabled is
+# the safest route, as perl adds the extra version directory to all the
+# locations it installs files to. If you disable it, an alternative
+# versioned installation can be obtained by setting INST_TOP above to a
+# path that includes an arbitrary version string.
+#
+INST_VER = \5.00503
+
+#
+# uncomment to enable threads-capabilities
+#
+#USE_THREADS = define
+
+#
+# uncomment to enable multiple interpreters
+#
+#USE_MULTI = define
+
+#
+# uncomment next line if you are using Visual C++ 2.x
+#
+#CCTYPE = MSVC20
+
+#
+# uncomment next line if you want to use the perl object
+# Currently, this cannot be enabled if you ask for threads above
+#
+#OBJECT = -DPERL_OBJECT
+
+#
+# uncomment next line if you want debug version of perl (big,slow)
+#
+#CFG = Debug
+
+#
+# uncomment next option if you want to use the VC++ compiler optimization.
+# Warning: This is known to produce incorrect code for compiler versions
+# earlier than VC++ 98 (Visual Studio 6.0). VC++ 98 generates code that
+# successfully passes the Perl regression test suite. It hasn't yet been
+# widely tested with real applications though.
+#
+#CFG = Optimize
+
+#
+# uncomment to enable use of PerlCRT.DLL when using the Visual C compiler.
+# Highly recommended. It has patches that fix known bugs in MSVCRT.DLL.
+# This currently requires VC 5.0 with Service Pack 3.
+# Get it from CPAN at http://www.perl.com/CPAN/authors/id/D/DO/DOUGL/
+# and follow the directions in the package to install.
+#
+#USE_PERLCRT = define
+
+#
+# uncomment to enable linking with setargv.obj under the Visual C
+# compiler. Setting this options enables perl to expand wildcards in
+# arguments, but it may be harder to use alternate methods like
+# File::DosGlob that are more powerful. This option is supported only with
+# Visual C.
+#
+#USE_SETARGV = define
+
+#
+# if you have the source for des_fcrypt(), uncomment this and make sure the
+# file exists (see README.win32). File should be located in the same
+# directory as this file.
+#
+#CRYPT_SRC = fcrypt.c
+
+#
+# if you didn't set CRYPT_SRC and if you have des_fcrypt() available in a
+# library, uncomment this, and make sure the library exists (see README.win32)
+# Specify the full pathname of the library.
+#
+#CRYPT_LIB = fcrypt.lib
+
+#
+# set this if you wish to use perl's malloc
+# WARNING: Turning this on/off WILL break binary compatibility with extensions
+# you may have compiled with/without it. Be prepared to recompile all
+# extensions if you change the default. Currently, this cannot be enabled
+# if you ask for PERL_OBJECT above.
+#
+#PERL_MALLOC = define
+
+#
+# set the install locations of the compiler include/libraries
+# Running VCVARS32.BAT is *required* when using Visual C.
+# Some versions of Visual C don't define MSVCDIR in the environment,
+# so you may have to set CCHOME explicitly (spaces in the path name should
+# not be quoted)
+#
+#CCHOME = f:\msvc20
+CCHOME = $(MSVCDIR)
+CCINCDIR = $(CCHOME)\include
+CCLIBDIR = $(CCHOME)\lib
+
+#
+# specify semicolon-separated list of extra directories that modules will
+# look for libraries (spaces in path names need not be quoted)
+#
+EXTRALIBDIRS =
+
+#
+# set this to your email address (perl will guess a value from
+# from your loginname and your hostname, which may not be right)
+#
+#EMAIL =
+
+##
+## Build configuration ends.
+##
+
+##################### CHANGE THESE ONLY IF YOU MUST #####################
+
+!IF "$(CRYPT_SRC)$(CRYPT_LIB)" == ""
+D_CRYPT = undef
+!ELSE
+D_CRYPT = define
+CRYPT_FLAG = -DHAVE_DES_FCRYPT
+!ENDIF
+
+!IF "$(OBJECT)" != ""
+PERL_MALLOC = undef
+USE_THREADS = undef
+USE_MULTI = undef
+!ENDIF
+
+!IF "$(PERL_MALLOC)" == ""
+PERL_MALLOC = undef
+!ENDIF
+
+!IF "$(USE_THREADS)" == ""
+USE_THREADS = undef
+!ENDIF
+
+!IF "$(USE_MULTI)" == ""
+USE_MULTI = undef
+!ENDIF
+
+#BUILDOPT = -DPERL_GLOBAL_STRUCT
+# -DUSE_PERLIO -D__STDC__=1 -DUSE_SFIO -DI_SFIO -I\sfio97\include
+
+!IF "$(PROCESSOR_ARCHITECTURE)" == ""
+PROCESSOR_ARCHITECTURE = x86
+!ENDIF
+
+!IF "$(OBJECT)" != ""
+ARCHNAME = MSWin32-$(PROCESSOR_ARCHITECTURE)-object
+!ELSE
+!IF "$(USE_THREADS)" == "define"
+ARCHNAME = MSWin32-$(PROCESSOR_ARCHITECTURE)-thread
+!ELSE
+ARCHNAME = MSWin32-$(PROCESSOR_ARCHITECTURE)
+!ENDIF
+!ENDIF
+
+ARCHDIR = ..\lib\$(ARCHNAME)
+COREDIR = ..\lib\CORE
+AUTODIR = ..\lib\auto
+
+#
+# Programs to compile, build .lib files and link
+#
+
+CC = cl.exe
+LINK32 = link.exe
+LIB32 = $(LINK32) -lib
+
+#
+# Options
+#
+
+RUNTIME = -MD
+INCLUDES = -I$(COREDIR) -I.\include -I. -I..
+#PCHFLAGS = -Fpc:\temp\vcmoduls.pch -YX
+DEFINES = -DWIN32 -D_CONSOLE -DNO_STRICT $(BUILDOPT) $(CRYPT_FLAG)
+LOCDEFS = -DPERLDLL -DPERL_CORE
+SUBSYS = console
+CXX_FLAG = -TP -GX
+
+!IF "$(USE_PERLCRT)" == ""
+! IF "$(CFG)" == "Debug"
+PERLCRTLIBC = msvcrtd.lib
+! ELSE
+PERLCRTLIBC = msvcrt.lib
+! ENDIF
+!ELSE
+! IF "$(CFG)" == "Debug"
+PERLCRTLIBC = PerlCRTD.lib
+! ELSE
+PERLCRTLIBC = PerlCRT.lib
+! ENDIF
+!ENDIF
+
+!IF "$(RUNTIME)" == "-MD"
+LIBC = $(PERLCRTLIBC)
+!ELSE
+LIBC = libcmt.lib
+!ENDIF
+
+!IF "$(CFG)" == "Debug"
+! IF "$(CCTYPE)" == "MSVC20"
+OPTIMIZE = -Od $(RUNTIME) -Z7 -D_DEBUG -DDEBUGGING
+! ELSE
+OPTIMIZE = -Od $(RUNTIME)d -Zi -D_DEBUG -DDEBUGGING
+! ENDIF
+LINK_DBG = -debug -pdb:none
+!ELSE
+! IF "$(CFG)" == "Optimize"
+OPTIMIZE = -O2 $(RUNTIME) -DNDEBUG
+! ELSE
+OPTIMIZE = -Od $(RUNTIME) -DNDEBUG
+! ENDIF
+LINK_DBG = -release
+!ENDIF
+
+!IF "$(OBJECT)" != ""
+OPTIMIZE = $(OPTIMIZE) $(CXX_FLAG)
+!ENDIF
+
+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 \
+ version.lib odbc32.lib odbccp32.lib
+
+# we add LIBC here, since we may be using PerlCRT.dll
+LIBFILES = $(LIBBASEFILES) $(LIBC)
+
+CFLAGS = -nologo -Gf -W3 $(INCLUDES) $(DEFINES) $(LOCDEFS) \
+ $(PCHFLAGS) $(OPTIMIZE)
+LINK_FLAGS = -nologo -nodefaultlib $(LINK_DBG) -machine:$(PROCESSOR_ARCHITECTURE)
+OBJOUT_FLAG = -Fo
+EXEOUT_FLAG = -Fe
+
+CFLAGS_O = $(CFLAGS) $(OBJECT)
+
+#################### do not edit below this line #######################
+############# NO USER-SERVICEABLE PARTS BEYOND THIS POINT ##############
+
+o = .obj
+
+#
+# Rules
+#
+
+.SUFFIXES : .c $(o) .dll .lib .exe
+
+.c$(o):
+ $(CC) -c -I$(<D) $(CFLAGS_O) $(OBJOUT_FLAG)$@ $<
+
+.y.c:
+ $(NOOP)
+
+$(o).dll:
+ $(LINK32) -dll -subsystem:windows -implib:$(*B).lib -def:$(*B).def \
+ -out:$@ $(LINK_FLAGS) $(LIBFILES) $< $(LIBPERL)
+
+#
+INST_BIN = $(INST_TOP)$(INST_VER)\bin\$(ARCHNAME)
+INST_SCRIPT = $(INST_TOP)$(INST_VER)\bin
+INST_LIB = $(INST_TOP)$(INST_VER)\lib
+INST_POD = $(INST_LIB)\pod
+INST_HTML = $(INST_POD)\html
+LIBDIR = ..\lib
+EXTDIR = ..\ext
+PODDIR = ..\pod
+EXTUTILSDIR = $(LIBDIR)\extutils
+
+#
+# various targets
+!IF "$(OBJECT)" == "-DPERL_OBJECT"
+PERLIMPLIB = ..\perlcore.lib
+PERLDLL = ..\perlcore.dll
+CAPILIB = $(COREDIR)\perlCAPI.lib
+!ELSE
+PERLIMPLIB = ..\perl.lib
+PERLDLL = ..\perl.dll
+CAPILIB =
+!ENDIF
+
+MINIPERL = ..\miniperl.exe
+MINIDIR = .\mini
+PERLEXE = ..\perl.exe
+GLOBEXE = ..\perlglob.exe
+CONFIGPM = ..\lib\Config.pm
+MINIMOD = ..\lib\ExtUtils\Miniperl.pm
+X2P = ..\x2p\a2p.exe
+
+PL2BAT = bin\pl2bat.pl
+GLOBBAT = bin\perlglob.bat
+
+UTILS = \
+ ..\utils\h2ph \
+ ..\utils\splain \
+ ..\utils\perlbug \
+ ..\utils\pl2pm \
+ ..\utils\c2ph \
+ ..\utils\h2xs \
+ ..\utils\perldoc \
+ ..\utils\pstruct \
+ ..\utils\perlcc \
+ ..\pod\checkpods \
+ ..\pod\pod2html \
+ ..\pod\pod2latex \
+ ..\pod\pod2man \
+ ..\pod\pod2text \
+ ..\x2p\find2perl \
+ ..\x2p\s2p \
+ bin\www.pl \
+ bin\runperl.pl \
+ bin\pl2bat.pl \
+ bin\perlglob.pl \
+ bin\search.pl
+
+MAKE = nmake -nologo
+
+CFGSH_TMPL = config.vc
+CFGH_TMPL = config_H.vc
+
+!IF "$(USE_PERLCRT)" == ""
+PERL95EXE = ..\perl95.exe
+!ENDIF
+
+XCOPY = xcopy /f /r /i /d
+RCOPY = xcopy /f /r /i /e /d
+NOOP = @echo
+NULL =
+
+#
+# filenames given to xsubpp must have forward slashes (since it puts
+# full pathnames in #line strings)
+XSUBPP = ..\$(MINIPERL) -I..\..\lib ..\$(EXTUTILSDIR)\xsubpp \
+ -C++ -prototypes
+
+MICROCORE_SRC = \
+ ..\av.c \
+ ..\byterun.c \
+ ..\deb.c \
+ ..\doio.c \
+ ..\doop.c \
+ ..\dump.c \
+ ..\globals.c \
+ ..\gv.c \
+ ..\hv.c \
+ ..\mg.c \
+ ..\op.c \
+ ..\perl.c \
+ ..\perly.c \
+ ..\pp.c \
+ ..\pp_ctl.c \
+ ..\pp_hot.c \
+ ..\pp_sys.c \
+ ..\regcomp.c \
+ ..\regexec.c \
+ ..\run.c \
+ ..\scope.c \
+ ..\sv.c \
+ ..\taint.c \
+ ..\toke.c \
+ ..\universal.c \
+ ..\util.c
+
+!IF "$(PERL_MALLOC)" == "define"
+EXTRACORE_SRC = $(EXTRACORE_SRC) ..\malloc.c
+!ENDIF
+
+!IF "$(OBJECT)" == ""
+EXTRACORE_SRC = $(EXTRACORE_SRC) ..\perlio.c
+!ENDIF
+
+WIN32_SRC = \
+ .\win32.c \
+ .\win32sck.c
+
+!IF "$(USE_THREADS)" == "define"
+WIN32_SRC = $(WIN32_SRC) .\win32thread.c
+!ENDIF
+
+!IF "$(CRYPT_SRC)" != ""
+WIN32_SRC = $(WIN32_SRC) .\$(CRYPT_SRC)
+!ENDIF
+
+PERL95_SRC = \
+ perl95.c \
+ win32mt.c \
+ win32sckmt.c
+
+!IF "$(CRYPT_SRC)" != ""
+PERL95_SRC = $(PERL95_SRC) .\$(CRYPT_SRC)
+!ENDIF
+
+DLL_SRC = $(DYNALOADER).c
+
+
+!IF "$(OBJECT)" == ""
+DLL_SRC = $(DLL_SRC) perllib.c
+!ENDIF
+
+X2P_SRC = \
+ ..\x2p\a2p.c \
+ ..\x2p\hash.c \
+ ..\x2p\str.c \
+ ..\x2p\util.c \
+ ..\x2p\walk.c
+
+CORE_NOCFG_H = \
+ ..\av.h \
+ ..\byterun.h \
+ ..\bytecode.h \
+ ..\cop.h \
+ ..\cv.h \
+ ..\dosish.h \
+ ..\embed.h \
+ ..\form.h \
+ ..\gv.h \
+ ..\handy.h \
+ ..\hv.h \
+ ..\iperlsys.h \
+ ..\mg.h \
+ ..\nostdio.h \
+ ..\op.h \
+ ..\opcode.h \
+ ..\perl.h \
+ ..\perlsdio.h \
+ ..\perlsfio.h \
+ ..\perly.h \
+ ..\pp.h \
+ ..\proto.h \
+ ..\regexp.h \
+ ..\scope.h \
+ ..\sv.h \
+ ..\thread.h \
+ ..\unixish.h \
+ ..\util.h \
+ ..\XSUB.h \
+ ..\EXTERN.h \
+ ..\perlvars.h \
+ ..\intrpvar.h \
+ ..\thrdvar.h \
+ .\include\dirent.h \
+ .\include\netdb.h \
+ .\include\sys\socket.h \
+ .\win32.h
+
+CORE_H = $(CORE_NOCFG_H) .\config.h
+
+MICROCORE_OBJ = $(MICROCORE_SRC:.c=.obj)
+CORE_OBJ = $(MICROCORE_OBJ) $(EXTRACORE_SRC:.c=.obj)
+WIN32_OBJ = $(WIN32_SRC:.c=.obj)
+MINICORE_OBJ = $(MICROCORE_OBJ:..\=.\mini\) \
+ $(MINIDIR)\miniperlmain$(o) \
+ $(MINIDIR)\perlio$(o)
+MINIWIN32_OBJ = $(WIN32_OBJ:.\=.\mini\)
+MINI_OBJ = $(MINICORE_OBJ) $(MINIWIN32_OBJ)
+PERL95_OBJ = $(PERL95_SRC:.c=.obj)
+DLL_OBJ = $(DLL_SRC:.c=.obj)
+X2P_OBJ = $(X2P_SRC:.c=.obj)
+
+PERLDLL_OBJ = $(CORE_OBJ)
+PERLEXE_OBJ = perlmain$(o)
+
+!IF "$(OBJECT)" == ""
+PERLDLL_OBJ = $(PERLDLL_OBJ) $(WIN32_OBJ) $(DLL_OBJ)
+!ELSE
+PERLEXE_OBJ = $(PERLEXE_OBJ) $(WIN32_OBJ) $(DLL_OBJ)
+PERL95_OBJ = $(PERL95_OBJ) DynaLoadmt$(o)
+!ENDIF
+
+!IF "$(USE_SETARGV)" != ""
+SETARGV_OBJ = setargv$(o)
+!ENDIF
+
+DYNAMIC_EXT = Socket IO Fcntl Opcode SDBM_File POSIX attrs Thread B re \
+ Data/Dumper
+STATIC_EXT = DynaLoader
+NONXS_EXT = Errno
+
+DYNALOADER = $(EXTDIR)\DynaLoader\DynaLoader
+SOCKET = $(EXTDIR)\Socket\Socket
+FCNTL = $(EXTDIR)\Fcntl\Fcntl
+OPCODE = $(EXTDIR)\Opcode\Opcode
+SDBM_FILE = $(EXTDIR)\SDBM_File\SDBM_File
+IO = $(EXTDIR)\IO\IO
+POSIX = $(EXTDIR)\POSIX\POSIX
+ATTRS = $(EXTDIR)\attrs\attrs
+THREAD = $(EXTDIR)\Thread\Thread
+B = $(EXTDIR)\B\B
+RE = $(EXTDIR)\re\re
+DUMPER = $(EXTDIR)\Data\Dumper\Dumper
+ERRNO = $(EXTDIR)\Errno\Errno
+
+SOCKET_DLL = $(AUTODIR)\Socket\Socket.dll
+FCNTL_DLL = $(AUTODIR)\Fcntl\Fcntl.dll
+OPCODE_DLL = $(AUTODIR)\Opcode\Opcode.dll
+SDBM_FILE_DLL = $(AUTODIR)\SDBM_File\SDBM_File.dll
+IO_DLL = $(AUTODIR)\IO\IO.dll
+POSIX_DLL = $(AUTODIR)\POSIX\POSIX.dll
+ATTRS_DLL = $(AUTODIR)\attrs\attrs.dll
+THREAD_DLL = $(AUTODIR)\Thread\Thread.dll
+B_DLL = $(AUTODIR)\B\B.dll
+DUMPER_DLL = $(AUTODIR)\Data\Dumper\Dumper.dll
+RE_DLL = $(AUTODIR)\re\re.dll
+
+ERRNO_PM = $(LIBDIR)\Errno.pm
+
+EXTENSION_C = \
+ $(SOCKET).c \
+ $(FCNTL).c \
+ $(OPCODE).c \
+ $(SDBM_FILE).c \
+ $(IO).c \
+ $(POSIX).c \
+ $(ATTRS).c \
+ $(THREAD).c \
+ $(RE).c \
+ $(DUMPER).c \
+ $(B).c
+
+EXTENSION_DLL = \
+ $(SOCKET_DLL) \
+ $(FCNTL_DLL) \
+ $(OPCODE_DLL) \
+ $(SDBM_FILE_DLL)\
+ $(IO_DLL) \
+ $(POSIX_DLL) \
+ $(ATTRS_DLL) \
+ $(DUMPER_DLL) \
+ $(B_DLL)
+
+EXTENSION_PM = \
+ $(ERRNO_PM)
+
+!IF "$(OBJECT)" == ""
+EXTENSION_DLL = \
+ $(EXTENSION_DLL)\
+ $(THREAD_DLL) \
+ $(RE_DLL)
+!ENDIF
+
+POD2HTML = $(PODDIR)\pod2html
+POD2MAN = $(PODDIR)\pod2man
+POD2LATEX = $(PODDIR)\pod2latex
+POD2TEXT = $(PODDIR)\pod2text
+
+CFG_VARS = \
+ "INST_DRV=$(INST_DRV)" \
+ "INST_TOP=$(INST_TOP)" \
+ "INST_VER=$(INST_VER)" \
+ "archname=$(ARCHNAME)" \
+ "cc=$(CC)" \
+ "ccflags=$(OPTIMIZE:"=\") $(DEFINES) $(OBJECT)" \
+ "cf_email=$(EMAIL)" \
+ "d_crypt=$(D_CRYPT)" \
+ "d_mymalloc=$(PERL_MALLOC)" \
+ "libs=$(LIBFILES)" \
+ "incpath=$(CCINCDIR:"=\")" \
+ "libperl=$(PERLIMPLIB:..\=)" \
+ "libpth=$(CCLIBDIR:"=\");$(EXTRALIBDIRS:"=\")" \
+ "libc=$(LIBC)" \
+ "make=nmake" \
+ "static_ext=$(STATIC_EXT)" \
+ "dynamic_ext=$(DYNAMIC_EXT)" \
+ "nonxs_ext=$(NONXS_EXT)" \
+ "usethreads=$(USE_THREADS)" \
+ "usemultiplicity=$(USE_MULTI)" \
+ "LINK_FLAGS=$(LINK_FLAGS:"=\")" \
+ "optimize=$(OPTIMIZE:"=\")"
+
+#
+# Top targets
+#
+
+all : .\config.h $(GLOBEXE) $(MINIMOD) $(CONFIGPM) $(PERLEXE) $(PERL95EXE) \
+ $(CAPILIB) $(X2P) $(EXTENSION_DLL) $(EXTENSION_PM)
+
+$(DYNALOADER)$(o) : $(DYNALOADER).c $(CORE_H) $(EXTDIR)\DynaLoader\dlutils.c
+
+#------------------------------------------------------------
+
+$(GLOBEXE) : perlglob$(o)
+ $(LINK32) $(LINK_FLAGS) $(LIBFILES) -out:$@ -subsystem:$(SUBSYS) \
+ perlglob$(o) setargv$(o)
+
+perlglob$(o) : perlglob.c
+
+config.w32 : $(CFGSH_TMPL)
+ copy $(CFGSH_TMPL) config.w32
+
+.\config.h : $(CFGH_TMPL)
+ -del /f config.h
+ copy $(CFGH_TMPL) config.h
+
+..\config.sh : config.w32 $(MINIPERL) config_sh.PL
+ $(MINIPERL) -I..\lib config_sh.PL $(CFG_VARS) config.w32 > ..\config.sh
+
+# this target is for when changes to the main config.sh happen
+# edit config.{b,v,g}c and make this target once for each supported
+# compiler (e.g. `dmake CCTYPE=BORLAND regen_config_h`)
+regen_config_h:
+ perl config_sh.PL $(CFG_VARS) $(CFGSH_TMPL) > ..\config.sh
+ cd ..
+ -del /f perl.exe
+ perl configpm
+ cd win32
+ -del /f $(CFGH_TMPL)
+ -mkdir $(COREDIR)
+ -perl -I..\lib config_h.PL "INST_VER=$(INST_VER)"
+ rename config.h $(CFGH_TMPL)
+
+$(CONFIGPM) : $(MINIPERL) ..\config.sh config_h.PL ..\minimod.pl
+ cd .. && miniperl configpm
+ if exist lib\* $(RCOPY) lib\*.* ..\lib\$(NULL)
+ $(XCOPY) ..\*.h $(COREDIR)\*.*
+ $(XCOPY) *.h $(COREDIR)\*.*
+ $(XCOPY) ..\ext\re\re.pm $(LIBDIR)\*.*
+ $(RCOPY) include $(COREDIR)\*.*
+ $(MINIPERL) -I..\lib config_h.PL "INST_VER=$(INST_VER)" \
+ || $(MAKE) /$(MAKEFLAGS) $(CONFIGPM)
+
+$(MINIPERL) : $(MINIDIR) $(MINI_OBJ)
+ $(LINK32) -subsystem:console -out:$@ @<<
+ $(LINK_FLAGS) $(LIBFILES) $(MINI_OBJ)
+<<
+
+$(MINIDIR) :
+ if not exist "$(MINIDIR)" mkdir "$(MINIDIR)"
+
+$(MINICORE_OBJ) : $(CORE_NOCFG_H)
+ $(CC) -c $(CFLAGS) $(OBJOUT_FLAG)$@ ..\$(*F).c
+
+$(MINIWIN32_OBJ) : $(CORE_NOCFG_H)
+ $(CC) -c $(CFLAGS) $(OBJOUT_FLAG)$@ $(*F).c
+
+# 1. we don't want to rebuild miniperl.exe when config.h changes
+# 2. we don't want to rebuild miniperl.exe with non-default config.h
+$(MINI_OBJ) : $(CORE_NOCFG_H)
+
+$(WIN32_OBJ) : $(CORE_H)
+$(CORE_OBJ) : $(CORE_H)
+$(DLL_OBJ) : $(CORE_H)
+$(PERL95_OBJ) : $(CORE_H)
+$(X2P_OBJ) : $(CORE_H)
+
+perldll.def : $(MINIPERL) $(CONFIGPM) ..\global.sym makedef.pl
+ $(MINIPERL) -w makedef.pl $(OPTIMIZE) $(DEFINES) $(OBJECT) \
+ CCTYPE=$(CCTYPE) > perldll.def
+
+$(PERLDLL): perldll.def $(PERLDLL_OBJ)
+ $(LINK32) -dll -def:perldll.def -out:$@ @<<
+ $(LINK_FLAGS) $(LIBFILES) $(PERLDLL_OBJ)
+<<
+ $(XCOPY) $(PERLIMPLIB) $(COREDIR)
+
+perl.def : $(MINIPERL) makeperldef.pl
+ $(MINIPERL) -I..\lib makeperldef.pl $(NULL) > perl.def
+
+$(MINIMOD) : $(MINIPERL) ..\minimod.pl
+ cd .. && miniperl minimod.pl > lib\ExtUtils\Miniperl.pm
+
+..\x2p\a2p$(o) : ..\x2p\a2p.c
+ $(CC) -I..\x2p $(CFLAGS) $(OBJOUT_FLAG)$@ -c ..\x2p\a2p.c
+
+..\x2p\hash$(o) : ..\x2p\hash.c
+ $(CC) -I..\x2p $(CFLAGS) $(OBJOUT_FLAG)$@ -c ..\x2p\hash.c
+
+..\x2p\str$(o) : ..\x2p\str.c
+ $(CC) -I..\x2p $(CFLAGS) $(OBJOUT_FLAG)$@ -c ..\x2p\str.c
+
+..\x2p\util$(o) : ..\x2p\util.c
+ $(CC) -I..\x2p $(CFLAGS) $(OBJOUT_FLAG)$@ -c ..\x2p\util.c
+
+..\x2p\walk$(o) : ..\x2p\walk.c
+ $(CC) -I..\x2p $(CFLAGS) $(OBJOUT_FLAG)$@ -c ..\x2p\walk.c
+
+$(X2P) : $(MINIPERL) $(X2P_OBJ)
+ $(MINIPERL) ..\x2p\find2perl.PL
+ $(MINIPERL) ..\x2p\s2p.PL
+ $(LINK32) -subsystem:console -out:$@ @<<
+ $(LINK_FLAGS) $(LIBFILES) $(X2P_OBJ)
+<<
+
+perlmain.c : runperl.c
+ copy runperl.c perlmain.c
+
+perlmain$(o) : perlmain.c
+ $(CC) $(CFLAGS_O) -UPERLDLL $(OBJOUT_FLAG)$@ -c perlmain.c
+
+$(PERLEXE): $(PERLDLL) $(CONFIGPM) $(PERLEXE_OBJ)
+ $(LINK32) -subsystem:console -out:$@ $(LINK_FLAGS) $(LIBFILES) \
+ $(PERLEXE_OBJ) $(SETARGV_OBJ) $(PERLIMPLIB)
+ copy splittree.pl ..
+ $(MINIPERL) -I..\lib ..\splittree.pl "../LIB" $(AUTODIR)
+
+!IF "$(USE_PERLCRT)" == ""
+
+perl95.c : runperl.c
+ copy runperl.c perl95.c
+
+perl95$(o) : perl95.c
+ $(CC) $(CFLAGS_O) -MT -UPERLDLL -DWIN95FIX -c perl95.c
+
+win32sckmt$(o) : win32sck.c
+ $(CC) $(CFLAGS_O) -MT -UPERLDLL -DWIN95FIX -c \
+ $(OBJOUT_FLAG)win32sckmt$(o) win32sck.c
+
+win32mt$(o) : win32.c
+ $(CC) $(CFLAGS_O) -MT -UPERLDLL -DWIN95FIX -c \
+ $(OBJOUT_FLAG)win32mt$(o) win32.c
+
+DynaLoadmt$(o) : $(DYNALOADER).c
+ $(CC) $(CFLAGS_O) -MT -UPERLDLL -DWIN95FIX -c \
+ $(OBJOUT_FLAG)DynaLoadmt$(o) $(DYNALOADER).c
+
+$(PERL95EXE): $(PERLDLL) $(CONFIGPM) $(PERL95_OBJ)
+ $(LINK32) -subsystem:console -nodefaultlib -out:$@ $(LINK_FLAGS) \
+ $(LIBBASEFILES) $(PERL95_OBJ) $(SETARGV_OBJ) $(PERLIMPLIB) \
+ libcmt.lib
+
+!ENDIF
+
+$(DYNALOADER).c: $(MINIPERL) $(EXTDIR)\DynaLoader\dl_win32.xs $(CONFIGPM)
+ if not exist $(AUTODIR) mkdir $(AUTODIR)
+ cd $(EXTDIR)\$(*B)
+ ..\$(MINIPERL) -I..\..\lib $(*B)_pm.PL
+ cd ..\..\win32
+ $(XCOPY) $(EXTDIR)\$(*B)\$(*B).pm $(LIBDIR)\$(NULL)
+ cd $(EXTDIR)\$(*B)
+ $(XSUBPP) dl_win32.xs > $(*B).c
+ cd ..\..\win32
+
+!IF "$(OBJECT)" == "-DPERL_OBJECT"
+perlCAPI.cpp : $(MINIPERL)
+ $(MINIPERL) GenCAPI.pl $(COREDIR)
+
+perlCAPI$(o) : perlCAPI.cpp
+ $(CC) $(CFLAGS_O) $(RUNTIME) -UPERLDLL -c \
+ $(OBJOUT_FLAG)perlCAPI$(o) perlCAPI.cpp
+
+$(CAPILIB) : perlCAPI.cpp perlCAPI$(o)
+ lib /OUT:$(CAPILIB) perlCAPI$(o)
+!ENDIF
+
+$(EXTDIR)\DynaLoader\dl_win32.xs: dl_win32.xs
+ copy dl_win32.xs $(EXTDIR)\DynaLoader\dl_win32.xs
+
+$(DUMPER_DLL): $(PERLEXE) $(DUMPER).xs
+ cd $(EXTDIR)\Data\$(*B)
+ ..\..\..\miniperl -I..\..\..\lib Makefile.PL INSTALLDIRS=perl
+ $(MAKE)
+ cd ..\..\..\win32
+
+$(RE_DLL): $(PERLEXE) $(RE).xs
+ cd $(EXTDIR)\$(*B)
+ ..\..\miniperl -I..\..\lib Makefile.PL INSTALLDIRS=perl
+ $(MAKE)
+ cd ..\..\win32
+
+$(B_DLL): $(PERLEXE) $(B).xs
+ cd $(EXTDIR)\$(*B)
+ ..\..\miniperl -I..\..\lib Makefile.PL INSTALLDIRS=perl
+ $(MAKE)
+ cd ..\..\win32
+
+$(THREAD_DLL): $(PERLEXE) $(THREAD).xs
+ cd $(EXTDIR)\$(*B)
+ ..\..\miniperl -I..\..\lib Makefile.PL INSTALLDIRS=perl
+ $(MAKE)
+ cd ..\..\win32
+
+$(ATTRS_DLL): $(PERLEXE) $(ATTRS).xs
+ cd $(EXTDIR)\$(*B)
+ ..\..\miniperl -I..\..\lib Makefile.PL INSTALLDIRS=perl
+ $(MAKE)
+ cd ..\..\win32
+
+$(POSIX_DLL): $(PERLEXE) $(POSIX).xs
+ cd $(EXTDIR)\$(*B)
+ ..\..\miniperl -I..\..\lib Makefile.PL INSTALLDIRS=perl
+ $(MAKE)
+ cd ..\..\win32
+
+$(IO_DLL): $(PERLEXE) $(IO).xs
+ cd $(EXTDIR)\$(*B)
+ ..\..\miniperl -I..\..\lib Makefile.PL INSTALLDIRS=perl
+ $(MAKE)
+ cd ..\..\win32
+
+$(SDBM_FILE_DLL) : $(PERLEXE) $(SDBM_FILE).xs
+ cd $(EXTDIR)\$(*B)
+ ..\..\miniperl -I..\..\lib Makefile.PL INSTALLDIRS=perl
+ $(MAKE)
+ cd ..\..\win32
+
+$(FCNTL_DLL): $(PERLEXE) $(FCNTL).xs
+ cd $(EXTDIR)\$(*B)
+ ..\..\miniperl -I..\..\lib Makefile.PL INSTALLDIRS=perl
+ $(MAKE)
+ cd ..\..\win32
+
+$(OPCODE_DLL): $(PERLEXE) $(OPCODE).xs
+ cd $(EXTDIR)\$(*B)
+ ..\..\miniperl -I..\..\lib Makefile.PL INSTALLDIRS=perl
+ $(MAKE)
+ cd ..\..\win32
+
+$(SOCKET_DLL): $(PERLEXE) $(SOCKET).xs
+ cd $(EXTDIR)\$(*B)
+ ..\..\miniperl -I..\..\lib Makefile.PL INSTALLDIRS=perl
+ $(MAKE)
+ cd ..\..\win32
+
+$(ERRNO_PM): $(PERLEXE) $(ERRNO)_pm.PL
+ cd $(EXTDIR)\$(*B)
+ ..\..\miniperl -I..\..\lib Makefile.PL INSTALLDIRS=perl
+ $(MAKE)
+ cd ..\..\win32
+
+doc: $(PERLEXE)
+ $(PERLEXE) -I..\lib ..\installhtml --podroot=.. --htmldir=./html \
+ --podpath=pod:lib:ext:utils --htmlroot="file://$(INST_HTML::=|)" \
+ --libpod=perlfunc:perlguts:perlvar:perlrun:perlop --recurse
+
+utils: $(PERLEXE) $(X2P)
+ cd ..\utils
+ $(MAKE) PERL=$(MINIPERL)
+ cd ..\pod
+ copy ..\README.win32 .\perlwin32.pod
+ $(MAKE) -f ..\win32\pod.mak converters
+ cd ..\win32
+ $(PERLEXE) $(PL2BAT) $(UTILS)
+
+distclean: clean
+ -del /f $(MINIPERL) $(PERLEXE) $(PERL95EXE) $(PERLDLL) $(GLOBEXE) \
+ $(PERLIMPLIB) ..\miniperl.lib $(MINIMOD)
+ -del /f *.def *.map
+ -del /f $(EXTENSION_DLL) $(EXTENSION_PM)
+ -del /f $(EXTENSION_C) $(DYNALOADER).c $(ERRNO).pm
+ -del /f $(EXTDIR)\DynaLoader\dl_win32.xs
+ -del /f $(LIBDIR)\.exists $(LIBDIR)\attrs.pm $(LIBDIR)\DynaLoader.pm
+ -del /f $(LIBDIR)\Fcntl.pm $(LIBDIR)\IO.pm $(LIBDIR)\Opcode.pm
+ -del /f $(LIBDIR)\ops.pm $(LIBDIR)\Safe.pm $(LIBDIR)\Thread.pm
+ -del /f $(LIBDIR)\SDBM_File.pm $(LIBDIR)\Socket.pm $(LIBDIR)\POSIX.pm
+ -del /f $(LIBDIR)\B.pm $(LIBDIR)\O.pm $(LIBDIR)\re.pm
+ -del /f $(LIBDIR)\Data\Dumper.pm
+ -rmdir /s /q $(LIBDIR)\IO || rmdir /s $(LIBDIR)\IO
+ -rmdir /s /q $(LIBDIR)\Thread || rmdir /s $(LIBDIR)\Thread
+ -rmdir /s /q $(LIBDIR)\B || rmdir /s $(LIBDIR)\B
+ -rmdir /s /q $(LIBDIR)\Data || rmdir /s $(LIBDIR)\Data
+ -del /f $(PODDIR)\*.html
+ -del /f $(PODDIR)\*.bat
+ cd ..\utils
+ -del /f h2ph splain perlbug pl2pm c2ph h2xs perldoc pstruct
+ -del /f *.bat
+ cd ..\win32
+ cd ..\x2p
+ -del /f find2perl s2p
+ -del /f *.bat
+ cd ..\win32
+ -del /f ..\config.sh ..\splittree.pl perlmain.c dlutils.c config.h.new
+ -del /f $(CONFIGPM)
+ -del /f perl95.c
+ -del /f bin\*.bat
+ cd $(EXTDIR)
+ -del /s *.lib *.def *.map *.pdb *.bs Makefile *$(o) pm_to_blib
+ cd ..\win32
+ -rmdir /s /q $(AUTODIR) || rmdir /s $(AUTODIR)
+ -rmdir /s /q $(COREDIR) || rmdir /s $(COREDIR)
+
+install : all installbare installhtml
+
+installbare : utils
+ $(PERLEXE) ..\installperl
+!IF "$(USE_PERLCRT)" == ""
+ $(XCOPY) $(PERL95EXE) $(INST_BIN)\*.*
+!ENDIF
+ $(XCOPY) $(GLOBEXE) $(INST_BIN)\*.*
+ $(XCOPY) bin\*.bat $(INST_SCRIPT)\*.*
+ $(XCOPY) bin\network.pl $(INST_LIB)\*.*
+
+installhtml : doc
+ $(RCOPY) html\*.* $(INST_HTML)\*.*
+
+inst_lib : $(CONFIGPM)
+ copy splittree.pl ..
+ $(MINIPERL) -I..\lib ..\splittree.pl "../LIB" $(AUTODIR)
+ $(RCOPY) ..\lib $(INST_LIB)\*.*
+
+minitest : $(MINIPERL) $(GLOBEXE) $(CONFIGPM) utils
+ $(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-prep : all utils
+ $(XCOPY) $(PERLEXE) ..\t\$(NULL)
+ $(XCOPY) $(PERLDLL) ..\t\$(NULL)
+ $(XCOPY) $(GLOBEXE) ..\t\$(NULL)
+
+test : test-prep
+ cd ..\t
+ $(PERLEXE) -I..\lib harness
+ cd ..\win32
+
+test-notty : test-prep
+ set PERL_SKIP_TTY_TEST=1
+ cd ..\t
+ $(PERLEXE) -I..\lib harness
+ cd ..\win32
+
+clean :
+ -@erase miniperlmain$(o)
+ -@erase $(MINIPERL)
+ -@erase perlglob$(o)
+ -@erase perlmain$(o)
+ -@erase config.w32
+ -@erase /f config.h
+ -@erase perlCAPI.cpp
+ -@erase $(GLOBEXE)
+ -@erase $(PERLEXE)
+ -@erase $(PERLDLL)
+ -@erase $(CORE_OBJ)
+ -@erase $(CAPILIB)
+ -rmdir /s /q $(MINIDIR) || rmdir /s $(MINIDIR)
+ -@erase $(WIN32_OBJ)
+ -@erase $(DLL_OBJ)
+ -@erase $(X2P_OBJ)
+ -@erase ..\*$(o) ..\*.lib ..\*.exp ..\*.res *$(o) *.lib *.exp *.res
+ -@erase ..\t\*.exe ..\t\*.dll ..\t\*.bat
+ -@erase ..\x2p\*.exe ..\x2p\*.bat
+ -@erase *.ilk
+ -@erase *.pdb
diff --git a/gnu/usr.bin/perl/win32/bin/pl2bat.pl b/gnu/usr.bin/perl/win32/bin/pl2bat.pl
index 73ae87164da..2fa80885005 100644
--- a/gnu/usr.bin/perl/win32/bin/pl2bat.pl
+++ b/gnu/usr.bin/perl/win32/bin/pl2bat.pl
@@ -1,73 +1,121 @@
-#!perl -w
+ eval 'exec perl -x -S "$0" ${1+"$@"}'
+ if 0; # In case running under some shell
+
require 5;
use Getopt::Std;
+use Config;
$0 =~ s|.*[/\\]||;
my $usage = <<EOT;
-Usage: $0 [-h] [-a argstring] [-s stripsuffix] [files]
+Usage: $0 [-h]
+ or: $0 [-w] [-u] [-a argstring] [-s stripsuffix] [files]
+ or: $0 [-w] [-u] [-n ntargs] [-o otherargs] [-s stripsuffix] [files]
+ -n ntargs arguments to invoke perl with in generated file
+ when run from Windows NT. Defaults to
+ '-x -S "%0" %*'.
+ -o otherargs arguments to invoke perl with in generated file
+ other than when run from Windows NT. Defaults
+ to '-x -S "%0" %1 %2 %3 %4 %5 %6 %7 %8 %9'.
-a argstring arguments to invoke perl with in generated file
- Defaults to "-x -S %0 %*" on WindowsNT,
- "-x -S %0 %1 %2 %3 %4 %5 %6 %7 %8 %9" otherwise
+ ignoring operating system (for compatibility
+ with previous pl2bat versions).
+ -u update files that may have already been processed
+ by (some version of) pl2bat.
+ -w include "-w" on the /^#!.*perl/ line (unless
+ a /^#!.*perl/ line was already present).
-s stripsuffix strip this suffix from file before appending ".bat"
- Not case-sensitive
+ Not case-sensitive
Can be a regex if it begins with `/'
- Defaults to "/\.pl/"
+ Defaults to "/\.plx?/"
-h show this help
EOT
my %OPT = ();
-warn($usage), exit(0) if !getopts('ha:s:',\%OPT) or $OPT{'h'};
-$OPT{'a'} = ($^O eq 'MSWin32' and &Win32::IsWinNT
- ? '-x -S %0 %*'
- : '-x -S %0 %1 %2 %3 %4 %5 %6 %7 %8 %9')
- unless exists $OPT{'a'};
-$OPT{'s'} = '.pl' unless exists $OPT{'s'};
+warn($usage), exit(0) if !getopts('whun:o:a:s:',\%OPT) or $OPT{'h'};
+$OPT{'n'} = '-x -S "%0" %*' unless exists $OPT{'n'};
+$OPT{'o'} = '-x -S "%0" %1 %2 %3 %4 %5 %6 %7 %8 %9' unless exists $OPT{'o'};
+$OPT{'s'} = '/\\.plx?/' unless exists $OPT{'s'};
$OPT{'s'} = ($OPT{'s'} =~ m|^/([^/]*)| ? $1 : "\Q$OPT{'s'}\E");
-(my $head = <<EOT) =~ s/^\t//gm;
+my $head;
+if( defined( $OPT{'a'} ) ) {
+ $head = <<EOT;
\@rem = '--*-Perl-*--
\@echo off
perl $OPT{'a'}
goto endofperl
\@rem ';
EOT
+} else {
+ $head = <<EOT;
+ \@rem = '--*-Perl-*--
+ \@echo off
+ if "%OS%" == "Windows_NT" goto WinNT
+ perl $OPT{'o'}
+ goto endofperl
+ :WinNT
+ perl $OPT{'n'}
+ if NOT "%COMSPEC%" == "%SystemRoot%\\system32\\cmd.exe" goto endofperl
+ if %errorlevel% == 9009 echo You do not have Perl in your PATH.
+ goto endofperl
+ \@rem ';
+EOT
+}
+$head =~ s/^\t//gm;
my $headlines = 2 + ($head =~ tr/\n/\n/);
my $tail = "__END__\n:endofperl\n";
@ARGV = ('-') unless @ARGV;
-process(@ARGV);
+foreach ( @ARGV ) {
+ process($_);
+}
sub process {
- LOOP:
- foreach ( @_ ) {
- my $myhead = $head;
- my $linedone = 0;
- my $linenum = $headlines;
- my $line;
- open( FILE, $_ ) or die "$0: Can't open $_: $!";
- @file = <FILE>;
- foreach $line ( @file ) {
- $linenum++;
- if ( $line =~ /^:endofperl/) {
- warn "$0: $_ has already been converted to a batch file!\n";
- next LOOP;
+ my( $file )= @_;
+ my $myhead = $head;
+ my $linedone = 0;
+ my $taildone = 0;
+ my $linenum = 0;
+ my $skiplines = 0;
+ my $line;
+ my $start= $Config{startperl};
+ $start= "#!perl" unless $start =~ /^#!.*perl/;
+ open( FILE, $file ) or die "$0: Can't open $file: $!";
+ @file = <FILE>;
+ foreach $line ( @file ) {
+ $linenum++;
+ if ( $line =~ /^:endofperl\b/ ) {
+ if( ! exists $OPT{'u'} ) {
+ warn "$0: $file has already been converted to a batch file!\n";
+ return;
}
- if ( not $linedone and $line =~ /^#!.*perl/ ) {
- $line .= "#line $linenum\n";
- $linedone++;
+ $taildone++;
+ }
+ if ( not $linedone and $line =~ /^#!.*perl/ ) {
+ if( exists $OPT{'u'} ) {
+ $skiplines = $linenum - 1;
+ $line .= "#line ".(1+$headlines)."\n";
+ } else {
+ $line .= "#line ".($linenum+$headlines)."\n";
}
- }
- close( FILE );
- s/$OPT{'s'}$//oi;
- $_ .= '.bat' unless /\.bat$/i or /^-$/;
- open( FILE, ">$_" ) or die "Can't open $_: $!";
- print FILE $myhead;
- print FILE "#!perl\n#line " . ($headlines+1) . "\n" unless $linedone;
- print FILE @file, $tail;
- close( FILE );
+ $linedone++;
+ }
+ if ( $line =~ /^#\s*line\b/ and $linenum == 2 + $skiplines ) {
+ $line = "";
+ }
}
+ close( FILE );
+ $file =~ s/$OPT{'s'}$//oi;
+ $file .= '.bat' unless $file =~ /\.bat$/i or $file =~ /^-$/;
+ open( FILE, ">$file" ) or die "Can't open $file: $!";
+ print FILE $myhead;
+ print FILE $start, ( $OPT{'w'} ? " -w" : "" ),
+ "\n#line ", ($headlines+1), "\n" unless $linedone;
+ print FILE @file[$skiplines..$#file];
+ print FILE $tail unless $taildone;
+ close( FILE );
}
__END__
@@ -77,7 +125,11 @@ pl2bat - wrap perl code into a batch file
=head1 SYNOPSIS
-B<pl2bat> [B<-h>] S<[B<-a> I<argstring>]> S<[B<-s> I<stripsuffix>]> [files]
+B<pl2bat> B<-h>
+
+B<pl2bat> [B<-w>] S<[B<-a> I<argstring>]> S<[B<-s> I<stripsuffix>]> [files]
+
+B<pl2bat> [B<-w>] S<[B<-n> I<ntargs>]> S<[B<-o> I<otherargs>]> S<[B<-s> I<stripsuffix>]> [files]
=head1 DESCRIPTION
@@ -88,32 +140,64 @@ Note that by default, the ".pl" suffix will be stripped before adding
a ".bat" suffix to the supplied file names. This can be controlled
with the C<-s> option.
-The default behavior on WindowsNT is to generate a batch file that
+The default behavior is to have the batch file compare the C<OS>
+environment variable against C<"Windows_NT">. If they match, it
uses the C<%*> construct to refer to all the command line arguments
that were given to it, so you'll need to make sure that works on your
variant of the command shell. It is known to work in the cmd.exe shell
under WindowsNT. 4DOS/NT users will want to put a C<ParameterChar = *>
line in their initialization file, or execute C<setdos /p*> in
-the shell startup file. On Windows95 and other platforms a nine
-argument limit is imposed on command-line arguments given to the
-generated batch file, since they may not support C<%*> in batch files.
-This can be overridden using the C<-a> option.
+the shell startup file.
+
+On Windows95 and other platforms a nine-argument limit is imposed
+on command-line arguments given to the generated batch file, since
+they may not support C<%*> in batch files.
+
+These can be overridden using the C<-n> and C<-o> options or the
+deprecated C<-a> option.
=head1 OPTIONS
=over 8
+=item B<-n> I<ntargs>
+
+Arguments to invoke perl with in generated batch file when run from
+Windows NT (or Windows 98, probably). Defaults to S<'-x -S "%0" %*'>.
+
+=item B<-o> I<otherargs>
+
+Arguments to invoke perl with in generated batch file except when
+run from Windows NT (ie. when run from DOS, Windows 3.1, or Windows 95).
+Defaults to S<'-x -S "%0" %1 %2 %3 %4 %5 %6 %7 %8 %9'>.
+
=item B<-a> I<argstring>
-Arguments to invoke perl with in generated batch file. Defaults to
-S<"-x -S %0 %*"> on WindowsNT, S<"-x -S %0 %1 %2 %3 %4 %5 %6 %7 %8 %9">
-on other platforms.
+Arguments to invoke perl with in generated batch file. Specifying
+B<-a> prevents the batch file from checking the C<OS> environment
+variable to determine which operating system it is being run from.
=item B<-s> I<stripsuffix>
Strip a suffix string from file name before appending a ".bat"
-suffix. The suffix is not case-sensitive. It can be a regex if it
-begins with `/' (the trailing '/' being optional. Defaults to ".pl".
+suffix. The suffix is not case-sensitive. It can be a regex if
+it begins with `/' (the trailing '/' is optional and a trailing
+C<$> is always assumed). Defaults to C</.plx?/>.
+
+=item B<-w>
+
+If no line matching C</^#!.*perl/> is found in the script, then such
+a line is inserted just after the new preamble. The exact line
+depends on C<$Config{startperl}> [see L<Config>]. With the B<-w>
+option, C<" -w"> is added after the value of C<$Config{startperl}>.
+If a line matching C</^#!.*perl/> already exists in the script,
+then it is not changed and the B<-w> option is ignored.
+
+=item B<-u>
+
+If the script appears to have already been processed by B<pl2bat>,
+then the script is skipped and not processed unless B<-u> was
+specified. If B<-u> is specified, the existing preamble is replaced.
=item B<-h>
@@ -135,6 +219,13 @@ Show command line usage.
print scalar reverse "rekcah lrep rehtona tsuj\n";
^Z
[..another.bat is now a certified japh application..]
+
+ C:\> ren *.bat *.pl
+ C:\> pl2bat -u *.pl
+ [..updates the wrapping of some previously wrapped scripts..]
+
+ C:\> pl2bat -u -s .bat *.bat
+ [..same as previous example except more dangerous..]
=head1 BUGS
@@ -142,8 +233,8 @@ C<$0> will contain the full name, including the ".bat" suffix
when the generated batch file runs. If you don't like this,
see runperl.bat for an alternative way to invoke perl scripts.
-Default behavior is to invoke Perl with the -S flag, so Perl will
-search the PATH to find the script. This may have undesirable
+Default behavior is to invoke Perl with the B<-S> flag, so Perl will
+search the PATH to find the script. This may have undesirable
effects.
=head1 SEE ALSO
diff --git a/gnu/usr.bin/perl/win32/bin/search.pl b/gnu/usr.bin/perl/win32/bin/search.pl
index b63f7353aff..ad74001be5f 100644
--- a/gnu/usr.bin/perl/win32/bin/search.pl
+++ b/gnu/usr.bin/perl/win32/bin/search.pl
@@ -71,6 +71,7 @@ sub init
{
## initialize variables that might be reset by command-line args
$DOREP=0; ## set true by -dorep (redo multi-hardlink files)
+ $DOREP=1 if $^O eq 'MSWin32';
$DO_SORT=0; ## set by -sort (sort files in a dir before checking)
$FIND_ONLY=0; ## set by -find (don't search files)
$LIST_ONLY=0; ## set true by -l (list filenames only)
@@ -867,7 +868,7 @@ sub dodir
}
## skip things that are empty
- unless (-s _) {
+ unless (-s _ || -d _) {
warn qq/skip (empty): $file\n/ if $WHY;
next;
}
@@ -894,7 +895,7 @@ sub dodir
}
## _never_ redo a directory
- if (defined $dir_done{$id}) {
+ if (defined $dir_done{$id} and $^O ne 'MSWin32') {
warn qq/skip (did as "$dir_done{$id}"): $file\n/ if $WHY;
next;
}
diff --git a/gnu/usr.bin/perl/win32/config.bc b/gnu/usr.bin/perl/win32/config.bc
index ad76309e5d9..eef2440d482 100644
--- a/gnu/usr.bin/perl/win32/config.bc
+++ b/gnu/usr.bin/perl/win32/config.bc
@@ -1,32 +1,5 @@
-#
-## This file was hand coded and a lot of information is invalid
-#
## Configured by: ~cf_email~
## Target system: WIN32
-#
-
-archlibexp='~INST_TOP~\lib'
-archname='MSWin32'
-cc='bcc32'
-ccflags='-DWIN32'
-cppflags='-DWIN32'
-dlsrc='dl_win32.xs'
-dynamic_ext='Fcntl IO Opcode SDBM_File Socket'
-extensions='Fcntl IO Opcode SDBM_File Socket'
-installarchlib='~INST_TOP~\lib'
-installprivlib='~INST_TOP~\lib'
-libpth=''
-libs=''
-osname='MSWin32'
-osvers='4.0'
-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'
-so='dll'
-startsh='#!/bin/sh'
-static_ext=' '
Author=''
CONFIG='true'
Date='$Date'
@@ -36,34 +9,42 @@ Locker=''
Log='$Log'
Mcc='Mcc'
PATCHLEVEL='~PATCHLEVEL~'
-POSIX_cflags='ccflags="$ccflags -DSTRUCT_TM_HASZONE"'
RCSfile='$RCSfile'
Revision='$Revision'
SUBVERSION='~SUBVERSION~'
Source=''
State=''
+_a='.lib'
+_exe='.exe'
+_o='.obj'
afs='false'
alignbytes='8'
+ansi2knr=''
aphostname=''
+apiversion='5.005'
ar='tlib /P128'
-archlib='~INST_TOP~\lib'
+archlib='~INST_TOP~~INST_VER~\lib\~archname~'
+archlibexp='~INST_TOP~~INST_VER~\lib\~archname~'
+archname='MSWin32'
archobjs=''
awk='awk'
baserev='5.0'
bash=''
-bin='~INST_TOP~\bin'
-binexp='~INST_TOP~\bin'
+bin='~INST_TOP~~INST_VER~\bin\~archname~'
+binexp='~INST_TOP~~INST_VER~\bin\~archname~'
bison=''
byacc='byacc'
byteorder='1234'
c=''
castflags='0'
cat='type'
-cccdlflags=''
-ccdlflags=' '
-cf_by='garyng'
-cf_email='71564.1743@compuserve.com'
-cf_time='Thu Apr 11 06:20:49 PDT 1996'
+cc='bcc32'
+cccdlflags=' '
+ccdlflags='-tWD'
+ccflags='-DWIN32'
+cf_by='nobody'
+cf_email='nobody@no.where.net'
+cf_time=''
chgrp=''
chmod=''
chown=''
@@ -73,12 +54,13 @@ compress=''
contains='grep'
cp='copy'
cpio=''
-cpp='cpp32'
+cpp='cpp32 -oCON'
cpp_stuff='42'
+cppflags='-DWIN32'
cpplast=''
cppminus=''
-cpprun=''
-cppstdin=''
+cpprun='cpp32 -oCON'
+cppstdin='cpp32 -oCON'
cryptlib=''
csh='undef'
d_Gconvert='gcvt((x),(n),(b))'
@@ -88,10 +70,8 @@ d_archlib='define'
d_attribut='undef'
d_bcmp='undef'
d_bcopy='undef'
-d_bincompat3='undef'
d_bsd='define'
d_bsdgetpgrp='undef'
-d_bsdpgrp='undef'
d_bsdsetpgrp='undef'
d_bzero='undef'
d_casti32='define'
@@ -113,6 +93,12 @@ d_dlopen='define'
d_dlsymun='undef'
d_dosuid='undef'
d_dup2='define'
+d_endgrent='undef'
+d_endhent='undef'
+d_endnent='undef'
+d_endpent='undef'
+d_endpwent='undef'
+d_endsent='undef'
d_eofnblk='define'
d_eunice='undef'
d_fchmod='undef'
@@ -127,25 +113,47 @@ d_flock='define'
d_fork='undef'
d_fpathconf='undef'
d_fsetpos='define'
+d_ftime='define'
+d_getgrent='undef'
d_getgrps='undef'
-d_setgrps='undef'
+d_gethbyaddr='define'
+d_gethbyname='define'
d_gethent='undef'
-d_gethname='undef'
-d_getlogin='undef'
+d_gethname='define'
+d_gethostprotos='define'
+d_getlogin='define'
+d_getnbyaddr='undef'
+d_getnbyname='undef'
+d_getnent='undef'
+d_getnetprotos='undef'
+d_getpbyname='define'
+d_getpbynumber='define'
+d_getpent='undef'
+d_getpwent='undef'
+d_getpgid='undef'
d_getpgrp2='undef'
d_getpgrp='undef'
-d_getpgid='undef'
d_getppid='undef'
d_getprior='undef'
+d_getprotoprotos='define'
+d_getsbyname='define'
+d_getsbyport='define'
+d_getsent='undef'
+d_getservprotos='define'
d_gettimeod='undef'
+d_grpasswd='undef'
+d_gnulibc='undef'
d_htonl='define'
d_index='undef'
d_inetaton='undef'
d_isascii='define'
d_killpg='undef'
+d_lchown='undef'
d_link='undef'
d_locconv='define'
d_lockf='undef'
+d_longdbl='define'
+d_longlong='undef'
d_lstat='undef'
d_mblen='define'
d_mbstowcs='define'
@@ -158,13 +166,13 @@ d_mkdir='define'
d_mkfifo='undef'
d_mktime='define'
d_msg='undef'
-d_msgctl='define'
-d_msgget='define'
-d_msgrcv='define'
-d_msgsnd='define'
+d_msgctl='undef'
+d_msgget='undef'
+d_msgrcv='undef'
+d_msgsnd='undef'
d_mymalloc='undef'
d_nice='undef'
-d_oldarchlib='undef'
+d_oldpthreads='undef'
d_oldsock='undef'
d_open3='undef'
d_pathconf='undef'
@@ -173,12 +181,16 @@ d_phostname='undef'
d_pipe='define'
d_poll='undef'
d_portable='define'
+d_pthread_yield='undef'
+d_pthreads_created_joinable='undef'
d_pwage='undef'
d_pwchange='undef'
d_pwclass='undef'
d_pwcomment='undef'
d_pwexpire='undef'
+d_pwgecos='undef'
d_pwquota='undef'
+d_pwpasswd='undef'
d_readdir='define'
d_readlink='undef'
d_rename='define'
@@ -187,16 +199,25 @@ d_rmdir='define'
d_safebcpy='undef'
d_safemcpy='undef'
d_sanemcmp='define'
+d_sched_yield='undef'
d_seekdir='define'
d_select='define'
d_sem='undef'
-d_semctl='define'
-d_semget='define'
-d_semop='define'
+d_semctl='undef'
+d_semctl_semid_ds='undef'
+d_semctl_semun='undef'
+d_semget='undef'
+d_semop='undef'
d_setegid='undef'
d_seteuid='undef'
+d_setgrent='undef'
+d_setgrps='undef'
+d_sethent='undef'
+d_setpwent='undef'
d_setlinebuf='undef'
d_setlocale='define'
+d_setnent='undef'
+d_setpent='undef'
d_setpgid='undef'
d_setpgrp2='undef'
d_setpgrp='undef'
@@ -207,20 +228,18 @@ d_setresuid='undef'
d_setreuid='undef'
d_setrgid='undef'
d_setruid='undef'
+d_setsent='undef'
d_setsid='undef'
+d_setvbuf='define'
d_sfio='undef'
d_shm='undef'
d_shmat='undef'
d_shmatprototype='undef'
-d_shmctl='define'
-d_shmdt='define'
-d_shmget='define'
-d_shrplib='undef'
+d_shmctl='undef'
+d_shmdt='undef'
+d_shmget='undef'
d_sigaction='undef'
-d_sigintrp=''
d_sigsetjmp='undef'
-d_sigvec='define'
-d_sigvectr='undef'
d_socket='define'
d_sockpair='undef'
d_statblks='undef'
@@ -253,6 +272,7 @@ d_truncate='undef'
d_tzname='define'
d_umask='define'
d_uname='undef'
+d_union_semun='define'
d_vfork='undef'
d_void_closedir='undef'
d_voidsig='define'
@@ -260,7 +280,7 @@ d_voidtty=''
d_volatile='define'
d_vprintf='define'
d_wait4='undef'
-d_waitpid='undef'
+d_waitpid='define'
d_wcstombs='define'
d_wctomb='define'
d_xenix='undef'
@@ -270,13 +290,18 @@ db_prefixtype='int'
defvoidused='15'
direntrytype='struct direct'
dlext='dll'
+dlsrc='dl_win32.xs'
+doublesize='8'
+dynamic_ext='Socket IO Fcntl Opcode SDBM_File attrs Thread'
eagain='EAGAIN'
+ebcdic='undef'
echo='echo'
egrep='egrep'
emacs=''
eunicefix=':'
exe_ext='.exe'
expr='expr'
+extensions='~static_ext~ ~dynamic_ext~ ~nonxs_ext~'
find='find'
firstmakefile='makefile'
flex=''
@@ -284,18 +309,19 @@ fpostype='fpos_t'
freetype='void'
full_csh=''
full_sed=''
-gcc=''
gccversion=''
gidtype='gid_t'
glibpth='/usr/shlib /lib/pa1.1 /usr/lib/large /lib /usr/lib /usr/lib/386 /lib/386 /lib/large /usr/lib/small /lib/small /usr/ccs/lib /usr/ucblib /usr/shlib '
grep='grep'
groupcat=''
groupstype='gid_t'
+gzip='gzip'
h_fcntl='false'
h_sysfile='true'
hint='recommended'
hostcat='ypcat hosts'
huge=''
+i_arpainet='define'
i_bsdioctl=''
i_db='undef'
i_dbm='undef'
@@ -304,14 +330,15 @@ i_dld='undef'
i_dlfcn='define'
i_fcntl='define'
i_float='define'
-i_gdbm='define'
-i_grp='define'
+i_gdbm='undef'
+i_grp='undef'
i_limits='define'
i_locale='define'
i_malloc='define'
i_math='define'
i_memory='undef'
i_ndbm='undef'
+i_netdb='undef'
i_neterrno='undef'
i_niin='undef'
i_pwd='undef'
@@ -350,22 +377,29 @@ i_varhdr='varargs.h'
i_vfork='undef'
incpath=''
inews=''
-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'
+installarchlib='~INST_TOP~~INST_VER~\lib\~archname~'
+installbin='~INST_TOP~~INST_VER~\bin\~archname~'
+installman1dir='~INST_TOP~~INST_VER~\man\man1'
+installman3dir='~INST_TOP~~INST_VER~\man\man3'
+installhtmldir='~INST_TOP~~INST_VER~\html'
+installhtmlhelpdir='~INST_TOP~~INST_VER~\htmlhelp'
+installprivlib='~INST_TOP~~INST_VER~\lib'
+installscript='~INST_TOP~~INST_VER~\bin'
+installsitearch='~INST_TOP~\site~INST_VER~\lib\~archname~'
+installsitelib='~INST_TOP~\site~INST_VER~\lib'
intsize='4'
-known_extensions='DB_File Fcntl GDBM_File NDBM_File ODBM_File Opcode POSIX SDBM_File Socket'
+known_extensions='DB_File Fcntl GDBM_File NDBM_File ODBM_File Opcode POSIX SDBM_File Socket IO attrs Thread'
ksh=''
large=''
ld='tlink32'
-lddlflags='-Tpd'
-ldflags=''
+lddlflags='-Tpd ~LINK_FLAGS~'
+ldflags='~LINK_FLAGS~'
less='less'
lib_ext='.lib'
libc='cw32mti.lib'
+libperl='perl.lib'
+libpth=''
+libs=''
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=''
@@ -374,6 +408,8 @@ ln=''
lns='copy'
locincpth='/usr/local/include /opt/local/include /usr/gnu/include /opt/gnu/include /usr/GNU/include /opt/GNU/include'
loclibpth='/usr/local/lib /opt/local/lib /usr/gnu/lib /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib'
+longdblsize='10'
+longlongsize='8'
longsize='4'
lp=''
lpr=''
@@ -382,14 +418,15 @@ lseektype='off_t'
mail=''
mailx=''
make='dmake'
+make_set_make='#'
mallocobj='malloc.o'
mallocsrc='malloc.c'
malloctype='void *'
-man1dir='~INST_TOP~\man\man1'
-man1direxp='~INST_TOP~\man\man1'
+man1dir='~INST_TOP~~INST_VER~\man\man1'
+man1direxp='~INST_TOP~~INST_VER~\man\man1'
man1ext='1'
-man3dir='~INST_TOP~\man\man3'
-man3direxp='~INST_TOP~\man\man3'
+man3dir='~INST_TOP~~INST_VER~\man\man3'
+man3direxp='~INST_TOP~~INST_VER~\man\man3'
man3ext='3'
medium=''
mips=''
@@ -404,81 +441,104 @@ mydomain=''
myhostname=''
myuname=''
n='-n'
+netdb_hlen_type='int'
+netdb_host_type='char *'
+netdb_name_type='char *'
+netdb_net_type='long'
+nm=''
nm_opt=''
nm_so_opt=''
+nonxs_ext='Errno'
nroff=''
o_nonblock='O_NONBLOCK'
obj_ext='.obj'
-oldarchlib=''
-oldarchlibexp=''
-optimize='-O'
+optimize='-O2'
orderlib='false'
+osname='MSWin32'
+osvers='4.0'
package='perl5'
pager='more /e'
passcat=''
-patchlevel='2'
+patchlevel='~PATCHLEVEL~'
path_sep=';'
perl='perl'
perladmin=''
-perlpath='~INST_TOP~\bin\perl.exe'
+perlpath='~INST_TOP~~INST_VER~\bin\~archname~\perl.exe'
pg=''
phostname='hostname'
+pidtype='int'
plibpth=''
pmake=''
pr=''
+prefix='~INST_TOP~'
prefixexp='~INST_DRV~'
-privlib='~INST_TOP~\lib'
+privlib='~INST_TOP~~INST_VER~\lib'
+privlibexp='~INST_TOP~~INST_VER~\lib'
prototype='define'
+ptrsize='4'
randbits='15'
-ranlib=''
+ranlib='rem'
rd_nodata='-1'
rm='del'
rmail=''
runnm='true'
-scriptdir='~INST_TOP~\bin'
-scriptdirexp='~INST_TOP~\bin'
+scriptdir='~INST_TOP~~INST_VER~\bin'
+scriptdirexp='~INST_TOP~~INST_VER~\bin'
sed='sed'
-selecttype='int *'
+selecttype='Perl_fd_set *'
sendmail='blat'
sh='cmd /x /c'
shar=''
+sharpbang='#!'
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'
+shrpenv=''
+shsharp='true'
+sig_name='ZERO NUM01 INT QUIT ILL NUM05 NUM06 NUM07 FPE KILL NUM10 SEGV NUM12 PIPE ALRM TERM USR1 USR2 CHLD NUM19 USR3 BREAK ABRT STOP NUM24 CONT CLD'
+sig_name_init='"ZERO", "NUM01", "INT", "QUIT", "ILL", "NUM05", "NUM06", "NUM07", "FPE", "KILL", "NUM10", "SEGV", "NUM12", "PIPE", "ALRM", "TERM", "USR1", "USR2", "CHLD", "NUM19", "USR3", "BREAK", "ABRT", "STOP", "NUM24", "CONT", "CLD", 0'
+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 18 0'
+sig_num_init='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, 18, 0'
signal_t='void'
-sitearch='~INST_TOP~\lib\site'
-sitearchexp='~INST_TOP~\lib\site'
-sitelib='~INST_TOP~\lib\site'
-sitelibexp='~INST_TOP~\lib\site'
+sitearch='~INST_TOP~\site~INST_VER~\lib\~archname~'
+sitearchexp='~INST_TOP~\site~INST_VER~\lib\~archname~'
+sitelib='~INST_TOP~\site~INST_VER~\lib'
+sitelibexp='~INST_TOP~\site~INST_VER~\lib'
sizetype='size_t'
sleep=''
smail=''
small=''
+so='dll'
sockethdr=''
socketlib=''
sort='sort'
spackage='Perl5'
spitshell=''
split=''
+src=''
ssizetype='int'
-startperl='#perl'
+startperl='#!perl'
+startsh='#!/bin/sh'
+static_ext='DynaLoader'
stdchar='unsigned char'
stdio_base='((fp)->buffer)'
stdio_bufsiz='((fp)->level + (fp)->curp - (fp)->buffer)'
stdio_cnt='((fp)->level)'
+stdio_filbuf=''
stdio_ptr='((fp)->curp)'
strings='/usr/include/string.h'
submit=''
+subversion='~SUBVERSION~'
sysman='/usr/man/man1'
tail=''
tar=''
tbl=''
+tee=''
test=''
timeincl='/usr/include/sys/time.h '
timetype='time_t'
touch='touch'
tr=''
+trnl='\012'
troff=''
uidtype='uid_t'
uname='uname'
@@ -486,13 +546,18 @@ uniq='uniq'
usedl='define'
usemymalloc='n'
usenm='false'
+useopcode='true'
useperlio='undef'
useposix='true'
-usesafe='true'
+usesfio='false'
+useshrplib='yes'
+usethreads='undef'
usevfork='false'
usrinc='/usr/include'
uuname=''
+version='~VERSION~'
vi=''
voidflags='15'
xlibpth='/usr/lib/386 /lib/386'
zcat=''
+zip='zip'
diff --git a/gnu/usr.bin/perl/win32/config.vc b/gnu/usr.bin/perl/win32/config.vc
index 7cc91dabd3b..df6e0e02a22 100644
--- a/gnu/usr.bin/perl/win32/config.vc
+++ b/gnu/usr.bin/perl/win32/config.vc
@@ -1,32 +1,5 @@
-#
-## This file was hand coded and a lot of information is invalid
-#
## Configured by: ~cf_email~
## Target system: WIN32
-#
-
-archlibexp='~INST_TOP~\lib'
-archname='MSWin32'
-cc='cl'
-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='~INST_TOP~\lib'
-installprivlib='~INST_TOP~\lib'
-libpth=''
-libs=''
-osname='MSWin32'
-osvers='4.0'
-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'
-so='dll'
-startsh='#!/bin/sh'
-static_ext=' '
Author=''
CONFIG='true'
Date='$Date'
@@ -36,34 +9,42 @@ Locker=''
Log='$Log'
Mcc='Mcc'
PATCHLEVEL='~PATCHLEVEL~'
-POSIX_cflags='ccflags="$ccflags -DSTRUCT_TM_HASZONE"'
RCSfile='$RCSfile'
Revision='$Revision'
SUBVERSION='~SUBVERSION~'
Source=''
State=''
+_a='.lib'
+_exe='.exe'
+_o='.obj'
afs='false'
alignbytes='8'
+ansi2knr=''
aphostname=''
+apiversion='5.005'
ar='lib'
-archlib='~INST_TOP~\lib'
+archlib='~INST_TOP~~INST_VER~\lib\~archname~'
+archlibexp='~INST_TOP~~INST_VER~\lib\~archname~'
+archname='MSWin32'
archobjs=''
awk='awk'
baserev='5.0'
bash=''
-bin='~INST_TOP~\bin'
-binexp='~INST_TOP~\bin'
+bin='~INST_TOP~~INST_VER~\bin\~archname~'
+binexp='~INST_TOP~~INST_VER~\bin\~archname~'
bison=''
byacc='byacc'
byteorder='1234'
c=''
castflags='0'
cat='type'
-cccdlflags=''
+cc='cl'
+cccdlflags=' '
ccdlflags=' '
-cf_by='garyng'
-cf_email='71564.1743@compuserve.com'
-cf_time='Thu Apr 11 06:20:49 PDT 1996'
+ccflags='-MD -DWIN32'
+cf_by='nobody'
+cf_email='nobody@no.where.net'
+cf_time=''
chgrp=''
chmod=''
chown=''
@@ -73,12 +54,13 @@ compress=''
contains='grep'
cp='copy'
cpio=''
-cpp='cpp'
+cpp='cl -nologo -E'
cpp_stuff='42'
+cppflags='-DWIN32'
cpplast=''
cppminus=''
-cpprun='cl -E'
-cppstdin='cl -E'
+cpprun='cl -nologo -E'
+cppstdin='cl -nologo -E'
cryptlib=''
csh='undef'
d_Gconvert='sprintf((b),"%.*g",(n),(x))'
@@ -88,10 +70,8 @@ d_archlib='define'
d_attribut='undef'
d_bcmp='undef'
d_bcopy='undef'
-d_bincompat3='undef'
d_bsd='define'
d_bsdgetpgrp='undef'
-d_bsdpgrp='undef'
d_bsdsetpgrp='undef'
d_bzero='undef'
d_casti32='define'
@@ -113,6 +93,12 @@ d_dlopen='define'
d_dlsymun='undef'
d_dosuid='undef'
d_dup2='define'
+d_endgrent='undef'
+d_endhent='undef'
+d_endnent='undef'
+d_endpent='undef'
+d_endpwent='undef'
+d_endsent='undef'
d_eofnblk='define'
d_eunice='undef'
d_fchmod='undef'
@@ -127,25 +113,47 @@ d_flock='define'
d_fork='undef'
d_fpathconf='undef'
d_fsetpos='define'
+d_ftime='define'
+d_getgrent='undef'
d_getgrps='undef'
-d_setgrps='undef'
+d_gethbyaddr='define'
+d_gethbyname='define'
d_gethent='undef'
-d_gethname='undef'
-d_getlogin='undef'
+d_gethname='define'
+d_gethostprotos='define'
+d_getlogin='define'
+d_getnbyaddr='undef'
+d_getnbyname='undef'
+d_getnent='undef'
+d_getnetprotos='undef'
+d_getpbyname='define'
+d_getpbynumber='define'
+d_getpent='undef'
+d_getpwent='undef'
+d_getpgid='undef'
d_getpgrp2='undef'
d_getpgrp='undef'
-d_getpgid='undef'
d_getppid='undef'
d_getprior='undef'
+d_getprotoprotos='define'
+d_getsbyname='define'
+d_getsbyport='define'
+d_getsent='undef'
+d_getservprotos='define'
d_gettimeod='undef'
+d_grpasswd='undef'
+d_gnulibc='undef'
d_htonl='define'
d_index='undef'
d_inetaton='undef'
d_isascii='define'
d_killpg='undef'
+d_lchown='undef'
d_link='undef'
d_locconv='define'
d_lockf='undef'
+d_longdbl='define'
+d_longlong='undef'
d_lstat='undef'
d_mblen='define'
d_mbstowcs='define'
@@ -158,13 +166,13 @@ d_mkdir='define'
d_mkfifo='undef'
d_mktime='define'
d_msg='undef'
-d_msgctl='define'
-d_msgget='define'
-d_msgrcv='define'
-d_msgsnd='define'
+d_msgctl='undef'
+d_msgget='undef'
+d_msgrcv='undef'
+d_msgsnd='undef'
d_mymalloc='undef'
d_nice='undef'
-d_oldarchlib='undef'
+d_oldpthreads='undef'
d_oldsock='undef'
d_open3='undef'
d_pathconf='undef'
@@ -173,12 +181,16 @@ d_phostname='undef'
d_pipe='define'
d_poll='undef'
d_portable='define'
+d_pthread_yield='undef'
+d_pthreads_created_joinable='undef'
d_pwage='undef'
d_pwchange='undef'
d_pwclass='undef'
d_pwcomment='undef'
d_pwexpire='undef'
+d_pwgecos='undef'
d_pwquota='undef'
+d_pwpasswd='undef'
d_readdir='define'
d_readlink='undef'
d_rename='define'
@@ -187,16 +199,25 @@ d_rmdir='define'
d_safebcpy='undef'
d_safemcpy='undef'
d_sanemcmp='define'
+d_sched_yield='undef'
d_seekdir='define'
d_select='define'
d_sem='undef'
-d_semctl='define'
-d_semget='define'
-d_semop='define'
+d_semctl='undef'
+d_semctl_semid_ds='undef'
+d_semctl_semun='undef'
+d_semget='undef'
+d_semop='undef'
d_setegid='undef'
d_seteuid='undef'
+d_setgrent='undef'
+d_setgrps='undef'
+d_sethent='undef'
+d_setpwent='undef'
d_setlinebuf='undef'
d_setlocale='define'
+d_setnent='undef'
+d_setpent='undef'
d_setpgid='undef'
d_setpgrp2='undef'
d_setpgrp='undef'
@@ -207,20 +228,18 @@ d_setresuid='undef'
d_setreuid='undef'
d_setrgid='undef'
d_setruid='undef'
+d_setsent='undef'
d_setsid='undef'
+d_setvbuf='define'
d_sfio='undef'
d_shm='undef'
d_shmat='undef'
d_shmatprototype='undef'
-d_shmctl='define'
-d_shmdt='define'
-d_shmget='define'
-d_shrplib='undef'
+d_shmctl='undef'
+d_shmdt='undef'
+d_shmget='undef'
d_sigaction='undef'
-d_sigintrp=''
d_sigsetjmp='undef'
-d_sigvec='define'
-d_sigvectr='undef'
d_socket='define'
d_sockpair='undef'
d_statblks='undef'
@@ -253,6 +272,7 @@ d_truncate='undef'
d_tzname='define'
d_umask='define'
d_uname='undef'
+d_union_semun='define'
d_vfork='undef'
d_void_closedir='undef'
d_voidsig='define'
@@ -260,7 +280,7 @@ d_voidtty=''
d_volatile='define'
d_vprintf='define'
d_wait4='undef'
-d_waitpid='undef'
+d_waitpid='define'
d_wcstombs='define'
d_wctomb='define'
d_xenix='undef'
@@ -270,13 +290,18 @@ db_prefixtype='int'
defvoidused='15'
direntrytype='struct direct'
dlext='dll'
+dlsrc='dl_win32.xs'
+doublesize='8'
+dynamic_ext='Socket IO Fcntl Opcode SDBM_File attrs Thread'
eagain='EAGAIN'
+ebcdic='undef'
echo='echo'
egrep='egrep'
emacs=''
eunicefix=':'
exe_ext='.exe'
expr='expr'
+extensions='~static_ext~ ~dynamic_ext~ ~nonxs_ext~'
find='find'
firstmakefile='makefile'
flex=''
@@ -284,18 +309,19 @@ fpostype='fpos_t'
freetype='void'
full_csh=''
full_sed=''
-gcc=''
gccversion=''
gidtype='gid_t'
glibpth='/usr/shlib /lib/pa1.1 /usr/lib/large /lib /usr/lib /usr/lib/386 /lib/386 /lib/large /usr/lib/small /lib/small /usr/ccs/lib /usr/ucblib /usr/shlib '
grep='grep'
groupcat=''
groupstype='gid_t'
+gzip='gzip'
h_fcntl='false'
h_sysfile='true'
hint='recommended'
hostcat='ypcat hosts'
huge=''
+i_arpainet='define'
i_bsdioctl=''
i_db='undef'
i_dbm='undef'
@@ -304,14 +330,15 @@ i_dld='undef'
i_dlfcn='define'
i_fcntl='define'
i_float='define'
-i_gdbm='define'
-i_grp='define'
+i_gdbm='undef'
+i_grp='undef'
i_limits='define'
i_locale='define'
i_malloc='define'
i_math='define'
i_memory='undef'
i_ndbm='undef'
+i_netdb='undef'
i_neterrno='undef'
i_niin='undef'
i_pwd='undef'
@@ -350,22 +377,29 @@ i_varhdr='varargs.h'
i_vfork='undef'
incpath=''
inews=''
-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'
+installarchlib='~INST_TOP~~INST_VER~\lib\~archname~'
+installbin='~INST_TOP~~INST_VER~\bin\~archname~'
+installman1dir='~INST_TOP~~INST_VER~\man\man1'
+installman3dir='~INST_TOP~~INST_VER~\man\man3'
+installhtmldir='~INST_TOP~~INST_VER~\html'
+installhtmlhelpdir='~INST_TOP~~INST_VER~\htmlhelp'
+installprivlib='~INST_TOP~~INST_VER~\lib'
+installscript='~INST_TOP~~INST_VER~\bin'
+installsitearch='~INST_TOP~\site~INST_VER~\lib\~archname~'
+installsitelib='~INST_TOP~\site~INST_VER~\lib'
intsize='4'
-known_extensions='DB_File Fcntl GDBM_File NDBM_File ODBM_File Opcode POSIX SDBM_File Socket'
+known_extensions='DB_File Fcntl GDBM_File NDBM_File ODBM_File Opcode POSIX SDBM_File Socket IO attrs Thread'
ksh=''
large=''
ld='link'
-lddlflags='-dll'
-ldflags='-nologo -subsystem:windows'
+lddlflags='-dll ~LINK_FLAGS~'
+ldflags='~LINK_FLAGS~'
less='less'
lib_ext='.lib'
libc='msvcrt.lib'
+libperl='perl.lib'
+libpth=''
+libs=''
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=''
@@ -374,6 +408,8 @@ ln=''
lns='copy'
locincpth='/usr/local/include /opt/local/include /usr/gnu/include /opt/gnu/include /usr/GNU/include /opt/GNU/include'
loclibpth='/usr/local/lib /opt/local/lib /usr/gnu/lib /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib'
+longdblsize='10'
+longlongsize='8'
longsize='4'
lp=''
lpr=''
@@ -382,14 +418,15 @@ lseektype='off_t'
mail=''
mailx=''
make='nmake'
+make_set_make='#'
mallocobj='malloc.o'
mallocsrc='malloc.c'
malloctype='void *'
-man1dir='~INST_TOP~\man\man1'
-man1direxp='~INST_TOP~\man\man1'
+man1dir='~INST_TOP~~INST_VER~\man\man1'
+man1direxp='~INST_TOP~~INST_VER~\man\man1'
man1ext='1'
-man3dir='~INST_TOP~\man\man3'
-man3direxp='~INST_TOP~\man\man3'
+man3dir='~INST_TOP~~INST_VER~\man\man3'
+man3direxp='~INST_TOP~~INST_VER~\man\man3'
man3ext='3'
medium=''
mips=''
@@ -404,81 +441,104 @@ mydomain=''
myhostname=''
myuname=''
n='-n'
+netdb_hlen_type='int'
+netdb_host_type='char *'
+netdb_name_type='char *'
+netdb_net_type='long'
+nm=''
nm_opt=''
nm_so_opt=''
+nonxs_ext='Errno'
nroff=''
o_nonblock='O_NONBLOCK'
obj_ext='.obj'
-oldarchlib=''
-oldarchlibexp=''
optimize='-O'
orderlib='false'
+osname='MSWin32'
+osvers='4.0'
package='perl5'
pager='more /e'
passcat=''
-patchlevel='2'
+patchlevel='~PATCHLEVEL~'
path_sep=';'
perl='perl'
perladmin=''
-perlpath='~INST_TOP~\bin\perl.exe'
+perlpath='~INST_TOP~~INST_VER~\bin\~archname~\perl.exe'
pg=''
phostname='hostname'
+pidtype='int'
plibpth=''
pmake=''
pr=''
+prefix='~INST_TOP~'
prefixexp='~INST_DRV~'
-privlib='~INST_TOP~\lib'
+privlib='~INST_TOP~~INST_VER~\lib'
+privlibexp='~INST_TOP~~INST_VER~\lib'
prototype='define'
+ptrsize='4'
randbits='15'
-ranlib=''
+ranlib='rem'
rd_nodata='-1'
rm='del'
rmail=''
runnm='true'
-scriptdir='~INST_TOP~\bin'
-scriptdirexp='~INST_TOP~\bin'
+scriptdir='~INST_TOP~~INST_VER~\bin'
+scriptdirexp='~INST_TOP~~INST_VER~\bin'
sed='sed'
-selecttype='int *'
+selecttype='Perl_fd_set *'
sendmail='blat'
sh='cmd /x /c'
shar=''
+sharpbang='#!'
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'
+shrpenv=''
+shsharp='true'
+sig_name='ZERO NUM01 INT QUIT ILL NUM05 NUM06 NUM07 FPE KILL NUM10 SEGV NUM12 PIPE ALRM TERM NUM16 NUM17 NUM18 NUM19 CHLD BREAK ABRT STOP NUM24 CONT CLD'
+sig_name_init='"ZERO", "NUM01", "INT", "QUIT", "ILL", "NUM05", "NUM06", "NUM07", "FPE", "KILL", "NUM10", "SEGV", "NUM12", "PIPE", "ALRM", "TERM", "NUM16", "NUM17", "NUM18", "NUM19", "CHLD", "BREAK", "ABRT", "STOP", "NUM24", "CONT", "CLD", 0'
+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 20 0'
+sig_num_init='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, 20, 0'
signal_t='void'
-sitearch='~INST_TOP~\lib\site'
-sitearchexp='~INST_TOP~\lib\site'
-sitelib='~INST_TOP~\lib\site'
-sitelibexp='~INST_TOP~\lib\site'
+sitearch='~INST_TOP~\site~INST_VER~\lib\~archname~'
+sitearchexp='~INST_TOP~\site~INST_VER~\lib\~archname~'
+sitelib='~INST_TOP~\site~INST_VER~\lib'
+sitelibexp='~INST_TOP~\site~INST_VER~\lib'
sizetype='size_t'
sleep=''
smail=''
small=''
+so='dll'
sockethdr=''
socketlib=''
sort='sort'
spackage='Perl5'
spitshell=''
split=''
+src=''
ssizetype='int'
-startperl='#perl'
-stdchar='unsigned char'
+startperl='#!perl'
+startsh='#!/bin/sh'
+static_ext='DynaLoader'
+stdchar='char'
stdio_base='((fp)->_base)'
stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)'
stdio_cnt='((fp)->_cnt)'
+stdio_filbuf=''
stdio_ptr='((fp)->_ptr)'
strings='/usr/include/string.h'
submit=''
+subversion='~SUBVERSION~'
sysman='/usr/man/man1'
tail=''
tar=''
tbl=''
+tee=''
test=''
timeincl='/usr/include/sys/time.h '
timetype='time_t'
touch='touch'
tr=''
+trnl='\012'
troff=''
uidtype='uid_t'
uname='uname'
@@ -486,13 +546,18 @@ uniq='uniq'
usedl='define'
usemymalloc='n'
usenm='false'
+useopcode='true'
useperlio='undef'
useposix='true'
-usesafe='true'
+usesfio='false'
+useshrplib='yes'
+usethreads='undef'
usevfork='false'
usrinc='/usr/include'
uuname=''
+version='~VERSION~'
vi=''
voidflags='15'
xlibpth='/usr/lib/386 /lib/386'
zcat=''
+zip='zip'
diff --git a/gnu/usr.bin/perl/win32/config_H.bc b/gnu/usr.bin/perl/win32/config_H.bc
index 61fb5a32412..1d895dd188a 100644
--- a/gnu/usr.bin/perl/win32/config_H.bc
+++ b/gnu/usr.bin/perl/win32/config_H.bc
@@ -7,51 +7,24 @@
* that running config_h.SH again will wipe out any changes you've made.
* For a more permanent change edit config.sh and rerun config_h.SH.
*
- * $Id: Config_h.U,v 3.0.1.4 1995/09/25 09:10:49 ram Exp $
+ * $Id: Config_h.U,v 3.0.1.5 1997/02/28 14:57:43 ram Exp $
*/
-/* Configuration time: Thu Apr 11 06:20:49 PDT 1996
- * Configured by: garyng
- * Target system:
+/*
+ * Package name : perl5
+ * Source directory :
+ * Configuration time: undef
+ * Configured by : gsar
+ * Target system :
*/
#ifndef _config_h_
#define _config_h_
-/* MEM_ALIGNBYTES:
- * This symbol contains the number of bytes required to align a
- * double. Usual values are 2, 4 and 8.
- * On NeXT starting with 3.2, you can build "Fat" Multiple Architecture
- * Binaries (MAB) for targets with varying alignment. This only matters
- * for perl, where the config.h can be generated and installed on one
- * system, and used by a different architecture to build an extension.
- * The default is eight, for safety.
- */
-#ifndef NeXT
-#define MEM_ALIGNBYTES 8 /**/
-#else /* NeXT */
-#ifdef __m68k__
-#define MEM_ALIGNBYTES 2
-#else
-#ifdef __i386__
-#define MEM_ALIGNBYTES 4
-#else /* __hppa__, __sparc__ and default for unknown architectures */
-#define MEM_ALIGNBYTES 8
-#endif /* __i386__ */
-#endif /* __m68k__ */
-#endif /* NeXT */
-
-/* ARCHNAME:
- * This symbol holds a string representing the architecture name.
- * It may be used to construct an architecture-dependant pathname
- * where library files may be held under a private library, for
- * instance.
+/* LOC_SED:
+ * This symbol holds the complete pathname to the sed program.
*/
-#ifdef _ALPHA_
-#define ARCHNAME "alpha-mswin32" /**/
-#else
-#define ARCHNAME "x86-mswin32" /**/
-#endif
+#define LOC_SED "" /**/
/* BIN:
* This symbol holds the path of the bin directory where the package will
@@ -61,38 +34,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\\bin" /**/
-#define BIN_EXP "c:\\perl\\bin" /**/
-
-/* CAT2:
- * This macro catenates 2 tokens together.
- */
-/* STRINGIFY:
- * This macro surrounds its token with double quotes.
- */
-#if 42 == 1
-#define CAT2(a,b)a/**/b
-#define CAT3(a,b,c)a/**/b/**/c
-#define CAT4(a,b,c,d)a/**/b/**/c/**/d
-#define CAT5(a,b,c,d,e)a/**/b/**/c/**/d/**/e
-#define STRINGIFY(a)"a"
- /* If you can get stringification with catify, tell me how! */
-#endif
-#if 42 == 42
-#define CAT2(a,b)a ## b
-#define CAT3(a,b,c)a ## b ## c
-#define CAT4(a,b,c,d)a ## b ## c ## d
-#define CAT5(a,b,c,d,e)a ## b ## c ## d ## e
-#define StGiFy(a)# a
-#define STRINGIFY(a)StGiFy(a)
-#define SCAT2(a,b)StGiFy(a) StGiFy(b)
-#define SCAT3(a,b,c)StGiFy(a) StGiFy(b) StGiFy(c)
-#define SCAT4(a,b,c,d)StGiFy(a) StGiFy(b) StGiFy(c) StGiFy(d)
-#define SCAT5(a,b,c,d,e)StGiFy(a) StGiFy(b) StGiFy(c) StGiFy(d) StGiFy(e)
-#endif
-#ifndef CAT2
-#include "Bletch: How does this C preprocessor catenate tokens?"
-#endif
+#define BIN "c:\\perl\\5.00503\\bin\\MSWin32-x86" /**/
+#define BIN_EXP "c:\\perl\\5.00503\\bin\\MSWin32-x86" /**/
/* CPPSTDIN:
* This symbol contains the first part of the string which will invoke
@@ -106,7 +49,7 @@
* output. This symbol will have the value "-" if CPPSTDIN needs a minus
* to specify standard input, otherwise the value is "".
*/
-#define CPPSTDIN ""
+#define CPPSTDIN "cpp32 -oCON"
#define CPPMINUS ""
/* HAS_ALARM:
@@ -142,27 +85,6 @@
*/
/*#define HAS_BZERO /**/
-/* CASTI32:
- * This symbol is defined if the C compiler can cast negative
- * or large floating point numbers to 32-bit ints.
- */
-#define CASTI32 /**/
-
-/* CASTNEGFLOAT:
- * This symbol is defined if the C compiler can cast negative
- * numbers to unsigned longs, ints and shorts.
- */
-/* CASTFLAGS:
- * This symbol contains flags that say what difficulties the compiler
- * has casting odd floating values to unsigned long:
- * 0 = ok
- * 1 = couldn't cast < 0
- * 2 = couldn't cast >= 0x80000000
- * 4 = couldn't cast in argument expression list
- */
-#define CASTNEGFLOAT /**/
-#define CASTFLAGS 0 /**/
-
/* HAS_CHOWN:
* This symbol, if defined, indicates that the chown routine is
* available.
@@ -181,12 +103,6 @@
*/
#define HAS_CHSIZE /**/
-/* VOID_CLOSEDIR:
- * This symbol, if defined, indicates that the closedir() routine
- * does not return a value.
- */
-/*#define VOID_CLOSEDIR /**/
-
/* HASCONST:
* This symbol, if defined, indicates that this C compiler knows about
* the const type. There is no need to actually test for that symbol
@@ -231,6 +147,26 @@
*/
#define HAS_DLERROR /**/
+/* SETUID_SCRIPTS_ARE_SECURE_NOW:
+ * This symbol, if defined, indicates that the bug that prevents
+ * setuid scripts from being secure is not present in this kernel.
+ */
+/* DOSUID:
+ * This symbol, if defined, indicates that the C program should
+ * check the script that it is executing for setuid/setgid bits, and
+ * attempt to emulate setuid/setgid on systems that have disabled
+ * setuid #! scripts because the kernel can't do it securely.
+ * It is up to the package designer to make sure that this emulation
+ * is done securely. Among other things, it should do an fstat on
+ * the script it just opened to make sure it really is a setuid/setgid
+ * script, it should make sure the arguments passed correspond exactly
+ * to the argument on the #! line, and it should not trust any
+ * subprocesses to which it must pass the filename rather than the
+ * file descriptor of the script to be executed.
+ */
+/*#define SETUID_SCRIPTS_ARE_SECURE_NOW /**/
+/*#define DOSUID /**/
+
/* HAS_DUP2:
* This symbol, if defined, indicates that the dup2 routine is
* available to duplicate file descriptors.
@@ -301,19 +237,7 @@
* available to get the list of process groups. If unavailable, multiple
* groups are probably not supported.
*/
-/* HAS_SETGROUPS:
- * This symbol, if defined, indicates that the setgroups() routine is
- * available to set the list of process groups. If unavailable, multiple
- * groups are probably not supported.
- */
/*#define HAS_GETGROUPS /**/
-/*#define HAS_SETGROUPS /**/
-
-/* HAS_GETHOSTENT:
- * This symbol, if defined, indicates that the gethostent routine is
- * available to lookup host names in some data base or other.
- */
-/*#define HAS_GETHOSTENT /**/
/* HAS_UNAME:
* This symbol, if defined, indicates that the C program may use the
@@ -326,7 +250,25 @@
* This symbol, if defined, indicates that the getlogin routine is
* available to get the login name.
*/
-/*#define HAS_GETLOGIN /**/
+#define HAS_GETLOGIN /**/
+
+/* HAS_GETPGID:
+ * This symbol, if defined, indicates to the C program that
+ * the getpgid(pid) function is available to get the
+ * process group id.
+ */
+/*#define HAS_GETPGID /**/
+
+/* HAS_GETPGRP:
+ * This symbol, if defined, indicates that the getpgrp routine is
+ * available to get the current process group.
+ */
+/* USE_BSD_GETPGRP:
+ * This symbol, if defined, indicates that getpgrp needs one
+ * arguments whereas USG one needs none.
+ */
+/*#define HAS_GETPGRP /**/
+/*#define USE_BSD_GETPGRP /**/
/* HAS_GETPGRP2:
* This symbol, if defined, indicates that the getpgrp2() (as in DG/UX)
@@ -371,11 +313,12 @@
#define HAS_NTOHL /**/
#define HAS_NTOHS /**/
-/* HAS_ISASCII:
- * This manifest constant lets the C program know that isascii
- * is available.
+/* HAS_INET_ATON:
+ * This symbol, if defined, indicates to the C program that the
+ * inet_aton() function is available to parse IP address "dotted-quad"
+ * strings.
*/
-#define HAS_ISASCII /**/
+/*#define HAS_INET_ATON /**/
/* HAS_KILLPG:
* This symbol, if defined, indicates that the killpg routine is available
@@ -485,12 +428,6 @@
*/
/*#define HAS_NICE /**/
-/* HAS_OPEN3:
- * This manifest constant lets the C program know that the three
- * argument form of open(2) is available.
- */
-/*#define HAS_OPEN3 /**/
-
/* HAS_PATHCONF:
* This symbol, if defined, indicates that pathconf() is available
* to determine file-system related limits and options associated
@@ -518,7 +455,8 @@
/* HAS_POLL:
* This symbol, if defined, indicates that the poll routine is
- * available to poll active file descriptors.
+ * available to poll active file descriptors. You may safely
+ * include <poll.h> when this symbol is defined.
*/
/*#define HAS_POLL /**/
@@ -567,29 +505,6 @@
*/
#define HAS_RMDIR /**/
-/* HAS_SAFE_BCOPY:
- * This symbol, if defined, indicates that the bcopy routine is available
- * to copy potentially overlapping memory blocks. Otherwise you should
- * probably use memmove() or memcpy(). If neither is defined, roll your
- * own version.
- */
-/*#define HAS_SAFE_BCOPY /**/
-
-/* HAS_SAFE_MEMCPY:
- * This symbol, if defined, indicates that the memcpy routine is available
- * to copy potentially overlapping memory blocks. Otherwise you should
- * probably use memmove() or memcpy(). If neither is defined, roll your
- * own version.
- */
-/*#define HAS_SAFE_MEMCPY /**/
-
-/* HAS_SANE_MEMCMP:
- * This symbol, if defined, indicates that the memcmp routine is available
- * and can be used to compare relative magnitudes of chars with their high
- * bits set. If it is not defined, roll your own version.
- */
-#define HAS_SANE_MEMCMP /**/
-
/* HAS_SELECT:
* This symbol, if defined, indicates that the select routine is
* available to select active file descriptors. If the timeout field
@@ -628,6 +543,24 @@
*/
#define HAS_SETLOCALE /**/
+/* HAS_SETPGID:
+ * This symbol, if defined, indicates that the setpgid(pid, gpid)
+ * routine is available to set process group ID.
+ */
+/*#define HAS_SETPGID /**/
+
+/* HAS_SETPGRP:
+ * This symbol, if defined, indicates that the setpgrp routine is
+ * available to set the current process group.
+ */
+/* USE_BSD_SETPGRP:
+ * This symbol, if defined, indicates that setpgrp needs two
+ * arguments whereas USG one needs none. See also HAS_SETPGID
+ * for a POSIX interface.
+ */
+/*#define HAS_SETPGRP /**/
+/*#define USE_BSD_SETPGRP /**/
+
/* HAS_SETPGRP2:
* This symbol, if defined, indicates that the setpgrp2() (as in DG/UX)
* routine is available to set the current process group.
@@ -704,88 +637,12 @@
#define Shmat_t void * /**/
/*#define HAS_SHMAT_PROTOTYPE /**/
-/* HAS_SIGACTION:
- * This symbol, if defined, indicates that Vr4's sigaction() routine
- * is available.
- */
-/*#define HAS_SIGACTION /**/
-
-/* HAS_SOCKET:
- * This symbol, if defined, indicates that the BSD socket interface is
- * supported.
- */
-/* HAS_SOCKETPAIR:
- * This symbol, if defined, indicates that the BSD socketpair() call is
- * supported.
- */
-#define HAS_SOCKET /**/
-/*#define HAS_SOCKETPAIR /**/
-
/* USE_STAT_BLOCKS:
* This symbol is defined if this system has a stat structure declaring
* st_blksize and st_blocks.
*/
/*#define USE_STAT_BLOCKS /**/
-/* USE_STDIO_PTR:
- * This symbol is defined if the _ptr and _cnt fields (or similar)
- * of the stdio FILE structure can be used to access the stdio buffer
- * for a file handle. If this is defined, then the FILE_ptr(fp)
- * and FILE_cnt(fp) macros will also be defined and should be used
- * to access these fields.
- */
-/* FILE_ptr:
- * This macro is used to access the _ptr field (or equivalent) of the
- * FILE structure pointed to by its argument. This macro will always be
- * defined if USE_STDIO_PTR is defined.
- */
-/* STDIO_PTR_LVALUE:
- * This symbol is defined if the FILE_ptr macro can be used as an
- * lvalue.
- */
-/* FILE_cnt:
- * This macro is used to access the _cnt field (or equivalent) of the
- * FILE structure pointed to by its argument. This macro will always be
- * defined if USE_STDIO_PTR is defined.
- */
-/* STDIO_CNT_LVALUE:
- * This symbol is defined if the FILE_cnt macro can be used as an
- * lvalue.
- */
-#define USE_STDIO_PTR /**/
-#ifdef USE_STDIO_PTR
-#define FILE_ptr(fp) ((fp)->curp)
-#define STDIO_PTR_LVALUE /**/
-#define FILE_cnt(fp) ((fp)->level)
-#define STDIO_CNT_LVALUE /**/
-#endif
-
-/* USE_STDIO_BASE:
- * This symbol is defined if the _base field (or similar) of the
- * stdio FILE structure can be used to access the stdio buffer for
- * a file handle. If this is defined, then the FILE_base(fp) macro
- * will also be defined and should be used to access this field.
- * Also, the FILE_bufsiz(fp) macro will be defined and should be used
- * to determine the number of bytes in the buffer. USE_STDIO_BASE
- * will never be defined unless USE_STDIO_PTR is.
- */
-/* FILE_base:
- * This macro is used to access the _base field (or equivalent) of the
- * FILE structure pointed to by its argument. This macro will always be
- * defined if USE_STDIO_BASE is defined.
- */
-/* FILE_bufsiz:
- * This macro is used to determine the number of bytes in the I/O
- * buffer pointed to by _base field (or equivalent) of the FILE
- * structure pointed to its argument. This macro will always be defined
- * if USE_STDIO_BASE is defined.
- */
-#define USE_STDIO_BASE /**/
-#ifdef USE_STDIO_BASE
-#define FILE_base(fp) ((fp)->buffer)
-#define FILE_bufsiz(fp) ((fp)->level + (fp)->curp - (fp)->buffer)
-#endif
-
/* HAS_STRCHR:
* This symbol is defined to indicate that the strchr()/strrchr()
* functions are available for string searching. If not, try the
@@ -890,20 +747,6 @@
*/
/*#define HAS_TCSETPGRP /**/
-/* Time_t:
- * This symbol holds the type returned by time(). It can be long,
- * or time_t on BSD sites (in which case <sys/types.h> should be
- * included).
- */
-#define Time_t time_t /* Time type */
-
-/* HAS_TIMES:
- * This symbol, if defined, indicates that the times() routine exists.
- * Note that this became obsolete on some systems (SUNOS), which now
- * use getrusage(). It may be necessary to include <sys/times.h>.
- */
-#define HAS_TIMES /**/
-
/* HAS_TRUNCATE:
* This symbol, if defined, indicates that the truncate routine is
* available to truncate files.
@@ -927,14 +770,6 @@
*/
/*#define HAS_VFORK /**/
-/* Signal_t:
- * This symbol's value is either "void" or "int", corresponding to the
- * appropriate return type of a signal handler. Thus, you can declare
- * a signal handler using "Signal_t (*handler)()", and define the
- * handler using "Signal_t handler(sig)".
- */
-#define Signal_t void /* Signal handler's return type */
-
/* HASVOLATILE:
* This symbol, if defined, indicates that this C compiler knows about
* the volatile declaration.
@@ -944,20 +779,6 @@
#define volatile
#endif
-/* HAS_VPRINTF:
- * This symbol, if defined, indicates that the vprintf routine is available
- * to printf with a pointer to an argument list. If unavailable, you
- * may need to write your own, probably in terms of _doprnt().
- */
-/* USE_CHAR_VSPRINTF:
- * This symbol is defined if this system has vsprintf() returning type
- * (char*). The trend seems to be to declare it as "int vsprintf()". It
- * is up to the package author to declare vsprintf correctly based on the
- * symbol.
- */
-#define HAS_VPRINTF /**/
-/*#define USE_CHAR_VSPRINTF /**/
-
/* HAS_WAIT4:
* This symbol, if defined, indicates that wait4() exists.
*/
@@ -967,7 +788,7 @@
* This symbol, if defined, indicates that the waitpid routine is
* available to wait for child process.
*/
-/*#define HAS_WAITPID /**/
+#define HAS_WAITPID /**/
/* HAS_WCSTOMBS:
* This symbol, if defined, indicates that the wcstombs routine is
@@ -981,46 +802,22 @@
*/
#define HAS_WCTOMB /**/
-/* Fpos_t:
- * This symbol holds the type used to declare file positions in libc.
- * It can be fpos_t, long, uint, etc... It may be necessary to include
- * <sys/types.h> to get any typedef'ed information.
- */
-#define Fpos_t fpos_t /* File position type */
-
-/* Gid_t:
- * This symbol holds the return type of getgid() and the type of
- * argument to setrgid() and related functions. Typically,
- * it is the type of group ids in the kernel. It can be int, ushort,
- * uid_t, etc... It may be necessary to include <sys/types.h> to get
- * any typedef'ed information.
- */
-#define Gid_t gid_t /* Type for getgid(), etc... */
-
-/* Groups_t:
- * This symbol holds the type used for the second argument to
- * [gs]etgroups(). Usually, this is the same of gidtype, but
- * sometimes it isn't. It can be int, ushort, uid_t, etc...
- * It may be necessary to include <sys/types.h> to get any
- * typedef'ed information. This is only required if you have
- * getgroups() or setgroups().
+/* I_ARPA_INET:
+ * This symbol, if defined, indicates that <arpa/inet.h> exists and should
+ * be included.
*/
-#if defined(HAS_GETGROUPS) || defined(HAS_SETGROUPS)
-#define Groups_t gid_t /* Type for 2nd arg to [gs]etgroups() */
-#endif
+/*#define I_ARPA_INET /**/
-/* DB_Prefix_t:
- * This symbol contains the type of the prefix structure element
- * in the <db.h> header file. In older versions of DB, it was
- * int, while in newer ones it is u_int32_t.
+/* I_DBM:
+ * This symbol, if defined, indicates that <dbm.h> exists and should
+ * be included.
*/
-/* DB_Hash_t:
- * This symbol contains the type of the prefix structure element
- * in the <db.h> header file. In older versions of DB, it was
- * int, while in newer ones it is size_t.
+/* I_RPCSVC_DBM:
+ * This symbol, if defined, indicates that <rpcsvc/dbm.h> exists and
+ * should be included.
*/
-#define DB_Hash_t int /**/
-#define DB_Prefix_t int /**/
+/*#define I_DBM /**/
+#define I_RPCSVC_DBM /**/
/* I_DIRENT:
* This symbol, if defined, indicates to the C program that it should
@@ -1064,7 +861,27 @@
* This symbol, if defined, indicates to the C program that it should
* include <grp.h>.
*/
-#define I_GRP /**/
+/* GRPASSWD:
+ * This symbol, if defined, indicates to the C program that struct group
+ * contains gr_passwd.
+ */
+/* HAS_SETGRENT:
+ * This symbol, if defined, indicates that the getgrent routine is
+ * available for initializing sequential access of the group database.
+ */
+/* HAS_GETGRENT:
+ * This symbol, if defined, indicates that the getgrent routine is
+ * available for sequential access of the group database.
+ */
+/* HAS_ENDGRENT:
+ * This symbol, if defined, indicates that the getgrent routine is
+ * available for finalizing sequential access of the group database.
+ */
+/*#define I_GRP /**/
+/*#define GRPASSWD /**/
+/*#define HAS_SETGRENT /**/
+/*#define HAS_GETGRENT /**/
+/*#define HAS_ENDGRENT /**/
/* I_LIMITS:
* This symbol, if defined, indicates to the C program that it should
@@ -1073,6 +890,12 @@
*/
#define I_LIMITS /**/
+/* I_LOCALE:
+ * This symbol, if defined, indicates to the C program that it should
+ * include <locale.h>.
+ */
+#define I_LOCALE /**/
+
/* I_MATH:
* This symbol, if defined, indicates to the C program that it should
* include <math.h>.
@@ -1103,41 +926,11 @@
*/
/*#define I_NETINET_IN /**/
-/* I_PWD:
+/* I_SFIO:
* This symbol, if defined, indicates to the C program that it should
- * include <pwd.h>.
- */
-/* PWQUOTA:
- * This symbol, if defined, indicates to the C program that struct passwd
- * contains pw_quota.
- */
-/* PWAGE:
- * This symbol, if defined, indicates to the C program that struct passwd
- * contains pw_age.
- */
-/* PWCHANGE:
- * This symbol, if defined, indicates to the C program that struct passwd
- * contains pw_change.
- */
-/* PWCLASS:
- * This symbol, if defined, indicates to the C program that struct passwd
- * contains pw_class.
- */
-/* PWEXPIRE:
- * This symbol, if defined, indicates to the C program that struct passwd
- * contains pw_expire.
- */
-/* PWCOMMENT:
- * This symbol, if defined, indicates to the C program that struct passwd
- * contains pw_comment.
+ * include <sfio.h>.
*/
-/*#define I_PWD /**/
-/*#define PWQUOTA /**/
-/*#define PWAGE /**/
-/*#define PWCHANGE /**/
-/*#define PWCLASS /**/
-/*#define PWEXPIRE /**/
-/*#define PWCOMMENT /**/
+/*#define I_SFIO /**/
/* I_STDDEF:
* This symbol, if defined, indicates that <stddef.h> exists and should
@@ -1199,6 +992,12 @@
*/
/*#define I_SYS_SELECT /**/
+/* I_SYS_STAT:
+ * This symbol, if defined, indicates to the C program that it should
+ * include <sys/stat.h>.
+ */
+#define I_SYS_STAT /**/
+
/* I_SYS_TIMES:
* This symbol, if defined, indicates to the C program that it should
* include <sys/times.h>.
@@ -1243,22 +1042,6 @@
/*#define I_TERMIOS /**/
/*#define I_SGTTY /**/
-/* I_TIME:
- * This symbol, if defined, indicates to the C program that it should
- * include <time.h>.
- */
-/* I_SYS_TIME:
- * This symbol, if defined, indicates to the C program that it should
- * include <sys/time.h>.
- */
-/* I_SYS_TIME_KERNEL:
- * This symbol, if defined, indicates to the C program that it should
- * include <sys/time.h> with KERNEL defined.
- */
-#define I_TIME /**/
-/*#define I_SYS_TIME /**/
-/*#define I_SYS_TIME_KERNEL /**/
-
/* I_UNISTD:
* This symbol, if defined, indicates to the C program that it should
* include <unistd.h>.
@@ -1271,6 +1054,14 @@
*/
#define I_UTIME /**/
+/* I_VALUES:
+ * This symbol, if defined, indicates to the C program that it should
+ * include <values.h> to get definition of symbols like MINFLOAT or
+ * MAXLONG, i.e. machine dependant limitations. Probably, you
+ * should use <limits.h> instead, if it is available.
+ */
+/*#define I_VALUES /**/
+
/* I_STDARG:
* This symbol, if defined, indicates that <stdarg.h> exists and should
* be included.
@@ -1288,64 +1079,6 @@
*/
/*#define I_VFORK /**/
-/* INTSIZE:
- * This symbol contains the value of sizeof(int) so that the C
- * preprocessor can make decisions based on it.
- */
-/* LONGSIZE:
- * This symbol contains the value of sizeof(long) so that the C
- * preprocessor can make decisions based on it.
- */
-/* SHORTSIZE:
- * This symbol contains the value of sizeof(short) so that the C
- * preprocessor can make decisions based on it.
- */
-#define INTSIZE 4 /**/
-#define LONGSIZE 4 /**/
-#define SHORTSIZE 2 /**/
-
-/* Off_t:
- * This symbol holds the type used to declare offsets in the kernel.
- * It can be int, long, off_t, etc... It may be necessary to include
- * <sys/types.h> to get any typedef'ed information.
- */
-#define Off_t off_t /* <offset> type */
-
-/* Mode_t:
- * This symbol holds the type used to declare file modes
- * for systems calls. It is usually mode_t, but may be
- * int or unsigned short. It may be necessary to include <sys/types.h>
- * to get any typedef'ed information.
- */
-#define Mode_t mode_t /* file mode parameter for system calls */
-
-/* VAL_O_NONBLOCK:
- * This symbol is to be used during open() or fcntl(F_SETFL) to turn on
- * non-blocking I/O for the file descriptor. Note that there is no way
- * back, i.e. you cannot turn it blocking again this way. If you wish to
- * alternatively switch between blocking and non-blocking, use the
- * ioctl(FIOSNBIO) call instead, but that is not supported by all devices.
- */
-/* VAL_EAGAIN:
- * This symbol holds the errno error code set by read() when no data was
- * present on the non-blocking file descriptor.
- */
-/* RD_NODATA:
- * This symbol holds the return code from read() when no data is present
- * on the non-blocking file descriptor. Be careful! If EOF_NONBLOCK is
- * not defined, then you can't distinguish between no data and EOF by
- * issuing a read(). You'll have to find another way to tell for sure!
- */
-/* EOF_NONBLOCK:
- * This symbol, if defined, indicates to the C program that a read() on
- * a non-blocking file descriptor will return 0 on EOF, and not the value
- * held in RD_NODATA (-1 usually, in that case!).
- */
-#define VAL_O_NONBLOCK O_NONBLOCK
-#define VAL_EAGAIN EAGAIN
-#define RD_NODATA -1
-#define EOF_NONBLOCK
-
/* CAN_PROTOTYPE:
* If defined, this macro indicates that the C compiler can handle
* function prototypes.
@@ -1364,37 +1097,14 @@
#define _(args) ()
#endif
-/* RANDBITS:
- * This symbol contains the number of bits of random number the rand()
- * function produces. Usual values are 15, 16, and 31.
- */
-#define RANDBITS 15 /**/
-
-/* Select_fd_set_t:
- * This symbol holds the type used for the 2nd, 3rd, and 4th
- * arguments to select. Usually, this is 'fd_set *', if HAS_FD_SET
- * is defined, and 'int *' otherwise. This is only useful if you
- * have select(), of course.
- */
-#define Select_fd_set_t int * /**/
-
-/* Size_t:
- * This symbol holds the type used to declare length parameters
- * for string functions. It is usually size_t, but may be
- * unsigned long, int, etc. It may be necessary to include
- * <sys/types.h> to get any typedef'ed information.
+/* SH_PATH:
+ * This symbol contains the full pathname to the shell used on this
+ * on this system to execute Bourne shell scripts. Usually, this will be
+ * /bin/sh, though it's possible that some systems will have /bin/ksh,
+ * /bin/pdksh, /bin/ash, /bin/bash, or even something such as
+ * D:/bin/sh.exe.
*/
-#define Size_t size_t /* length paramater for string functions */
-
-/* SSize_t:
- * This symbol holds the type used by functions that return
- * a count of bytes or an error condition. It must be a signed type.
- * It is usually ssize_t, but may be long or int, etc.
- * It may be necessary to include <sys/types.h> or <unistd.h>
- * to get any typedef'ed information.
- * We will pick a type such that sizeof(SSize_t) == sizeof(Size_t).
- */
-#define SSize_t int /* signed count of bytes */
+#define SH_PATH "cmd /x /c" /**/
/* STDCHAR:
* This symbol is defined to be the type of char used in stdio.h.
@@ -1402,46 +1112,16 @@
*/
#define STDCHAR unsigned char /**/
-/* Uid_t:
- * This symbol holds the type used to declare user ids in the kernel.
- * It can be int, ushort, uid_t, etc... It may be necessary to include
- * <sys/types.h> to get any typedef'ed information.
- */
-#define Uid_t uid_t /* UID type */
-
-/* LOC_SED:
- * This symbol holds the complete pathname to the sed program.
- */
-#define LOC_SED "" /**/
-
-/* OSNAME:
- * This symbol contains the name of the operating system, as determined
- * by Configure. You shouldn't rely on it too much; the specific
- * feature tests from Configure are generally more reliable.
- */
-#define OSNAME "MSWin32" /**/
-
-/* ARCHLIB:
- * This variable, if defined, holds the name of the directory in
- * which the user wants to put architecture-dependent public
- * library files for perl5. It is most often a local directory
- * such as /usr/local/lib. Programs using this variable must be
- * prepared to deal with filename expansion. If ARCHLIB is the
- * same as PRIVLIB, it is not defined, since presumably the
- * program already searches PRIVLIB.
- */
-/* ARCHLIB_EXP:
- * 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\\lib" /**/
-#define ARCHLIB_EXP (win32PerlLibPath()) /**/
-
-/* BINCOMPAT3:
- * This symbol, if defined, indicates that Perl 5.004 should be
- * binary-compatible with Perl 5.003.
+/* MEM_ALIGNBYTES:
+ * This symbol contains the number of bytes required to align a
+ * double. Usual values are 2, 4 and 8.
+ * On NeXT starting with 3.2, you can build "Fat" Multiple Architecture
+ * Binaries (MAB) for targets with varying alignment. This only matters
+ * for perl, where the config.h can be generated and installed on one
+ * system, and used by a different architecture to build an extension.
+ * The default is eight, for safety.
*/
-/*#define BINCOMPAT3 /**/
+#define MEM_ALIGNBYTES 8 /**/
/* BYTEORDER:
* This symbol holds the hexadecimal constant defined in byteorder,
@@ -1466,39 +1146,32 @@
#endif /* ENDIAN CHECK */
#endif /* NeXT */
-/* CSH:
- * This symbol, if defined, indicates that the C-shell exists.
- * If defined, contains the full pathname of csh.
+/* CASTI32:
+ * This symbol is defined if the C compiler can cast negative
+ * or large floating point numbers to 32-bit ints.
*/
-/*#define CSH "" /**/
+#define CASTI32 /**/
-/* DLSYM_NEEDS_UNDERSCORE:
- * This symbol, if defined, indicates that we need to prepend an
- * underscore to the symbol name before calling dlsym(). This only
- * makes sense if you *have* dlsym, which we will presume is the
- * case if you're using dl_dlopen.xs.
+/* CASTNEGFLOAT:
+ * This symbol is defined if the C compiler can cast negative
+ * numbers to unsigned longs, ints and shorts.
*/
-/*#define DLSYM_NEEDS_UNDERSCORE /**/
-
-/* SETUID_SCRIPTS_ARE_SECURE_NOW:
- * This symbol, if defined, indicates that the bug that prevents
- * setuid scripts from being secure is not present in this kernel.
+/* CASTFLAGS:
+ * This symbol contains flags that say what difficulties the compiler
+ * has casting odd floating values to unsigned long:
+ * 0 = ok
+ * 1 = couldn't cast < 0
+ * 2 = couldn't cast >= 0x80000000
+ * 4 = couldn't cast in argument expression list
*/
-/* DOSUID:
- * This symbol, if defined, indicates that the C program should
- * check the script that it is executing for setuid/setgid bits, and
- * attempt to emulate setuid/setgid on systems that have disabled
- * setuid #! scripts because the kernel can't do it securely.
- * It is up to the package designer to make sure that this emulation
- * is done securely. Among other things, it should do an fstat on
- * the script it just opened to make sure it really is a setuid/setgid
- * script, it should make sure the arguments passed correspond exactly
- * to the argument on the #! line, and it should not trust any
- * subprocesses to which it must pass the filename rather than the
- * file descriptor of the script to be executed.
+#define CASTNEGFLOAT /**/
+#define CASTFLAGS 0 /**/
+
+/* VOID_CLOSEDIR:
+ * This symbol, if defined, indicates that the closedir() routine
+ * does not return a value.
*/
-/*#define SETUID_SCRIPTS_ARE_SECURE_NOW /**/
-/*#define DOSUID /**/
+/*#define VOID_CLOSEDIR /**/
/* Gconvert:
* This preprocessor macro is defined to convert a floating point
@@ -1517,62 +1190,58 @@
*/
#define Gconvert(x,n,t,b) gcvt((x),(n),(b))
-/* HAS_GETPGID:
+/* HAS_GNULIBC:
* This symbol, if defined, indicates to the C program that
- * the getpgid(pid) function is available to get the
- * process group id.
+ * the GNU C library is being used.
*/
-/*#define HAS_GETPGID /**/
-
-/* HAS_GETPGRP:
- * This symbol, if defined, indicates that the getpgrp routine is
- * available to get the current process group.
- */
-/* USE_BSD_GETPGRP:
- * This symbol, if defined, indicates that getpgrp needs one
- * arguments whereas USG one needs none.
+/*#define HAS_GNULIBC /**/
+/* HAS_ISASCII:
+ * This manifest constant lets the C program know that isascii
+ * is available.
*/
-/*#define HAS_GETPGRP /**/
-/*#define USE_BSD_GETPGRP /**/
+#define HAS_ISASCII /**/
-/* HAS_INET_ATON:
- * This symbol, if defined, indicates to the C program that the
- * inet_aton() function is available to parse IP address "dotted-quad"
- * strings.
+/* HAS_LCHOWN:
+ * This symbol, if defined, indicates that the lchown routine is
+ * available to operate on a symbolic link (instead of following the
+ * link).
*/
-/*#define HAS_INET_ATON /**/
+/*#define HAS_LCHOWN /**/
-/* HAS_SETPGID:
- * This symbol, if defined, indicates to the C program that
- * the setpgid(pid, gpid) function is available to set the
- * process group id.
+/* HAS_OPEN3:
+ * This manifest constant lets the C program know that the three
+ * argument form of open(2) is available.
*/
-/*#define HAS_SETPGID /**/
+/*#define HAS_OPEN3 /**/
-/* HAS_SETPGRP:
- * This symbol, if defined, indicates that the setpgrp routine is
- * available to set the current process group.
+/* HAS_SAFE_BCOPY:
+ * This symbol, if defined, indicates that the bcopy routine is available
+ * to copy potentially overlapping memory blocks. Otherwise you should
+ * probably use memmove() or memcpy(). If neither is defined, roll your
+ * own version.
*/
-/* USE_BSD_SETPGRP:
- * This symbol, if defined, indicates that setpgrp needs two
- * arguments whereas USG one needs none. See also HAS_SETPGID
- * for a POSIX interface.
+/*#define HAS_SAFE_BCOPY /**/
+
+/* HAS_SAFE_MEMCPY:
+ * This symbol, if defined, indicates that the memcpy routine is available
+ * to copy potentially overlapping memory blocks. Otherwise you should
+ * probably use memmove() or memcpy(). If neither is defined, roll your
+ * own version.
*/
-/* USE_BSDPGRP:
- * This symbol, if defined, indicates that the BSD notion of process
- * group is to be used. For instance, you have to say setpgrp(pid, pgrp)
- * instead of the USG setpgrp(). This should be obsolete since
- * there are systems which have BSD-ish setpgrp but USG-ish getpgrp.
+/*#define HAS_SAFE_MEMCPY /**/
+
+/* HAS_SANE_MEMCMP:
+ * This symbol, if defined, indicates that the memcmp routine is available
+ * and can be used to compare relative magnitudes of chars with their high
+ * bits set. If it is not defined, roll your own version.
*/
-/*#define HAS_SETPGRP /**/
-/*#define USE_BSD_SETPGRP /**/
-/*#define USE_BSDPGRP /**/
+#define HAS_SANE_MEMCMP /**/
-/* USE_SFIO:
- * This symbol, if defined, indicates that sfio should
- * be used.
+/* HAS_SIGACTION:
+ * This symbol, if defined, indicates that Vr4's sigaction() routine
+ * is available.
*/
-/*#define USE_SFIO /**/
+/*#define HAS_SIGACTION /**/
/* Sigjmp_buf:
* This is the buffer type to be used with Sigsetjmp and Siglongjmp.
@@ -1598,48 +1267,483 @@
#define Siglongjmp(buf,retval) longjmp((buf),(retval))
#endif
-/* USE_DYNAMIC_LOADING:
- * This symbol, if defined, indicates that dynamic loading of
- * some sort is available.
+/* USE_STDIO_PTR:
+ * This symbol is defined if the _ptr and _cnt fields (or similar)
+ * of the stdio FILE structure can be used to access the stdio buffer
+ * for a file handle. If this is defined, then the FILE_ptr(fp)
+ * and FILE_cnt(fp) macros will also be defined and should be used
+ * to access these fields.
*/
-#define USE_DYNAMIC_LOADING /**/
+/* FILE_ptr:
+ * This macro is used to access the _ptr field (or equivalent) of the
+ * FILE structure pointed to by its argument. This macro will always be
+ * defined if USE_STDIO_PTR is defined.
+ */
+/* STDIO_PTR_LVALUE:
+ * This symbol is defined if the FILE_ptr macro can be used as an
+ * lvalue.
+ */
+/* FILE_cnt:
+ * This macro is used to access the _cnt field (or equivalent) of the
+ * FILE structure pointed to by its argument. This macro will always be
+ * defined if USE_STDIO_PTR is defined.
+ */
+/* STDIO_CNT_LVALUE:
+ * This symbol is defined if the FILE_cnt macro can be used as an
+ * lvalue.
+ */
+#define USE_STDIO_PTR /**/
+#ifdef USE_STDIO_PTR
+#define FILE_ptr(fp) ((fp)->curp)
+#define STDIO_PTR_LVALUE /**/
+#define FILE_cnt(fp) ((fp)->level)
+#define STDIO_CNT_LVALUE /**/
+#endif
-/* I_DBM:
- * This symbol, if defined, indicates that <dbm.h> exists and should
- * be included.
+/* USE_STDIO_BASE:
+ * This symbol is defined if the _base field (or similar) of the
+ * stdio FILE structure can be used to access the stdio buffer for
+ * a file handle. If this is defined, then the FILE_base(fp) macro
+ * will also be defined and should be used to access this field.
+ * Also, the FILE_bufsiz(fp) macro will be defined and should be used
+ * to determine the number of bytes in the buffer. USE_STDIO_BASE
+ * will never be defined unless USE_STDIO_PTR is.
*/
-/* I_RPCSVC_DBM:
- * This symbol, if defined, indicates that <rpcsvc/dbm.h> exists and
- * should be included.
+/* FILE_base:
+ * This macro is used to access the _base field (or equivalent) of the
+ * FILE structure pointed to by its argument. This macro will always be
+ * defined if USE_STDIO_BASE is defined.
*/
-/*#define I_DBM /**/
-#define I_RPCSVC_DBM /**/
+/* FILE_bufsiz:
+ * This macro is used to determine the number of bytes in the I/O
+ * buffer pointed to by _base field (or equivalent) of the FILE
+ * structure pointed to its argument. This macro will always be defined
+ * if USE_STDIO_BASE is defined.
+ */
+#define USE_STDIO_BASE /**/
+#ifdef USE_STDIO_BASE
+#define FILE_base(fp) ((fp)->buffer)
+#define FILE_bufsiz(fp) ((fp)->level + (fp)->curp - (fp)->buffer)
+#endif
-/* I_LOCALE:
- * This symbol, if defined, indicates to the C program that it should
- * include <locale.h>.
+/* HAS_VPRINTF:
+ * This symbol, if defined, indicates that the vprintf routine is available
+ * to printf with a pointer to an argument list. If unavailable, you
+ * may need to write your own, probably in terms of _doprnt().
*/
-#define I_LOCALE /**/
+/* USE_CHAR_VSPRINTF:
+ * This symbol is defined if this system has vsprintf() returning type
+ * (char*). The trend seems to be to declare it as "int vsprintf()". It
+ * is up to the package author to declare vsprintf correctly based on the
+ * symbol.
+ */
+#define HAS_VPRINTF /**/
+/*#define USE_CHAR_VSPRINTF /**/
-/* I_SFIO:
- * This symbol, if defined, indicates to the C program that it should
- * include <sfio.h>.
+/* DOUBLESIZE:
+ * This symbol contains the size of a double, so that the C preprocessor
+ * can make decisions based on it.
*/
-/*#define I_SFIO /**/
+#define DOUBLESIZE 8 /**/
-/* I_SYS_STAT:
+/* I_TIME:
* This symbol, if defined, indicates to the C program that it should
- * include <sys/stat.h>.
+ * include <time.h>.
*/
-#define I_SYS_STAT /**/
+/* I_SYS_TIME:
+ * This symbol, if defined, indicates to the C program that it should
+ * include <sys/time.h>.
+ */
+/* I_SYS_TIME_KERNEL:
+ * This symbol, if defined, indicates to the C program that it should
+ * include <sys/time.h> with KERNEL defined.
+ */
+#define I_TIME /**/
+/*#define I_SYS_TIME /**/
+/*#define I_SYS_TIME_KERNEL /**/
-/* I_VALUES:
+/* INTSIZE:
+ * This symbol contains the value of sizeof(int) so that the C
+ * preprocessor can make decisions based on it.
+ */
+/* LONGSIZE:
+ * This symbol contains the value of sizeof(long) so that the C
+ * preprocessor can make decisions based on it.
+ */
+/* SHORTSIZE:
+ * This symbol contains the value of sizeof(short) so that the C
+ * preprocessor can make decisions based on it.
+ */
+#define INTSIZE 4 /**/
+#define LONGSIZE 4 /**/
+#define SHORTSIZE 2 /**/
+
+/* VAL_O_NONBLOCK:
+ * This symbol is to be used during open() or fcntl(F_SETFL) to turn on
+ * non-blocking I/O for the file descriptor. Note that there is no way
+ * back, i.e. you cannot turn it blocking again this way. If you wish to
+ * alternatively switch between blocking and non-blocking, use the
+ * ioctl(FIOSNBIO) call instead, but that is not supported by all devices.
+ */
+/* VAL_EAGAIN:
+ * This symbol holds the errno error code set by read() when no data was
+ * present on the non-blocking file descriptor.
+ */
+/* RD_NODATA:
+ * This symbol holds the return code from read() when no data is present
+ * on the non-blocking file descriptor. Be careful! If EOF_NONBLOCK is
+ * not defined, then you can't distinguish between no data and EOF by
+ * issuing a read(). You'll have to find another way to tell for sure!
+ */
+/* EOF_NONBLOCK:
+ * This symbol, if defined, indicates to the C program that a read() on
+ * a non-blocking file descriptor will return 0 on EOF, and not the value
+ * held in RD_NODATA (-1 usually, in that case!).
+ */
+#define VAL_O_NONBLOCK O_NONBLOCK
+#define VAL_EAGAIN EAGAIN
+#define RD_NODATA -1
+#define EOF_NONBLOCK
+
+/* PTRSIZE:
+ * This symbol contains the size of a pointer, so that the C preprocessor
+ * can make decisions based on it. It will be sizeof(void *) if
+ * the compiler supports (void *); otherwise it will be
+ * sizeof(char *).
+ */
+#define PTRSIZE 4 /**/
+
+/* RANDBITS:
+ * This symbol contains the number of bits of random number the rand()
+ * function produces. Usual values are 15, 16, and 31.
+ */
+#define RANDBITS 15 /**/
+
+/* SSize_t:
+ * This symbol holds the type used by functions that return
+ * a count of bytes or an error condition. It must be a signed type.
+ * It is usually ssize_t, but may be long or int, etc.
+ * It may be necessary to include <sys/types.h> or <unistd.h>
+ * to get any typedef'ed information.
+ * We will pick a type such that sizeof(SSize_t) == sizeof(Size_t).
+ */
+#define SSize_t int /* signed count of bytes */
+
+/* OSNAME:
+ * This symbol contains the name of the operating system, as determined
+ * by Configure. You shouldn't rely on it too much; the specific
+ * feature tests from Configure are generally more reliable.
+ */
+#define OSNAME "MSWin32" /**/
+
+/* CAT2:
+ * This macro catenates 2 tokens together.
+ */
+/* STRINGIFY:
+ * This macro surrounds its token with double quotes.
+ */
+#if 42 == 1
+#define CAT2(a,b)a/**/b
+#define STRINGIFY(a)"a"
+ /* If you can get stringification with catify, tell me how! */
+#endif
+#if 42 == 42
+#define CAT2(a,b)a ## b
+#define StGiFy(a)# a
+#define STRINGIFY(a)StGiFy(a)
+#endif
+#if 42 != 1 && 42 != 42
+#include "Bletch: How does this C preprocessor catenate tokens?"
+#endif
+
+/* CSH:
+ * This symbol, if defined, contains the full pathname of csh.
+ */
+/*#define HAS_CSH /**/
+#ifdef HAS_CSH
+#define CSH "" /**/
+#endif
+
+/* HAS_ENDHOSTENT:
+ * This symbol, if defined, indicates that the endhostent() routine is
+ * available to close whatever was being used for host queries.
+ */
+/*#define HAS_ENDHOSTENT /**/
+
+/* HAS_ENDNETENT:
+ * This symbol, if defined, indicates that the endnetent() routine is
+ * available to close whatever was being used for network queries.
+ */
+/*#define HAS_ENDNETENT /**/
+
+/* HAS_ENDPROTOENT:
+ * This symbol, if defined, indicates that the endprotoent() routine is
+ * available to close whatever was being used for protocol queries.
+ */
+/*#define HAS_ENDPROTOENT /**/
+
+/* HAS_ENDSERVENT:
+ * This symbol, if defined, indicates that the endservent() routine is
+ * available to close whatever was being used for service queries.
+ */
+/*#define HAS_ENDSERVENT /**/
+
+/* HAS_GETHOSTBYADDR:
+ * This symbol, if defined, indicates that the gethostbyaddr() routine is
+ * available to look up hosts by their IP addresses.
+ */
+#define HAS_GETHOSTBYADDR /**/
+
+/* HAS_GETHOSTBYNAME:
+ * This symbol, if defined, indicates that the gethostbyname() routine is
+ * available to look up host names in some data base or other.
+ */
+#define HAS_GETHOSTBYNAME /**/
+
+/* HAS_GETHOSTENT:
+ * This symbol, if defined, indicates that the gethostent() routine is
+ * available to look up host names in some data base or another.
+ */
+/*#define HAS_GETHOSTENT /**/
+
+/* HAS_GETNETBYADDR:
+ * This symbol, if defined, indicates that the getnetbyaddr() routine is
+ * available to look up networks by their IP addresses.
+ */
+/*#define HAS_GETNETBYADDR /**/
+
+/* HAS_GETNETBYNAME:
+ * This symbol, if defined, indicates that the getnetbyname() routine is
+ * available to look up networks by their names.
+ */
+/*#define HAS_GETNETBYNAME /**/
+
+/* HAS_GETNETENT:
+ * This symbol, if defined, indicates that the getnetent() routine is
+ * available to look up network names in some data base or another.
+ */
+/*#define HAS_GETNETENT /**/
+
+/* HAS_GETPROTOENT:
+ * This symbol, if defined, indicates that the getprotoent() routine is
+ * available to look up protocols in some data base or another.
+ */
+/*#define HAS_GETPROTOENT /**/
+
+/* HAS_GETPROTOBYNAME:
+ * This symbol, if defined, indicates that the getprotobyname()
+ * routine is available to look up protocols by their name.
+ */
+/* HAS_GETPROTOBYNUMBER:
+ * This symbol, if defined, indicates that the getprotobynumber()
+ * routine is available to look up protocols by their number.
+ */
+#define HAS_GETPROTOBYNAME /**/
+#define HAS_GETPROTOBYNUMBER /**/
+
+/* HAS_GETSERVENT:
+ * This symbol, if defined, indicates that the getservent() routine is
+ * available to look up network services in some data base or another.
+ */
+/*#define HAS_GETSERVENT /**/
+
+/* HAS_GETSERVBYNAME:
+ * This symbol, if defined, indicates that the getservbyname()
+ * routine is available to look up services by their name.
+ */
+/* HAS_GETSERVBYPORT:
+ * This symbol, if defined, indicates that the getservbyport()
+ * routine is available to look up services by their port.
+ */
+#define HAS_GETSERVBYNAME /**/
+#define HAS_GETSERVBYPORT /**/
+
+/* HAS_LONG_DOUBLE:
+ * This symbol will be defined if the C compiler supports long
+ * doubles.
+ */
+/* LONG_DOUBLESIZE:
+ * This symbol contains the size of a long double, so that the
+ * C preprocessor can make decisions based on it. It is only
+ * defined if the system supports long doubles.
+ */
+#define HAS_LONG_DOUBLE /**/
+#ifdef HAS_LONG_DOUBLE
+#define LONG_DOUBLESIZE 10 /**/
+#endif
+
+/* HAS_LONG_LONG:
+ * This symbol will be defined if the C compiler supports
+ * long long.
+ */
+/* LONGLONGSIZE:
+ * This symbol contains the size of a long long, so that the
+ * C preprocessor can make decisions based on it. It is only
+ * defined if the system supports long long.
+ */
+/*#define HAS_LONG_LONG /**/
+#ifdef HAS_LONG_LONG
+#define LONGLONGSIZE 8 /**/
+#endif
+
+/* HAS_SETGROUPS:
+ * This symbol, if defined, indicates that the setgroups() routine is
+ * available to set the list of process groups. If unavailable, multiple
+ * groups are probably not supported.
+ */
+/*#define HAS_SETGROUPS /**/
+
+/* HAS_SETHOSTENT:
+ * This symbol, if defined, indicates that the sethostent() routine is
+ * available.
+ */
+/*#define HAS_SETHOSTENT /**/
+
+/* HAS_SETNETENT:
+ * This symbol, if defined, indicates that the setnetent() routine is
+ * available.
+ */
+/*#define HAS_SETNETENT /**/
+
+/* HAS_SETPROTOENT:
+ * This symbol, if defined, indicates that the setprotoent() routine is
+ * available.
+ */
+/*#define HAS_SETPROTOENT /**/
+
+/* HAS_SETSERVENT:
+ * This symbol, if defined, indicates that the setservent() routine is
+ * available.
+ */
+/*#define HAS_SETSERVENT /**/
+
+/* HAS_SETVBUF:
+ * This symbol, if defined, indicates that the setvbuf routine is
+ * available to change buffering on an open stdio stream.
+ * to a line-buffered mode.
+ */
+#define HAS_SETVBUF /**/
+
+/* HAS_SOCKET:
+ * This symbol, if defined, indicates that the BSD socket interface is
+ * supported.
+ */
+/* HAS_SOCKETPAIR:
+ * This symbol, if defined, indicates that the BSD socketpair() call is
+ * supported.
+ */
+#define HAS_SOCKET /**/
+/*#define HAS_SOCKETPAIR /**/
+
+/* HAS_UNION_SEMUN:
+ * This symbol, if defined, indicates that the union semun is
+ * defined by including <sys/sem.h>. If not, the user code
+ * probably needs to define it as:
+ * union semun {
+ * int val;
+ * struct semid_ds *buf;
+ * unsigned short *array;
+ * }
+ */
+/* USE_SEMCTL_SEMUN:
+ * This symbol, if defined, indicates that union semun is
+ * used for semctl IPC_STAT.
+ */
+/* USE_SEMCTL_SEMID_DS:
+ * This symbol, if defined, indicates that struct semid_ds * is
+ * used for semctl IPC_STAT.
+ */
+#define HAS_UNION_SEMUN /**/
+/*#define USE_SEMCTL_SEMUN /**/
+/*#define USE_SEMCTL_SEMID_DS /**/
+
+/* Signal_t:
+ * This symbol's value is either "void" or "int", corresponding to the
+ * appropriate return type of a signal handler. Thus, you can declare
+ * a signal handler using "Signal_t (*handler)()", and define the
+ * handler using "Signal_t handler(sig)".
+ */
+#define Signal_t void /* Signal handler's return type */
+
+/* Groups_t:
+ * This symbol holds the type used for the second argument to
+ * getgroups() and setgropus(). Usually, this is the same as
+ * gidtype (gid_t) , but sometimes it isn't.
+ * It can be int, ushort, uid_t, etc...
+ * It may be necessary to include <sys/types.h> to get any
+ * typedef'ed information. This is only required if you have
+ * getgroups() or setgropus()..
+ */
+#if defined(HAS_GETGROUPS) || defined(HAS_SETGROUPS)
+#define Groups_t gid_t /* Type for 2nd arg to [sg]etgroups() */
+#endif
+
+/* I_NETDB:
+ * This symbol, if defined, indicates that <netdb.h> exists and
+ * should be included.
+ */
+/*#define I_NETDB /**/
+
+/* I_PWD:
* This symbol, if defined, indicates to the C program that it should
- * include <values.h> to get definition of symbols like MINFLOAT or
- * MAXLONG, i.e. machine dependant limitations. Probably, you
- * should use <limits.h> instead, if it is available.
+ * include <pwd.h>.
*/
-/*#define I_VALUES /**/
+/* PWQUOTA:
+ * This symbol, if defined, indicates to the C program that struct passwd
+ * contains pw_quota.
+ */
+/* PWAGE:
+ * This symbol, if defined, indicates to the C program that struct passwd
+ * contains pw_age.
+ */
+/* PWCHANGE:
+ * This symbol, if defined, indicates to the C program that struct passwd
+ * contains pw_change.
+ */
+/* PWCLASS:
+ * This symbol, if defined, indicates to the C program that struct passwd
+ * contains pw_class.
+ */
+/* PWEXPIRE:
+ * This symbol, if defined, indicates to the C program that struct passwd
+ * contains pw_expire.
+ */
+/* PWCOMMENT:
+ * This symbol, if defined, indicates to the C program that struct passwd
+ * contains pw_comment.
+ */
+/* PWGECOS:
+ * This symbol, if defined, indicates to the C program that struct passwd
+ * contains pw_gecos.
+ */
+/* PWPASSWD:
+ * This symbol, if defined, indicates to the C program that struct passwd
+ * contains pw_passwd.
+ */
+/* HAS_SETPWENT:
+ * This symbol, if defined, indicates that the getpwrent routine is
+ * available for initializing sequential access of the passwd database.
+ */
+/* HAS_GETPWENT:
+ * This symbol, if defined, indicates that the getpwent routine is
+ * available for sequential access of the password database.
+ */
+/* HAS_ENDPWENT:
+ * This symbol, if defined, indicates that the getpwent routine is
+ * available for finalizing sequential access of the passwd database.
+ */
+/*#define I_PWD /**/
+/*#define PWQUOTA /**/
+/*#define PWAGE /**/
+/*#define PWCHANGE /**/
+/*#define PWCLASS /**/
+/*#define PWEXPIRE /**/
+/*#define PWCOMMENT /**/
+/*#define PWGECOS /**/
+/*#define PWPASSWD /**/
+/*#define HAS_SETPWENT /**/
+/*#define HAS_GETPWENT /**/
+/*#define HAS_ENDPWENT /**/
/* Free_t:
* This variable contains the return type of free(). It is usually
@@ -1656,43 +1760,6 @@
*/
/*#define MYMALLOC /**/
-/* OLDARCHLIB:
- * This variable, if defined, holds the name of the directory in
- * which the user has perl5.000 or perl5.001 architecture-dependent
- * public library files for perl5. For the most part, these
- * files will work with 5.002 (and later), but that is not
- * guaranteed.
- */
-/* OLDARCHLIB_EXP:
- * This symbol contains the ~name expanded version of OLDARCHLIB, to be
- * used in programs that are not prepared to deal with ~ expansion at
- * run-time.
- */
-/*#define OLDARCHLIB "" /**/
-/*#define OLDARCHLIB_EXP "" /**/
-
-/* PRIVLIB:
- * This symbol contains the name of the private library for this package.
- * The library is private in the sense that it needn't be in anyone's
- * execution path, but it should be accessible by the world. The program
- * should be prepared to do ~ expansion.
- */
-/* PRIVLIB_EXP:
- * 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\\lib" /**/
-#define PRIVLIB_EXP "c:\\perl\\lib" /**/
-
-/* SH_PATH:
- * This symbol contains the full pathname to the shell used on this
- * on this system to execute Bourne shell scripts. Usually, this will be
- * /bin/sh, though it's possible that some systems will have /bin/ksh,
- * /bin/pdksh, /bin/ash, /bin/bash, or even something such as
- * D:/bin/sh.exe.
- */
-#define SH_PATH "cmd.exe" /**/
-
/* SIG_NAME:
* This symbol contains a list of signal names in order of
* signal number. This is intended
@@ -1721,8 +1788,95 @@
* The last element is 0, corresponding to the 0 at the end of
* the sig_name list.
*/
-#define 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",0 /**/
-#define 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,0 /**/
+#define SIG_NAME "ZERO", "INT", "QUIT", "ILL", "FPE", "KILL", "SEGV", "PIPE", "ALRM", "TERM", "USR1", "USR2", "CHLD", "USR3", "BREAK", "ABRT", "STOP", "CONT", "CLD", 0 /**/
+#define SIG_NUM 0, 2, 3, 4, 8, 9, 11, 13, 14, 15, 16, 17, 18, 20, 21, 22, 23, 25, 18, 0 /**/
+
+/* VOIDFLAGS:
+ * This symbol indicates how much support of the void type is given by this
+ * compiler. What various bits mean:
+ *
+ * 1 = supports declaration of void
+ * 2 = supports arrays of pointers to functions returning void
+ * 4 = supports comparisons between pointers to void functions and
+ * addresses of void functions
+ * 8 = suports declaration of generic void pointers
+ *
+ * The package designer should define VOIDUSED to indicate the requirements
+ * of the package. This can be done either by #defining VOIDUSED before
+ * including config.h, or by defining defvoidused in Myinit.U. If the
+ * latter approach is taken, only those flags will be tested. If the
+ * level of void support necessary is not present, defines void to int.
+ */
+#ifndef VOIDUSED
+#define VOIDUSED 15
+#endif
+#define VOIDFLAGS 15
+#if (VOIDFLAGS & VOIDUSED) != VOIDUSED
+#define void int /* is void to be avoided? */
+#define M_VOID /* Xenix strikes again */
+#endif
+
+/* ARCHLIB:
+ * This variable, if defined, holds the name of the directory in
+ * which the user wants to put architecture-dependent public
+ * library files for perl5. It is most often a local directory
+ * such as /usr/local/lib. Programs using this variable must be
+ * prepared to deal with filename expansion. If ARCHLIB is the
+ * same as PRIVLIB, it is not defined, since presumably the
+ * program already searches PRIVLIB.
+ */
+/* ARCHLIB_EXP:
+ * 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.00503\\lib\\MSWin32-x86" /**/
+/*#define ARCHLIB_EXP "" /**/
+
+/* DLSYM_NEEDS_UNDERSCORE:
+ * This symbol, if defined, indicates that we need to prepend an
+ * underscore to the symbol name before calling dlsym(). This only
+ * makes sense if you *have* dlsym, which we will presume is the
+ * case if you're using dl_dlopen.xs.
+ */
+/*#define DLSYM_NEEDS_UNDERSCORE /**/
+
+/* USE_SFIO:
+ * This symbol, if defined, indicates that sfio should
+ * be used.
+ */
+/*#define USE_SFIO /**/
+
+/* USE_DYNAMIC_LOADING:
+ * This symbol, if defined, indicates that dynamic loading of
+ * some sort is available.
+ */
+#define USE_DYNAMIC_LOADING /**/
+
+/* DB_Prefix_t:
+ * This symbol contains the type of the prefix structure element
+ * in the <db.h> header file. In older versions of DB, it was
+ * int, while in newer ones it is u_int32_t.
+ */
+/* DB_Hash_t:
+ * This symbol contains the type of the prefix structure element
+ * in the <db.h> header file. In older versions of DB, it was
+ * int, while in newer ones it is size_t.
+ */
+#define DB_Hash_t int /**/
+#define DB_Prefix_t int /**/
+
+/* PRIVLIB:
+ * This symbol contains the name of the private library for this package.
+ * The library is private in the sense that it needn't be in anyone's
+ * execution path, but it should be accessible by the world. The program
+ * should be prepared to do ~ expansion.
+ */
+/* PRIVLIB_EXP:
+ * 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.00503\\lib" /**/
+#define PRIVLIB_EXP (win32_get_privlib("5.00503")) /**/
/* SITEARCH:
* This symbol contains the name of the private library for this package.
@@ -1737,8 +1891,8 @@
* 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\\lib\\site" /**/
-#define SITEARCH_EXP "c:\\perl\\lib\\site" /**/
+#define SITEARCH "c:\\perl\\site\\5.00503\\lib\\MSWin32-x86" /**/
+/*#define SITEARCH_EXP "" /**/
/* SITELIB:
* This symbol contains the name of the private library for this package.
@@ -1753,15 +1907,15 @@
* This symbol contains the ~name expanded version of SITELIB, to be used
* in programs that are not prepared to deal with ~ expansion at run-time.
*/
-#define SITELIB "c:\\perl\\lib\\site" /**/
-#define SITELIB_EXP "c:\\perl\\lib\\site" /**/
+#define SITELIB "c:\\perl\\site\\5.00503\\lib" /**/
+#define SITELIB_EXP (win32_get_sitelib("5.00503")) /**/
/* STARTPERL:
* This variable contains the string to put in front of a perl
* script to make sure (one hopes) that it runs with perl and not
* some shell.
*/
-#define STARTPERL "#perl" /**/
+#define STARTPERL "#!perl" /**/
/* USE_PERLIO:
* This symbol, if defined, indicates that the PerlIO abstraction should
@@ -1770,33 +1924,171 @@
*/
/*#define USE_PERLIO /**/
-/* VOIDFLAGS:
- * This symbol indicates how much support of the void type is given by this
- * compiler. What various bits mean:
- *
- * 1 = supports declaration of void
- * 2 = supports arrays of pointers to functions returning void
- * 4 = supports comparisons between pointers to void functions and
- * addresses of void functions
- * 8 = suports declaration of generic void pointers
- *
- * The package designer should define VOIDUSED to indicate the requirements
- * of the package. This can be done either by #defining VOIDUSED before
- * including config.h, or by defining defvoidused in Myinit.U. If the
- * latter approach is taken, only those flags will be tested. If the
- * level of void support necessary is not present, defines void to int.
+/* HAS_GETHOST_PROTOS:
+ * This symbol, if defined, indicates that <netdb.h> includes
+ * prototypes for gethostent(), gethostbyname(), and
+ * gethostbyaddr(). Otherwise, it is up to the program to guess
+ * them. See netdbtype.U for probing for various Netdb_xxx_t types.
*/
-#ifndef VOIDUSED
-#define VOIDUSED 15
-#endif
-#define VOIDFLAGS 15
-#if (VOIDFLAGS & VOIDUSED) != VOIDUSED
-#define void int /* is void to be avoided? */
-#define M_VOID /* Xenix strikes again */
-#endif
+#define HAS_GETHOST_PROTOS /**/
+
+/* HAS_GETNET_PROTOS:
+ * This symbol, if defined, indicates that <netdb.h> includes
+ * prototypes for getnetent(), getnetbyname(), and
+ * getnetbyaddr(). Otherwise, it is up to the program to guess
+ * them. See netdbtype.U for probing for various Netdb_xxx_t types.
+ */
+/*#define HAS_GETNET_PROTOS /**/
+
+/* HAS_GETPROTO_PROTOS:
+ * This symbol, if defined, indicates that <netdb.h> includes
+ * prototypes for getprotoent(), getprotobyname(), and
+ * getprotobyaddr(). Otherwise, it is up to the program to guess
+ * them. See netdbtype.U for probing for various Netdb_xxx_t types.
+ */
+#define HAS_GETPROTO_PROTOS /**/
+
+/* HAS_GETSERV_PROTOS:
+ * This symbol, if defined, indicates that <netdb.h> includes
+ * prototypes for getservent(), getservbyname(), and
+ * getservbyaddr(). Otherwise, it is up to the program to guess
+ * them. See netdbtype.U for probing for various Netdb_xxx_t types.
+ */
+#define HAS_GETSERV_PROTOS /**/
+
+/* Netdb_host_t:
+ * This symbol holds the type used for the 1st argument
+ * to gethostbyaddr().
+ */
+/* Netdb_hlen_t:
+ * This symbol holds the type used for the 2nd argument
+ * to gethostbyaddr().
+ */
+/* Netdb_name_t:
+ * This symbol holds the type used for the argument to
+ * gethostbyname().
+ */
+/* Netdb_net_t:
+ * This symbol holds the type used for the 1st argument to
+ * getnetbyaddr().
+ */
+#define Netdb_host_t char * /**/
+#define Netdb_hlen_t int /**/
+#define Netdb_name_t char * /**/
+#define Netdb_net_t long /**/
+
+/* Select_fd_set_t:
+ * This symbol holds the type used for the 2nd, 3rd, and 4th
+ * arguments to select. Usually, this is 'fd_set *', if HAS_FD_SET
+ * is defined, and 'int *' otherwise. This is only useful if you
+ * have select(), of course.
+ */
+#define Select_fd_set_t Perl_fd_set * /**/
+
+/* ARCHNAME:
+ * This symbol holds a string representing the architecture name.
+ * It may be used to construct an architecture-dependant pathname
+ * where library files may be held under a private library, for
+ * instance.
+ */
+#define ARCHNAME "MSWin32-x86" /**/
+
+/* HAS_PTHREAD_YIELD:
+ * This symbol, if defined, indicates that the pthread_yield
+ * routine is available to yield the execution of the current
+ * thread.
+ */
+/* HAS_SCHED_YIELD:
+ * This symbol, if defined, indicates that the sched_yield
+ * routine is available to yield the execution of the current
+ * thread.
+ */
+/*#define HAS_PTHREAD_YIELD /**/
+/*#define HAS_SCHED_YIELD /**/
+
+/* PTHREADS_CREATED_JOINABLE:
+ * This symbol, if defined, indicates that pthreads are created
+ * in the joinable (aka undetached) state.
+ */
+/*#define PTHREADS_CREATED_JOINABLE /**/
+
+/* USE_THREADS:
+ * This symbol, if defined, indicates that Perl should
+ * be built to use threads.
+ */
+/* OLD_PTHREADS_API:
+ * This symbol, if defined, indicates that Perl should
+ * be built to use the old draft POSIX threads API.
+ */
+/*#define USE_THREADS /**/
+/*#define OLD_PTHREADS_API /**/
+
+/* Time_t:
+ * This symbol holds the type returned by time(). It can be long,
+ * or time_t on BSD sites (in which case <sys/types.h> should be
+ * included).
+ */
+#define Time_t time_t /* Time type */
+
+/* HAS_TIMES:
+ * This symbol, if defined, indicates that the times() routine exists.
+ * Note that this became obsolete on some systems (SUNOS), which now
+ * use getrusage(). It may be necessary to include <sys/times.h>.
+ */
+#define HAS_TIMES /**/
+
+/* Fpos_t:
+ * This symbol holds the type used to declare file positions in libc.
+ * It can be fpos_t, long, uint, etc... It may be necessary to include
+ * <sys/types.h> to get any typedef'ed information.
+ */
+#define Fpos_t fpos_t /* File position type */
+
+/* Gid_t:
+ * This symbol holds the return type of getgid() and the type of
+ * argument to setrgid() and related functions. Typically,
+ * it is the type of group ids in the kernel. It can be int, ushort,
+ * uid_t, etc... It may be necessary to include <sys/types.h> to get
+ * any typedef'ed information.
+ */
+#define Gid_t gid_t /* Type for getgid(), etc... */
+
+/* Off_t:
+ * This symbol holds the type used to declare offsets in the kernel.
+ * It can be int, long, off_t, etc... It may be necessary to include
+ * <sys/types.h> to get any typedef'ed information.
+ */
+#define Off_t off_t /* <offset> type */
+
+/* Mode_t:
+ * This symbol holds the type used to declare file modes
+ * for systems calls. It is usually mode_t, but may be
+ * int or unsigned short. It may be necessary to include <sys/types.h>
+ * to get any typedef'ed information.
+ */
+#define Mode_t mode_t /* file mode parameter for system calls */
+
+/* Pid_t:
+ * This symbol holds the type used to declare process ids in the kernel.
+ * It can be int, uint, pid_t, etc... It may be necessary to include
+ * <sys/types.h> to get any typedef'ed information.
+ */
+#define Pid_t int /* PID type */
+
+/* Size_t:
+ * This symbol holds the type used to declare length parameters
+ * for string functions. It is usually size_t, but may be
+ * unsigned long, int, etc. It may be necessary to include
+ * <sys/types.h> to get any typedef'ed information.
+ */
+#define Size_t size_t /* length paramater for string functions */
+
+/* Uid_t:
+ * This symbol holds the type used to declare user ids in the kernel.
+ * It can be int, ushort, uid_t, etc... It may be necessary to include
+ * <sys/types.h> to get any typedef'ed information.
+ */
+#define Uid_t uid_t /* UID type */
#endif
#include <win32.h>
-#ifndef DEBUGGING
-#define DEBUGGING
-#endif
diff --git a/gnu/usr.bin/perl/win32/config_H.vc b/gnu/usr.bin/perl/win32/config_H.vc
index 76f19f1d872..d239d246ba6 100644
--- a/gnu/usr.bin/perl/win32/config_H.vc
+++ b/gnu/usr.bin/perl/win32/config_H.vc
@@ -7,51 +7,24 @@
* that running config_h.SH again will wipe out any changes you've made.
* For a more permanent change edit config.sh and rerun config_h.SH.
*
- * $Id: Config_h.U,v 3.0.1.4 1995/09/25 09:10:49 ram Exp $
+ * $Id: Config_h.U,v 3.0.1.5 1997/02/28 14:57:43 ram Exp $
*/
-/* Configuration time: Thu Apr 11 06:20:49 PDT 1996
- * Configured by: garyng
- * Target system:
+/*
+ * Package name : perl5
+ * Source directory :
+ * Configuration time: undef
+ * Configured by : gsar
+ * Target system :
*/
#ifndef _config_h_
#define _config_h_
-/* MEM_ALIGNBYTES:
- * This symbol contains the number of bytes required to align a
- * double. Usual values are 2, 4 and 8.
- * On NeXT starting with 3.2, you can build "Fat" Multiple Architecture
- * Binaries (MAB) for targets with varying alignment. This only matters
- * for perl, where the config.h can be generated and installed on one
- * system, and used by a different architecture to build an extension.
- * The default is eight, for safety.
- */
-#ifndef NeXT
-#define MEM_ALIGNBYTES 8 /**/
-#else /* NeXT */
-#ifdef __m68k__
-#define MEM_ALIGNBYTES 2
-#else
-#ifdef __i386__
-#define MEM_ALIGNBYTES 4
-#else /* __hppa__, __sparc__ and default for unknown architectures */
-#define MEM_ALIGNBYTES 8
-#endif /* __i386__ */
-#endif /* __m68k__ */
-#endif /* NeXT */
-
-/* ARCHNAME:
- * This symbol holds a string representing the architecture name.
- * It may be used to construct an architecture-dependant pathname
- * where library files may be held under a private library, for
- * instance.
+/* LOC_SED:
+ * This symbol holds the complete pathname to the sed program.
*/
-#ifdef _ALPHA_
-#define ARCHNAME "alpha-mswin32" /**/
-#else
-#define ARCHNAME "x86-mswin32" /**/
-#endif
+#define LOC_SED "" /**/
/* BIN:
* This symbol holds the path of the bin directory where the package will
@@ -61,38 +34,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\\bin" /**/
-#define BIN_EXP "c:\\perl\\bin" /**/
-
-/* CAT2:
- * This macro catenates 2 tokens together.
- */
-/* STRINGIFY:
- * This macro surrounds its token with double quotes.
- */
-#if 42 == 1
-#define CAT2(a,b)a/**/b
-#define CAT3(a,b,c)a/**/b/**/c
-#define CAT4(a,b,c,d)a/**/b/**/c/**/d
-#define CAT5(a,b,c,d,e)a/**/b/**/c/**/d/**/e
-#define STRINGIFY(a)"a"
- /* If you can get stringification with catify, tell me how! */
-#endif
-#if 42 == 42
-#define CAT2(a,b)a ## b
-#define CAT3(a,b,c)a ## b ## c
-#define CAT4(a,b,c,d)a ## b ## c ## d
-#define CAT5(a,b,c,d,e)a ## b ## c ## d ## e
-#define StGiFy(a)# a
-#define STRINGIFY(a)StGiFy(a)
-#define SCAT2(a,b)StGiFy(a) StGiFy(b)
-#define SCAT3(a,b,c)StGiFy(a) StGiFy(b) StGiFy(c)
-#define SCAT4(a,b,c,d)StGiFy(a) StGiFy(b) StGiFy(c) StGiFy(d)
-#define SCAT5(a,b,c,d,e)StGiFy(a) StGiFy(b) StGiFy(c) StGiFy(d) StGiFy(e)
-#endif
-#ifndef CAT2
-#include "Bletch: How does this C preprocessor catenate tokens?"
-#endif
+#define BIN "c:\\perl\\5.00503\\bin\\MSWin32-x86" /**/
+#define BIN_EXP "c:\\perl\\5.00503\\bin\\MSWin32-x86" /**/
/* CPPSTDIN:
* This symbol contains the first part of the string which will invoke
@@ -106,7 +49,7 @@
* output. This symbol will have the value "-" if CPPSTDIN needs a minus
* to specify standard input, otherwise the value is "".
*/
-#define CPPSTDIN "cl -E"
+#define CPPSTDIN "cl -nologo -E"
#define CPPMINUS ""
/* HAS_ALARM:
@@ -142,27 +85,6 @@
*/
/*#define HAS_BZERO /**/
-/* CASTI32:
- * This symbol is defined if the C compiler can cast negative
- * or large floating point numbers to 32-bit ints.
- */
-#define CASTI32 /**/
-
-/* CASTNEGFLOAT:
- * This symbol is defined if the C compiler can cast negative
- * numbers to unsigned longs, ints and shorts.
- */
-/* CASTFLAGS:
- * This symbol contains flags that say what difficulties the compiler
- * has casting odd floating values to unsigned long:
- * 0 = ok
- * 1 = couldn't cast < 0
- * 2 = couldn't cast >= 0x80000000
- * 4 = couldn't cast in argument expression list
- */
-#define CASTNEGFLOAT /**/
-#define CASTFLAGS 0 /**/
-
/* HAS_CHOWN:
* This symbol, if defined, indicates that the chown routine is
* available.
@@ -181,12 +103,6 @@
*/
#define HAS_CHSIZE /**/
-/* VOID_CLOSEDIR:
- * This symbol, if defined, indicates that the closedir() routine
- * does not return a value.
- */
-/*#define VOID_CLOSEDIR /**/
-
/* HASCONST:
* This symbol, if defined, indicates that this C compiler knows about
* the const type. There is no need to actually test for that symbol
@@ -231,6 +147,26 @@
*/
#define HAS_DLERROR /**/
+/* SETUID_SCRIPTS_ARE_SECURE_NOW:
+ * This symbol, if defined, indicates that the bug that prevents
+ * setuid scripts from being secure is not present in this kernel.
+ */
+/* DOSUID:
+ * This symbol, if defined, indicates that the C program should
+ * check the script that it is executing for setuid/setgid bits, and
+ * attempt to emulate setuid/setgid on systems that have disabled
+ * setuid #! scripts because the kernel can't do it securely.
+ * It is up to the package designer to make sure that this emulation
+ * is done securely. Among other things, it should do an fstat on
+ * the script it just opened to make sure it really is a setuid/setgid
+ * script, it should make sure the arguments passed correspond exactly
+ * to the argument on the #! line, and it should not trust any
+ * subprocesses to which it must pass the filename rather than the
+ * file descriptor of the script to be executed.
+ */
+/*#define SETUID_SCRIPTS_ARE_SECURE_NOW /**/
+/*#define DOSUID /**/
+
/* HAS_DUP2:
* This symbol, if defined, indicates that the dup2 routine is
* available to duplicate file descriptors.
@@ -301,19 +237,7 @@
* available to get the list of process groups. If unavailable, multiple
* groups are probably not supported.
*/
-/* HAS_SETGROUPS:
- * This symbol, if defined, indicates that the setgroups() routine is
- * available to set the list of process groups. If unavailable, multiple
- * groups are probably not supported.
- */
/*#define HAS_GETGROUPS /**/
-/*#define HAS_SETGROUPS /**/
-
-/* HAS_GETHOSTENT:
- * This symbol, if defined, indicates that the gethostent routine is
- * available to lookup host names in some data base or other.
- */
-/*#define HAS_GETHOSTENT /**/
/* HAS_UNAME:
* This symbol, if defined, indicates that the C program may use the
@@ -326,7 +250,25 @@
* This symbol, if defined, indicates that the getlogin routine is
* available to get the login name.
*/
-/*#define HAS_GETLOGIN /**/
+#define HAS_GETLOGIN /**/
+
+/* HAS_GETPGID:
+ * This symbol, if defined, indicates to the C program that
+ * the getpgid(pid) function is available to get the
+ * process group id.
+ */
+/*#define HAS_GETPGID /**/
+
+/* HAS_GETPGRP:
+ * This symbol, if defined, indicates that the getpgrp routine is
+ * available to get the current process group.
+ */
+/* USE_BSD_GETPGRP:
+ * This symbol, if defined, indicates that getpgrp needs one
+ * arguments whereas USG one needs none.
+ */
+/*#define HAS_GETPGRP /**/
+/*#define USE_BSD_GETPGRP /**/
/* HAS_GETPGRP2:
* This symbol, if defined, indicates that the getpgrp2() (as in DG/UX)
@@ -371,11 +313,12 @@
#define HAS_NTOHL /**/
#define HAS_NTOHS /**/
-/* HAS_ISASCII:
- * This manifest constant lets the C program know that isascii
- * is available.
+/* HAS_INET_ATON:
+ * This symbol, if defined, indicates to the C program that the
+ * inet_aton() function is available to parse IP address "dotted-quad"
+ * strings.
*/
-#define HAS_ISASCII /**/
+/*#define HAS_INET_ATON /**/
/* HAS_KILLPG:
* This symbol, if defined, indicates that the killpg routine is available
@@ -485,12 +428,6 @@
*/
/*#define HAS_NICE /**/
-/* HAS_OPEN3:
- * This manifest constant lets the C program know that the three
- * argument form of open(2) is available.
- */
-/*#define HAS_OPEN3 /**/
-
/* HAS_PATHCONF:
* This symbol, if defined, indicates that pathconf() is available
* to determine file-system related limits and options associated
@@ -518,7 +455,8 @@
/* HAS_POLL:
* This symbol, if defined, indicates that the poll routine is
- * available to poll active file descriptors.
+ * available to poll active file descriptors. You may safely
+ * include <poll.h> when this symbol is defined.
*/
/*#define HAS_POLL /**/
@@ -567,29 +505,6 @@
*/
#define HAS_RMDIR /**/
-/* HAS_SAFE_BCOPY:
- * This symbol, if defined, indicates that the bcopy routine is available
- * to copy potentially overlapping memory blocks. Otherwise you should
- * probably use memmove() or memcpy(). If neither is defined, roll your
- * own version.
- */
-/*#define HAS_SAFE_BCOPY /**/
-
-/* HAS_SAFE_MEMCPY:
- * This symbol, if defined, indicates that the memcpy routine is available
- * to copy potentially overlapping memory blocks. Otherwise you should
- * probably use memmove() or memcpy(). If neither is defined, roll your
- * own version.
- */
-/*#define HAS_SAFE_MEMCPY /**/
-
-/* HAS_SANE_MEMCMP:
- * This symbol, if defined, indicates that the memcmp routine is available
- * and can be used to compare relative magnitudes of chars with their high
- * bits set. If it is not defined, roll your own version.
- */
-#define HAS_SANE_MEMCMP /**/
-
/* HAS_SELECT:
* This symbol, if defined, indicates that the select routine is
* available to select active file descriptors. If the timeout field
@@ -628,6 +543,24 @@
*/
#define HAS_SETLOCALE /**/
+/* HAS_SETPGID:
+ * This symbol, if defined, indicates that the setpgid(pid, gpid)
+ * routine is available to set process group ID.
+ */
+/*#define HAS_SETPGID /**/
+
+/* HAS_SETPGRP:
+ * This symbol, if defined, indicates that the setpgrp routine is
+ * available to set the current process group.
+ */
+/* USE_BSD_SETPGRP:
+ * This symbol, if defined, indicates that setpgrp needs two
+ * arguments whereas USG one needs none. See also HAS_SETPGID
+ * for a POSIX interface.
+ */
+/*#define HAS_SETPGRP /**/
+/*#define USE_BSD_SETPGRP /**/
+
/* HAS_SETPGRP2:
* This symbol, if defined, indicates that the setpgrp2() (as in DG/UX)
* routine is available to set the current process group.
@@ -704,88 +637,12 @@
#define Shmat_t void * /**/
/*#define HAS_SHMAT_PROTOTYPE /**/
-/* HAS_SIGACTION:
- * This symbol, if defined, indicates that Vr4's sigaction() routine
- * is available.
- */
-/*#define HAS_SIGACTION /**/
-
-/* HAS_SOCKET:
- * This symbol, if defined, indicates that the BSD socket interface is
- * supported.
- */
-/* HAS_SOCKETPAIR:
- * This symbol, if defined, indicates that the BSD socketpair() call is
- * supported.
- */
-#define HAS_SOCKET /**/
-/*#define HAS_SOCKETPAIR /**/
-
/* USE_STAT_BLOCKS:
* This symbol is defined if this system has a stat structure declaring
* st_blksize and st_blocks.
*/
/*#define USE_STAT_BLOCKS /**/
-/* USE_STDIO_PTR:
- * This symbol is defined if the _ptr and _cnt fields (or similar)
- * of the stdio FILE structure can be used to access the stdio buffer
- * for a file handle. If this is defined, then the FILE_ptr(fp)
- * and FILE_cnt(fp) macros will also be defined and should be used
- * to access these fields.
- */
-/* FILE_ptr:
- * This macro is used to access the _ptr field (or equivalent) of the
- * FILE structure pointed to by its argument. This macro will always be
- * defined if USE_STDIO_PTR is defined.
- */
-/* STDIO_PTR_LVALUE:
- * This symbol is defined if the FILE_ptr macro can be used as an
- * lvalue.
- */
-/* FILE_cnt:
- * This macro is used to access the _cnt field (or equivalent) of the
- * FILE structure pointed to by its argument. This macro will always be
- * defined if USE_STDIO_PTR is defined.
- */
-/* STDIO_CNT_LVALUE:
- * This symbol is defined if the FILE_cnt macro can be used as an
- * lvalue.
- */
-#define USE_STDIO_PTR /**/
-#ifdef USE_STDIO_PTR
-#define FILE_ptr(fp) ((fp)->_ptr)
-#define STDIO_PTR_LVALUE /**/
-#define FILE_cnt(fp) ((fp)->_cnt)
-#define STDIO_CNT_LVALUE /**/
-#endif
-
-/* USE_STDIO_BASE:
- * This symbol is defined if the _base field (or similar) of the
- * stdio FILE structure can be used to access the stdio buffer for
- * a file handle. If this is defined, then the FILE_base(fp) macro
- * will also be defined and should be used to access this field.
- * Also, the FILE_bufsiz(fp) macro will be defined and should be used
- * to determine the number of bytes in the buffer. USE_STDIO_BASE
- * will never be defined unless USE_STDIO_PTR is.
- */
-/* FILE_base:
- * This macro is used to access the _base field (or equivalent) of the
- * FILE structure pointed to by its argument. This macro will always be
- * defined if USE_STDIO_BASE is defined.
- */
-/* FILE_bufsiz:
- * This macro is used to determine the number of bytes in the I/O
- * buffer pointed to by _base field (or equivalent) of the FILE
- * structure pointed to its argument. This macro will always be defined
- * if USE_STDIO_BASE is defined.
- */
-#define USE_STDIO_BASE /**/
-#ifdef USE_STDIO_BASE
-#define FILE_base(fp) ((fp)->_base)
-#define FILE_bufsiz(fp) ((fp)->_cnt + (fp)->_ptr - (fp)->_base)
-#endif
-
/* HAS_STRCHR:
* This symbol is defined to indicate that the strchr()/strrchr()
* functions are available for string searching. If not, try the
@@ -890,20 +747,6 @@
*/
/*#define HAS_TCSETPGRP /**/
-/* Time_t:
- * This symbol holds the type returned by time(). It can be long,
- * or time_t on BSD sites (in which case <sys/types.h> should be
- * included).
- */
-#define Time_t time_t /* Time type */
-
-/* HAS_TIMES:
- * This symbol, if defined, indicates that the times() routine exists.
- * Note that this became obsolete on some systems (SUNOS), which now
- * use getrusage(). It may be necessary to include <sys/times.h>.
- */
-#define HAS_TIMES /**/
-
/* HAS_TRUNCATE:
* This symbol, if defined, indicates that the truncate routine is
* available to truncate files.
@@ -927,14 +770,6 @@
*/
/*#define HAS_VFORK /**/
-/* Signal_t:
- * This symbol's value is either "void" or "int", corresponding to the
- * appropriate return type of a signal handler. Thus, you can declare
- * a signal handler using "Signal_t (*handler)()", and define the
- * handler using "Signal_t handler(sig)".
- */
-#define Signal_t void /* Signal handler's return type */
-
/* HASVOLATILE:
* This symbol, if defined, indicates that this C compiler knows about
* the volatile declaration.
@@ -944,20 +779,6 @@
#define volatile
#endif
-/* HAS_VPRINTF:
- * This symbol, if defined, indicates that the vprintf routine is available
- * to printf with a pointer to an argument list. If unavailable, you
- * may need to write your own, probably in terms of _doprnt().
- */
-/* USE_CHAR_VSPRINTF:
- * This symbol is defined if this system has vsprintf() returning type
- * (char*). The trend seems to be to declare it as "int vsprintf()". It
- * is up to the package author to declare vsprintf correctly based on the
- * symbol.
- */
-#define HAS_VPRINTF /**/
-/*#define USE_CHAR_VSPRINTF /**/
-
/* HAS_WAIT4:
* This symbol, if defined, indicates that wait4() exists.
*/
@@ -967,7 +788,7 @@
* This symbol, if defined, indicates that the waitpid routine is
* available to wait for child process.
*/
-/*#define HAS_WAITPID /**/
+#define HAS_WAITPID /**/
/* HAS_WCSTOMBS:
* This symbol, if defined, indicates that the wcstombs routine is
@@ -981,46 +802,22 @@
*/
#define HAS_WCTOMB /**/
-/* Fpos_t:
- * This symbol holds the type used to declare file positions in libc.
- * It can be fpos_t, long, uint, etc... It may be necessary to include
- * <sys/types.h> to get any typedef'ed information.
- */
-#define Fpos_t fpos_t /* File position type */
-
-/* Gid_t:
- * This symbol holds the return type of getgid() and the type of
- * argument to setrgid() and related functions. Typically,
- * it is the type of group ids in the kernel. It can be int, ushort,
- * uid_t, etc... It may be necessary to include <sys/types.h> to get
- * any typedef'ed information.
- */
-#define Gid_t gid_t /* Type for getgid(), etc... */
-
-/* Groups_t:
- * This symbol holds the type used for the second argument to
- * [gs]etgroups(). Usually, this is the same of gidtype, but
- * sometimes it isn't. It can be int, ushort, uid_t, etc...
- * It may be necessary to include <sys/types.h> to get any
- * typedef'ed information. This is only required if you have
- * getgroups() or setgroups().
+/* I_ARPA_INET:
+ * This symbol, if defined, indicates that <arpa/inet.h> exists and should
+ * be included.
*/
-#if defined(HAS_GETGROUPS) || defined(HAS_SETGROUPS)
-#define Groups_t gid_t /* Type for 2nd arg to [gs]etgroups() */
-#endif
+/*#define I_ARPA_INET /**/
-/* DB_Prefix_t:
- * This symbol contains the type of the prefix structure element
- * in the <db.h> header file. In older versions of DB, it was
- * int, while in newer ones it is u_int32_t.
+/* I_DBM:
+ * This symbol, if defined, indicates that <dbm.h> exists and should
+ * be included.
*/
-/* DB_Hash_t:
- * This symbol contains the type of the prefix structure element
- * in the <db.h> header file. In older versions of DB, it was
- * int, while in newer ones it is size_t.
+/* I_RPCSVC_DBM:
+ * This symbol, if defined, indicates that <rpcsvc/dbm.h> exists and
+ * should be included.
*/
-#define DB_Hash_t int /**/
-#define DB_Prefix_t int /**/
+/*#define I_DBM /**/
+#define I_RPCSVC_DBM /**/
/* I_DIRENT:
* This symbol, if defined, indicates to the C program that it should
@@ -1064,7 +861,27 @@
* This symbol, if defined, indicates to the C program that it should
* include <grp.h>.
*/
-#define I_GRP /**/
+/* GRPASSWD:
+ * This symbol, if defined, indicates to the C program that struct group
+ * contains gr_passwd.
+ */
+/* HAS_SETGRENT:
+ * This symbol, if defined, indicates that the getgrent routine is
+ * available for initializing sequential access of the group database.
+ */
+/* HAS_GETGRENT:
+ * This symbol, if defined, indicates that the getgrent routine is
+ * available for sequential access of the group database.
+ */
+/* HAS_ENDGRENT:
+ * This symbol, if defined, indicates that the getgrent routine is
+ * available for finalizing sequential access of the group database.
+ */
+/*#define I_GRP /**/
+/*#define GRPASSWD /**/
+/*#define HAS_SETGRENT /**/
+/*#define HAS_GETGRENT /**/
+/*#define HAS_ENDGRENT /**/
/* I_LIMITS:
* This symbol, if defined, indicates to the C program that it should
@@ -1073,6 +890,12 @@
*/
#define I_LIMITS /**/
+/* I_LOCALE:
+ * This symbol, if defined, indicates to the C program that it should
+ * include <locale.h>.
+ */
+#define I_LOCALE /**/
+
/* I_MATH:
* This symbol, if defined, indicates to the C program that it should
* include <math.h>.
@@ -1103,41 +926,11 @@
*/
/*#define I_NETINET_IN /**/
-/* I_PWD:
+/* I_SFIO:
* This symbol, if defined, indicates to the C program that it should
- * include <pwd.h>.
- */
-/* PWQUOTA:
- * This symbol, if defined, indicates to the C program that struct passwd
- * contains pw_quota.
- */
-/* PWAGE:
- * This symbol, if defined, indicates to the C program that struct passwd
- * contains pw_age.
- */
-/* PWCHANGE:
- * This symbol, if defined, indicates to the C program that struct passwd
- * contains pw_change.
- */
-/* PWCLASS:
- * This symbol, if defined, indicates to the C program that struct passwd
- * contains pw_class.
- */
-/* PWEXPIRE:
- * This symbol, if defined, indicates to the C program that struct passwd
- * contains pw_expire.
- */
-/* PWCOMMENT:
- * This symbol, if defined, indicates to the C program that struct passwd
- * contains pw_comment.
+ * include <sfio.h>.
*/
-/*#define I_PWD /**/
-/*#define PWQUOTA /**/
-/*#define PWAGE /**/
-/*#define PWCHANGE /**/
-/*#define PWCLASS /**/
-/*#define PWEXPIRE /**/
-/*#define PWCOMMENT /**/
+/*#define I_SFIO /**/
/* I_STDDEF:
* This symbol, if defined, indicates that <stddef.h> exists and should
@@ -1199,6 +992,12 @@
*/
/*#define I_SYS_SELECT /**/
+/* I_SYS_STAT:
+ * This symbol, if defined, indicates to the C program that it should
+ * include <sys/stat.h>.
+ */
+#define I_SYS_STAT /**/
+
/* I_SYS_TIMES:
* This symbol, if defined, indicates to the C program that it should
* include <sys/times.h>.
@@ -1243,22 +1042,6 @@
/*#define I_TERMIOS /**/
/*#define I_SGTTY /**/
-/* I_TIME:
- * This symbol, if defined, indicates to the C program that it should
- * include <time.h>.
- */
-/* I_SYS_TIME:
- * This symbol, if defined, indicates to the C program that it should
- * include <sys/time.h>.
- */
-/* I_SYS_TIME_KERNEL:
- * This symbol, if defined, indicates to the C program that it should
- * include <sys/time.h> with KERNEL defined.
- */
-#define I_TIME /**/
-/*#define I_SYS_TIME /**/
-/*#define I_SYS_TIME_KERNEL /**/
-
/* I_UNISTD:
* This symbol, if defined, indicates to the C program that it should
* include <unistd.h>.
@@ -1271,6 +1054,14 @@
*/
#define I_UTIME /**/
+/* I_VALUES:
+ * This symbol, if defined, indicates to the C program that it should
+ * include <values.h> to get definition of symbols like MINFLOAT or
+ * MAXLONG, i.e. machine dependant limitations. Probably, you
+ * should use <limits.h> instead, if it is available.
+ */
+/*#define I_VALUES /**/
+
/* I_STDARG:
* This symbol, if defined, indicates that <stdarg.h> exists and should
* be included.
@@ -1288,64 +1079,6 @@
*/
/*#define I_VFORK /**/
-/* INTSIZE:
- * This symbol contains the value of sizeof(int) so that the C
- * preprocessor can make decisions based on it.
- */
-/* LONGSIZE:
- * This symbol contains the value of sizeof(long) so that the C
- * preprocessor can make decisions based on it.
- */
-/* SHORTSIZE:
- * This symbol contains the value of sizeof(short) so that the C
- * preprocessor can make decisions based on it.
- */
-#define INTSIZE 4 /**/
-#define LONGSIZE 4 /**/
-#define SHORTSIZE 2 /**/
-
-/* Off_t:
- * This symbol holds the type used to declare offsets in the kernel.
- * It can be int, long, off_t, etc... It may be necessary to include
- * <sys/types.h> to get any typedef'ed information.
- */
-#define Off_t off_t /* <offset> type */
-
-/* Mode_t:
- * This symbol holds the type used to declare file modes
- * for systems calls. It is usually mode_t, but may be
- * int or unsigned short. It may be necessary to include <sys/types.h>
- * to get any typedef'ed information.
- */
-#define Mode_t mode_t /* file mode parameter for system calls */
-
-/* VAL_O_NONBLOCK:
- * This symbol is to be used during open() or fcntl(F_SETFL) to turn on
- * non-blocking I/O for the file descriptor. Note that there is no way
- * back, i.e. you cannot turn it blocking again this way. If you wish to
- * alternatively switch between blocking and non-blocking, use the
- * ioctl(FIOSNBIO) call instead, but that is not supported by all devices.
- */
-/* VAL_EAGAIN:
- * This symbol holds the errno error code set by read() when no data was
- * present on the non-blocking file descriptor.
- */
-/* RD_NODATA:
- * This symbol holds the return code from read() when no data is present
- * on the non-blocking file descriptor. Be careful! If EOF_NONBLOCK is
- * not defined, then you can't distinguish between no data and EOF by
- * issuing a read(). You'll have to find another way to tell for sure!
- */
-/* EOF_NONBLOCK:
- * This symbol, if defined, indicates to the C program that a read() on
- * a non-blocking file descriptor will return 0 on EOF, and not the value
- * held in RD_NODATA (-1 usually, in that case!).
- */
-#define VAL_O_NONBLOCK O_NONBLOCK
-#define VAL_EAGAIN EAGAIN
-#define RD_NODATA -1
-#define EOF_NONBLOCK
-
/* CAN_PROTOTYPE:
* If defined, this macro indicates that the C compiler can handle
* function prototypes.
@@ -1364,84 +1097,31 @@
#define _(args) ()
#endif
-/* RANDBITS:
- * This symbol contains the number of bits of random number the rand()
- * function produces. Usual values are 15, 16, and 31.
- */
-#define RANDBITS 15 /**/
-
-/* Select_fd_set_t:
- * This symbol holds the type used for the 2nd, 3rd, and 4th
- * arguments to select. Usually, this is 'fd_set *', if HAS_FD_SET
- * is defined, and 'int *' otherwise. This is only useful if you
- * have select(), of course.
- */
-#define Select_fd_set_t int * /**/
-
-/* Size_t:
- * This symbol holds the type used to declare length parameters
- * for string functions. It is usually size_t, but may be
- * unsigned long, int, etc. It may be necessary to include
- * <sys/types.h> to get any typedef'ed information.
+/* SH_PATH:
+ * This symbol contains the full pathname to the shell used on this
+ * on this system to execute Bourne shell scripts. Usually, this will be
+ * /bin/sh, though it's possible that some systems will have /bin/ksh,
+ * /bin/pdksh, /bin/ash, /bin/bash, or even something such as
+ * D:/bin/sh.exe.
*/
-#define Size_t size_t /* length paramater for string functions */
-
-/* SSize_t:
- * This symbol holds the type used by functions that return
- * a count of bytes or an error condition. It must be a signed type.
- * It is usually ssize_t, but may be long or int, etc.
- * It may be necessary to include <sys/types.h> or <unistd.h>
- * to get any typedef'ed information.
- * We will pick a type such that sizeof(SSize_t) == sizeof(Size_t).
- */
-#define SSize_t int /* signed count of bytes */
+#define SH_PATH "cmd /x /c" /**/
/* STDCHAR:
* This symbol is defined to be the type of char used in stdio.h.
* It has the values "unsigned char" or "char".
*/
-#define STDCHAR unsigned char /**/
-
-/* Uid_t:
- * This symbol holds the type used to declare user ids in the kernel.
- * It can be int, ushort, uid_t, etc... It may be necessary to include
- * <sys/types.h> to get any typedef'ed information.
- */
-#define Uid_t uid_t /* UID type */
+#define STDCHAR char /**/
-/* LOC_SED:
- * This symbol holds the complete pathname to the sed program.
- */
-#define LOC_SED "" /**/
-
-/* OSNAME:
- * This symbol contains the name of the operating system, as determined
- * by Configure. You shouldn't rely on it too much; the specific
- * feature tests from Configure are generally more reliable.
- */
-#define OSNAME "MSWin32" /**/
-
-/* ARCHLIB:
- * This variable, if defined, holds the name of the directory in
- * which the user wants to put architecture-dependent public
- * library files for perl5. It is most often a local directory
- * such as /usr/local/lib. Programs using this variable must be
- * prepared to deal with filename expansion. If ARCHLIB is the
- * same as PRIVLIB, it is not defined, since presumably the
- * program already searches PRIVLIB.
- */
-/* ARCHLIB_EXP:
- * 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\\lib" /**/
-#define ARCHLIB_EXP (win32PerlLibPath()) /**/
-
-/* BINCOMPAT3:
- * This symbol, if defined, indicates that Perl 5.004 should be
- * binary-compatible with Perl 5.003.
+/* MEM_ALIGNBYTES:
+ * This symbol contains the number of bytes required to align a
+ * double. Usual values are 2, 4 and 8.
+ * On NeXT starting with 3.2, you can build "Fat" Multiple Architecture
+ * Binaries (MAB) for targets with varying alignment. This only matters
+ * for perl, where the config.h can be generated and installed on one
+ * system, and used by a different architecture to build an extension.
+ * The default is eight, for safety.
*/
-/*#define BINCOMPAT3 /**/
+#define MEM_ALIGNBYTES 8 /**/
/* BYTEORDER:
* This symbol holds the hexadecimal constant defined in byteorder,
@@ -1466,39 +1146,32 @@
#endif /* ENDIAN CHECK */
#endif /* NeXT */
-/* CSH:
- * This symbol, if defined, indicates that the C-shell exists.
- * If defined, contains the full pathname of csh.
+/* CASTI32:
+ * This symbol is defined if the C compiler can cast negative
+ * or large floating point numbers to 32-bit ints.
*/
-/*#define CSH "" /**/
+#define CASTI32 /**/
-/* DLSYM_NEEDS_UNDERSCORE:
- * This symbol, if defined, indicates that we need to prepend an
- * underscore to the symbol name before calling dlsym(). This only
- * makes sense if you *have* dlsym, which we will presume is the
- * case if you're using dl_dlopen.xs.
+/* CASTNEGFLOAT:
+ * This symbol is defined if the C compiler can cast negative
+ * numbers to unsigned longs, ints and shorts.
*/
-/*#define DLSYM_NEEDS_UNDERSCORE /**/
-
-/* SETUID_SCRIPTS_ARE_SECURE_NOW:
- * This symbol, if defined, indicates that the bug that prevents
- * setuid scripts from being secure is not present in this kernel.
+/* CASTFLAGS:
+ * This symbol contains flags that say what difficulties the compiler
+ * has casting odd floating values to unsigned long:
+ * 0 = ok
+ * 1 = couldn't cast < 0
+ * 2 = couldn't cast >= 0x80000000
+ * 4 = couldn't cast in argument expression list
*/
-/* DOSUID:
- * This symbol, if defined, indicates that the C program should
- * check the script that it is executing for setuid/setgid bits, and
- * attempt to emulate setuid/setgid on systems that have disabled
- * setuid #! scripts because the kernel can't do it securely.
- * It is up to the package designer to make sure that this emulation
- * is done securely. Among other things, it should do an fstat on
- * the script it just opened to make sure it really is a setuid/setgid
- * script, it should make sure the arguments passed correspond exactly
- * to the argument on the #! line, and it should not trust any
- * subprocesses to which it must pass the filename rather than the
- * file descriptor of the script to be executed.
+#define CASTNEGFLOAT /**/
+#define CASTFLAGS 0 /**/
+
+/* VOID_CLOSEDIR:
+ * This symbol, if defined, indicates that the closedir() routine
+ * does not return a value.
*/
-/*#define SETUID_SCRIPTS_ARE_SECURE_NOW /**/
-/*#define DOSUID /**/
+/*#define VOID_CLOSEDIR /**/
/* Gconvert:
* This preprocessor macro is defined to convert a floating point
@@ -1517,62 +1190,58 @@
*/
#define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
-/* HAS_GETPGID:
+/* HAS_GNULIBC:
* This symbol, if defined, indicates to the C program that
- * the getpgid(pid) function is available to get the
- * process group id.
+ * the GNU C library is being used.
*/
-/*#define HAS_GETPGID /**/
-
-/* HAS_GETPGRP:
- * This symbol, if defined, indicates that the getpgrp routine is
- * available to get the current process group.
- */
-/* USE_BSD_GETPGRP:
- * This symbol, if defined, indicates that getpgrp needs one
- * arguments whereas USG one needs none.
+/*#define HAS_GNULIBC /**/
+/* HAS_ISASCII:
+ * This manifest constant lets the C program know that isascii
+ * is available.
*/
-/*#define HAS_GETPGRP /**/
-/*#define USE_BSD_GETPGRP /**/
+#define HAS_ISASCII /**/
-/* HAS_INET_ATON:
- * This symbol, if defined, indicates to the C program that the
- * inet_aton() function is available to parse IP address "dotted-quad"
- * strings.
+/* HAS_LCHOWN:
+ * This symbol, if defined, indicates that the lchown routine is
+ * available to operate on a symbolic link (instead of following the
+ * link).
*/
-/*#define HAS_INET_ATON /**/
+/*#define HAS_LCHOWN /**/
-/* HAS_SETPGID:
- * This symbol, if defined, indicates to the C program that
- * the setpgid(pid, gpid) function is available to set the
- * process group id.
+/* HAS_OPEN3:
+ * This manifest constant lets the C program know that the three
+ * argument form of open(2) is available.
*/
-/*#define HAS_SETPGID /**/
+/*#define HAS_OPEN3 /**/
-/* HAS_SETPGRP:
- * This symbol, if defined, indicates that the setpgrp routine is
- * available to set the current process group.
+/* HAS_SAFE_BCOPY:
+ * This symbol, if defined, indicates that the bcopy routine is available
+ * to copy potentially overlapping memory blocks. Otherwise you should
+ * probably use memmove() or memcpy(). If neither is defined, roll your
+ * own version.
*/
-/* USE_BSD_SETPGRP:
- * This symbol, if defined, indicates that setpgrp needs two
- * arguments whereas USG one needs none. See also HAS_SETPGID
- * for a POSIX interface.
+/*#define HAS_SAFE_BCOPY /**/
+
+/* HAS_SAFE_MEMCPY:
+ * This symbol, if defined, indicates that the memcpy routine is available
+ * to copy potentially overlapping memory blocks. Otherwise you should
+ * probably use memmove() or memcpy(). If neither is defined, roll your
+ * own version.
*/
-/* USE_BSDPGRP:
- * This symbol, if defined, indicates that the BSD notion of process
- * group is to be used. For instance, you have to say setpgrp(pid, pgrp)
- * instead of the USG setpgrp(). This should be obsolete since
- * there are systems which have BSD-ish setpgrp but USG-ish getpgrp.
+/*#define HAS_SAFE_MEMCPY /**/
+
+/* HAS_SANE_MEMCMP:
+ * This symbol, if defined, indicates that the memcmp routine is available
+ * and can be used to compare relative magnitudes of chars with their high
+ * bits set. If it is not defined, roll your own version.
*/
-/*#define HAS_SETPGRP /**/
-/*#define USE_BSD_SETPGRP /**/
-/*#define USE_BSDPGRP /**/
+#define HAS_SANE_MEMCMP /**/
-/* USE_SFIO:
- * This symbol, if defined, indicates that sfio should
- * be used.
+/* HAS_SIGACTION:
+ * This symbol, if defined, indicates that Vr4's sigaction() routine
+ * is available.
*/
-/*#define USE_SFIO /**/
+/*#define HAS_SIGACTION /**/
/* Sigjmp_buf:
* This is the buffer type to be used with Sigsetjmp and Siglongjmp.
@@ -1598,48 +1267,483 @@
#define Siglongjmp(buf,retval) longjmp((buf),(retval))
#endif
-/* USE_DYNAMIC_LOADING:
- * This symbol, if defined, indicates that dynamic loading of
- * some sort is available.
+/* USE_STDIO_PTR:
+ * This symbol is defined if the _ptr and _cnt fields (or similar)
+ * of the stdio FILE structure can be used to access the stdio buffer
+ * for a file handle. If this is defined, then the FILE_ptr(fp)
+ * and FILE_cnt(fp) macros will also be defined and should be used
+ * to access these fields.
*/
-#define USE_DYNAMIC_LOADING /**/
+/* FILE_ptr:
+ * This macro is used to access the _ptr field (or equivalent) of the
+ * FILE structure pointed to by its argument. This macro will always be
+ * defined if USE_STDIO_PTR is defined.
+ */
+/* STDIO_PTR_LVALUE:
+ * This symbol is defined if the FILE_ptr macro can be used as an
+ * lvalue.
+ */
+/* FILE_cnt:
+ * This macro is used to access the _cnt field (or equivalent) of the
+ * FILE structure pointed to by its argument. This macro will always be
+ * defined if USE_STDIO_PTR is defined.
+ */
+/* STDIO_CNT_LVALUE:
+ * This symbol is defined if the FILE_cnt macro can be used as an
+ * lvalue.
+ */
+#define USE_STDIO_PTR /**/
+#ifdef USE_STDIO_PTR
+#define FILE_ptr(fp) ((fp)->_ptr)
+#define STDIO_PTR_LVALUE /**/
+#define FILE_cnt(fp) ((fp)->_cnt)
+#define STDIO_CNT_LVALUE /**/
+#endif
-/* I_DBM:
- * This symbol, if defined, indicates that <dbm.h> exists and should
- * be included.
+/* USE_STDIO_BASE:
+ * This symbol is defined if the _base field (or similar) of the
+ * stdio FILE structure can be used to access the stdio buffer for
+ * a file handle. If this is defined, then the FILE_base(fp) macro
+ * will also be defined and should be used to access this field.
+ * Also, the FILE_bufsiz(fp) macro will be defined and should be used
+ * to determine the number of bytes in the buffer. USE_STDIO_BASE
+ * will never be defined unless USE_STDIO_PTR is.
*/
-/* I_RPCSVC_DBM:
- * This symbol, if defined, indicates that <rpcsvc/dbm.h> exists and
- * should be included.
+/* FILE_base:
+ * This macro is used to access the _base field (or equivalent) of the
+ * FILE structure pointed to by its argument. This macro will always be
+ * defined if USE_STDIO_BASE is defined.
*/
-/*#define I_DBM /**/
-#define I_RPCSVC_DBM /**/
+/* FILE_bufsiz:
+ * This macro is used to determine the number of bytes in the I/O
+ * buffer pointed to by _base field (or equivalent) of the FILE
+ * structure pointed to its argument. This macro will always be defined
+ * if USE_STDIO_BASE is defined.
+ */
+#define USE_STDIO_BASE /**/
+#ifdef USE_STDIO_BASE
+#define FILE_base(fp) ((fp)->_base)
+#define FILE_bufsiz(fp) ((fp)->_cnt + (fp)->_ptr - (fp)->_base)
+#endif
-/* I_LOCALE:
- * This symbol, if defined, indicates to the C program that it should
- * include <locale.h>.
+/* HAS_VPRINTF:
+ * This symbol, if defined, indicates that the vprintf routine is available
+ * to printf with a pointer to an argument list. If unavailable, you
+ * may need to write your own, probably in terms of _doprnt().
*/
-#define I_LOCALE /**/
+/* USE_CHAR_VSPRINTF:
+ * This symbol is defined if this system has vsprintf() returning type
+ * (char*). The trend seems to be to declare it as "int vsprintf()". It
+ * is up to the package author to declare vsprintf correctly based on the
+ * symbol.
+ */
+#define HAS_VPRINTF /**/
+/*#define USE_CHAR_VSPRINTF /**/
-/* I_SFIO:
- * This symbol, if defined, indicates to the C program that it should
- * include <sfio.h>.
+/* DOUBLESIZE:
+ * This symbol contains the size of a double, so that the C preprocessor
+ * can make decisions based on it.
*/
-/*#define I_SFIO /**/
+#define DOUBLESIZE 8 /**/
-/* I_SYS_STAT:
+/* I_TIME:
* This symbol, if defined, indicates to the C program that it should
- * include <sys/stat.h>.
+ * include <time.h>.
*/
-#define I_SYS_STAT /**/
+/* I_SYS_TIME:
+ * This symbol, if defined, indicates to the C program that it should
+ * include <sys/time.h>.
+ */
+/* I_SYS_TIME_KERNEL:
+ * This symbol, if defined, indicates to the C program that it should
+ * include <sys/time.h> with KERNEL defined.
+ */
+#define I_TIME /**/
+/*#define I_SYS_TIME /**/
+/*#define I_SYS_TIME_KERNEL /**/
-/* I_VALUES:
+/* INTSIZE:
+ * This symbol contains the value of sizeof(int) so that the C
+ * preprocessor can make decisions based on it.
+ */
+/* LONGSIZE:
+ * This symbol contains the value of sizeof(long) so that the C
+ * preprocessor can make decisions based on it.
+ */
+/* SHORTSIZE:
+ * This symbol contains the value of sizeof(short) so that the C
+ * preprocessor can make decisions based on it.
+ */
+#define INTSIZE 4 /**/
+#define LONGSIZE 4 /**/
+#define SHORTSIZE 2 /**/
+
+/* VAL_O_NONBLOCK:
+ * This symbol is to be used during open() or fcntl(F_SETFL) to turn on
+ * non-blocking I/O for the file descriptor. Note that there is no way
+ * back, i.e. you cannot turn it blocking again this way. If you wish to
+ * alternatively switch between blocking and non-blocking, use the
+ * ioctl(FIOSNBIO) call instead, but that is not supported by all devices.
+ */
+/* VAL_EAGAIN:
+ * This symbol holds the errno error code set by read() when no data was
+ * present on the non-blocking file descriptor.
+ */
+/* RD_NODATA:
+ * This symbol holds the return code from read() when no data is present
+ * on the non-blocking file descriptor. Be careful! If EOF_NONBLOCK is
+ * not defined, then you can't distinguish between no data and EOF by
+ * issuing a read(). You'll have to find another way to tell for sure!
+ */
+/* EOF_NONBLOCK:
+ * This symbol, if defined, indicates to the C program that a read() on
+ * a non-blocking file descriptor will return 0 on EOF, and not the value
+ * held in RD_NODATA (-1 usually, in that case!).
+ */
+#define VAL_O_NONBLOCK O_NONBLOCK
+#define VAL_EAGAIN EAGAIN
+#define RD_NODATA -1
+#define EOF_NONBLOCK
+
+/* PTRSIZE:
+ * This symbol contains the size of a pointer, so that the C preprocessor
+ * can make decisions based on it. It will be sizeof(void *) if
+ * the compiler supports (void *); otherwise it will be
+ * sizeof(char *).
+ */
+#define PTRSIZE 4 /**/
+
+/* RANDBITS:
+ * This symbol contains the number of bits of random number the rand()
+ * function produces. Usual values are 15, 16, and 31.
+ */
+#define RANDBITS 15 /**/
+
+/* SSize_t:
+ * This symbol holds the type used by functions that return
+ * a count of bytes or an error condition. It must be a signed type.
+ * It is usually ssize_t, but may be long or int, etc.
+ * It may be necessary to include <sys/types.h> or <unistd.h>
+ * to get any typedef'ed information.
+ * We will pick a type such that sizeof(SSize_t) == sizeof(Size_t).
+ */
+#define SSize_t int /* signed count of bytes */
+
+/* OSNAME:
+ * This symbol contains the name of the operating system, as determined
+ * by Configure. You shouldn't rely on it too much; the specific
+ * feature tests from Configure are generally more reliable.
+ */
+#define OSNAME "MSWin32" /**/
+
+/* CAT2:
+ * This macro catenates 2 tokens together.
+ */
+/* STRINGIFY:
+ * This macro surrounds its token with double quotes.
+ */
+#if 42 == 1
+#define CAT2(a,b)a/**/b
+#define STRINGIFY(a)"a"
+ /* If you can get stringification with catify, tell me how! */
+#endif
+#if 42 == 42
+#define CAT2(a,b)a ## b
+#define StGiFy(a)# a
+#define STRINGIFY(a)StGiFy(a)
+#endif
+#if 42 != 1 && 42 != 42
+#include "Bletch: How does this C preprocessor catenate tokens?"
+#endif
+
+/* CSH:
+ * This symbol, if defined, contains the full pathname of csh.
+ */
+/*#define HAS_CSH /**/
+#ifdef HAS_CSH
+#define CSH "" /**/
+#endif
+
+/* HAS_ENDHOSTENT:
+ * This symbol, if defined, indicates that the endhostent() routine is
+ * available to close whatever was being used for host queries.
+ */
+/*#define HAS_ENDHOSTENT /**/
+
+/* HAS_ENDNETENT:
+ * This symbol, if defined, indicates that the endnetent() routine is
+ * available to close whatever was being used for network queries.
+ */
+/*#define HAS_ENDNETENT /**/
+
+/* HAS_ENDPROTOENT:
+ * This symbol, if defined, indicates that the endprotoent() routine is
+ * available to close whatever was being used for protocol queries.
+ */
+/*#define HAS_ENDPROTOENT /**/
+
+/* HAS_ENDSERVENT:
+ * This symbol, if defined, indicates that the endservent() routine is
+ * available to close whatever was being used for service queries.
+ */
+/*#define HAS_ENDSERVENT /**/
+
+/* HAS_GETHOSTBYADDR:
+ * This symbol, if defined, indicates that the gethostbyaddr() routine is
+ * available to look up hosts by their IP addresses.
+ */
+#define HAS_GETHOSTBYADDR /**/
+
+/* HAS_GETHOSTBYNAME:
+ * This symbol, if defined, indicates that the gethostbyname() routine is
+ * available to look up host names in some data base or other.
+ */
+#define HAS_GETHOSTBYNAME /**/
+
+/* HAS_GETHOSTENT:
+ * This symbol, if defined, indicates that the gethostent() routine is
+ * available to look up host names in some data base or another.
+ */
+/*#define HAS_GETHOSTENT /**/
+
+/* HAS_GETNETBYADDR:
+ * This symbol, if defined, indicates that the getnetbyaddr() routine is
+ * available to look up networks by their IP addresses.
+ */
+/*#define HAS_GETNETBYADDR /**/
+
+/* HAS_GETNETBYNAME:
+ * This symbol, if defined, indicates that the getnetbyname() routine is
+ * available to look up networks by their names.
+ */
+/*#define HAS_GETNETBYNAME /**/
+
+/* HAS_GETNETENT:
+ * This symbol, if defined, indicates that the getnetent() routine is
+ * available to look up network names in some data base or another.
+ */
+/*#define HAS_GETNETENT /**/
+
+/* HAS_GETPROTOENT:
+ * This symbol, if defined, indicates that the getprotoent() routine is
+ * available to look up protocols in some data base or another.
+ */
+/*#define HAS_GETPROTOENT /**/
+
+/* HAS_GETPROTOBYNAME:
+ * This symbol, if defined, indicates that the getprotobyname()
+ * routine is available to look up protocols by their name.
+ */
+/* HAS_GETPROTOBYNUMBER:
+ * This symbol, if defined, indicates that the getprotobynumber()
+ * routine is available to look up protocols by their number.
+ */
+#define HAS_GETPROTOBYNAME /**/
+#define HAS_GETPROTOBYNUMBER /**/
+
+/* HAS_GETSERVENT:
+ * This symbol, if defined, indicates that the getservent() routine is
+ * available to look up network services in some data base or another.
+ */
+/*#define HAS_GETSERVENT /**/
+
+/* HAS_GETSERVBYNAME:
+ * This symbol, if defined, indicates that the getservbyname()
+ * routine is available to look up services by their name.
+ */
+/* HAS_GETSERVBYPORT:
+ * This symbol, if defined, indicates that the getservbyport()
+ * routine is available to look up services by their port.
+ */
+#define HAS_GETSERVBYNAME /**/
+#define HAS_GETSERVBYPORT /**/
+
+/* HAS_LONG_DOUBLE:
+ * This symbol will be defined if the C compiler supports long
+ * doubles.
+ */
+/* LONG_DOUBLESIZE:
+ * This symbol contains the size of a long double, so that the
+ * C preprocessor can make decisions based on it. It is only
+ * defined if the system supports long doubles.
+ */
+#define HAS_LONG_DOUBLE /**/
+#ifdef HAS_LONG_DOUBLE
+#define LONG_DOUBLESIZE 10 /**/
+#endif
+
+/* HAS_LONG_LONG:
+ * This symbol will be defined if the C compiler supports
+ * long long.
+ */
+/* LONGLONGSIZE:
+ * This symbol contains the size of a long long, so that the
+ * C preprocessor can make decisions based on it. It is only
+ * defined if the system supports long long.
+ */
+/*#define HAS_LONG_LONG /**/
+#ifdef HAS_LONG_LONG
+#define LONGLONGSIZE 8 /**/
+#endif
+
+/* HAS_SETGROUPS:
+ * This symbol, if defined, indicates that the setgroups() routine is
+ * available to set the list of process groups. If unavailable, multiple
+ * groups are probably not supported.
+ */
+/*#define HAS_SETGROUPS /**/
+
+/* HAS_SETHOSTENT:
+ * This symbol, if defined, indicates that the sethostent() routine is
+ * available.
+ */
+/*#define HAS_SETHOSTENT /**/
+
+/* HAS_SETNETENT:
+ * This symbol, if defined, indicates that the setnetent() routine is
+ * available.
+ */
+/*#define HAS_SETNETENT /**/
+
+/* HAS_SETPROTOENT:
+ * This symbol, if defined, indicates that the setprotoent() routine is
+ * available.
+ */
+/*#define HAS_SETPROTOENT /**/
+
+/* HAS_SETSERVENT:
+ * This symbol, if defined, indicates that the setservent() routine is
+ * available.
+ */
+/*#define HAS_SETSERVENT /**/
+
+/* HAS_SETVBUF:
+ * This symbol, if defined, indicates that the setvbuf routine is
+ * available to change buffering on an open stdio stream.
+ * to a line-buffered mode.
+ */
+#define HAS_SETVBUF /**/
+
+/* HAS_SOCKET:
+ * This symbol, if defined, indicates that the BSD socket interface is
+ * supported.
+ */
+/* HAS_SOCKETPAIR:
+ * This symbol, if defined, indicates that the BSD socketpair() call is
+ * supported.
+ */
+#define HAS_SOCKET /**/
+/*#define HAS_SOCKETPAIR /**/
+
+/* HAS_UNION_SEMUN:
+ * This symbol, if defined, indicates that the union semun is
+ * defined by including <sys/sem.h>. If not, the user code
+ * probably needs to define it as:
+ * union semun {
+ * int val;
+ * struct semid_ds *buf;
+ * unsigned short *array;
+ * }
+ */
+/* USE_SEMCTL_SEMUN:
+ * This symbol, if defined, indicates that union semun is
+ * used for semctl IPC_STAT.
+ */
+/* USE_SEMCTL_SEMID_DS:
+ * This symbol, if defined, indicates that struct semid_ds * is
+ * used for semctl IPC_STAT.
+ */
+#define HAS_UNION_SEMUN /**/
+/*#define USE_SEMCTL_SEMUN /**/
+/*#define USE_SEMCTL_SEMID_DS /**/
+
+/* Signal_t:
+ * This symbol's value is either "void" or "int", corresponding to the
+ * appropriate return type of a signal handler. Thus, you can declare
+ * a signal handler using "Signal_t (*handler)()", and define the
+ * handler using "Signal_t handler(sig)".
+ */
+#define Signal_t void /* Signal handler's return type */
+
+/* Groups_t:
+ * This symbol holds the type used for the second argument to
+ * getgroups() and setgropus(). Usually, this is the same as
+ * gidtype (gid_t) , but sometimes it isn't.
+ * It can be int, ushort, uid_t, etc...
+ * It may be necessary to include <sys/types.h> to get any
+ * typedef'ed information. This is only required if you have
+ * getgroups() or setgropus()..
+ */
+#if defined(HAS_GETGROUPS) || defined(HAS_SETGROUPS)
+#define Groups_t gid_t /* Type for 2nd arg to [sg]etgroups() */
+#endif
+
+/* I_NETDB:
+ * This symbol, if defined, indicates that <netdb.h> exists and
+ * should be included.
+ */
+/*#define I_NETDB /**/
+
+/* I_PWD:
* This symbol, if defined, indicates to the C program that it should
- * include <values.h> to get definition of symbols like MINFLOAT or
- * MAXLONG, i.e. machine dependant limitations. Probably, you
- * should use <limits.h> instead, if it is available.
+ * include <pwd.h>.
*/
-/*#define I_VALUES /**/
+/* PWQUOTA:
+ * This symbol, if defined, indicates to the C program that struct passwd
+ * contains pw_quota.
+ */
+/* PWAGE:
+ * This symbol, if defined, indicates to the C program that struct passwd
+ * contains pw_age.
+ */
+/* PWCHANGE:
+ * This symbol, if defined, indicates to the C program that struct passwd
+ * contains pw_change.
+ */
+/* PWCLASS:
+ * This symbol, if defined, indicates to the C program that struct passwd
+ * contains pw_class.
+ */
+/* PWEXPIRE:
+ * This symbol, if defined, indicates to the C program that struct passwd
+ * contains pw_expire.
+ */
+/* PWCOMMENT:
+ * This symbol, if defined, indicates to the C program that struct passwd
+ * contains pw_comment.
+ */
+/* PWGECOS:
+ * This symbol, if defined, indicates to the C program that struct passwd
+ * contains pw_gecos.
+ */
+/* PWPASSWD:
+ * This symbol, if defined, indicates to the C program that struct passwd
+ * contains pw_passwd.
+ */
+/* HAS_SETPWENT:
+ * This symbol, if defined, indicates that the getpwrent routine is
+ * available for initializing sequential access of the passwd database.
+ */
+/* HAS_GETPWENT:
+ * This symbol, if defined, indicates that the getpwent routine is
+ * available for sequential access of the password database.
+ */
+/* HAS_ENDPWENT:
+ * This symbol, if defined, indicates that the getpwent routine is
+ * available for finalizing sequential access of the passwd database.
+ */
+/*#define I_PWD /**/
+/*#define PWQUOTA /**/
+/*#define PWAGE /**/
+/*#define PWCHANGE /**/
+/*#define PWCLASS /**/
+/*#define PWEXPIRE /**/
+/*#define PWCOMMENT /**/
+/*#define PWGECOS /**/
+/*#define PWPASSWD /**/
+/*#define HAS_SETPWENT /**/
+/*#define HAS_GETPWENT /**/
+/*#define HAS_ENDPWENT /**/
/* Free_t:
* This variable contains the return type of free(). It is usually
@@ -1656,43 +1760,6 @@
*/
/*#define MYMALLOC /**/
-/* OLDARCHLIB:
- * This variable, if defined, holds the name of the directory in
- * which the user has perl5.000 or perl5.001 architecture-dependent
- * public library files for perl5. For the most part, these
- * files will work with 5.002 (and later), but that is not
- * guaranteed.
- */
-/* OLDARCHLIB_EXP:
- * This symbol contains the ~name expanded version of OLDARCHLIB, to be
- * used in programs that are not prepared to deal with ~ expansion at
- * run-time.
- */
-/*#define OLDARCHLIB "" /**/
-/*#define OLDARCHLIB_EXP "" /**/
-
-/* PRIVLIB:
- * This symbol contains the name of the private library for this package.
- * The library is private in the sense that it needn't be in anyone's
- * execution path, but it should be accessible by the world. The program
- * should be prepared to do ~ expansion.
- */
-/* PRIVLIB_EXP:
- * 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\\lib" /**/
-#define PRIVLIB_EXP "c:\\perl\\lib" /**/
-
-/* SH_PATH:
- * This symbol contains the full pathname to the shell used on this
- * on this system to execute Bourne shell scripts. Usually, this will be
- * /bin/sh, though it's possible that some systems will have /bin/ksh,
- * /bin/pdksh, /bin/ash, /bin/bash, or even something such as
- * D:/bin/sh.exe.
- */
-#define SH_PATH "cmd.exe" /**/
-
/* SIG_NAME:
* This symbol contains a list of signal names in order of
* signal number. This is intended
@@ -1721,8 +1788,95 @@
* The last element is 0, corresponding to the 0 at the end of
* the sig_name list.
*/
-#define 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",0 /**/
-#define 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,0 /**/
+#define SIG_NAME "ZERO", "INT", "QUIT", "ILL", "FPE", "KILL", "SEGV", "PIPE", "ALRM", "TERM", "CHLD", "BREAK", "ABRT", "STOP", "CONT", "CLD", 0 /**/
+#define SIG_NUM 0, 2, 3, 4, 8, 9, 11, 13, 14, 15, 20, 21, 22, 23, 25, 20, 0 /**/
+
+/* VOIDFLAGS:
+ * This symbol indicates how much support of the void type is given by this
+ * compiler. What various bits mean:
+ *
+ * 1 = supports declaration of void
+ * 2 = supports arrays of pointers to functions returning void
+ * 4 = supports comparisons between pointers to void functions and
+ * addresses of void functions
+ * 8 = suports declaration of generic void pointers
+ *
+ * The package designer should define VOIDUSED to indicate the requirements
+ * of the package. This can be done either by #defining VOIDUSED before
+ * including config.h, or by defining defvoidused in Myinit.U. If the
+ * latter approach is taken, only those flags will be tested. If the
+ * level of void support necessary is not present, defines void to int.
+ */
+#ifndef VOIDUSED
+#define VOIDUSED 15
+#endif
+#define VOIDFLAGS 15
+#if (VOIDFLAGS & VOIDUSED) != VOIDUSED
+#define void int /* is void to be avoided? */
+#define M_VOID /* Xenix strikes again */
+#endif
+
+/* ARCHLIB:
+ * This variable, if defined, holds the name of the directory in
+ * which the user wants to put architecture-dependent public
+ * library files for perl5. It is most often a local directory
+ * such as /usr/local/lib. Programs using this variable must be
+ * prepared to deal with filename expansion. If ARCHLIB is the
+ * same as PRIVLIB, it is not defined, since presumably the
+ * program already searches PRIVLIB.
+ */
+/* ARCHLIB_EXP:
+ * 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.00503\\lib\\MSWin32-x86" /**/
+/*#define ARCHLIB_EXP "" /**/
+
+/* DLSYM_NEEDS_UNDERSCORE:
+ * This symbol, if defined, indicates that we need to prepend an
+ * underscore to the symbol name before calling dlsym(). This only
+ * makes sense if you *have* dlsym, which we will presume is the
+ * case if you're using dl_dlopen.xs.
+ */
+/*#define DLSYM_NEEDS_UNDERSCORE /**/
+
+/* USE_SFIO:
+ * This symbol, if defined, indicates that sfio should
+ * be used.
+ */
+/*#define USE_SFIO /**/
+
+/* USE_DYNAMIC_LOADING:
+ * This symbol, if defined, indicates that dynamic loading of
+ * some sort is available.
+ */
+#define USE_DYNAMIC_LOADING /**/
+
+/* DB_Prefix_t:
+ * This symbol contains the type of the prefix structure element
+ * in the <db.h> header file. In older versions of DB, it was
+ * int, while in newer ones it is u_int32_t.
+ */
+/* DB_Hash_t:
+ * This symbol contains the type of the prefix structure element
+ * in the <db.h> header file. In older versions of DB, it was
+ * int, while in newer ones it is size_t.
+ */
+#define DB_Hash_t int /**/
+#define DB_Prefix_t int /**/
+
+/* PRIVLIB:
+ * This symbol contains the name of the private library for this package.
+ * The library is private in the sense that it needn't be in anyone's
+ * execution path, but it should be accessible by the world. The program
+ * should be prepared to do ~ expansion.
+ */
+/* PRIVLIB_EXP:
+ * 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.00503\\lib" /**/
+#define PRIVLIB_EXP (win32_get_privlib("5.00503")) /**/
/* SITEARCH:
* This symbol contains the name of the private library for this package.
@@ -1737,8 +1891,8 @@
* 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\\lib\\site" /**/
-#define SITEARCH_EXP "c:\\perl\\lib\\site" /**/
+#define SITEARCH "c:\\perl\\site\\5.00503\\lib\\MSWin32-x86" /**/
+/*#define SITEARCH_EXP "" /**/
/* SITELIB:
* This symbol contains the name of the private library for this package.
@@ -1753,15 +1907,15 @@
* This symbol contains the ~name expanded version of SITELIB, to be used
* in programs that are not prepared to deal with ~ expansion at run-time.
*/
-#define SITELIB "c:\\perl\\lib\\site" /**/
-#define SITELIB_EXP "c:\\perl\\lib\\site" /**/
+#define SITELIB "c:\\perl\\site\\5.00503\\lib" /**/
+#define SITELIB_EXP (win32_get_sitelib("5.00503")) /**/
/* STARTPERL:
* This variable contains the string to put in front of a perl
* script to make sure (one hopes) that it runs with perl and not
* some shell.
*/
-#define STARTPERL "#perl" /**/
+#define STARTPERL "#!perl" /**/
/* USE_PERLIO:
* This symbol, if defined, indicates that the PerlIO abstraction should
@@ -1770,33 +1924,171 @@
*/
/*#define USE_PERLIO /**/
-/* VOIDFLAGS:
- * This symbol indicates how much support of the void type is given by this
- * compiler. What various bits mean:
- *
- * 1 = supports declaration of void
- * 2 = supports arrays of pointers to functions returning void
- * 4 = supports comparisons between pointers to void functions and
- * addresses of void functions
- * 8 = suports declaration of generic void pointers
- *
- * The package designer should define VOIDUSED to indicate the requirements
- * of the package. This can be done either by #defining VOIDUSED before
- * including config.h, or by defining defvoidused in Myinit.U. If the
- * latter approach is taken, only those flags will be tested. If the
- * level of void support necessary is not present, defines void to int.
+/* HAS_GETHOST_PROTOS:
+ * This symbol, if defined, indicates that <netdb.h> includes
+ * prototypes for gethostent(), gethostbyname(), and
+ * gethostbyaddr(). Otherwise, it is up to the program to guess
+ * them. See netdbtype.U for probing for various Netdb_xxx_t types.
*/
-#ifndef VOIDUSED
-#define VOIDUSED 15
-#endif
-#define VOIDFLAGS 15
-#if (VOIDFLAGS & VOIDUSED) != VOIDUSED
-#define void int /* is void to be avoided? */
-#define M_VOID /* Xenix strikes again */
-#endif
+#define HAS_GETHOST_PROTOS /**/
+
+/* HAS_GETNET_PROTOS:
+ * This symbol, if defined, indicates that <netdb.h> includes
+ * prototypes for getnetent(), getnetbyname(), and
+ * getnetbyaddr(). Otherwise, it is up to the program to guess
+ * them. See netdbtype.U for probing for various Netdb_xxx_t types.
+ */
+/*#define HAS_GETNET_PROTOS /**/
+
+/* HAS_GETPROTO_PROTOS:
+ * This symbol, if defined, indicates that <netdb.h> includes
+ * prototypes for getprotoent(), getprotobyname(), and
+ * getprotobyaddr(). Otherwise, it is up to the program to guess
+ * them. See netdbtype.U for probing for various Netdb_xxx_t types.
+ */
+#define HAS_GETPROTO_PROTOS /**/
+
+/* HAS_GETSERV_PROTOS:
+ * This symbol, if defined, indicates that <netdb.h> includes
+ * prototypes for getservent(), getservbyname(), and
+ * getservbyaddr(). Otherwise, it is up to the program to guess
+ * them. See netdbtype.U for probing for various Netdb_xxx_t types.
+ */
+#define HAS_GETSERV_PROTOS /**/
+
+/* Netdb_host_t:
+ * This symbol holds the type used for the 1st argument
+ * to gethostbyaddr().
+ */
+/* Netdb_hlen_t:
+ * This symbol holds the type used for the 2nd argument
+ * to gethostbyaddr().
+ */
+/* Netdb_name_t:
+ * This symbol holds the type used for the argument to
+ * gethostbyname().
+ */
+/* Netdb_net_t:
+ * This symbol holds the type used for the 1st argument to
+ * getnetbyaddr().
+ */
+#define Netdb_host_t char * /**/
+#define Netdb_hlen_t int /**/
+#define Netdb_name_t char * /**/
+#define Netdb_net_t long /**/
+
+/* Select_fd_set_t:
+ * This symbol holds the type used for the 2nd, 3rd, and 4th
+ * arguments to select. Usually, this is 'fd_set *', if HAS_FD_SET
+ * is defined, and 'int *' otherwise. This is only useful if you
+ * have select(), of course.
+ */
+#define Select_fd_set_t Perl_fd_set * /**/
+
+/* ARCHNAME:
+ * This symbol holds a string representing the architecture name.
+ * It may be used to construct an architecture-dependant pathname
+ * where library files may be held under a private library, for
+ * instance.
+ */
+#define ARCHNAME "MSWin32-x86" /**/
+
+/* HAS_PTHREAD_YIELD:
+ * This symbol, if defined, indicates that the pthread_yield
+ * routine is available to yield the execution of the current
+ * thread.
+ */
+/* HAS_SCHED_YIELD:
+ * This symbol, if defined, indicates that the sched_yield
+ * routine is available to yield the execution of the current
+ * thread.
+ */
+/*#define HAS_PTHREAD_YIELD /**/
+/*#define HAS_SCHED_YIELD /**/
+
+/* PTHREADS_CREATED_JOINABLE:
+ * This symbol, if defined, indicates that pthreads are created
+ * in the joinable (aka undetached) state.
+ */
+/*#define PTHREADS_CREATED_JOINABLE /**/
+
+/* USE_THREADS:
+ * This symbol, if defined, indicates that Perl should
+ * be built to use threads.
+ */
+/* OLD_PTHREADS_API:
+ * This symbol, if defined, indicates that Perl should
+ * be built to use the old draft POSIX threads API.
+ */
+/*#define USE_THREADS /**/
+/*#define OLD_PTHREADS_API /**/
+
+/* Time_t:
+ * This symbol holds the type returned by time(). It can be long,
+ * or time_t on BSD sites (in which case <sys/types.h> should be
+ * included).
+ */
+#define Time_t time_t /* Time type */
+
+/* HAS_TIMES:
+ * This symbol, if defined, indicates that the times() routine exists.
+ * Note that this became obsolete on some systems (SUNOS), which now
+ * use getrusage(). It may be necessary to include <sys/times.h>.
+ */
+#define HAS_TIMES /**/
+
+/* Fpos_t:
+ * This symbol holds the type used to declare file positions in libc.
+ * It can be fpos_t, long, uint, etc... It may be necessary to include
+ * <sys/types.h> to get any typedef'ed information.
+ */
+#define Fpos_t fpos_t /* File position type */
+
+/* Gid_t:
+ * This symbol holds the return type of getgid() and the type of
+ * argument to setrgid() and related functions. Typically,
+ * it is the type of group ids in the kernel. It can be int, ushort,
+ * uid_t, etc... It may be necessary to include <sys/types.h> to get
+ * any typedef'ed information.
+ */
+#define Gid_t gid_t /* Type for getgid(), etc... */
+
+/* Off_t:
+ * This symbol holds the type used to declare offsets in the kernel.
+ * It can be int, long, off_t, etc... It may be necessary to include
+ * <sys/types.h> to get any typedef'ed information.
+ */
+#define Off_t off_t /* <offset> type */
+
+/* Mode_t:
+ * This symbol holds the type used to declare file modes
+ * for systems calls. It is usually mode_t, but may be
+ * int or unsigned short. It may be necessary to include <sys/types.h>
+ * to get any typedef'ed information.
+ */
+#define Mode_t mode_t /* file mode parameter for system calls */
+
+/* Pid_t:
+ * This symbol holds the type used to declare process ids in the kernel.
+ * It can be int, uint, pid_t, etc... It may be necessary to include
+ * <sys/types.h> to get any typedef'ed information.
+ */
+#define Pid_t int /* PID type */
+
+/* Size_t:
+ * This symbol holds the type used to declare length parameters
+ * for string functions. It is usually size_t, but may be
+ * unsigned long, int, etc. It may be necessary to include
+ * <sys/types.h> to get any typedef'ed information.
+ */
+#define Size_t size_t /* length paramater for string functions */
+
+/* Uid_t:
+ * This symbol holds the type used to declare user ids in the kernel.
+ * It can be int, ushort, uid_t, etc... It may be necessary to include
+ * <sys/types.h> to get any typedef'ed information.
+ */
+#define Uid_t uid_t /* UID type */
#endif
#include <win32.h>
-#ifndef DEBUGGING
-#define DEBUGGING
-#endif
diff --git a/gnu/usr.bin/perl/win32/config_h.PL b/gnu/usr.bin/perl/win32/config_h.PL
index 5d47016dc97..617b996cdb1 100644
--- a/gnu/usr.bin/perl/win32/config_h.PL
+++ b/gnu/usr.bin/perl/win32/config_h.PL
@@ -2,8 +2,21 @@
use Config;
use File::Compare qw(compare);
use File::Copy qw(copy);
+my $OBJ = 1 if $Config{'ccflags'} =~ /PERL_OBJECT/i;
my $name = $0;
$name =~ s#^(.*)\.PL$#../$1.SH#;
+my %opt;
+while (@ARGV && $ARGV[0] =~ /^([\w_]+)=(.*)$/)
+ {
+ $opt{$1}=$2;
+ shift(@ARGV);
+ }
+my $patchlevel = $opt{INST_VER};
+$patchlevel =~ s|^[\\/]||;
+$patchlevel =~ s|~VERSION~|$]|g;
+$patchlevel ||= $];
+$patchlevel = qq["$patchlevel"];
+
open(SH,"<$name") || die "Cannot open $name:$!";
while (<SH>)
{
@@ -27,6 +40,7 @@ eval $str;
die "$str:$@" if $@;
open(H,">$file.new") || die "Cannot open $file.new:$!";
+binmode H; # no CRs (which cause a spurious rebuild)
while (<SH>)
{
last if /^$term$/o;
@@ -35,18 +49,18 @@ while (<SH>)
munge();
s/\\\$/\$/g;
s#/[ *\*]*\*/#/**/#;
- if (/^\s*#define\s+ARCHLIB_EXP/)
+ if (/^\s*#define\s+(PRIVLIB|SITELIB)_EXP/)
{
- $_ = "#define ARCHLIB_EXP (win32PerlLibPath())\t/**/\n"
- . "#define APPLLIB_EXP (win32SiteLibPath())\t/**/\n";
+ $_ = "#define ". $1 . "_EXP (win32_get_". lc($1) . "($patchlevel))\t/**/\n";
+ }
+ # incpush() handles archlibs, so disable them
+ elsif (/^\s*#define\s+(ARCHLIB|SITEARCH)_EXP/)
+ {
+ $_ = "/*#define ". $1 . "_EXP \"\"\t/**/\n";
}
print H;
}
-print H "#include <win32.h>
-#ifndef DEBUGGING
-#define DEBUGGING
-#endif
-";
+print H "#include <win32.h>\n";
close(H);
close(SH);
@@ -55,15 +69,20 @@ 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))
+if (!$OBJ && compare("$file.new",$file))
{
warn "$file has changed\n";
chmod(0666,$file);
unlink($file);
rename("$file.new",$file);
- chmod(0444,$file);
+ #chmod(0444,$file);
exit(1);
}
+else
+ {
+ unlink ("$file.new");
+ exit(0);
+ }
sub Config
{
diff --git a/gnu/usr.bin/perl/win32/config_sh.PL b/gnu/usr.bin/perl/win32/config_sh.PL
index 0769ef31120..1d4b2fb5c35 100644
--- a/gnu/usr.bin/perl/win32/config_sh.PL
+++ b/gnu/usr.bin/perl/win32/config_sh.PL
@@ -1,3 +1,15 @@
+# take a semicolon separated path list and turn it into a quoted
+# list of paths that Text::Parsewords will grok
+sub mungepath {
+ my $p = shift;
+ # remove leading/trailing semis/spaces
+ $p =~ s/^[ ;]+//;
+ $p =~ s/[ ;]+$//;
+ $p =~ s/'/"/g;
+ my @p = map { $_ = "\"$_\"" if /\s/ and !/^".*"$/; $_ } split /;/, $p;
+ return join(' ', @p);
+}
+
my %opt;
while (@ARGV && $ARGV[0] =~ /^([\w_]+)=(.*)$/)
{
@@ -5,6 +17,8 @@ while (@ARGV && $ARGV[0] =~ /^([\w_]+)=(.*)$/)
shift(@ARGV);
}
+$opt{VERSION} = $];
+$opt{INST_VER} =~ s|~VERSION~|$]|g;
if ($] =~ /\.(\d\d\d)?(\d\d)?$/) { # should always be true
$opt{PATCHLEVEL} = int($1 || 0);
$opt{SUBVERSION} = $2 || '00';
@@ -13,11 +27,23 @@ if ($] =~ /\.(\d\d\d)?(\d\d)?$/) { # should always be true
$opt{'cf_by'} = $ENV{USERNAME} unless $opt{'cf_by'};
$opt{'cf_email'} = $opt{'cf_by'} . '@' . (gethostbyname('localhost'))[0]
unless $opt{'cf_email'};
+$opt{'usemymalloc'} = 'y' if $opt{'d_mymalloc'} eq 'define';
+
+$opt{libpth} = mungepath($opt{libpth}) if exists $opt{libpth};
+$opt{incpath} = mungepath($opt{incpath}) if exists $opt{incpath};
while (<>)
{
s/~([\w_]+)~/$opt{$1}/g;
- $_ = "$1='$opt{$1}'\n" if (/^([\w_]+)=/ && exists($opt{$1}));
+ if (/^([\w_]+)=(.*)$/) {
+ # this depends on cf_time being empty in the template (or we'll get a loop)
+ if ($1 eq 'cf_time') {
+ $_ = "$1='" . localtime(time) . "'\n" if $2 =~ /^\s*'\s*'/;
+ }
+ elsif (exists $opt{$1}) {
+ $_ = "$1='$opt{$1}'\n";
+ }
+ }
print;
}
diff --git a/gnu/usr.bin/perl/win32/dl_win32.xs b/gnu/usr.bin/perl/win32/dl_win32.xs
index 7b227e299c9..c650acffb73 100644
--- a/gnu/usr.bin/perl/win32/dl_win32.xs
+++ b/gnu/usr.bin/perl/win32/dl_win32.xs
@@ -18,27 +18,75 @@ calls.
*/
#define WIN32_LEAN_AND_MEAN
+#ifdef __GNUC__
+#define Win32_Winsock
+#endif
#include <windows.h>
#include <string.h>
#include "EXTERN.h"
#include "perl.h"
+#include "win32.h"
+
+#ifdef PERL_OBJECT
+#define NO_XSLOCKS
+#endif /* PERL_OBJECT */
+
#include "XSUB.h"
+static SV *error_sv;
+
+static char *
+OS_Error_String(CPERLarg)
+{
+ DWORD err = GetLastError();
+ STRLEN len;
+ if (!error_sv)
+ error_sv = newSVpv("",0);
+ win32_str_os_error(error_sv,err);
+ return SvPV(error_sv,len);
+}
+
#include "dlutils.c" /* SaveError() etc */
static void
-dl_private_init()
+dl_private_init(CPERLarg)
{
- (void)dl_generic_private_init();
+ (void)dl_generic_private_init(PERL_OBJECT_THIS);
}
+/*
+ This function assumes the list staticlinkmodules
+ will be formed from package names with '::' replaced
+ with '/'. Thus Win32::OLE is in the list as Win32/OLE
+*/
static int
dl_static_linked(char *filename)
{
char **p;
+ char* ptr;
+ static char subStr[] = "/auto/";
+ char szBuffer[MAX_PATH];
+
+ /* change all the '\\' to '/' */
+ strcpy(szBuffer, filename);
+ for(ptr = szBuffer; ptr = strchr(ptr, '\\'); ++ptr)
+ *ptr = '/';
+
+ /* delete the file name */
+ ptr = strrchr(szBuffer, '/');
+ if(ptr != NULL)
+ *ptr = '\0';
+
+ /* remove leading lib path */
+ ptr = strstr(szBuffer, subStr);
+ if(ptr != NULL)
+ ptr += sizeof(subStr)-1;
+ else
+ ptr = szBuffer;
+
for (p = staticlinkmodules; *p;p++) {
- if (strstr(filename, *p)) return 1;
+ if (strstr(ptr, *p)) return 1;
};
return 0;
}
@@ -46,7 +94,7 @@ dl_static_linked(char *filename)
MODULE = DynaLoader PACKAGE = DynaLoader
BOOT:
- (void)dl_private_init();
+ (void)dl_private_init(PERL_OBJECT_THIS);
void *
dl_load_file(filename,flags=0)
@@ -54,15 +102,16 @@ dl_load_file(filename,flags=0)
int flags
PREINIT:
CODE:
- DLDEBUG(1,fprintf(stderr,"dl_load_file(%s):\n", filename));
+ DLDEBUG(1,PerlIO_printf(PerlIO_stderr(),"dl_load_file(%s):\n", filename));
if (dl_static_linked(filename) == 0)
RETVAL = (void*) LoadLibraryEx(filename, NULL, LOAD_WITH_ALTERED_SEARCH_PATH ) ;
else
RETVAL = (void*) GetModuleHandle(NULL);
- DLDEBUG(2,fprintf(stderr," libref=%x\n", RETVAL));
+ DLDEBUG(2,PerlIO_printf(PerlIO_stderr()," libref=%x\n", RETVAL));
ST(0) = sv_newmortal() ;
if (RETVAL == NULL)
- SaveError("%d",GetLastError()) ;
+ SaveError(PERL_OBJECT_THIS_ "load_file:%s",
+ OS_Error_String(PERL_OBJECT_THIS)) ;
else
sv_setiv( ST(0), (IV)RETVAL);
@@ -72,13 +121,14 @@ dl_find_symbol(libhandle, symbolname)
void * libhandle
char * symbolname
CODE:
- DLDEBUG(2,fprintf(stderr,"dl_find_symbol(handle=%x, symbol=%s)\n",
+ DLDEBUG(2,PerlIO_printf(PerlIO_stderr(),"dl_find_symbol(handle=%x, symbol=%s)\n",
libhandle, symbolname));
RETVAL = (void*) GetProcAddress((HINSTANCE) libhandle, symbolname);
- DLDEBUG(2,fprintf(stderr," symbolref = %x\n", RETVAL));
+ DLDEBUG(2,PerlIO_printf(PerlIO_stderr()," symbolref = %x\n", RETVAL));
ST(0) = sv_newmortal() ;
if (RETVAL == NULL)
- SaveError("%d",GetLastError()) ;
+ SaveError(PERL_OBJECT_THIS_ "find_symbol:%s",
+ OS_Error_String(PERL_OBJECT_THIS)) ;
else
sv_setiv( ST(0), (IV)RETVAL);
@@ -97,9 +147,9 @@ dl_install_xsub(perl_name, symref, filename="$Package")
void * symref
char * filename
CODE:
- DLDEBUG(2,fprintf(stderr,"dl_install_xsub(name=%s, symref=%x)\n",
+ DLDEBUG(2,PerlIO_printf(PerlIO_stderr(),"dl_install_xsub(name=%s, symref=%x)\n",
perl_name, symref));
- ST(0)=sv_2mortal(newRV((SV*)newXS(perl_name, (void(*)(CV*))symref, filename)));
+ ST(0)=sv_2mortal(newRV((SV*)newXS(perl_name, (void(*)(CV* _CPERLarg))symref, filename)));
char *
diff --git a/gnu/usr.bin/perl/win32/include/dirent.h b/gnu/usr.bin/perl/win32/include/dirent.h
index 8cc7e11479b..be363ce8044 100644
--- a/gnu/usr.bin/perl/win32/include/dirent.h
+++ b/gnu/usr.bin/perl/win32/include/dirent.h
@@ -38,12 +38,12 @@ typedef struct _dir_struc
struct direct dirstr; // Directory structure to return
} DIR;
-DIR *opendir(char *filename);
-struct direct *readdir(DIR *dirp);
-long telldir(DIR *dirp);
-void seekdir(DIR *dirp,long loc);
-void rewinddir(DIR *dirp);
-int closedir(DIR *dirp);
+DIR * win32_opendir(char *filename);
+struct direct * win32_readdir(DIR *dirp);
+long win32_telldir(DIR *dirp);
+void win32_seekdir(DIR *dirp,long loc);
+void win32_rewinddir(DIR *dirp);
+int win32_closedir(DIR *dirp);
#endif //_INC_DIRENT
diff --git a/gnu/usr.bin/perl/win32/include/sys/socket.h b/gnu/usr.bin/perl/win32/include/sys/socket.h
index 9e5259b254f..6ffb0ac269e 100644
--- a/gnu/usr.bin/perl/win32/include/sys/socket.h
+++ b/gnu/usr.bin/perl/win32/include/sys/socket.h
@@ -11,6 +11,13 @@ extern "C" {
#endif
#ifndef _WINDOWS_
+#ifdef __GNUC__
+#define WIN32_LEAN_AND_MEAN
+#ifdef __GNUC__
+#define Win32_Winsock
+#endif
+#include <windows.h>
+#else
#define _WINDOWS_
#define FAR
@@ -38,12 +45,50 @@ typedef struct _OVERLAPPED {
HANDLE hEvent;
} OVERLAPPED, *LPOVERLAPPED;
+#endif
#endif //_WINDOWS_
+#ifndef __GNUC__
#include <winsock.h>
+#endif
#define ENOTSOCK WSAENOTSOCK
#undef HOST_NOT_FOUND
+#ifdef USE_SOCKETS_AS_HANDLES
+
+#ifndef PERL_FD_SETSIZE
+#define PERL_FD_SETSIZE 64
+#endif
+
+#define PERL_BITS_PER_BYTE 8
+#define PERL_NFDBITS (sizeof(Perl_fd_mask)*PERL_BITS_PER_BYTE)
+
+typedef int Perl_fd_mask;
+
+typedef struct Perl_fd_set {
+ Perl_fd_mask bits[(PERL_FD_SETSIZE+PERL_NFDBITS-1)/PERL_NFDBITS];
+} Perl_fd_set;
+
+#define PERL_FD_CLR(n,p) \
+ ((p)->bits[(n)/PERL_NFDBITS] &= ~((unsigned)1 << ((n)%PERL_NFDBITS)))
+
+#define PERL_FD_SET(n,p) \
+ ((p)->bits[(n)/PERL_NFDBITS] |= ((unsigned)1 << ((n)%PERL_NFDBITS)))
+
+#define PERL_FD_ZERO(p) memset((char *)(p),0,sizeof(*(p)))
+
+#define PERL_FD_ISSET(n,p) \
+ ((p)->bits[(n)/PERL_NFDBITS] & ((unsigned)1 << ((n)%PERL_NFDBITS)))
+
+#else /* USE_SOCKETS_AS_HANDLES */
+
+#define Perl_fd_set fd_set
+#define PERL_FD_SET(n,p) FD_SET(n,p)
+#define PERL_FD_CLR(n,p) FD_CLR(n,p)
+#define PERL_FD_ISSET(n,p) FD_ISSET(n,p)
+#define PERL_FD_ZERO(p) FD_ZERO(p)
+
+#endif /* USE_SOCKETS_AS_HANDLES */
SOCKET win32_accept (SOCKET s, struct sockaddr *addr, int *addrlen);
int win32_bind (SOCKET s, const struct sockaddr *addr, int namelen);
@@ -63,7 +108,8 @@ u_short win32_ntohs (u_short netshort);
int win32_recv (SOCKET s, char * buf, int len, int flags);
int win32_recvfrom (SOCKET s, char * buf, int len, int flags,
struct sockaddr *from, int * fromlen);
-int win32_select (int nfds, int *readfds, int *writefds, int *exceptfds, const struct timeval *timeout);
+int win32_select (int nfds, Perl_fd_set *rfds, Perl_fd_set *wfds, Perl_fd_set *xfds,
+ const struct timeval *timeout);
int win32_send (SOCKET s, const char * buf, int len, int flags);
int win32_sendto (SOCKET s, const char * buf, int len, int flags,
const struct sockaddr *to, int tolen);
@@ -95,6 +141,8 @@ void win32_endnetent(void);
void win32_endprotoent(void);
void win32_endservent(void);
+#ifndef WIN32SCK_IS_STDSCK
+#ifndef PERL_OBJECT
//
// direct to our version
//
@@ -115,6 +163,7 @@ void win32_endservent(void);
#define recv win32_recv
#define recvfrom win32_recvfrom
#define shutdown win32_shutdown
+#define closesocket win32_closesocket
#define ioctlsocket win32_ioctlsocket
#define setsockopt win32_setsockopt
#define getsockopt win32_getsockopt
@@ -142,6 +191,22 @@ void win32_endservent(void);
#define setprotoent win32_setprotoent
#define setservent win32_setservent
+#ifdef USE_SOCKETS_AS_HANDLES
+#undef fd_set
+#undef FD_SET
+#undef FD_CLR
+#undef FD_ISSET
+#undef FD_ZERO
+#define fd_set Perl_fd_set
+#define FD_SET(n,p) PERL_FD_SET(n,p)
+#define FD_CLR(n,p) PERL_FD_CLR(n,p)
+#define FD_ISSET(n,p) PERL_FD_ISSET(n,p)
+#define FD_ZERO(p) PERL_FD_ZERO(p)
+#endif /* USE_SOCKETS_AS_HANDLES */
+
+#endif /* PERL_OBJECT */
+#endif /* WIN32SCK_IS_STDSCK */
+
#ifdef __cplusplus
}
#endif
diff --git a/gnu/usr.bin/perl/win32/makedef.pl b/gnu/usr.bin/perl/win32/makedef.pl
index b4883ccb593..a637ca1d46c 100644
--- a/gnu/usr.bin/perl/win32/makedef.pl
+++ b/gnu/usr.bin/perl/win32/makedef.pl
@@ -14,29 +14,90 @@
# that does not present in the WIN32 port but there is no easy
# way to find them so I just put a exception list here
-my $CCTYPE = shift || "MSVC";
+my $CCTYPE = "MSVC"; # default
-$skip_sym=<<'!END!OF!SKIP!';
-Perl_SvIV
-Perl_SvNV
-Perl_SvTRUE
-Perl_SvUV
+while (@ARGV)
+ {
+ my $flag = shift;
+ $define{$1} = 1 if ($flag =~ /^-D(\w+)$/);
+ $CCTYPE = $1 if ($flag =~ /^CCTYPE=(\w+)$/);
+ }
+
+open(CFG,'config.h') || die "Cannot open config.h:$!";
+while (<CFG>)
+ {
+ $define{$1} = 1 if /^\s*#\s*define\s+(MYMALLOC)\b/;
+ $define{$1} = 1 if /^\s*#\s*define\s+(USE_THREADS)\b/;
+ }
+close(CFG);
+
+warn join(' ',keys %define)."\n";
+
+if ($define{PERL_OBJECT}) {
+ print "LIBRARY PerlCore\n";
+ print "DESCRIPTION 'Perl interpreter'\n";
+ print "EXPORTS\n";
+ output_symbol("perl_alloc");
+ exit(0);
+}
+
+if ($CCTYPE ne 'GCC')
+ {
+ print "LIBRARY Perl\n";
+ print "DESCRIPTION 'Perl interpreter, export autogenerated'\n";
+ }
+else
+ {
+ $define{'PERL_GLOBAL_STRUCT'} = 1;
+ $define{'MULTIPLICITY'} = 1;
+ }
+
+print "EXPORTS\n";
+
+my %skip;
+my %export;
+
+sub skip_symbols
+{
+ my $list = shift;
+ foreach my $symbol (@$list)
+ {
+ $skip{$symbol} = 1;
+ }
+}
+
+sub emit_symbols
+{
+ my $list = shift;
+ foreach my $symbol (@$list)
+ {
+ emit_symbol($symbol) unless exists $skip{$symbol};
+ }
+}
+
+skip_symbols [qw(
+PL_statusvalue_vms
+PL_archpat_auto
+PL_cryptseen
+PL_DBcv
+PL_generation
+PL_in_clean_all
+PL_in_clean_objs
+PL_lastgotoprobe
+PL_linestart
+PL_modcount
+PL_pending_ident
+PL_sortcxix
+PL_sublex_info
+PL_timesbuf
Perl_block_type
-Perl_sv_pvn
Perl_additem
Perl_cast_ulong
Perl_check_uni
Perl_checkcomma
Perl_chsize
Perl_ck_aelem
-Perl_cryptseen
Perl_cx_dump
-Perl_deb
-Perl_deb_growlevel
-Perl_debop
-Perl_debprofdump
-Perl_debstack
-Perl_debstackptrs
Perl_do_ipcctl
Perl_do_ipcget
Perl_do_msgrcv
@@ -63,6 +124,7 @@ Perl_force_next
Perl_force_word
Perl_hv_stashpv
Perl_intuit_more
+Perl_init_thread_intern
Perl_know_next
Perl_modkids
Perl_mstats
@@ -84,13 +146,6 @@ Perl_pp_map
Perl_pp_nswitch
Perl_q
Perl_reall_srchlen
-Perl_regdump
-Perl_regfold
-Perl_regmyendp
-Perl_regmyp_size
-Perl_regmystartp
-Perl_regnarrate
-Perl_regprop
Perl_same_dirent
Perl_saw_return
Perl_scan_const
@@ -106,16 +161,14 @@ Perl_scan_trans
Perl_scan_word
Perl_setenv_getix
Perl_skipspace
+Perl_sort_mutex
Perl_sublex_done
Perl_sublex_start
-Perl_sv_peek
Perl_sv_ref
Perl_sv_setptrobj
-Perl_timesbuf
Perl_too_few_arguments
Perl_too_many_arguments
Perl_unlnk
-Perl_wait4pid
Perl_watch
Perl_yyname
Perl_yyrule
@@ -127,36 +180,144 @@ mystack_mark
perl_init_ext
perl_requirepv
stack
-statusvalue_vms
Perl_safexcalloc
Perl_safexmalloc
Perl_safexfree
Perl_safexrealloc
Perl_my_memcmp
Perl_my_memset
-Perl_cshlen
-Perl_cshname
-!END!OF!SKIP!
+PL_cshlen
+PL_cshname
+PL_opsave
+)];
-# All symbols have a Perl_ prefix because that's what embed.h
-# sticks in front of them.
+if ($define{'MYMALLOC'})
+ {
+ skip_symbols [qw(
+ Perl_safefree
+ Perl_safemalloc
+ Perl_saferealloc
+ Perl_safecalloc)];
+ emit_symbols [qw(
+ Perl_malloc
+ Perl_free
+ Perl_realloc
+ Perl_calloc)];
+ }
+else
+ {
+ skip_symbols [qw(
+ Perl_malloced_size)];
+ }
-print "LIBRARY Perl\n";
-print "DESCRIPTION 'Perl interpreter, export autogenerated'\n";
-print "CODE LOADONCALL\n";
-print "DATA LOADONCALL NONSHARED MULTIPLE\n";
-print "EXPORTS\n";
+unless ($define{'USE_THREADS'})
+ {
+ skip_symbols [qw(
+PL_thr_key
+PL_sv_mutex
+PL_cred_mutex
+PL_strtab_mutex
+PL_svref_mutex
+PL_malloc_mutex
+PL_eval_mutex
+PL_eval_cond
+PL_eval_owner
+PL_threads_mutex
+PL_nthreads
+PL_nthreads_cond
+PL_threadnum
+PL_threadsv_names
+PL_thrsv
+Perl_vtbl_mutex
+Perl_getTHR
+Perl_setTHR
+Perl_condpair_magic
+Perl_new_struct_thread
+Perl_per_thread_magicals
+Perl_thread_create
+Perl_find_threadsv
+Perl_unlock_condpair
+Perl_magic_mutexfree
+Perl_sv_iv
+Perl_sv_nv
+Perl_sv_true
+Perl_sv_uv
+Perl_sv_pvn
+)];
+ }
-open (GLOBAL, "<../global.sym") || die "failed to open global.sym" . $!;
-while (<GLOBAL>) {
- my $symbol;
- next if (!/^[A-Za-z]/);
- next if (/_amg[ \t]*$/);
- $symbol = "Perl_$_";
- next if ($skip_sym =~ m/$symbol/m);
- emit_symbol($symbol);
+unless ($define{'FAKE_THREADS'})
+ {
+ skip_symbols [qw(PL_curthr)];
+ }
+
+sub readvar
+{
+ my $file = shift;
+ open(VARS,$file) || die "Cannot open $file:$!";
+ my @syms;
+ while (<VARS>)
+ {
+ # All symbols have a Perl_ prefix because that's what embed.h
+ # sticks in front of them.
+ push(@syms,"PL_".$1) if (/\bPERLVARI?C?\([IGT](\w+)/);
+ }
+ close(VARS);
+ return \@syms;
}
+
+if ($define{'USE_THREADS'} || $define{'MULTIPLICITY'})
+ {
+ my $thrd = readvar("../thrdvar.h");
+ skip_symbols $thrd;
+ }
+
+if ($define{'MULTIPLICITY'})
+ {
+ my $interp = readvar("../intrpvar.h");
+ skip_symbols $interp;
+ }
+
+if ($define{'PERL_GLOBAL_STRUCT'})
+ {
+ my $global = readvar("../perlvars.h");
+ skip_symbols $global;
+ emit_symbols [qw(Perl_GetVars)];
+ emit_symbols [qw(PL_Vars PL_VarsPtr)] unless $CCTYPE eq 'GCC';
+ }
+
+unless ($define{'DEBUGGING'})
+ {
+ skip_symbols [qw(
+ Perl_deb
+ Perl_deb_growlevel
+ Perl_debop
+ Perl_debprofdump
+ Perl_debstack
+ Perl_debstackptrs
+ Perl_runops_debug
+ Perl_sv_peek
+ Perl_watchaddr
+ Perl_watchok)];
+ }
+
+if ($define{'HAVE_DES_FCRYPT'})
+ {
+ emit_symbols [qw(win32_crypt)];
+ }
+
+open (GLOBAL, "<../global.sym") || die "failed to open global.sym" . $!;
+while (<GLOBAL>)
+ {
+ next if (!/^[A-Za-z]/);
+ next if (/_amg[ \t]*$/);
+ # All symbols have a Perl_ prefix because that's what embed.h
+ # sticks in front of them.
+ chomp($_);
+ my $symbol = "Perl_$_";
+ emit_symbol($symbol) unless exists $skip{$symbol};
+ }
close(GLOBAL);
# also add symbols from interp.sym
@@ -164,45 +325,67 @@ close(GLOBAL);
# doesn't hurt to include them anyway.
# these don't have Perl prefix
-open (INTERP, "<../interp.sym") || die "failed to open interp.sym" . $!;
-while (<INTERP>) {
- my $symbol;
- next if (!/^[A-Za-z]/);
- next if (/_amg[ \t]*$/);
- $symbol = $_;
- next if ($skip_sym =~ m/$symbol/m);
- #print "\t$symbol";
- emit_symbol("Perl_" . $symbol);
-}
+unless ($define{'PERL_GLOBAL_STRUCT'})
+ {
+ my $glob = readvar("../perlvars.h");
+ emit_symbols $glob;
+ }
+
+unless ($define{'MULTIPLICITY'})
+ {
+ my $glob = readvar("../intrpvar.h");
+ emit_symbols $glob;
+ }
-#close(INTERP);
+unless ($define{'MULTIPLICITY'} || $define{'USE_THREADS'})
+ {
+ my $glob = readvar("../thrdvar.h");
+ emit_symbols $glob;
+ }
while (<DATA>) {
my $symbol;
next if (!/^[A-Za-z]/);
next if (/^#/);
+ s/\r//g;
+ chomp($_);
$symbol = $_;
- next if ($skip_sym =~ m/^$symbol/m);
+ next if exists $skip{$symbol};
emit_symbol($symbol);
}
+foreach my $symbol (sort keys %export)
+ {
+ output_symbol($symbol);
+ }
+
sub emit_symbol {
my $symbol = shift;
- chomp $symbol;
- if ($CCTYPE eq "BORLAND") {
- # workaround Borland quirk by exporting both the straight
- # name and a name with leading underscore. Note the
- # alias *must* come after the symbol itself, if both
- # are to be exported. (Linker bug?)
- print "\t_$symbol\n";
- print "\t$symbol = _$symbol\n";
- }
- else {
- # for binary coexistence, export both the symbol and
- # alias with leading underscore
- print "\t$symbol\n";
- print "\t_$symbol = $symbol\n";
- }
+ chomp($symbol);
+ $export{$symbol} = 1;
+}
+
+sub output_symbol {
+ my $symbol = shift;
+ if ($CCTYPE eq "BORLAND") {
+ # workaround Borland quirk by exporting both the straight
+ # name and a name with leading underscore. Note the
+ # alias *must* come after the symbol itself, if both
+ # are to be exported. (Linker bug?)
+ print "\t_$symbol\n";
+ print "\t$symbol = _$symbol\n";
+ }
+ elsif ($CCTYPE eq 'GCC') {
+ # Symbols have leading _ whole process is $%£"% slow
+ # so skip aliases for now
+ print "\t$symbol\n";
+ }
+ else {
+ # for binary coexistence, export both the symbol and
+ # alias with leading underscore
+ print "\t$symbol\n";
+ print "\t_$symbol = $symbol\n";
+ }
}
1;
@@ -211,6 +394,7 @@ __DATA__
perl_init_i18nl10n
perl_init_ext
perl_alloc
+perl_atexit
perl_construct
perl_destruct
perl_free
@@ -227,7 +411,13 @@ perl_call_sv
perl_require_pv
perl_eval_pv
perl_eval_sv
+perl_new_ctype
+perl_new_collate
+perl_new_numeric
+perl_set_numeric_standard
+perl_set_numeric_local
boot_DynaLoader
+Perl_thread_create
win32_errno
win32_environ
win32_stdin
@@ -265,6 +455,7 @@ win32_stat
win32_pipe
win32_popen
win32_pclose
+win32_rename
win32_setmode
win32_lseek
win32_tell
@@ -280,6 +471,7 @@ win32_mkdir
win32_rmdir
win32_chdir
win32_flock
+win32_execv
win32_execvp
win32_htons
win32_ntohs
@@ -297,6 +489,7 @@ win32_sendto
win32_recv
win32_recvfrom
win32_shutdown
+win32_closesocket
win32_ioctlsocket
win32_setsockopt
win32_getsockopt
@@ -324,6 +517,7 @@ win32_setnetent
win32_setprotoent
win32_setservent
win32_getenv
+win32_putenv
win32_perror
win32_setbuf
win32_setvbuf
@@ -340,8 +534,26 @@ win32_malloc
win32_calloc
win32_realloc
win32_free
-win32stdio
+win32_sleep
+win32_times
+win32_alarm
+win32_open_osfhandle
+win32_get_osfhandle
+win32_ioctl
+win32_utime
+win32_wait
+win32_waitpid
+win32_kill
+win32_str_os_error
+win32_opendir
+win32_readdir
+win32_telldir
+win32_seekdir
+win32_rewinddir
+win32_closedir
Perl_win32_init
+Perl_init_os_extras
+Perl_getTHR
+Perl_setTHR
RunPerl
-SetIOSubSystem
-GetIOSubSystem
+
diff --git a/gnu/usr.bin/perl/win32/makefile.mk b/gnu/usr.bin/perl/win32/makefile.mk
index dbac98f7ffd..0c613d38cea 100644
--- a/gnu/usr.bin/perl/win32/makefile.mk
+++ b/gnu/usr.bin/perl/win32/makefile.mk
@@ -1,607 +1,1121 @@
-#
-# Makefile to build perl on Windowns NT using Microsoft NMAKE.
-#
-#
-# 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.
-#
-
-#
-# Set these to wherever you want "nmake install" to put your
-# newly built perl.
-INST_DRV=c:
-INST_TOP=$(INST_DRV)\perl
-
-#
-# uncomment one if you are using Visual C++ 2.x or Borland
-# comment out both if you are using Visual C++ 4.x and above
-#CCTYPE=MSVC20
-CCTYPE=BORLAND
-
-#
-# uncomment next line if you want debug version of perl (big,slow)
-#CFG=Debug
-
-#
-# set the install locations of the compiler include/libraries
-#CCHOME = f:\msdev\vc
-CCHOME = D:\bc5
-CCINCDIR = $(CCHOME)\include
-CCLIBDIR = $(CCHOME)\lib
-
-#
-# set this to point to cmd.exe (only needed if you use some
-# alternate shell that doesn't grok cmd.exe style commands)
-SHELL = g:\winnt\system32\cmd.exe
-
-#
-# set this to your email address (perl will guess a value from
-# from your loginname and your hostname, which may not be right)
-#EMAIL =
-
-##################### CHANGE THESE ONLY IF YOU MUST #####################
-
-#
-# Programs to compile, build .lib files and link
-#
-
-.USESHELL :
-
-.IF "$(CCTYPE)" == "BORLAND"
-
-CC = bcc32
-LINK32 = tlink32
-LIB32 = tlib
-IMPLIB = implib
-
-#
-# Options
-#
-RUNTIME = -D_RTLDLL
-INCLUDES = -I.\include -I. -I.. -I$(CCINCDIR)
-#PCHFLAGS = -H -H$(INTDIR)\bcmoduls.pch
-DEFINES = -DWIN32 -DPERLDLL
-SUBSYS = console
-LIBC = cw32mti.lib
-LIBFILES = import32.lib $(LIBC) odbc32.lib odbccp32.lib
-
-WINIOMAYBE =
-
-.IF "$(CFG)" == "Debug"
-OPTIMIZE = -v $(RUNTIME)
-LINK_DBG = -v
-.ELSE
-OPTIMIZE = -O $(RUNTIME)
-LINK_DBG =
-.ENDIF
-
-CFLAGS = -w -tWM -tWD $(INCLUDES) $(DEFINES) $(PCHFLAGS) $(OPTIMIZE)
-LINK_FLAGS = $(LINK_DBG) -L$(CCLIBDIR)
-OBJOUT_FLAG = -o
-
-.ELSE
-
-CC=cl.exe
-LINK32=link.exe
-LIB32=$(LINK32) -lib
-#
-# Options
-#
-.IF "$(RUNTIME)" == ""
-RUNTIME = -MD
-.ENDIF
-INCLUDES = -I.\include -I. -I..
-#PCHFLAGS = -Fp$(INTDIR)\vcmoduls.pch -YX
-DEFINES = -DWIN32 -D_CONSOLE -DPERLDLL
-SUBSYS = console
-
-.IF "$(RUNTIME)" == "-MD"
-LIBC = msvcrt.lib
-WINIOMAYBE =
-.ELSE
-LIBC = libcmt.lib
-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 = -debug -pdb:none
-.ELSE
-.IF "$(CCTYPE)" == "MSVC20"
-OPTIMIZE = -Od $(RUNTIME) -DNDEBUG
-.ELSE
-OPTIMIZE = -Od $(RUNTIME) -DNDEBUG
-.ENDIF
-LINK_DBG = -release
-.ENDIF
-
-# we don't add LIBC here, the compiler do it based on -MD/-MT
-LIBFILES = 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 \
- version.lib odbc32.lib odbccp32.lib
-
-CFLAGS = -nologo -W3 $(INCLUDES) $(DEFINES) $(PCHFLAGS) $(OPTIMIZE)
-LINK_FLAGS = -nologo $(LIBFILES) $(LINK_DBG) -machine:I386
-OBJOUT_FLAG = -Fo
-
-.ENDIF
-
-#################### 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) $(OBJOUT_FLAG)$@ $<
-
-.IF "$(CCTYPE)" == "BORLAND"
-
-.obj.dll:
- $(LINK32) -Tpd -ap $(LINK_FLAGS) c0d32.obj $<,$@,,$(LIBFILES),$(*B).def
- $(IMPLIB) $(*B).lib $@
-.ELSE
-
-.obj.dll:
- $(LINK32) -dll -subsystem:windows -implib:$(*B).lib -def:$(*B).def \
- -out:$@ $(LINK_FLAGS) $< $(LIBPERL)
-
-.ENDIF
-
-#
-INST_BIN=$(INST_TOP)\bin
-INST_LIB=$(INST_TOP)\lib
-INST_POD=$(INST_LIB)\pod
-INST_HTML=$(INST_POD)\html
-LIBDIR=..\lib
-EXTDIR=..\ext
-PODDIR=..\pod
-EXTUTILSDIR=$(LIBDIR)\extutils
-
-#
-# various targets
-PERLIMPLIB=..\perl.lib
-MINIPERL=..\miniperl.exe
-PERLDLL=..\perl.dll
-PERLEXE=..\perl.exe
-GLOBEXE=..\perlglob.exe
-CONFIGPM=..\lib\Config.pm
-MINIMOD=..\lib\ExtUtils\Miniperl.pm
-
-PL2BAT=bin\pl2bat.pl
-GLOBBAT = bin\perlglob.bat
-
-.IF "$(CCTYPE)" == "BORLAND"
-
-# Borland wildargs is incompatible with MS setargv
-CFGSH_TMPL = config.bc
-CFGH_TMPL = config_H.bc
-# Borland's perl.exe will work on W95, so we don't make this
-
-.ELSE
-
-MAKE = nmake -nologo
-CFGSH_TMPL = config.vc
-CFGH_TMPL = config_H.vc
-PERL95EXE=..\perl95.exe
-
-.ENDIF
-
-XCOPY=xcopy /f /r /i /d
-RCOPY=xcopy /f /r /i /e /d
-#NULL=
-
-#
-# filenames given to xsubpp must have forward slashes (since it puts
-# full pathnames in #line strings)
-XSUBPP=..\$(MINIPERL) -I..\..\lib ..\$(EXTUTILSDIR)\xsubpp -C++ -prototypes
-
-CORE_C= ..\av.c \
- ..\deb.c \
- ..\doio.c \
- ..\doop.c \
- ..\dump.c \
- ..\globals.c \
- ..\gv.c \
- ..\hv.c \
- ..\mg.c \
- ..\op.c \
- ..\perl.c \
- ..\perlio.c \
- ..\perly.c \
- ..\pp.c \
- ..\pp_ctl.c \
- ..\pp_hot.c \
- ..\pp_sys.c \
- ..\regcomp.c \
- ..\regexec.c \
- ..\run.c \
- ..\scope.c \
- ..\sv.c \
- ..\taint.c \
- ..\toke.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
-
-PERL95_OBJ = perl95.obj \
- win32mt.obj \
- win32iomt.obj \
- win32sckmt.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
-SOCKET=$(EXTDIR)\Socket\Socket
-FCNTL=$(EXTDIR)\Fcntl\Fcntl
-OPCODE=$(EXTDIR)\Opcode\Opcode
-SDBM_FILE=$(EXTDIR)\SDBM_File\SDBM_File
-IO=$(EXTDIR)\IO\IO
-
-SOCKET_DLL=..\lib\auto\Socket\Socket.dll
-FCNTL_DLL=..\lib\auto\Fcntl\Fcntl.dll
-OPCODE_DLL=..\lib\auto\Opcode\Opcode.dll
-SDBM_FILE_DLL=..\lib\auto\SDBM_File\SDBM_File.dll
-IO_DLL=..\lib\auto\IO\IO.dll
-
-STATICLINKMODULES=DynaLoader
-DYNALOADMODULES= \
- $(SOCKET_DLL) \
- $(FCNTL_DLL) \
- $(OPCODE_DLL) \
- $(SDBM_FILE_DLL)\
- $(IO_DLL)
-
-POD2HTML=$(PODDIR)\pod2html
-POD2MAN=$(PODDIR)\pod2man
-POD2LATEX=$(PODDIR)\pod2latex
-POD2TEXT=$(PODDIR)\pod2text
-
-#
-# Top targets
-#
-
-all: $(PERLEXE) $(PERL95EXE) $(GLOBEXE) $(DYNALOADMODULES) $(MINIMOD) $(GLOBBAT)
-
-$(DYNALOADER).obj : $(DYNALOADER).c $(CORE_H) $(EXTDIR)\DynaLoader\dlutils.c
-
-#------------------------------------------------------------
-
-$(GLOBEXE): perlglob.obj
-.IF "$(CCTYPE)" == "BORLAND"
- $(CC) -c -w -v -tWM -I$(CCINCDIR) perlglob.c
- $(LINK32) -Tpe -ap $(LINK_FLAGS) c0x32.obj perlglob.obj \
- $(CCLIBDIR)\32BIT\wildargs.obj,$@,,import32.lib cw32mt.lib,
-.ELSE
- $(LINK32) $(LINK_FLAGS) -out:$@ -subsystem:$(SUBSYS) perlglob.obj setargv.obj
-.ENDIF
-
-$(GLOBBAT) : ..\lib\File\DosGlob.pm $(MINIPERL)
- $(MINIPERL) $(PL2BAT) - < ..\lib\File\DosGlob.pm > $(GLOBBAT)
-
-perlglob.obj : perlglob.c
-
-..\miniperlmain.obj : ..\miniperlmain.c $(CORE_H)
-
-config.w32 : $(CFGSH_TMPL)
- copy $(CFGSH_TMPL) config.w32
-
-.\config.h : $(CFGSH_TMPL)
- -del /f config.h
- copy $(CFGH_TMPL) config.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" \
- "cf_email=$(EMAIL)" "libs=$(LIBFILES:f)" "incpath=$(CCINCDIR)" \
- "libpth=$(strip $(CCLIBDIR) $(LIBFILES:d))" "libc=$(LIBC)" \
- config.w32 > ..\config.sh
-
-$(CONFIGPM) : $(MINIPERL) ..\config.sh config_h.PL ..\minimod.pl
- cd .. && miniperl configpm
- if exist lib\* $(RCOPY) lib\*.* ..\lib\$(NULL)
- $(XCOPY) ..\*.h ..\lib\CORE\*.*
- $(XCOPY) *.h ..\lib\CORE\*.*
- $(RCOPY) include ..\lib\CORE\*.*
- $(MINIPERL) -I..\lib config_h.PL || $(MAKE) CCTYPE=$(CCTYPE) \
- RUNTIME=$(RUNTIME) CFG=$(CFG) $(CONFIGPM)
-
-$(MINIPERL) : ..\miniperlmain.obj $(CORE_OBJ) $(WIN32_OBJ)
-.IF "$(CCTYPE)" == "BORLAND"
- $(LINK32) -Tpe -ap $(LINK_FLAGS) \
- @$(mktmp c0x32.obj ..\miniperlmain.obj \
- $(CORE_OBJ:s,\,\\) $(WIN32_OBJ:s,\,\\),$@,,$(LIBFILES),)
-.ELSE
- $(LINK32) -subsystem:console -out:$@ \
- @$(mktmp $(LINK_FLAGS) ..\miniperlmain.obj \
- $(CORE_OBJ:s,\,\\) $(WIN32_OBJ:s,\,\\))
-.ENDIF
-
-$(WIN32_OBJ) : $(CORE_H)
-$(CORE_OBJ) : $(CORE_H)
-$(DLL_OBJ) : $(CORE_H)
-
-perldll.def : $(MINIPERL) $(CONFIGPM)
- $(MINIPERL) -w makedef.pl $(CCTYPE) > perldll.def
-
-$(PERLDLL): perldll.def $(CORE_OBJ) $(WIN32_OBJ) $(DLL_OBJ)
-.IF "$(CCTYPE)" == "BORLAND"
- $(LINK32) -Tpd -ap $(LINK_FLAGS) \
- @$(mktmp c0d32.obj $(CORE_OBJ:s,\,\\) \
- $(WIN32_OBJ:s,\,\\) $(DLL_OBJ:s,\,\\)\n \
- $@,\n \
- $(LIBFILES)\n \
- perldll.def\n)
- $(IMPLIB) $*.lib $@
-.ELSE
- $(LINK32) -dll -def:perldll.def -out:$@ \
- @$(mktmp $(LINK_FLAGS) $(CORE_OBJ:s,\,\\) \
- $(WIN32_OBJ:s,\,\\) $(DLL_OBJ:s,\,\\))
-.ENDIF
- $(XCOPY) $(PERLIMPLIB) ..\lib\CORE
-
-perl.def : $(MINIPERL) makeperldef.pl
- $(MINIPERL) -I..\lib makeperldef.pl $(NULL) > perl.def
-
-$(MINIMOD) : $(MINIPERL) ..\minimod.pl
- cd .. && miniperl minimod.pl > lib\ExtUtils\Miniperl.pm
-
-perlmain.c : runperl.c
- copy runperl.c perlmain.c
-
-perlmain.obj : perlmain.c
- $(CC) $(CFLAGS) -UPERLDLL -c perlmain.c
-
-
-$(PERLEXE): $(PERLDLL) $(CONFIGPM) perlmain.obj
-.IF "$(CCTYPE)" == "BORLAND"
- $(LINK32) -Tpe -ap $(LINK_FLAGS) \
- @$(mktmp c0x32.obj perlmain.obj $(WINIOMAYBE)\n \
- $@,\n \
- $(PERLIMPLIB) $(LIBFILES)\n)
-.ELSE
- $(LINK32) -subsystem:console -out:perl.exe $(LINK_FLAGS) \
- perlmain.obj $(WINIOMAYBE) $(PERLIMPLIB)
- copy perl.exe $@
- del perl.exe
-.ENDIF
- copy splittree.pl ..
- $(MINIPERL) -I..\lib ..\splittree.pl "../LIB" "../LIB/auto"
- attrib -r ..\t\*.*
- copy test ..\t
-
-.IF "$(CCTYPE)" != "BORLAND"
-
-perl95.c : runperl.c
- copy runperl.c perl95.c
-
-perl95.obj : perl95.c
- $(CC) $(CFLAGS) -MT -UPERLDLL -c perl95.c
-
-win32iomt.obj : win32io.c
- $(CC) $(CFLAGS) -MT -c $(OBJOUT_FLAG)win32iomt.obj win32io.c
-
-win32sckmt.obj : win32sck.c
- $(CC) $(CFLAGS) -MT -c $(OBJOUT_FLAG)win32sckmt.obj win32sck.c
-
-win32mt.obj : win32.c
- $(CC) $(CFLAGS) -MT -c $(OBJOUT_FLAG)win32mt.obj win32.c
-
-$(PERL95EXE): $(PERLDLL) $(CONFIGPM) $(PERL95_OBJ)
- $(LINK32) -subsystem:console -out:perl95.exe $(LINK_FLAGS) \
- $(PERL95_OBJ) $(PERLIMPLIB)
- copy perl95.exe $@
- del perl95.exe
-
-.ENDIF
-
-$(DYNALOADER).c: $(MINIPERL) $(EXTDIR)\DynaLoader\dl_win32.xs $(CONFIGPM)
- if not exist ..\lib\auto mkdir ..\lib\auto
- $(XCOPY) $(EXTDIR)\$(*B)\$(*B).pm $(LIBDIR)\$(NULL)
- cd $(EXTDIR)\$(*B) && $(XSUBPP) dl_win32.xs > $(*B).c
- $(XCOPY) $(EXTDIR)\$(*B)\dlutils.c .
-
-$(EXTDIR)\DynaLoader\dl_win32.xs: dl_win32.xs
- copy dl_win32.xs $(EXTDIR)\DynaLoader\dl_win32.xs
-
-$(IO_DLL): $(PERLEXE) $(CONFIGPM) $(IO).xs
- cd $(EXTDIR)\$(*B) && \
- ..\..\miniperl -I..\..\lib Makefile.PL INSTALLDIRS=perl
- cd $(EXTDIR)\$(*B) && $(MAKE)
-
-$(SDBM_FILE_DLL) : $(PERLEXE) $(SDBM_FILE).xs
- cd $(EXTDIR)\$(*B) && \
- ..\..\miniperl -I..\..\lib Makefile.PL INSTALLDIRS=perl
- cd $(EXTDIR)\$(*B) && $(MAKE)
-
-$(FCNTL_DLL): $(PERLEXE) $(FCNTL).xs
- cd $(EXTDIR)\$(*B) && \
- ..\..\miniperl -I..\..\lib Makefile.PL INSTALLDIRS=perl
- cd $(EXTDIR)\$(*B) && $(MAKE)
-
-$(OPCODE_DLL): $(PERLEXE) $(OPCODE).xs
- cd $(EXTDIR)\$(*B) && \
- ..\..\miniperl -I..\..\lib Makefile.PL INSTALLDIRS=perl
- cd $(EXTDIR)\$(*B) && $(MAKE)
-
-$(SOCKET_DLL): $(SOCKET).xs $(PERLEXE)
- cd $(EXTDIR)\$(*B) && \
- ..\..\miniperl -I..\..\lib Makefile.PL INSTALLDIRS=perl
- cd $(EXTDIR)\$(*B) && $(MAKE)
-
-doc: $(PERLEXE)
- cd ..\pod && $(MAKE) -f ..\win32\pod.mak checkpods \
- pod2html pod2latex pod2man pod2text
- cd ..\pod && $(XCOPY) *.bat ..\win32\bin\*.*
- copy ..\README.win32 ..\pod\perlwin32.pod
- $(PERLEXE) ..\installhtml --podroot=.. --htmldir=./html \
- --podpath=pod:lib:ext:utils --htmlroot="//$(INST_HTML:s,:,|,)" \
- --libpod=perlfunc:perlguts:perlvar:perlrun:perlop --recurse
-
-utils: $(PERLEXE)
- cd ..\utils && $(MAKE) PERL=$(MINIPERL)
- cd ..\utils && $(PERLEXE) ..\win32\$(PL2BAT) h2ph splain perlbug \
- pl2pm c2ph h2xs perldoc pstruct
- $(XCOPY) ..\utils\*.bat bin\*.*
- $(PERLEXE) $(PL2BAT) bin\network.pl bin\www.pl bin\runperl.pl \
- bin\pl2bat.pl
-
-distclean: clean
- -del /f $(MINIPERL) $(PERLEXE) $(PERLDLL) $(GLOBEXE) \
- $(PERLIMPLIB) ..\miniperl.lib $(MINIMOD)
- -del /f *.def *.map
- -del /f $(SOCKET_DLL) $(IO_DLL) $(SDBM_FILE_DLL) $(FCNTL_DLL) \
- $(OPCODE_DLL)
- -del /f $(SOCKET).c $(IO).c $(SDBM_FILE).c $(FCNTL).c $(OPCODE).c \
- $(DYNALOADER).c
- -del /f $(PODDIR)\*.html
- -del /f $(PODDIR)\*.bat
- -del /f ..\config.sh ..\splittree.pl perlmain.c dlutils.c config.h.new
-.IF "$(PERL95EXE)" != ""
- -del /f perl95.c
-.ENDIF
- -del /f bin\*.bat
- -cd $(EXTDIR) && del /s *.lib *.def *.map *.bs Makefile *.obj pm_to_blib
- -rmdir /s /q ..\lib\auto
- -rmdir /s /q ..\lib\CORE
-
-install : all doc utils
- if not exist $(INST_TOP) mkdir $(INST_TOP)
- echo I $(INST_TOP) L $(LIBDIR)
- $(XCOPY) $(PERLEXE) $(INST_BIN)\*.*
-.IF "$(PERL95EXE)" != ""
- $(XCOPY) $(PERL95EXE) $(INST_BIN)\*.*
-.ENDIF
- $(XCOPY) $(GLOBEXE) $(INST_BIN)\*.*
- $(XCOPY) $(PERLDLL) $(INST_BIN)\*.*
- $(XCOPY) bin\*.bat $(INST_BIN)\*.*
- $(RCOPY) ..\lib $(INST_LIB)\*.*
- $(XCOPY) ..\pod\*.bat $(INST_BIN)\*.*
- $(XCOPY) ..\pod\*.pod $(INST_POD)\*.*
- $(RCOPY) html\*.* $(INST_HTML)\*.*
-
-inst_lib : $(CONFIGPM)
- copy splittree.pl ..
- $(MINIPERL) -I..\lib ..\splittree.pl "../LIB" "../LIB/auto"
- $(RCOPY) ..\lib $(INST_LIB)\*.*
-
-minitest : $(MINIPERL) $(GLOBEXE) $(CONFIGPM)
- $(XCOPY) $(MINIPERL) ..\t\perl.exe
-.IF "$(CCTYPE)" == "BORLAND"
- $(XCOPY) $(GLOBBAT) ..\t\$(NULL)
-.ELSE
- $(XCOPY) $(GLOBEXE) ..\t\$(NULL)
-.ENDIF
- attrib -r ..\t\*.*
- copy test ..\t
- cd ..\t && \
- $(MINIPERL) -I..\lib test base/*.t comp/*.t cmd/*.t io/*.t op/*.t pragma/*.t
-
-test : all
- $(XCOPY) $(PERLEXE) ..\t\$(NULL)
- $(XCOPY) $(PERLDLL) ..\t\$(NULL)
-.IF "$(CCTYPE)" == "BORLAND"
- $(XCOPY) $(GLOBBAT) ..\t\$(NULL)
-.ELSE
- $(XCOPY) $(GLOBEXE) ..\t\$(NULL)
-.ENDIF
- cd ..\t && $(PERLEXE) -I..\lib harness
-
-clean :
- -@erase miniperlmain.obj
- -@erase $(MINIPERL)
- -@erase perlglob.obj
- -@erase perlmain.obj
- -@erase config.w32
- -@erase /f config.h
- -@erase $(GLOBEXE)
- -@erase $(PERLEXE)
- -@erase $(PERLDLL)
- -@erase $(CORE_OBJ)
- -@erase $(WIN32_OBJ)
- -@erase $(DLL_OBJ)
- -@erase ..\*.obj ..\*.lib ..\*.exp *.obj *.lib *.exp
- -@erase ..\t\*.exe ..\t\*.dll ..\t\*.bat
- -@erase *.ilk
- -@erase *.pdb
-
-
+#
+# Makefile to build perl on Windows NT using DMAKE.
+# Supported compilers:
+# Visual C++ 2.0 thro 5.0
+# Borland C++ 5.02
+# Mingw32 with gcc-2.8.1 or egcs-1.0.2 **experimental**
+#
+# 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.
+#
+
+##
+## Make sure you read README.win32 *before* you mess with anything here!
+##
+
+##
+## Build configuration. Edit the values below to suit your needs.
+##
+
+#
+# Set these to wherever you want "nmake install" to put your
+# newly built perl.
+#
+INST_DRV *= c:
+INST_TOP *= $(INST_DRV)\perl
+
+#
+# Comment this out if you DON'T want your perl installation to be versioned.
+# This means that the new installation will overwrite any files from the
+# old installation at the same INST_TOP location. Leaving it enabled is
+# the safest route, as perl adds the extra version directory to all the
+# locations it installs files to. If you disable it, an alternative
+# versioned installation can be obtained by setting INST_TOP above to a
+# path that includes an arbitrary version string.
+#
+INST_VER *= \5.00503
+
+#
+# uncomment to enable threads-capabilities
+#
+#USE_THREADS *= define
+
+#
+# uncomment to enable multiple interpreters
+#
+#USE_MULTI *= define
+
+#
+# uncomment one
+#
+#CCTYPE *= MSVC20
+#CCTYPE *= MSVC
+CCTYPE *= BORLAND
+#CCTYPE *= GCC
+
+#
+# uncomment next line if you want to use the perl object
+# Currently, this cannot be enabled if you ask for threads above, or
+# if you are using GCC or EGCS.
+#
+#OBJECT *= -DPERL_OBJECT
+
+#
+# uncomment next line if you want debug version of perl (big,slow)
+#
+#CFG *= Debug
+
+#
+# uncomment next option if you want to use the VC++ compiler optimization.
+# This option is only relevant for the Microsoft compiler; we automatically
+# use maximum optimization with the other compilers (unless you specify a
+# DEBUGGING build).
+# Warning: This is known to produce incorrect code for compiler versions
+# earlier than VC++ 98 (Visual Studio 6.0). VC++ 98 generates code that
+# successfully passes the Perl regression test suite. It hasn't yet been
+# widely tested with real applications though.
+#
+#CFG *= Optimize
+
+#
+# uncomment to enable use of PerlCRT.DLL when using the Visual C compiler.
+# Highly recommended. It has patches that fix known bugs in MSVCRT.DLL.
+# This currently requires VC 5.0 with Service Pack 3.
+# Get it from CPAN at http://www.perl.com/CPAN/authors/id/D/DO/DOUGL/
+# and follow the directions in the package to install.
+#
+#USE_PERLCRT *= define
+
+#
+# uncomment to enable linking with setargv.obj under the Visual C
+# compiler. Setting this options enables perl to expand wildcards in
+# arguments, but it may be harder to use alternate methods like
+# File::DosGlob that are more powerful. This option is supported only with
+# Visual C.
+#
+#USE_SETARGV *= define
+
+#
+# if you have the source for des_fcrypt(), uncomment this and make sure the
+# file exists (see README.win32). File should be located in the same
+# directory as this file.
+#
+#CRYPT_SRC *= fcrypt.c
+
+#
+# if you didn't set CRYPT_SRC and if you have des_fcrypt() available in a
+# library, uncomment this, and make sure the library exists (see README.win32)
+# Specify the full pathname of the library.
+#
+#CRYPT_LIB *= fcrypt.lib
+
+#
+# set this if you wish to use perl's malloc
+# WARNING: Turning this on/off WILL break binary compatibility with extensions
+# you may have compiled with/without it. Be prepared to recompile all
+# extensions if you change the default. Currently, this cannot be enabled
+# if you ask for PERL_OBJECT above.
+#
+#PERL_MALLOC *= define
+
+#
+# set the install locations of the compiler include/libraries
+# Running VCVARS32.BAT is *required* when using Visual C.
+# Some versions of Visual C don't define MSVCDIR in the environment,
+# so you may have to set CCHOME explicitly (spaces in the path name should
+# not be quoted)
+#
+#CCHOME *= f:\msdev\vc
+CCHOME *= C:\bc5
+#CCHOME *= D:\packages\mingw32
+CCINCDIR *= $(CCHOME)\include
+CCLIBDIR *= $(CCHOME)\lib
+
+#
+# specify semicolon-separated list of extra directories that modules will
+# look for libraries (spaces in path names need not be quoted)
+#
+EXTRALIBDIRS *=
+
+#
+# set this to point to cmd.exe (only needed if you use some
+# alternate shell that doesn't grok cmd.exe style commands)
+#
+#SHELL *= g:\winnt\system32\cmd.exe
+
+#
+# set this to your email address (perl will guess a value from
+# from your loginname and your hostname, which may not be right)
+#
+#EMAIL *=
+
+##
+## Build configuration ends.
+##
+
+##################### CHANGE THESE ONLY IF YOU MUST #####################
+
+.IF "$(CRYPT_SRC)$(CRYPT_LIB)" == ""
+D_CRYPT = undef
+.ELSE
+D_CRYPT = define
+CRYPT_FLAG = -DHAVE_DES_FCRYPT
+.ENDIF
+
+.IF "$(OBJECT)" != ""
+PERL_MALLOC != undef
+USE_THREADS != undef
+USE_MULTI != undef
+.ENDIF
+
+PERL_MALLOC *= undef
+
+USE_THREADS *= undef
+USE_MULTI *= undef
+
+#BUILDOPT *= -DPERL_GLOBAL_STRUCT
+# -DUSE_PERLIO -D__STDC__=1 -DUSE_SFIO -DI_SFIO -I\sfio97\include
+
+.IMPORT .IGNORE : PROCESSOR_ARCHITECTURE
+
+PROCESSOR_ARCHITECTURE *= x86
+
+.IF "$(OBJECT)" != ""
+ARCHNAME = MSWin32-$(PROCESSOR_ARCHITECTURE)-object
+.ELIF "$(USE_THREADS)" == "define"
+ARCHNAME = MSWin32-$(PROCESSOR_ARCHITECTURE)-thread
+.ELSE
+ARCHNAME = MSWin32-$(PROCESSOR_ARCHITECTURE)
+.ENDIF
+
+ARCHDIR = ..\lib\$(ARCHNAME)
+COREDIR = ..\lib\CORE
+AUTODIR = ..\lib\auto
+
+#
+# Programs to compile, build .lib files and link
+#
+
+.USESHELL :
+
+.IF "$(CCTYPE)" == "BORLAND"
+
+CC = bcc32
+LINK32 = tlink32
+LIB32 = tlib /P128
+IMPLIB = implib -c
+
+#
+# Options
+#
+RUNTIME = -D_RTLDLL
+INCLUDES = -I$(COREDIR) -I.\include -I. -I.. -I"$(CCINCDIR)"
+#PCHFLAGS = -H -Hc -H=c:\temp\bcmoduls.pch
+DEFINES = -DWIN32 $(BUILDOPT) $(CRYPT_FLAG)
+LOCDEFS = -DPERLDLL -DPERL_CORE
+SUBSYS = console
+CXX_FLAG = -P
+
+LIBC = cw32mti.lib
+LIBFILES = $(CRYPT_LIB) import32.lib $(LIBC) odbc32.lib odbccp32.lib
+
+.IF "$(CFG)" == "Debug"
+OPTIMIZE = -v $(RUNTIME) -DDEBUGGING
+LINK_DBG = -v
+.ELSE
+OPTIMIZE = -O2 $(RUNTIME)
+LINK_DBG =
+.ENDIF
+
+CFLAGS = -w -g0 -tWM -tWD $(INCLUDES) $(DEFINES) $(LOCDEFS) \
+ $(PCHFLAGS) $(OPTIMIZE)
+LINK_FLAGS = $(LINK_DBG) -L"$(CCLIBDIR)"
+OBJOUT_FLAG = -o
+EXEOUT_FLAG = -e
+LIBOUT_FLAG =
+
+.ELIF "$(CCTYPE)" == "GCC"
+
+CC = gcc
+LINK32 = gcc
+LIB32 = ar rc
+IMPLIB = dlltool
+
+o = .o
+a = .a
+
+#
+# Options
+#
+RUNTIME =
+INCLUDES = -I$(COREDIR) -I.\include -I. -I..
+DEFINES = -DWIN32 $(BUILDOPT) $(CRYPT_FLAG)
+LOCDEFS = -DPERLDLL -DPERL_CORE
+SUBSYS = console
+CXX_FLAG = -xc++
+
+LIBC = -lcrtdll
+LIBFILES = $(CRYPT_LIB) -ladvapi32 -luser32 -lnetapi32 -lwsock32 \
+ -lmingw32 -lgcc -lmoldname $(LIBC) -lkernel32
+
+.IF "$(CFG)" == "Debug"
+OPTIMIZE = -g -O2 $(RUNTIME) -DDEBUGGING
+LINK_DBG = -g
+.ELSE
+OPTIMIZE = -g -O2 $(RUNTIME)
+LINK_DBG =
+.ENDIF
+
+CFLAGS = $(INCLUDES) $(DEFINES) $(LOCDEFS) $(OPTIMIZE)
+LINK_FLAGS = $(LINK_DBG) -L"$(CCLIBDIR)"
+OBJOUT_FLAG = -o
+EXEOUT_FLAG = -o
+LIBOUT_FLAG =
+
+.ELSE
+
+CC = cl.exe
+LINK32 = link.exe
+LIB32 = $(LINK32) -lib
+
+#
+# Options
+#
+
+RUNTIME = -MD
+INCLUDES = -I$(COREDIR) -I.\include -I. -I..
+#PCHFLAGS = -Fpc:\temp\vcmoduls.pch -YX
+DEFINES = -DWIN32 -D_CONSOLE -DNO_STRICT $(BUILDOPT) $(CRYPT_FLAG)
+LOCDEFS = -DPERLDLL -DPERL_CORE
+SUBSYS = console
+CXX_FLAG = -TP -GX
+
+.IF "$(USE_PERLCRT)" == ""
+.IF "$(CFG)" == "Debug"
+PERLCRTLIBC = msvcrtd.lib
+.ELSE
+PERLCRTLIBC = msvcrt.lib
+.ENDIF
+.ELSE
+.IF "$(CFG)" == "Debug"
+PERLCRTLIBC = PerlCRTD.lib
+.ELSE
+PERLCRTLIBC = PerlCRT.lib
+.ENDIF
+.ENDIF
+
+.IF "$(RUNTIME)" == "-MD"
+LIBC = $(PERLCRTLIBC)
+.ELSE
+LIBC = libcmt.lib
+.ENDIF
+
+.IF "$(CFG)" == "Debug"
+.IF "$(CCTYPE)" == "MSVC20"
+OPTIMIZE = -Od $(RUNTIME) -Z7 -D_DEBUG -DDEBUGGING
+.ELSE
+OPTIMIZE = -Od $(RUNTIME)d -Zi -D_DEBUG -DDEBUGGING
+.ENDIF
+LINK_DBG = -debug -pdb:none
+.ELSE
+.IF "$(CFG)" == "Optimize"
+OPTIMIZE = -O2 $(RUNTIME) -DNDEBUG
+.ELSE
+OPTIMIZE = -Od $(RUNTIME) -DNDEBUG
+.ENDIF
+LINK_DBG = -release
+.ENDIF
+
+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 \
+ version.lib odbc32.lib odbccp32.lib
+
+# we add LIBC here, since we may be using PerlCRT.dll
+LIBFILES = $(LIBBASEFILES) $(LIBC)
+
+CFLAGS = -nologo -Gf -W3 $(INCLUDES) $(DEFINES) $(LOCDEFS) \
+ $(PCHFLAGS) $(OPTIMIZE)
+LINK_FLAGS = -nologo -nodefaultlib $(LINK_DBG) -machine:$(PROCESSOR_ARCHITECTURE)
+OBJOUT_FLAG = -Fo
+EXEOUT_FLAG = -Fe
+LIBOUT_FLAG = /out:
+
+.ENDIF
+
+.IF "$(OBJECT)" != ""
+OPTIMIZE += $(CXX_FLAG)
+.ENDIF
+
+CFLAGS_O = $(CFLAGS) $(OBJECT)
+
+#################### do not edit below this line #######################
+############# NO USER-SERVICEABLE PARTS BEYOND THIS POINT ##############
+
+o *= .obj
+a *= .lib
+
+LKPRE = INPUT (
+LKPOST = )
+
+#
+# Rules
+#
+
+.SUFFIXES : .c $(o) .dll $(a) .exe
+
+.c$(o):
+ $(CC) -c $(null,$(<:d) $(NULL) -I$(<:d)) $(CFLAGS_O) $(OBJOUT_FLAG)$@ $<
+
+.y.c:
+ $(NOOP)
+
+$(o).dll:
+.IF "$(CCTYPE)" == "BORLAND"
+ $(LINK32) -Tpd -ap $(LINK_FLAGS) c0d32$(o) $<,$@,,$(LIBFILES),$(*B).def
+ $(IMPLIB) $(*B).lib $@
+.ELIF "$(CCTYPE)" == "GCC"
+ $(LINK32) -o $@ $(LINK_FLAGS) $< $(LIBFILES)
+ $(IMPLIB) -def $(*B).def $(*B).a $@
+.ELSE
+ $(LINK32) -dll -subsystem:windows -implib:$(*B).lib -def:$(*B).def \
+ -out:$@ $(LINK_FLAGS) $(LIBFILES) $< $(LIBPERL)
+.ENDIF
+
+#
+INST_BIN = $(INST_TOP)$(INST_VER)\bin\$(ARCHNAME)
+INST_SCRIPT = $(INST_TOP)$(INST_VER)\bin
+INST_LIB = $(INST_TOP)$(INST_VER)\lib
+INST_POD = $(INST_LIB)\pod
+INST_HTML = $(INST_POD)\html
+LIBDIR = ..\lib
+EXTDIR = ..\ext
+PODDIR = ..\pod
+EXTUTILSDIR = $(LIBDIR)\extutils
+
+#
+# various targets
+MINIPERL = ..\miniperl.exe
+MINIDIR = .\mini
+PERLEXE = ..\perl.exe
+GLOBEXE = ..\perlglob.exe
+CONFIGPM = ..\lib\Config.pm
+MINIMOD = ..\lib\ExtUtils\Miniperl.pm
+X2P = ..\x2p\a2p.exe
+
+PL2BAT = bin\pl2bat.pl
+GLOBBAT = bin\perlglob.bat
+
+UTILS = \
+ ..\utils\h2ph \
+ ..\utils\splain \
+ ..\utils\perlbug \
+ ..\utils\pl2pm \
+ ..\utils\c2ph \
+ ..\utils\h2xs \
+ ..\utils\perldoc \
+ ..\utils\pstruct \
+ ..\utils\perlcc \
+ ..\pod\checkpods \
+ ..\pod\pod2html \
+ ..\pod\pod2latex \
+ ..\pod\pod2man \
+ ..\pod\pod2text \
+ ..\x2p\find2perl \
+ ..\x2p\s2p \
+ bin\www.pl \
+ bin\runperl.pl \
+ bin\pl2bat.pl \
+ bin\perlglob.pl \
+ bin\search.pl
+
+.IF "$(CCTYPE)" == "BORLAND"
+
+CFGSH_TMPL = config.bc
+CFGH_TMPL = config_H.bc
+
+.ELIF "$(CCTYPE)" == "GCC"
+
+CFGSH_TMPL = config.gc
+CFGH_TMPL = config_H.gc
+.IF "$(OBJECT)" == "-DPERL_OBJECT"
+PERLIMPLIB = ..\libperlcore$(a)
+.ELSE
+PERLIMPLIB = ..\libperl$(a)
+.ENDIF
+
+.ELSE
+
+CFGSH_TMPL = config.vc
+CFGH_TMPL = config_H.vc
+.IF "$(USE_PERLCRT)" == ""
+PERL95EXE = ..\perl95.exe
+.ENDIF
+
+.ENDIF
+
+.IF "$(OBJECT)" == "-DPERL_OBJECT"
+PERLIMPLIB *= ..\perlcore$(a)
+PERLDLL = ..\perlcore.dll
+CAPILIB = $(COREDIR)\perlCAPI$(a)
+.ELSE
+PERLIMPLIB *= ..\perl$(a)
+PERLDLL = ..\perl.dll
+CAPILIB =
+.ENDIF
+
+XCOPY = xcopy /f /r /i /d
+RCOPY = xcopy /f /r /i /e /d
+NOOP = @echo
+
+#
+# filenames given to xsubpp must have forward slashes (since it puts
+# full pathnames in #line strings)
+XSUBPP = ..\$(MINIPERL) -I..\..\lib ..\$(EXTUTILSDIR)\xsubpp \
+ -C++ -prototypes
+
+MICROCORE_SRC = \
+ ..\av.c \
+ ..\byterun.c \
+ ..\deb.c \
+ ..\doio.c \
+ ..\doop.c \
+ ..\dump.c \
+ ..\globals.c \
+ ..\gv.c \
+ ..\hv.c \
+ ..\mg.c \
+ ..\op.c \
+ ..\perl.c \
+ ..\perly.c \
+ ..\pp.c \
+ ..\pp_ctl.c \
+ ..\pp_hot.c \
+ ..\pp_sys.c \
+ ..\regcomp.c \
+ ..\regexec.c \
+ ..\run.c \
+ ..\scope.c \
+ ..\sv.c \
+ ..\taint.c \
+ ..\toke.c \
+ ..\universal.c \
+ ..\util.c
+
+.IF "$(PERL_MALLOC)" == "define"
+EXTRACORE_SRC += ..\malloc.c
+.ENDIF
+
+.IF "$(OBJECT)" == ""
+EXTRACORE_SRC += ..\perlio.c
+.ENDIF
+
+WIN32_SRC = \
+ .\win32.c \
+ .\win32sck.c
+
+.IF "$(USE_THREADS)" == "define"
+WIN32_SRC += .\win32thread.c
+.ENDIF
+
+.IF "$(CRYPT_SRC)" != ""
+WIN32_SRC += .\$(CRYPT_SRC)
+.ENDIF
+
+PERL95_SRC = \
+ perl95.c \
+ win32mt.c \
+ win32sckmt.c
+
+.IF "$(CRYPT_SRC)" != ""
+PERL95_SRC += .\$(CRYPT_SRC)
+.ENDIF
+
+DLL_SRC = $(DYNALOADER).c
+
+
+.IF "$(OBJECT)" == ""
+DLL_SRC += perllib.c
+.ENDIF
+
+X2P_SRC = \
+ ..\x2p\a2p.c \
+ ..\x2p\hash.c \
+ ..\x2p\str.c \
+ ..\x2p\util.c \
+ ..\x2p\walk.c
+
+CORE_NOCFG_H = \
+ ..\av.h \
+ ..\byterun.h \
+ ..\bytecode.h \
+ ..\cop.h \
+ ..\cv.h \
+ ..\dosish.h \
+ ..\embed.h \
+ ..\form.h \
+ ..\gv.h \
+ ..\handy.h \
+ ..\hv.h \
+ ..\iperlsys.h \
+ ..\mg.h \
+ ..\nostdio.h \
+ ..\op.h \
+ ..\opcode.h \
+ ..\perl.h \
+ ..\perlsdio.h \
+ ..\perlsfio.h \
+ ..\perly.h \
+ ..\pp.h \
+ ..\proto.h \
+ ..\regexp.h \
+ ..\scope.h \
+ ..\sv.h \
+ ..\thread.h \
+ ..\unixish.h \
+ ..\util.h \
+ ..\XSUB.h \
+ ..\EXTERN.h \
+ ..\perlvars.h \
+ ..\intrpvar.h \
+ ..\thrdvar.h \
+ .\include\dirent.h \
+ .\include\netdb.h \
+ .\include\sys\socket.h \
+ .\win32.h
+
+CORE_H = $(CORE_NOCFG_H) .\config.h
+
+MICROCORE_OBJ = $(MICROCORE_SRC:db:+$(o))
+CORE_OBJ = $(MICROCORE_OBJ) $(EXTRACORE_SRC:db:+$(o))
+WIN32_OBJ = $(WIN32_SRC:db:+$(o))
+MINICORE_OBJ = $(MINIDIR)\{$(MICROCORE_OBJ:f) miniperlmain$(o) perlio$(o)}
+MINIWIN32_OBJ = $(MINIDIR)\{$(WIN32_OBJ:f)}
+MINI_OBJ = $(MINICORE_OBJ) $(MINIWIN32_OBJ)
+PERL95_OBJ = $(PERL95_SRC:db:+$(o))
+DLL_OBJ = $(DLL_SRC:db:+$(o))
+X2P_OBJ = $(X2P_SRC:db:+$(o))
+
+PERLDLL_OBJ = $(CORE_OBJ)
+PERLEXE_OBJ = perlmain$(o)
+
+.IF "$(OBJECT)" == ""
+PERLDLL_OBJ += $(WIN32_OBJ) $(DLL_OBJ)
+.ELSE
+PERLEXE_OBJ += $(WIN32_OBJ) $(DLL_OBJ)
+PERL95_OBJ += DynaLoadmt$(o)
+.ENDIF
+
+.IF "$(USE_SETARGV)" != ""
+SETARGV_OBJ = setargv$(o)
+.ENDIF
+
+DYNAMIC_EXT = Socket IO Fcntl Opcode SDBM_File POSIX attrs Thread B re \
+ Data/Dumper
+STATIC_EXT = DynaLoader
+NONXS_EXT = Errno
+
+DYNALOADER = $(EXTDIR)\DynaLoader\DynaLoader
+SOCKET = $(EXTDIR)\Socket\Socket
+FCNTL = $(EXTDIR)\Fcntl\Fcntl
+OPCODE = $(EXTDIR)\Opcode\Opcode
+SDBM_FILE = $(EXTDIR)\SDBM_File\SDBM_File
+IO = $(EXTDIR)\IO\IO
+POSIX = $(EXTDIR)\POSIX\POSIX
+ATTRS = $(EXTDIR)\attrs\attrs
+THREAD = $(EXTDIR)\Thread\Thread
+B = $(EXTDIR)\B\B
+RE = $(EXTDIR)\re\re
+DUMPER = $(EXTDIR)\Data\Dumper\Dumper
+ERRNO = $(EXTDIR)\Errno\Errno
+
+SOCKET_DLL = $(AUTODIR)\Socket\Socket.dll
+FCNTL_DLL = $(AUTODIR)\Fcntl\Fcntl.dll
+OPCODE_DLL = $(AUTODIR)\Opcode\Opcode.dll
+SDBM_FILE_DLL = $(AUTODIR)\SDBM_File\SDBM_File.dll
+IO_DLL = $(AUTODIR)\IO\IO.dll
+POSIX_DLL = $(AUTODIR)\POSIX\POSIX.dll
+ATTRS_DLL = $(AUTODIR)\attrs\attrs.dll
+THREAD_DLL = $(AUTODIR)\Thread\Thread.dll
+B_DLL = $(AUTODIR)\B\B.dll
+DUMPER_DLL = $(AUTODIR)\Data\Dumper\Dumper.dll
+RE_DLL = $(AUTODIR)\re\re.dll
+
+ERRNO_PM = $(LIBDIR)\Errno.pm
+
+EXTENSION_C = \
+ $(SOCKET).c \
+ $(FCNTL).c \
+ $(OPCODE).c \
+ $(SDBM_FILE).c \
+ $(IO).c \
+ $(POSIX).c \
+ $(ATTRS).c \
+ $(THREAD).c \
+ $(RE).c \
+ $(DUMPER).c \
+ $(B).c
+
+EXTENSION_DLL = \
+ $(SOCKET_DLL) \
+ $(FCNTL_DLL) \
+ $(OPCODE_DLL) \
+ $(SDBM_FILE_DLL)\
+ $(IO_DLL) \
+ $(POSIX_DLL) \
+ $(ATTRS_DLL) \
+ $(DUMPER_DLL) \
+ $(B_DLL)
+
+EXTENSION_PM = \
+ $(ERRNO_PM)
+
+# re.dll doesn't build with PERL_OBJECT yet
+.IF "$(OBJECT)" == ""
+EXTENSION_DLL += \
+ $(THREAD_DLL) \
+ $(RE_DLL)
+.ENDIF
+
+POD2HTML = $(PODDIR)\pod2html
+POD2MAN = $(PODDIR)\pod2man
+POD2LATEX = $(PODDIR)\pod2latex
+POD2TEXT = $(PODDIR)\pod2text
+
+CFG_VARS = \
+ "INST_DRV=$(INST_DRV)" \
+ "INST_TOP=$(INST_TOP)" \
+ "INST_VER=$(INST_VER)" \
+ "archname=$(ARCHNAME)" \
+ "cc=$(CC)" \
+ "ccflags=$(OPTIMIZE:s/"/\"/) $(DEFINES) $(OBJECT)" \
+ "cf_email=$(EMAIL)" \
+ "d_crypt=$(D_CRYPT)" \
+ "d_mymalloc=$(PERL_MALLOC)" \
+ "libs=$(LIBFILES:f)" \
+ "incpath=$(CCINCDIR:s/"/\"/)" \
+ "libperl=$(PERLIMPLIB:f)" \
+ "libpth=$(CCLIBDIR:s/"/\"/);$(EXTRALIBDIRS:s/"/\"/)" \
+ "libc=$(LIBC)" \
+ "make=dmake" \
+ "_o=$(o)" "obj_ext=$(o)" \
+ "_a=$(a)" "lib_ext=$(a)" \
+ "static_ext=$(STATIC_EXT)" \
+ "dynamic_ext=$(DYNAMIC_EXT)" \
+ "nonxs_ext=$(NONXS_EXT)" \
+ "usethreads=$(USE_THREADS)" \
+ "usemultiplicity=$(USE_MULTI)" \
+ "LINK_FLAGS=$(LINK_FLAGS:s/"/\"/)" \
+ "optimize=$(OPTIMIZE:s/"/\"/)"
+
+#
+# Top targets
+#
+
+all : .\config.h $(GLOBEXE) $(MINIMOD) $(CONFIGPM) $(PERLEXE) $(PERL95EXE) \
+ $(CAPILIB) $(X2P) $(EXTENSION_DLL) $(EXTENSION_PM)
+
+$(DYNALOADER)$(o) : $(DYNALOADER).c $(CORE_H) $(EXTDIR)\DynaLoader\dlutils.c
+
+#------------------------------------------------------------
+
+$(GLOBEXE) : perlglob$(o)
+.IF "$(CCTYPE)" == "BORLAND"
+ $(CC) -c -w -v -tWM -I"$(CCINCDIR)" perlglob.c
+ $(LINK32) -Tpe -ap $(LINK_FLAGS) c0x32$(o) perlglob$(o) \
+ "$(CCLIBDIR)\32BIT\wildargs$(o)",$@,,import32.lib cw32mt.lib,
+.ELIF "$(CCTYPE)" == "GCC"
+ $(LINK32) $(LINK_FLAGS) -o $@ perlglob$(o) $(LIBFILES)
+.ELSE
+ $(LINK32) $(LINK_FLAGS) $(LIBFILES) -out:$@ -subsystem:$(SUBSYS) \
+ perlglob$(o) setargv$(o)
+.ENDIF
+
+perlglob$(o) : perlglob.c
+
+config.w32 : $(CFGSH_TMPL)
+ copy $(CFGSH_TMPL) config.w32
+
+.\config.h : $(CFGH_TMPL) $(CORE_NOCFG_H)
+ -del /f config.h
+ copy $(CFGH_TMPL) config.h
+
+..\config.sh : config.w32 $(MINIPERL) config_sh.PL
+ $(MINIPERL) -I..\lib config_sh.PL $(CFG_VARS) config.w32 > ..\config.sh
+
+# this target is for when changes to the main config.sh happen
+# edit config.{b,v,g}c and make this target once for each supported
+# compiler (e.g. `dmake CCTYPE=BORLAND regen_config_h`)
+regen_config_h:
+ perl config_sh.PL $(CFG_VARS) $(CFGSH_TMPL) > ..\config.sh
+ -cd .. && del /f perl.exe
+ cd .. && perl configpm
+ -del /f $(CFGH_TMPL)
+ -mkdir $(COREDIR)
+ -perl -I..\lib config_h.PL "INST_VER=$(INST_VER)"
+ rename config.h $(CFGH_TMPL)
+
+$(CONFIGPM) : $(MINIPERL) ..\config.sh config_h.PL ..\minimod.pl
+ cd .. && miniperl configpm
+ if exist lib\* $(RCOPY) lib\*.* ..\lib\$(NULL)
+ $(XCOPY) ..\*.h $(COREDIR)\*.*
+ $(XCOPY) *.h $(COREDIR)\*.*
+ $(XCOPY) ..\ext\re\re.pm $(LIBDIR)\*.*
+ $(RCOPY) include $(COREDIR)\*.*
+ $(MINIPERL) -I..\lib config_h.PL "INST_VER=$(INST_VER)" \
+ || $(MAKE) $(MAKEMACROS) $(CONFIGPM)
+
+$(MINIPERL) : $(MINIDIR) $(MINI_OBJ)
+.IF "$(CCTYPE)" == "BORLAND"
+ $(LINK32) -Tpe -ap $(LINK_FLAGS) \
+ @$(mktmp c0x32$(o) $(MINI_OBJ:s,\,\\),$(@:s,\,\\),,$(LIBFILES),)
+.ELIF "$(CCTYPE)" == "GCC"
+ $(LINK32) -v -o $@ $(LINK_FLAGS) \
+ $(mktmp $(LKPRE) $(MINI_OBJ:s,\,\\) $(LIBFILES) $(LKPOST))
+.ELSE
+ $(LINK32) -subsystem:console -out:$@ \
+ @$(mktmp $(LINK_FLAGS) $(LIBFILES) $(MINI_OBJ:s,\,\\))
+.ENDIF
+
+$(MINIDIR) :
+ if not exist "$(MINIDIR)" mkdir "$(MINIDIR)"
+
+$(MINICORE_OBJ) : $(CORE_NOCFG_H)
+ $(CC) -c $(CFLAGS) $(OBJOUT_FLAG)$@ ..\$(*B).c
+
+$(MINIWIN32_OBJ) : $(CORE_NOCFG_H)
+ $(CC) -c $(CFLAGS) $(OBJOUT_FLAG)$@ $(*B).c
+
+# 1. we don't want to rebuild miniperl.exe when config.h changes
+# 2. we don't want to rebuild miniperl.exe with non-default config.h
+$(MINI_OBJ) : $(CORE_NOCFG_H)
+
+$(WIN32_OBJ) : $(CORE_H)
+$(CORE_OBJ) : $(CORE_H)
+$(DLL_OBJ) : $(CORE_H)
+$(PERL95_OBJ) : $(CORE_H)
+$(X2P_OBJ) : $(CORE_H)
+
+perldll.def : $(MINIPERL) $(CONFIGPM) ..\global.sym makedef.pl
+ $(MINIPERL) -w makedef.pl $(OPTIMIZE) $(DEFINES) $(OBJECT) \
+ CCTYPE=$(CCTYPE) > perldll.def
+
+$(PERLDLL): perldll.def $(PERLDLL_OBJ)
+.IF "$(CCTYPE)" == "BORLAND"
+ $(LINK32) -Tpd -ap $(LINK_FLAGS) \
+ @$(mktmp c0d32$(o) $(PERLDLL_OBJ:s,\,\\)\n \
+ $@,\n \
+ $(LIBFILES)\n \
+ perldll.def\n)
+ $(IMPLIB) $*.lib $@
+.ELIF "$(CCTYPE)" == "GCC"
+ $(LINK32) -mdll -o $@ -Wl,--base-file -Wl,perl.base $(LINK_FLAGS) \
+ $(mktmp $(LKPRE) $(PERLDLL_OBJ:s,\,\\) $(LIBFILES) $(LKPOST))
+ dlltool --output-lib $(PERLIMPLIB) \
+ --dllname perl.dll \
+ --def perldll.def \
+ --base-file perl.base \
+ --output-exp perl.exp
+ $(LINK32) -mdll -o $@ $(LINK_FLAGS) \
+ $(mktmp $(LKPRE) $(PERLDLL_OBJ:s,\,\\) $(LIBFILES) \
+ perl.exp $(LKPOST))
+.ELSE
+ $(LINK32) -dll -def:perldll.def -out:$@ \
+ @$(mktmp $(LINK_FLAGS) $(LIBFILES) $(PERLDLL_OBJ:s,\,\\))
+.ENDIF
+ $(XCOPY) $(PERLIMPLIB) $(COREDIR)
+
+perl.def : $(MINIPERL) makeperldef.pl
+ $(MINIPERL) -I..\lib makeperldef.pl $(NULL) > perl.def
+
+$(MINIMOD) : $(MINIPERL) ..\minimod.pl
+ cd .. && miniperl minimod.pl > lib\ExtUtils\Miniperl.pm
+
+..\x2p\a2p$(o) : ..\x2p\a2p.c
+ $(CC) -I..\x2p $(CFLAGS) $(OBJOUT_FLAG)$@ -c ..\x2p\a2p.c
+
+..\x2p\hash$(o) : ..\x2p\hash.c
+ $(CC) -I..\x2p $(CFLAGS) $(OBJOUT_FLAG)$@ -c ..\x2p\hash.c
+
+..\x2p\str$(o) : ..\x2p\str.c
+ $(CC) -I..\x2p $(CFLAGS) $(OBJOUT_FLAG)$@ -c ..\x2p\str.c
+
+..\x2p\util$(o) : ..\x2p\util.c
+ $(CC) -I..\x2p $(CFLAGS) $(OBJOUT_FLAG)$@ -c ..\x2p\util.c
+
+..\x2p\walk$(o) : ..\x2p\walk.c
+ $(CC) -I..\x2p $(CFLAGS) $(OBJOUT_FLAG)$@ -c ..\x2p\walk.c
+
+$(X2P) : $(MINIPERL) $(X2P_OBJ)
+ $(MINIPERL) ..\x2p\find2perl.PL
+ $(MINIPERL) ..\x2p\s2p.PL
+.IF "$(CCTYPE)" == "BORLAND"
+ $(LINK32) -Tpe -ap $(LINK_FLAGS) \
+ @$(mktmp c0x32$(o) $(X2P_OBJ:s,\,\\),$(@:s,\,\\),,$(LIBFILES),)
+.ELIF "$(CCTYPE)" == "GCC"
+ $(LINK32) -v -o $@ $(LINK_FLAGS) \
+ $(mktmp $(LKPRE) $(X2P_OBJ:s,\,\\) $(LIBFILES) $(LKPOST))
+.ELSE
+ $(LINK32) -subsystem:console -out:$@ \
+ @$(mktmp $(LINK_FLAGS) $(LIBFILES) $(X2P_OBJ:s,\,\\))
+.ENDIF
+
+perlmain.c : runperl.c
+ copy runperl.c perlmain.c
+
+perlmain$(o) : perlmain.c
+ $(CC) $(CFLAGS_O) -UPERLDLL $(OBJOUT_FLAG)$@ -c perlmain.c
+
+$(PERLEXE): $(PERLDLL) $(CONFIGPM) $(PERLEXE_OBJ)
+.IF "$(CCTYPE)" == "BORLAND"
+ $(LINK32) -Tpe -ap $(LINK_FLAGS) \
+ @$(mktmp c0x32$(o) $(PERLEXE_OBJ:s,\,\\)\n \
+ $(@:s,\,\\),\n \
+ $(PERLIMPLIB) $(LIBFILES)\n)
+.ELIF "$(CCTYPE)" == "GCC"
+ $(LINK32) -o $@ $(LINK_FLAGS) \
+ $(PERLEXE_OBJ) $(PERLIMPLIB) $(LIBFILES)
+.ELSE
+ $(LINK32) -subsystem:console -out:$@ $(LINK_FLAGS) $(LIBFILES) \
+ $(PERLEXE_OBJ) $(SETARGV_OBJ) $(PERLIMPLIB)
+.ENDIF
+ copy splittree.pl ..
+ $(MINIPERL) -I..\lib ..\splittree.pl "../LIB" $(AUTODIR)
+
+.IF "$(CCTYPE)" != "BORLAND"
+.IF "$(CCTYPE)" != "GCC"
+.IF "$(USE_PERLCRT)" == ""
+
+perl95.c : runperl.c
+ copy runperl.c perl95.c
+
+perl95$(o) : perl95.c
+ $(CC) $(CFLAGS_O) -MT -UPERLDLL -DWIN95FIX -c perl95.c
+
+win32sckmt$(o) : win32sck.c
+ $(CC) $(CFLAGS_O) -MT -UPERLDLL -DWIN95FIX -c \
+ $(OBJOUT_FLAG)win32sckmt$(o) win32sck.c
+
+win32mt$(o) : win32.c
+ $(CC) $(CFLAGS_O) -MT -UPERLDLL -DWIN95FIX -c \
+ $(OBJOUT_FLAG)win32mt$(o) win32.c
+
+DynaLoadmt$(o) : $(DYNALOADER).c
+ $(CC) $(CFLAGS_O) -MT -UPERLDLL -DWIN95FIX -c \
+ $(OBJOUT_FLAG)DynaLoadmt$(o) $(DYNALOADER).c
+
+$(PERL95EXE): $(PERLDLL) $(CONFIGPM) $(PERL95_OBJ)
+ $(LINK32) -subsystem:console -nodefaultlib -out:$@ $(LINK_FLAGS) \
+ $(LIBBASEFILES) $(PERL95_OBJ) $(SETARGV_OBJ) $(PERLIMPLIB) \
+ libcmt.lib
+
+.ENDIF
+.ENDIF
+.ENDIF
+
+$(DYNALOADER).c: $(MINIPERL) $(EXTDIR)\DynaLoader\dl_win32.xs $(CONFIGPM)
+ if not exist $(AUTODIR) mkdir $(AUTODIR)
+ cd $(EXTDIR)\$(*B) && ..\$(MINIPERL) -I..\..\lib $(*B)_pm.PL
+ $(XCOPY) $(EXTDIR)\$(*B)\$(*B).pm $(LIBDIR)\$(NULL)
+ cd $(EXTDIR)\$(*B) && $(XSUBPP) dl_win32.xs > $(*B).c
+ $(XCOPY) $(EXTDIR)\$(*B)\dlutils.c .
+
+.IF "$(OBJECT)" == "-DPERL_OBJECT"
+
+perlCAPI.cpp : $(MINIPERL)
+ $(MINIPERL) GenCAPI.pl $(COREDIR)
+
+perlCAPI$(o) : perlCAPI.cpp
+.IF "$(CCTYPE)" == "BORLAND"
+ $(CC) $(CFLAGS_O) -c $(OBJOUT_FLAG)perlCAPI$(o) perlCAPI.cpp
+.ELIF "$(CCTYPE)" == "GCC"
+ $(CC) $(CFLAGS_O) -c $(OBJOUT_FLAG)perlCAPI$(o) perlCAPI.cpp
+.ELSE
+ $(CC) $(CFLAGS_O) $(RUNTIME) -UPERLDLL -c \
+ $(OBJOUT_FLAG)perlCAPI$(o) perlCAPI.cpp
+.ENDIF
+
+$(CAPILIB) : perlCAPI.cpp perlCAPI$(o)
+.IF "$(CCTYPE)" == "BORLAND"
+ $(LIB32) $(LIBOUT_FLAG)$(CAPILIB) +perlCAPI$(o)
+.ELSE
+ $(LIB32) $(LIBOUT_FLAG)$(CAPILIB) perlCAPI$(o)
+.ENDIF
+
+.ENDIF
+
+$(EXTDIR)\DynaLoader\dl_win32.xs: dl_win32.xs
+ copy dl_win32.xs $(EXTDIR)\DynaLoader\dl_win32.xs
+
+$(DUMPER_DLL): $(PERLEXE) $(DUMPER).xs
+ cd $(EXTDIR)\Data\$(*B) && \
+ ..\..\..\miniperl -I..\..\..\lib Makefile.PL INSTALLDIRS=perl
+ cd $(EXTDIR)\Data\$(*B) && $(MAKE)
+
+$(RE_DLL): $(PERLEXE) $(RE).xs
+ cd $(EXTDIR)\$(*B) && \
+ ..\..\miniperl -I..\..\lib Makefile.PL INSTALLDIRS=perl
+ cd $(EXTDIR)\$(*B) && $(MAKE)
+
+$(B_DLL): $(PERLEXE) $(B).xs
+ cd $(EXTDIR)\$(*B) && \
+ ..\..\miniperl -I..\..\lib Makefile.PL INSTALLDIRS=perl
+ cd $(EXTDIR)\$(*B) && $(MAKE)
+
+$(THREAD_DLL): $(PERLEXE) $(THREAD).xs
+ cd $(EXTDIR)\$(*B) && \
+ ..\..\miniperl -I..\..\lib Makefile.PL INSTALLDIRS=perl
+ cd $(EXTDIR)\$(*B) && $(MAKE)
+
+$(ATTRS_DLL): $(PERLEXE) $(ATTRS).xs
+ cd $(EXTDIR)\$(*B) && \
+ ..\..\miniperl -I..\..\lib Makefile.PL INSTALLDIRS=perl
+ cd $(EXTDIR)\$(*B) && $(MAKE)
+
+$(POSIX_DLL): $(PERLEXE) $(POSIX).xs
+ cd $(EXTDIR)\$(*B) && \
+ ..\..\miniperl -I..\..\lib Makefile.PL INSTALLDIRS=perl
+ cd $(EXTDIR)\$(*B) && $(MAKE)
+
+$(IO_DLL): $(PERLEXE) $(IO).xs
+ cd $(EXTDIR)\$(*B) && \
+ ..\..\miniperl -I..\..\lib Makefile.PL INSTALLDIRS=perl
+ cd $(EXTDIR)\$(*B) && $(MAKE)
+
+$(SDBM_FILE_DLL) : $(PERLEXE) $(SDBM_FILE).xs
+ cd $(EXTDIR)\$(*B) && \
+ ..\..\miniperl -I..\..\lib Makefile.PL INSTALLDIRS=perl
+ cd $(EXTDIR)\$(*B) && $(MAKE)
+
+$(FCNTL_DLL): $(PERLEXE) $(FCNTL).xs
+ cd $(EXTDIR)\$(*B) && \
+ ..\..\miniperl -I..\..\lib Makefile.PL INSTALLDIRS=perl
+ cd $(EXTDIR)\$(*B) && $(MAKE)
+
+$(OPCODE_DLL): $(PERLEXE) $(OPCODE).xs
+ cd $(EXTDIR)\$(*B) && \
+ ..\..\miniperl -I..\..\lib Makefile.PL INSTALLDIRS=perl
+ cd $(EXTDIR)\$(*B) && $(MAKE)
+
+$(SOCKET_DLL): $(PERLEXE) $(SOCKET).xs
+ cd $(EXTDIR)\$(*B) && \
+ ..\..\miniperl -I..\..\lib Makefile.PL INSTALLDIRS=perl
+ cd $(EXTDIR)\$(*B) && $(MAKE)
+
+$(ERRNO_PM): $(PERLEXE) $(ERRNO)_pm.PL
+ cd $(EXTDIR)\$(*B) && \
+ ..\..\miniperl -I..\..\lib Makefile.PL INSTALLDIRS=perl
+ cd $(EXTDIR)\$(*B) && $(MAKE)
+
+doc: $(PERLEXE)
+ $(PERLEXE) -I..\lib ..\installhtml --podroot=.. --htmldir=./html \
+ --podpath=pod:lib:ext:utils --htmlroot="file://$(INST_HTML:s,:,|,)"\
+ --libpod=perlfunc:perlguts:perlvar:perlrun:perlop --recurse
+
+utils: $(PERLEXE) $(X2P)
+ cd ..\utils && $(MAKE) PERL=$(MINIPERL)
+ copy ..\README.win32 ..\pod\perlwin32.pod
+ cd ..\pod && $(MAKE) -f ..\win32\pod.mak converters
+ $(PERLEXE) $(PL2BAT) $(UTILS)
+
+distclean: clean
+ -del /f $(MINIPERL) $(PERLEXE) $(PERL95EXE) $(PERLDLL) $(GLOBEXE) \
+ $(PERLIMPLIB) ..\miniperl$(a) $(MINIMOD)
+ -del /f *.def *.map
+ -del /f $(EXTENSION_DLL) $(EXTENSION_PM)
+ -del /f $(EXTENSION_C) $(DYNALOADER).c $(ERRNO).pm
+ -del /f $(EXTDIR)\DynaLoader\dl_win32.xs
+ -del /f $(LIBDIR)\.exists $(LIBDIR)\attrs.pm $(LIBDIR)\DynaLoader.pm
+ -del /f $(LIBDIR)\Fcntl.pm $(LIBDIR)\IO.pm $(LIBDIR)\Opcode.pm
+ -del /f $(LIBDIR)\ops.pm $(LIBDIR)\Safe.pm $(LIBDIR)\Thread.pm
+ -del /f $(LIBDIR)\SDBM_File.pm $(LIBDIR)\Socket.pm $(LIBDIR)\POSIX.pm
+ -del /f $(LIBDIR)\B.pm $(LIBDIR)\O.pm $(LIBDIR)\re.pm
+ -del /f $(LIBDIR)\Data\Dumper.pm
+ -rmdir /s /q $(LIBDIR)\IO || rmdir /s $(LIBDIR)\IO
+ -rmdir /s /q $(LIBDIR)\Thread || rmdir /s $(LIBDIR)\Thread
+ -rmdir /s /q $(LIBDIR)\B || rmdir /s $(LIBDIR)\B
+ -rmdir /s /q $(LIBDIR)\Data || rmdir /s $(LIBDIR)\Data
+ -del /f $(PODDIR)\*.html
+ -del /f $(PODDIR)\*.bat
+ -cd ..\utils && del /f h2ph splain perlbug pl2pm c2ph h2xs perldoc \
+ pstruct *.bat
+ -cd ..\x2p && del /f find2perl s2p *.bat
+ -del /f ..\config.sh ..\splittree.pl perlmain.c dlutils.c config.h.new
+ -del /f $(CONFIGPM)
+.IF "$(PERL95EXE)" != ""
+ -del /f perl95.c
+.ENDIF
+ -del /f bin\*.bat
+ -cd $(EXTDIR) && del /s *$(a) *.def *.map *.pdb *.bs Makefile *$(o) \
+ pm_to_blib
+ -rmdir /s /q $(AUTODIR) || rmdir /s $(AUTODIR)
+ -rmdir /s /q $(COREDIR) || rmdir /s $(COREDIR)
+
+install : all installbare installhtml
+
+installbare : utils
+ $(PERLEXE) ..\installperl
+.IF "$(PERL95EXE)" != ""
+ $(XCOPY) $(PERL95EXE) $(INST_BIN)\*.*
+.ENDIF
+ $(XCOPY) $(GLOBEXE) $(INST_BIN)\*.*
+ $(XCOPY) bin\*.bat $(INST_SCRIPT)\*.*
+ $(XCOPY) bin\network.pl $(INST_LIB)\*.*
+
+installhtml : doc
+ $(RCOPY) html\*.* $(INST_HTML)\*.*
+
+inst_lib : $(CONFIGPM)
+ copy splittree.pl ..
+ $(MINIPERL) -I..\lib ..\splittree.pl "../LIB" $(AUTODIR)
+ $(RCOPY) ..\lib $(INST_LIB)\*.*
+
+minitest : $(MINIPERL) $(GLOBEXE) $(CONFIGPM) utils
+ $(XCOPY) $(MINIPERL) ..\t\perl.exe
+.IF "$(CCTYPE)" == "BORLAND"
+ $(XCOPY) $(GLOBBAT) ..\t\$(NULL)
+.ELSE
+ $(XCOPY) $(GLOBEXE) ..\t\$(NULL)
+.ENDIF
+ attrib -r ..\t\*.*
+ copy test ..\t
+ cd ..\t && \
+ $(MINIPERL) -I..\lib test base/*.t comp/*.t cmd/*.t io/*.t op/*.t pragma/*.t
+
+test-prep : all utils
+ $(XCOPY) $(PERLEXE) ..\t\$(NULL)
+ $(XCOPY) $(PERLDLL) ..\t\$(NULL)
+.IF "$(CCTYPE)" == "BORLAND"
+ $(XCOPY) $(GLOBBAT) ..\t\$(NULL)
+.ELSE
+ $(XCOPY) $(GLOBEXE) ..\t\$(NULL)
+.ENDIF
+
+test : test-prep
+ cd ..\t && $(PERLEXE) -I..\lib harness
+
+test-notty : test-prep
+ set PERL_SKIP_TTY_TEST=1 && \
+ cd ..\t && $(PERLEXE) -I.\lib harness
+
+clean :
+ -@erase miniperlmain$(o)
+ -@erase $(MINIPERL)
+ -@erase perlglob$(o)
+ -@erase perlmain$(o)
+ -@erase perlCAPI.cpp
+ -@erase config.w32
+ -@erase /f config.h
+ -@erase $(GLOBEXE)
+ -@erase $(PERLEXE)
+ -@erase $(PERLDLL)
+ -@erase $(CORE_OBJ)
+ -rmdir /s /q $(MINIDIR) || rmdir /s $(MINIDIR)
+ -@erase $(WIN32_OBJ)
+ -@erase $(DLL_OBJ)
+ -@erase $(X2P_OBJ)
+ -@erase ..\*$(o) ..\*$(a) ..\*.exp ..\*.res *$(o) *$(a) *.exp *.res
+ -@erase ..\t\*.exe ..\t\*.dll ..\t\*.bat
+ -@erase ..\x2p\*.exe ..\x2p\*.bat
+ -@erase *.ilk
+ -@erase *.pdb
diff --git a/gnu/usr.bin/perl/win32/perlglob.c b/gnu/usr.bin/perl/win32/perlglob.c
index b2fdca2f71e..be9d55052ce 100644
--- a/gnu/usr.bin/perl/win32/perlglob.c
+++ b/gnu/usr.bin/perl/win32/perlglob.c
@@ -22,7 +22,8 @@ main(int argc, char *argv[])
/* check out the file system characteristics */
if (GetFullPathName(".", MAX_PATH, root, &dummy)) {
- if (dummy = strchr(root, '\\'))
+ dummy = strchr(root,'\\');
+ if (dummy)
*++dummy = '\0';
if (GetVolumeInformation(root, volname, MAX_PATH,
&serial, &maxname, &flags, 0, 0)) {
@@ -40,3 +41,4 @@ main(int argc, char *argv[])
}
return 0;
}
+
diff --git a/gnu/usr.bin/perl/win32/perllib.c b/gnu/usr.bin/perl/win32/perllib.c
index 391b4d375f0..d1d942c4956 100644
--- a/gnu/usr.bin/perl/win32/perllib.c
+++ b/gnu/usr.bin/perl/win32/perllib.c
@@ -2,31 +2,28 @@
* "The Road goes ever on and on, down from the door where it began."
*/
-#ifdef __cplusplus
-extern "C" {
-#endif
#include "EXTERN.h"
#include "perl.h"
#include "XSUB.h"
-#ifdef __cplusplus
-}
-# define EXTERN_C extern "C"
-#else
-# define EXTERN_C extern
-#endif
-
static void xs_init _((void));
-__declspec(dllexport) int
+DllExport int
RunPerl(int argc, char **argv, char **env, void *iosubsystem)
{
int exitstatus;
PerlInterpreter *my_perl;
- void *pOldIOSubsystem;
- pOldIOSubsystem = SetIOSubSystem(iosubsystem);
+#ifdef PERL_GLOBAL_STRUCT
+#define PERLVAR(var,type) /**/
+#define PERLVARI(var,type,init) PL_Vars.var = init;
+#define PERLVARIC(var,type,init) PL_Vars.var = init;
+#include "perlvars.h"
+#undef PERLVAR
+#undef PERLVARI
+#undef PERLVARIC
+#endif
PERL_SYS_INIT(&argc,&argv);
@@ -35,7 +32,7 @@ RunPerl(int argc, char **argv, char **env, void *iosubsystem)
if (!(my_perl = perl_alloc()))
return (1);
perl_construct( my_perl );
- perl_destruct_level = 0;
+ PL_perl_destruct_level = 0;
exitstatus = perl_parse( my_perl, xs_init, argc, argv, env);
if (!exitstatus) {
@@ -47,12 +44,10 @@ RunPerl(int argc, char **argv, char **env, void *iosubsystem)
PERL_SYS_TERM();
- SetIOSubSystem(pOldIOSubsystem);
-
return (exitstatus);
}
-extern HANDLE PerlDllHandle;
+extern HANDLE w32_perldll_handle;
BOOL APIENTRY
DllMain(HANDLE hModule, /* DLL module handle */
@@ -71,7 +66,7 @@ DllMain(HANDLE hModule, /* DLL module handle */
setmode( fileno( stderr ), O_BINARY );
_fmode = O_BINARY;
#endif
- PerlDllHandle = hModule;
+ w32_perldll_handle = hModule;
break;
/* The DLL is detaching from a process due to
diff --git a/gnu/usr.bin/perl/win32/pod.mak b/gnu/usr.bin/perl/win32/pod.mak
index 9881ed882d6..c9569a3b5aa 100644
--- a/gnu/usr.bin/perl/win32/pod.mak
+++ b/gnu/usr.bin/perl/win32/pod.mak
@@ -8,8 +8,10 @@ POD2HTML = pod2html \
all: $(CONVERTERS) html
+converters: $(CONVERTERS)
+
PERL = ..\miniperl.exe
-PL2BAT = ..\win32\bin\pl2bat.pl
+REALPERL = ..\perl.exe
POD = \
perl.pod \
@@ -20,9 +22,12 @@ POD = \
perlre.pod \
perlrun.pod \
perlfunc.pod \
+ perlopentut.pod \
perlvar.pod \
perlsub.pod \
perlmod.pod \
+ perlmodlib.pod \
+ perlmodinstall.pod \
perlform.pod \
perllocale.pod \
perlref.pod \
@@ -33,15 +38,18 @@ POD = \
perltie.pod \
perlbot.pod \
perlipc.pod \
+ perlthrtut.pod \
perldebug.pod \
perldiag.pod \
perlsec.pod \
perltrap.pod \
+ perlport.pod \
perlstyle.pod \
perlpod.pod \
perlbook.pod \
perlembed.pod \
perlapio.pod \
+ perlwin32.pod \
perlxs.pod \
perlxstut.pod \
perlguts.pod \
@@ -67,12 +75,16 @@ MAN = \
perlre.man \
perlrun.man \
perlfunc.man \
+ perlopentut.man \
perlvar.man \
perlsub.man \
perlmod.man \
+ perlmodlib.man \
+ perlmodinstall.man \
perlform.man \
perllocale.man \
perlref.man \
+ perlreftut.man \
perldsc.man \
perllol.man \
perltoot.man \
@@ -80,15 +92,18 @@ MAN = \
perltie.man \
perlbot.man \
perlipc.man \
+ perlthrtut.man \
perldebug.man \
perldiag.man \
perlsec.man \
perltrap.man \
+ perlport.man \
perlstyle.man \
perlpod.man \
perlbook.man \
perlembed.man \
perlapio.man \
+ perlwin32.man \
perlxs.man \
perlxstut.man \
perlguts.man \
@@ -114,12 +129,16 @@ HTML = \
perlre.html \
perlrun.html \
perlfunc.html \
+ perlopentut.html \
perlvar.html \
perlsub.html \
perlmod.html \
+ perlmodlib.html \
+ perlmodinstall.html \
perlform.html \
perllocale.html \
perlref.html \
+ perlreftut.html \
perldsc.html \
perllol.html \
perltoot.html \
@@ -127,15 +146,18 @@ HTML = \
perltie.html \
perlbot.html \
perlipc.html \
+ perlthrtut.html \
perldebug.html \
perldiag.html \
perlsec.html \
perltrap.html \
+ perlport.html \
perlstyle.html \
perlpod.html \
perlbook.html \
perlembed.html \
perlapio.html \
+ perlwin32.html \
perlxs.html \
perlxstut.html \
perlguts.html \
@@ -161,12 +183,16 @@ TEX = \
perlre.tex \
perlrun.tex \
perlfunc.tex \
+ perlopentut.tex \
perlvar.tex \
perlsub.tex \
perlmod.tex \
+ perlmodlib.tex \
+ perlmodinstall.tex \
perlform.tex \
perllocale.tex \
perlref.tex \
+ perlreftut.tex \
perldsc.tex \
perllol.tex \
perltoot.tex \
@@ -174,15 +200,18 @@ TEX = \
perltie.tex \
perlbot.tex \
perlipc.tex \
+ perlthrtut.tex \
perldebug.tex \
perldiag.tex \
perlsec.tex \
perltrap.tex \
+ perlport.tex \
perlstyle.tex \
perlpod.tex \
perlbook.tex \
perlembed.tex \
perlapio.tex \
+ perlwin32.tex \
perlxs.tex \
perlxstut.tex \
perlguts.tex \
@@ -206,67 +235,67 @@ html: pod2html $(HTML)
tex: pod2latex $(TEX)
toc:
- $(PERL) -I..\lib buildtoc >perltoc.pod
+ $(PERL) -I../lib buildtoc >perltoc.pod
.SUFFIXES: .pm .pod
.SUFFIXES: .man
.pm.man:
- $(PERL) -I..\lib pod2man $*.pm >$*.man
+ $(PERL) -I../lib pod2man $*.pm >$*.man
.pod.man:
- $(PERL) -I..\lib pod2man $*.pod >$*.man
+ $(PERL) -I../lib pod2man $*.pod >$*.man
.SUFFIXES: .html
.pm.html:
- $(PERL) -I..\lib $(POD2HTML) --infile=$*.pm --outfile=$*.html
+ $(PERL) -I../lib $(POD2HTML) --infile=$*.pm --outfile=$*.html
.pod.html:
- $(PERL) -I..\lib $(POD2HTML) --infile=$*.pod --outfile=$*.html
+ $(PERL) -I../lib $(POD2HTML) --infile=$*.pod --outfile=$*.html
.SUFFIXES: .tex
.pm.tex:
- $(PERL) -I..\lib pod2latex $*.pm
+ $(PERL) -I../lib pod2latex $*.pm
.pod.tex:
- $(PERL) -I..\lib pod2latex $*.pod
+ $(PERL) -I../lib pod2latex $*.pod
clean:
- del /f $(MAN) $(HTML) $(TEX)
- del /f pod2html-*cache
- del /f *.aux *.log
+ rm -f $(MAN)
+ rm -f $(HTML)
+ rm -f $(TEX)
+ rm -f pod2html-*cache
+ rm -f *.aux *.log *.exe
realclean: clean
- del /f $(CONVERTERS)
+ rm -f $(CONVERTERS)
distclean: realclean
check: checkpods
@echo "checking..."; \
- $(PERL) -I..\lib checkpods $(POD)
+ $(PERL) -I../lib checkpods $(POD)
# Dependencies.
-pod2latex: pod2latex.PL ..\lib\Config.pm
- $(PERL) -I..\lib pod2latex.PL
- $(PERL) $(PL2BAT) pod2latex
+pod2latex: pod2latex.PL ../lib/Config.pm
+ $(PERL) -I../lib pod2latex.PL
-pod2html: pod2html.PL ..\lib\Config.pm
- $(PERL) -I..\lib pod2html.PL
- $(PERL) $(PL2BAT) pod2html
+pod2html: pod2html.PL ../lib/Config.pm
+ $(PERL) -I ../lib pod2html.PL
-pod2man: pod2man.PL ..\lib\Config.pm
- $(PERL) -I..\lib pod2man.PL
- $(PERL) $(PL2BAT) pod2man
+pod2man: pod2man.PL ../lib/Config.pm
+ $(PERL) -I ../lib pod2man.PL
-pod2text: pod2text.PL ..\lib\Config.pm
- $(PERL) -I..\lib pod2text.PL
- $(PERL) $(PL2BAT) pod2text
+pod2text: pod2text.PL ../lib/Config.pm
+ $(PERL) -I ../lib pod2text.PL
-checkpods: checkpods.PL ..\lib\Config.pm
- $(PERL) -I..\lib checkpods.PL
- $(PERL) $(PL2BAT) checkpods
+checkpods: checkpods.PL ../lib/Config.pm
+ $(PERL) -I ../lib checkpods.PL
+compile: all
+ $(REALPERL) -I../lib ../utils/perlcc -regex 's/$$/.exe/' pod2latex pod2man pod2text checkpods -prog -verbose dcf -log ../compilelog;
+
diff --git a/gnu/usr.bin/perl/win32/runperl.c b/gnu/usr.bin/perl/win32/runperl.c
index 07e2bd6f835..8cf521d4ea5 100644
--- a/gnu/usr.bin/perl/win32/runperl.c
+++ b/gnu/usr.bin/perl/win32/runperl.c
@@ -1,18 +1,96 @@
-#include <stdio.h>
-#include <win32io.h>
+#include "EXTERN.h"
+#include "perl.h"
+
+#ifdef PERL_OBJECT
+
+#define NO_XSLOCKS
+#include "XSUB.H"
+#include "win32iop.h"
+
+#include <fcntl.h>
+#include "perlhost.h"
+
+
+char *staticlinkmodules[] = {
+ "DynaLoader",
+ NULL,
+};
+
+EXTERN_C void boot_DynaLoader _((CV* cv _CPERLarg));
+
+static void
+xs_init(CPERLarg)
+{
+ char *file = __FILE__;
+ dXSUB_SYS;
+ newXS("DynaLoader::boot_DynaLoader", boot_DynaLoader, file);
+}
+
+CPerlObj *pPerl;
+
+#undef PERL_SYS_INIT
+#define PERL_SYS_INIT(a, c)
+
+int
+main(int argc, char **argv, char **env)
+{
+ CPerlHost host;
+ int exitstatus = 1;
+#ifndef __BORLANDC__
+ /* XXX this _may_ be a problem on some compilers (e.g. Borland) that
+ * want to free() argv after main() returns. As luck would have it,
+ * Borland's CRT does the right thing to argv[0] already. */
+ char szModuleName[MAX_PATH];
+
+ GetModuleFileName(NULL, szModuleName, sizeof(szModuleName));
+ argv[0] = szModuleName;
+#endif
+
+ if (!host.PerlCreate())
+ exit(exitstatus);
+
+ exitstatus = host.PerlParse(xs_init, argc, argv, NULL);
+
+ if (!exitstatus)
+ exitstatus = host.PerlRun();
+
+ host.PerlDestroy();
+
+ return exitstatus;
+}
+
+#else /* PERL_OBJECT */
+
+#ifdef __GNUC__
+/*
+ * GNU C does not do __declspec()
+ */
+#define __declspec(foo)
+
+/* Mingw32 defaults to globing command line
+ * This is inconsistent with other Win32 ports and
+ * seems to cause trouble with passing -DXSVERSION=\"1.6\"
+ * So we turn it off like this:
+ */
+int _CRT_glob = 0;
-#ifndef _DLL
-extern WIN32_IOSUBSYSTEM win32stdio;
#endif
-extern int RunPerl(int argc, char **argv, char **env, void *iosubsystem);
+
+__declspec(dllimport) int RunPerl(int argc, char **argv, char **env, void *ios);
int
main(int argc, char **argv, char **env)
{
-#ifdef _DLL
- return (RunPerl(argc, argv, env, NULL));
-#else
- return (RunPerl(argc, argv, env, &win32stdio));
+#ifndef __BORLANDC__
+ /* XXX this _may_ be a problem on some compilers (e.g. Borland) that
+ * want to free() argv after main() returns. As luck would have it,
+ * Borland's CRT does the right thing to argv[0] already. */
+ char szModuleName[MAX_PATH];
+ GetModuleFileName(NULL, szModuleName, sizeof(szModuleName));
+ argv[0] = szModuleName;
#endif
+ return RunPerl(argc, argv, env, (void*)0);
}
+
+#endif /* PERL_OBJECT */
diff --git a/gnu/usr.bin/perl/win32/win32.c b/gnu/usr.bin/perl/win32/win32.c
index 7cbfae8a83d..7b9acd4a8f1 100644
--- a/gnu/usr.bin/perl/win32/win32.c
+++ b/gnu/usr.bin/perl/win32/win32.c
@@ -11,8 +11,23 @@
#define WIN32_LEAN_AND_MEAN
#define WIN32IO_IS_STDIO
#include <tchar.h>
+#ifdef __GNUC__
+#define Win32_Winsock
+#endif
#include <windows.h>
+#ifndef __MINGW32__
+#include <lmcons.h>
+#include <lmerr.h>
+/* ugliness to work around a buggy struct definition in lmwksta.h */
+#undef LPTSTR
+#define LPTSTR LPWSTR
+#include <lmwksta.h>
+#undef LPTSTR
+#define LPTSTR LPSTR
+#include <lmapibuf.h>
+#endif /* __MINGW32__ */
+
/* #include "config.h" */
#define PERLIO_NOT_STDIO 0
@@ -22,109 +37,288 @@
#include "EXTERN.h"
#include "perl.h"
+
+#include "patchlevel.h"
+
+#define NO_XSLOCKS
+#ifdef PERL_OBJECT
+extern CPerlObj* pPerl;
+#endif
#include "XSUB.h"
+
+#include "Win32iop.h"
#include <fcntl.h>
#include <sys/stat.h>
+#ifndef __GNUC__
+/* assert.h conflicts with #define of assert in perl.h */
#include <assert.h>
+#endif
#include <string.h>
#include <stdarg.h>
#include <float.h>
+#include <time.h>
+#if defined(_MSC_VER) || defined(__MINGW32__)
+#include <sys/utime.h>
+#else
+#include <utime.h>
+#endif
-#define CROAK croak
-#define WARN warn
+#ifdef __GNUC__
+/* Mingw32 defaults to globing command line
+ * So we turn it off like this:
+ */
+int _CRT_glob = 0;
+#endif
#define EXECF_EXEC 1
#define EXECF_SPAWN 2
#define EXECF_SPAWN_NOWAIT 3
-static DWORD IdOS(void);
-
-extern WIN32_IOSUBSYSTEM win32stdio;
-static PWIN32_IOSUBSYSTEM pIOSubSystem = &win32stdio;
-
-BOOL ProbeEnv = FALSE;
-DWORD Win32System = (DWORD)-1;
-char szShellPath[MAX_PATH+1];
-char szPerlLibRoot[MAX_PATH+1];
-HANDLE PerlDllHandle = INVALID_HANDLE_VALUE;
+#if defined(PERL_OBJECT)
+#undef win32_get_privlib
+#define win32_get_privlib g_win32_get_privlib
+#undef win32_get_sitelib
+#define win32_get_sitelib g_win32_get_sitelib
+#undef do_aspawn
+#define do_aspawn g_do_aspawn
+#undef do_spawn
+#define do_spawn g_do_spawn
+#undef do_exec
+#define do_exec g_do_exec
+#undef getlogin
+#define getlogin g_getlogin
+#endif
-static int do_spawn2(char *cmd, int exectype);
+static DWORD os_id(void);
+static void get_shell(void);
+static long tokenize(char *str, char **dest, char ***destv);
+ int do_spawn2(char *cmd, int exectype);
+static BOOL has_shell_metachars(char *ptr);
+static long filetime_to_clock(PFILETIME ft);
+static BOOL filetime_from_time(PFILETIME ft, time_t t);
+static char * get_emd_part(char *leading, char *trailing, ...);
+static void remove_dead_process(HANDLE deceased);
+
+HANDLE w32_perldll_handle = INVALID_HANDLE_VALUE;
+static DWORD w32_platform = (DWORD)-1;
+
+#ifdef USE_THREADS
+# ifdef USE_DECLSPEC_THREAD
+__declspec(thread) char strerror_buffer[512];
+__declspec(thread) char getlogin_buffer[128];
+__declspec(thread) char w32_perllib_root[MAX_PATH+1];
+# ifdef HAVE_DES_FCRYPT
+__declspec(thread) char crypt_buffer[30];
+# endif
+# else
+# define strerror_buffer (thr->i.Wstrerror_buffer)
+# define getlogin_buffer (thr->i.Wgetlogin_buffer)
+# define w32_perllib_root (thr->i.Ww32_perllib_root)
+# define crypt_buffer (thr->i.Wcrypt_buffer)
+# endif
+#else
+static char strerror_buffer[512];
+static char getlogin_buffer[128];
+static char w32_perllib_root[MAX_PATH+1];
+# ifdef HAVE_DES_FCRYPT
+static char crypt_buffer[30];
+# endif
+#endif
int
IsWin95(void) {
- return (IdOS() == VER_PLATFORM_WIN32_WINDOWS);
+ return (os_id() == VER_PLATFORM_WIN32_WINDOWS);
}
int
IsWinNT(void) {
- return (IdOS() == VER_PLATFORM_WIN32_NT);
+ return (os_id() == VER_PLATFORM_WIN32_NT);
+}
+
+char*
+GetRegStrFromKey(HKEY hkey, const char *lpszValueName, char** ptr, DWORD* lpDataLen)
+{ /* Retrieve a REG_SZ or REG_EXPAND_SZ from the registry */
+ HKEY handle;
+ DWORD type;
+ const char *subkey = "Software\\Perl";
+ long retval;
+
+ retval = RegOpenKeyEx(hkey, subkey, 0, KEY_READ, &handle);
+ if (retval == ERROR_SUCCESS){
+ retval = RegQueryValueEx(handle, lpszValueName, 0, &type, NULL, lpDataLen);
+ if (retval == ERROR_SUCCESS && type == REG_SZ) {
+ if (*ptr) {
+ Renew(*ptr, *lpDataLen, char);
+ }
+ else {
+ New(1312, *ptr, *lpDataLen, char);
+ }
+ retval = RegQueryValueEx(handle, lpszValueName, 0, NULL, (PBYTE)*ptr, lpDataLen);
+ if (retval != ERROR_SUCCESS) {
+ Safefree(*ptr);
+ *ptr = Nullch;
+ }
+ }
+ RegCloseKey(handle);
+ }
+ return *ptr;
}
-DllExport PWIN32_IOSUBSYSTEM
-SetIOSubSystem(void *p)
+char*
+GetRegStr(const char *lpszValueName, char** ptr, DWORD* lpDataLen)
{
- PWIN32_IOSUBSYSTEM old = pIOSubSystem;
- if (p) {
- PWIN32_IOSUBSYSTEM pio = (PWIN32_IOSUBSYSTEM)p;
- if (pio->signature_begin == 12345678L
- && pio->signature_end == 87654321L) {
- pIOSubSystem = pio;
- }
- }
- else {
- pIOSubSystem = &win32stdio;
+ *ptr = GetRegStrFromKey(HKEY_CURRENT_USER, lpszValueName, ptr, lpDataLen);
+ if (*ptr == Nullch)
+ {
+ *ptr = GetRegStrFromKey(HKEY_LOCAL_MACHINE, lpszValueName, ptr, lpDataLen);
}
- return old;
+ return *ptr;
}
-DllExport PWIN32_IOSUBSYSTEM
-GetIOSubSystem(void)
+static char *
+get_emd_part(char *prev_path, char *trailing_path, ...)
{
- return pIOSubSystem;
+ char base[10];
+ va_list ap;
+ char mod_name[MAX_PATH+1];
+ char *ptr;
+ char *optr;
+ char *strip;
+ int oldsize, newsize;
+
+ va_start(ap, trailing_path);
+ strip = va_arg(ap, char *);
+
+ sprintf(base, "%5.3f", (double) 5 + ((double) PATCHLEVEL / (double) 1000));
+
+ GetModuleFileName((HMODULE)((w32_perldll_handle == INVALID_HANDLE_VALUE)
+ ? GetModuleHandle(NULL) : w32_perldll_handle),
+ mod_name, sizeof(mod_name));
+ ptr = strrchr(mod_name, '\\');
+ while (ptr && strip) {
+ /* look for directories to skip back */
+ optr = ptr;
+ *ptr = '\0';
+ ptr = strrchr(mod_name, '\\');
+ if (!ptr || stricmp(ptr+1, strip) != 0) {
+ if(!(*strip == '5' && *(ptr+1) == '5' && strncmp(strip, base, 5) == 0
+ && strncmp(ptr+1, base, 5) == 0)) {
+ *optr = '\\';
+ ptr = optr;
+ }
+ }
+ strip = va_arg(ap, char *);
+ }
+ if (!ptr) {
+ ptr = mod_name;
+ *ptr++ = '.';
+ *ptr = '\\';
+ }
+ va_end(ap);
+ strcpy(++ptr, trailing_path);
+
+ /* only add directory if it exists */
+ if(GetFileAttributes(mod_name) != (DWORD) -1) {
+ /* directory exists */
+ newsize = strlen(mod_name) + 1;
+ if (prev_path) {
+ oldsize = strlen(prev_path) + 1;
+ newsize += oldsize; /* includes plus 1 for ';' */
+ Renew(prev_path, newsize, char);
+ prev_path[oldsize-1] = ';';
+ strcpy(&prev_path[oldsize], mod_name);
+ }
+ else {
+ New(1311, prev_path, newsize, char);
+ strcpy(prev_path, mod_name);
+ }
+ }
+
+ return prev_path;
}
char *
-win32PerlLibPath(void)
+win32_get_privlib(char *pl)
{
- char *end;
- GetModuleFileName((PerlDllHandle == INVALID_HANDLE_VALUE)
- ? GetModuleHandle(NULL)
- : PerlDllHandle,
- szPerlLibRoot,
- sizeof(szPerlLibRoot));
+ char *stdlib = "lib";
+ char buffer[MAX_PATH+1];
+ char *path = Nullch;
+ DWORD datalen;
+
+ /* $stdlib = $HKCU{"lib-$]"} || $HKLM{"lib-$]"} || $HKCU{"lib"} || $HKLM{"lib"} || ""; */
+ sprintf(buffer, "%s-%s", stdlib, pl);
+ path = GetRegStr(buffer, &path, &datalen);
+ if (!path)
+ path = GetRegStr(stdlib, &path, &datalen);
- *(end = strrchr(szPerlLibRoot, '\\')) = '\0';
- if (stricmp(end-4,"\\bin") == 0)
- end -= 4;
- strcpy(end,"\\lib");
- return (szPerlLibRoot);
+ /* $stdlib .= ";$EMD/../../lib" */
+ return get_emd_part(path, stdlib, ARCHNAME, "bin", Nullch);
}
char *
-win32SiteLibPath(void)
+win32_get_sitelib(char *pl)
{
- static char szPerlSiteLib[MAX_PATH+1];
- strcpy(szPerlSiteLib, win32PerlLibPath());
- strcat(szPerlSiteLib, "\\site");
- return (szPerlSiteLib);
+ char *sitelib = "sitelib";
+ char regstr[40];
+ char pathstr[MAX_PATH+1];
+ DWORD datalen;
+ char *path1 = Nullch;
+ char *path2 = Nullch;
+ int len, newsize;
+
+ /* $HKCU{"sitelib-$]"} || $HKLM{"sitelib-$]"} . ---; */
+ sprintf(regstr, "%s-%s", sitelib, pl);
+ path1 = GetRegStr(regstr, &path1, &datalen);
+
+ /* $sitelib .=
+ * ";$EMD/" . ((-d $EMD/../../../$]) ? "../../.." : "../.."). "/site/$]/lib"; */
+ sprintf(pathstr, "site\\%s\\lib", pl);
+ path1 = get_emd_part(path1, pathstr, ARCHNAME, "bin", pl, Nullch);
+
+ /* $HKCU{'sitelib'} || $HKLM{'sitelib'} . ---; */
+ path2 = GetRegStr(sitelib, &path2, &datalen);
+
+ /* $sitelib .=
+ * ";$EMD/" . ((-d $EMD/../../../$]) ? "../../.." : "../.."). "/site/lib"; */
+ path2 = get_emd_part(path2, "site\\lib", ARCHNAME, "bin", pl, Nullch);
+
+ if (!path1)
+ return path2;
+
+ if (!path2)
+ return path1;
+
+ len = strlen(path1);
+ newsize = len + strlen(path2) + 2; /* plus one for ';' */
+
+ Renew(path1, newsize, char);
+ path1[len++] = ';';
+ strcpy(&path1[len], path2);
+
+ Safefree(path2);
+ return path1;
}
-BOOL
-HasRedirection(char *ptr)
+
+static BOOL
+has_shell_metachars(char *ptr)
{
int inquote = 0;
char quote = '\0';
/*
* Scan string looking for redirection (< or >) or pipe
- * characters (|) that are not in a quoted string
+ * characters (|) that are not in a quoted string.
+ * Shell variable interpolation (%VAR%) can also happen inside strings.
*/
- while(*ptr) {
+ while (*ptr) {
switch(*ptr) {
+ case '%':
+ return TRUE;
case '\'':
case '\"':
- if(inquote) {
- if(quote == *ptr) {
+ if (inquote) {
+ if (quote == *ptr) {
inquote = 0;
quote = '\0';
}
@@ -137,7 +331,7 @@ HasRedirection(char *ptr)
case '>':
case '<':
case '|':
- if(!inquote)
+ if (!inquote)
return TRUE;
default:
break;
@@ -147,6 +341,7 @@ HasRedirection(char *ptr)
return FALSE;
}
+#if !defined(PERL_OBJECT)
/* since the current process environment is being updated in util.c
* the library functions will get the correct environment
*/
@@ -168,156 +363,10 @@ my_popen(char *cmd, char *mode)
#else
#define fixcmd(x)
#endif
-
-#if 1
-/* was #ifndef PERLDLL, but the #else stuff doesn't work on NT
- * GSAR 97/03/13
- */
fixcmd(cmd);
-#ifdef __BORLANDC__ /* workaround a Borland stdio bug */
win32_fflush(stdout);
win32_fflush(stderr);
-#endif
return win32_popen(cmd, mode);
-#else
-/*
- * There seems to be some problems for the _popen call in a DLL
- * this trick at the moment seems to work but it is never test
- * on NT yet
- *
- */
-# ifdef __cplusplus
-#define EXT_C_FUNC extern "C"
-# else
-#define EXT_C_FUNC extern
-# endif
-
- 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);
-
- BOOL fSuccess;
- PerlIO *pf; /* to store the _popen return value */
- int tm = 0; /* flag indicating tDllExport or binary mode */
- int fhNeeded, fhInherited, fhDup;
- int ineeded, iinherited;
- DWORD dwDup;
- int phdls[2]; /* I/O handles for pipe */
- HANDLE hPIn, hPOut, hPErr,
- hSaveStdin, hSaveStdout, hSaveStderr,
- hPNeeded, hPInherited, hPDuped;
-
- /* first check for errors in the arguments */
- if ( (cmd == NULL) || (mode == NULL)
- || ((*mode != 'w') && (*mode != _T('r'))) )
- goto error1;
-
- if ( *(mode + 1) == _T('t') )
- tm = O_TEXT;
- else if ( *(mode + 1) == _T('b') )
- tm = O_BINARY;
- else
- tm = (*mode == 'w' ? O_BINARY : O_TEXT);
-
-
- fixcmd(cmd);
- if (&win32stdio != pIOSubSystem)
- return win32_popen(cmd, mode);
-
-#ifdef EFG
- if ( _pipe( phdls, 1024, tm ) == -1 )
-#else
- if ( win32_pipe( phdls, 1024, tm ) == -1 )
-#endif
- goto error1;
-
- /* save the current situation */
- hSaveStdin = GetStdHandle(STD_INPUT_HANDLE);
- hSaveStdout = GetStdHandle(STD_OUTPUT_HANDLE);
- hSaveStderr = GetStdHandle(STD_ERROR_HANDLE);
-
- if (*mode == _T('w')) {
- ineeded = 1;
- dwDup = STD_INPUT_HANDLE;
- iinherited = 0;
- }
- else {
- ineeded = 0;
- dwDup = STD_OUTPUT_HANDLE;
- iinherited = 1;
- }
-
- fhNeeded = phdls[ineeded];
- fhInherited = phdls[iinherited];
-
- fSuccess = DuplicateHandle(GetCurrentProcess(),
- (HANDLE) stolen_get_osfhandle(fhNeeded),
- GetCurrentProcess(),
- &hPNeeded,
- 0,
- FALSE, /* not inherited */
- DUPLICATE_SAME_ACCESS);
-
- if (!fSuccess)
- goto error2;
-
- fhDup = stolen_open_osfhandle((long) hPNeeded, tm);
- win32_dup2(fhDup, fhNeeded);
- win32_close(fhDup);
-
-#ifdef AAA
- /* Close the Out pipe, child won't need it */
- hPDuped = (HANDLE) stolen_get_osfhandle(fhNeeded);
-
- _lock_fhandle(fhNeeded);
- _set_osfhnd(fhNeeded, (long)hPNeeded); /* put in ours duplicated one */
- _unlock_fhandle(fhNeeded);
-
- CloseHandle(hPDuped); /* close the handle first */
-#endif
-
- if (!SetStdHandle(dwDup, (HANDLE) stolen_get_osfhandle(fhInherited)))
- goto error2;
-
- /*
- * make sure the child see the same stderr as the calling program
- */
- if (!SetStdHandle(STD_ERROR_HANDLE,
- (HANDLE)stolen_get_osfhandle(win32_fileno(win32_stderr()))))
- goto error2;
-
- pf = win32_popen(cmd, mode); /* ask _popen to do the job */
-
- /* restore to where we were */
- SetStdHandle(STD_INPUT_HANDLE, hSaveStdin);
- SetStdHandle(STD_OUTPUT_HANDLE, hSaveStdout);
- SetStdHandle(STD_ERROR_HANDLE, hSaveStderr);
-
- /* we don't need it any more, that's for the child */
- win32_close(fhInherited);
-
- if (NULL == pf) {
- /* something wrong */
- win32_close(fhNeeded);
- goto error1;
- }
- else {
- /*
- * here we steal the file handle in pf and stuff ours in
- */
- win32_dup2(fhNeeded, win32_fileno(pf));
- win32_close(fhNeeded);
- }
- return (pf);
-
-error2:
- win32_close(fhNeeded);
- win32_close(fhInherited);
-
-error1:
- return (NULL);
-
-#endif
}
long
@@ -325,26 +374,78 @@ my_pclose(PerlIO *fp)
{
return win32_pclose(fp);
}
+#endif
static DWORD
-IdOS(void)
+os_id(void)
{
static OSVERSIONINFO osver;
- if (osver.dwPlatformId != Win32System) {
+ if (osver.dwPlatformId != w32_platform) {
memset(&osver, 0, sizeof(OSVERSIONINFO));
osver.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
GetVersionEx(&osver);
- Win32System = osver.dwPlatformId;
+ w32_platform = osver.dwPlatformId;
}
- return (Win32System);
+ return (w32_platform);
}
-static char *
-GetShell(void)
+/* Tokenize a string. Words are null-separated, and the list
+ * ends with a doubled null. Any character (except null and
+ * including backslash) may be escaped by preceding it with a
+ * backslash (the backslash will be stripped).
+ * Returns number of words in result buffer.
+ */
+static long
+tokenize(char *str, char **dest, char ***destv)
+{
+ char *retstart = Nullch;
+ char **retvstart = 0;
+ int items = -1;
+ if (str) {
+ int slen = strlen(str);
+ register char *ret;
+ register char **retv;
+ New(1307, ret, slen+2, char);
+ New(1308, retv, (slen+3)/2, char*);
+
+ retstart = ret;
+ retvstart = retv;
+ *retv = ret;
+ items = 0;
+ while (*str) {
+ *ret = *str++;
+ if (*ret == '\\' && *str)
+ *ret = *str++;
+ else if (*ret == ' ') {
+ while (*str == ' ')
+ str++;
+ if (ret == retstart)
+ ret--;
+ else {
+ *ret = '\0';
+ ++items;
+ if (*str)
+ *++retv = ret+1;
+ }
+ }
+ else if (!*str)
+ ++items;
+ ret++;
+ }
+ retvstart[items] = Nullch;
+ *ret++ = '\0';
+ *ret = '\0';
+ }
+ *dest = retstart;
+ *destv = retvstart;
+ return items;
+}
+
+static void
+get_shell(void)
{
- if (!ProbeEnv) {
- char* defaultshell = (IsWinNT() ? "cmd.exe" : "command.com");
+ if (!w32_perlshell_tokens) {
/* we don't use COMSPEC here for two reasons:
* 1. the same reason perl on UNIX doesn't use SHELL--rampant and
* uncontrolled unportability of the ensuing scripts.
@@ -352,55 +453,75 @@ GetShell(void)
* interactive use (which is what most programs look in COMSPEC
* for).
*/
- char *usershell = getenv("PERL5SHELL");
-
- ProbeEnv = TRUE;
- strcpy(szShellPath, usershell ? usershell : defaultshell);
+ char* defaultshell = (IsWinNT() ? "cmd.exe /x/c" : "command.com /c");
+ char *usershell = getenv("PERL5SHELL");
+ w32_perlshell_items = tokenize(usershell ? usershell : defaultshell,
+ &w32_perlshell_tokens,
+ &w32_perlshell_vec);
}
- return szShellPath;
}
int
-do_aspawn(void* really, void** mark, void** arglast)
+do_aspawn(void *vreally, void **vmark, void **vsp)
{
+ SV *really = (SV*)vreally;
+ SV **mark = (SV**)vmark;
+ SV **sp = (SV**)vsp;
char **argv;
- char *strPtr;
- char *cmd;
+ char *str;
int status;
- unsigned int length;
+ int flag = P_WAIT;
int index = 0;
- SV *sv = (SV*)really;
- SV** pSv = (SV**)mark;
+ STRLEN n_a;
- New(1310, argv, (arglast - mark) + 4, char*);
+ if (sp <= mark)
+ return -1;
- if(sv != Nullsv) {
- cmd = SvPV(sv, length);
- }
- else {
- argv[index++] = cmd = GetShell();
- if (IsWinNT())
- argv[index++] = "/x"; /* always enable command extensions */
- argv[index++] = "/c";
+ get_shell();
+ New(1306, argv, (sp - mark) + w32_perlshell_items + 2, char*);
+
+ if (SvNIOKp(*(mark+1)) && !SvPOKp(*(mark+1))) {
+ ++mark;
+ flag = SvIVx(*mark);
}
- while(++pSv <= (SV**)arglast) {
- sv = *pSv;
- strPtr = SvPV(sv, length);
- if(strPtr != NULL && *strPtr != '\0')
- argv[index++] = strPtr;
+ while (++mark <= sp) {
+ if (*mark && (str = SvPV(*mark, n_a)))
+ argv[index++] = str;
+ else
+ argv[index++] = "";
}
argv[index++] = 0;
- status = win32_spawnvp(P_WAIT, cmd, (const char* const*)argv);
-
- Safefree(argv);
+ status = win32_spawnvp(flag,
+ (const char*)(really ? SvPV(really,n_a) : argv[0]),
+ (const char* const*)argv);
+
+ if (status < 0 && (errno == ENOEXEC || errno == ENOENT)) {
+ /* possible shell-builtin, invoke with shell */
+ int sh_items;
+ sh_items = w32_perlshell_items;
+ while (--index >= 0)
+ argv[index+sh_items] = argv[index];
+ while (--sh_items >= 0)
+ argv[sh_items] = w32_perlshell_vec[sh_items];
+
+ status = win32_spawnvp(flag,
+ (const char*)(really ? SvPV(really,n_a) : argv[0]),
+ (const char* const*)argv);
+ }
- if (status < 0) {
- if (dowarn)
- warn("Can't spawn \"%s\": %s", cmd, strerror(errno));
- status = 255 << 8;
+ if (flag != P_NOWAIT) {
+ if (status < 0) {
+ if (PL_dowarn)
+ warn("Can't spawn \"%s\": %s", argv[0], strerror(errno));
+ status = 255 * 256;
+ }
+ else
+ status *= 256;
+ PL_statusvalue = status;
}
+ Safefree(argv);
return (status);
}
@@ -412,13 +533,11 @@ do_spawn2(char *cmd, int exectype)
char **argv;
int status = -1;
BOOL needToTry = TRUE;
- char *shell, *cmd2;
-
- /* save an extra exec if possible */
- shell = GetShell();
+ char *cmd2;
- /* see if there are shell metacharacters in it */
- if(!HasRedirection(cmd)) {
+ /* Save an extra exec if possible. See if there are shell
+ * metacharacters in it */
+ if (!has_shell_metachars(cmd)) {
New(1301,argv, strlen(cmd) / 2 + 2, char*);
New(1302,cmd2, strlen(cmd) + 1, char);
strcpy(cmd2, cmd);
@@ -428,13 +547,13 @@ do_spawn2(char *cmd, int exectype)
s++;
if (*s)
*(a++) = s;
- while(*s && !isspace(*s))
+ while (*s && !isspace(*s))
s++;
- if(*s)
+ if (*s)
*s++ = '\0';
}
*a = Nullch;
- if(argv[0]) {
+ if (argv[0]) {
switch (exectype) {
case EXECF_SPAWN:
status = win32_spawnvp(P_WAIT, argv[0],
@@ -448,19 +567,21 @@ do_spawn2(char *cmd, int exectype)
status = win32_execvp(argv[0], (const char* const*)argv);
break;
}
- if(status != -1 || errno == 0)
+ if (status != -1 || errno == 0)
needToTry = FALSE;
}
Safefree(argv);
Safefree(cmd2);
}
- if(needToTry) {
- char *argv[5];
- int i = 0;
- argv[i++] = shell;
- if (IsWinNT())
- argv[i++] = "/x";
- argv[i++] = "/c"; argv[i++] = cmd; argv[i] = Nullch;
+ if (needToTry) {
+ char **argv;
+ int i = -1;
+ get_shell();
+ New(1306, argv, w32_perlshell_items + 2, char*);
+ while (++i < w32_perlshell_items)
+ argv[i] = w32_perlshell_vec[i];
+ argv[i++] = cmd;
+ argv[i] = Nullch;
switch (exectype) {
case EXECF_SPAWN:
status = win32_spawnvp(P_WAIT, argv[0],
@@ -474,14 +595,20 @@ do_spawn2(char *cmd, int exectype)
status = win32_execvp(argv[0], (const char* const*)argv);
break;
}
+ cmd = argv[0];
+ Safefree(argv);
}
- if (status < 0) {
- if (dowarn)
- warn("Can't %s \"%s\": %s",
- (exectype == EXECF_EXEC ? "exec" : "spawn"),
- needToTry ? shell : argv[0],
- strerror(errno));
- status = 255 << 8;
+ if (exectype != EXECF_SPAWN_NOWAIT) {
+ if (status < 0) {
+ if (PL_dowarn)
+ warn("Can't %s \"%s\": %s",
+ (exectype == EXECF_EXEC ? "exec" : "spawn"),
+ cmd, strerror(errno));
+ status = 255 * 256;
+ }
+ else
+ status *= 256;
+ PL_statusvalue = status;
}
return (status);
}
@@ -492,6 +619,12 @@ do_spawn(char *cmd)
return do_spawn2(cmd, EXECF_SPAWN);
}
+int
+do_spawn_nowait(char *cmd)
+{
+ return do_spawn2(cmd, EXECF_SPAWN_NOWAIT);
+}
+
bool
do_exec(char *cmd)
{
@@ -499,64 +632,48 @@ do_exec(char *cmd)
return FALSE;
}
-
-#define PATHLEN 1024
-
/* The idea here is to read all the directory names into a string table
* (separated by nulls) and when one of the other dir functions is called
* return the pointer to the current file name.
*/
DIR *
-opendir(char *filename)
-{
- DIR *p;
- long len;
- long idx;
- char scannamespc[PATHLEN];
- char *scanname = scannamespc;
- struct stat sbuf;
- WIN32_FIND_DATA FindData;
- HANDLE fh;
-/* char root[_MAX_PATH];*/
-/* char volname[_MAX_PATH];*/
-/* DWORD serial, maxname, flags;*/
-/* BOOL downcase;*/
-/* char *dummy;*/
+win32_opendir(char *filename)
+{
+ DIR *p;
+ long len;
+ long idx;
+ char scanname[MAX_PATH+3];
+ struct stat sbuf;
+ WIN32_FIND_DATA FindData;
+ HANDLE fh;
+
+ len = strlen(filename);
+ if (len > MAX_PATH)
+ return NULL;
/* check to see if filename is a directory */
- if (win32_stat(filename, &sbuf) < 0 || sbuf.st_mode & S_IFDIR == 0) {
+ if (win32_stat(filename, &sbuf) < 0 || !S_ISDIR(sbuf.st_mode))
return NULL;
- }
- /* get the file system characteristics */
-/* if(GetFullPathName(filename, MAX_PATH, root, &dummy)) {
- * if(dummy = strchr(root, '\\'))
- * *++dummy = '\0';
- * if(GetVolumeInformation(root, volname, MAX_PATH, &serial,
- * &maxname, &flags, 0, 0)) {
- * downcase = !(flags & FS_CASE_IS_PRESERVED);
- * }
- * }
- * else {
- * downcase = TRUE;
- * }
- */
/* Get us a DIR structure */
Newz(1303, p, 1, DIR);
- if(p == NULL)
+ if (p == NULL)
return NULL;
/* Create the search pattern */
strcpy(scanname, filename);
-
- if(index("/\\", *(scanname + strlen(scanname) - 1)) == NULL)
- strcat(scanname, "/*");
- else
- strcat(scanname, "*");
+ if (scanname[len-1] != '/' && scanname[len-1] != '\\')
+ scanname[len++] = '/';
+ scanname[len++] = '*';
+ scanname[len] = '\0';
/* do the FindFirstFile call */
fh = FindFirstFile(scanname, &FindData);
- if(fh == INVALID_HANDLE_VALUE) {
+ if (fh == INVALID_HANDLE_VALUE) {
+ /* FindFirstFile() fails on empty drives! */
+ if (GetLastError() == ERROR_FILE_NOT_FOUND)
+ return p;
+ Safefree( p);
return NULL;
}
@@ -565,13 +682,9 @@ opendir(char *filename)
*/
idx = strlen(FindData.cFileName)+1;
New(1304, p->start, idx, char);
- if(p->start == NULL) {
- CROAK("opendir: malloc failed!\n");
- }
+ if (p->start == NULL)
+ croak("opendir: malloc failed!\n");
strcpy(p->start, FindData.cFileName);
-/* if(downcase)
- * strlwr(p->start);
- */
p->nfiles++;
/* loop finding all the files that match the wildcard
@@ -585,20 +698,16 @@ opendir(char *filename)
* new name and it's null terminator
*/
Renew(p->start, idx+len+1, char);
- if(p->start == NULL) {
- CROAK("opendir: malloc failed!\n");
- }
+ if (p->start == NULL)
+ croak("opendir: malloc failed!\n");
strcpy(&p->start[idx], FindData.cFileName);
-/* if (downcase)
- * strlwr(&p->start[idx]);
- */
- p->nfiles++;
- idx += len+1;
- }
- FindClose(fh);
- p->size = idx;
- p->curr = p->start;
- return p;
+ p->nfiles++;
+ idx += len+1;
+ }
+ FindClose(fh);
+ p->size = idx;
+ p->curr = p->start;
+ return p;
}
@@ -606,7 +715,7 @@ opendir(char *filename)
* string pointer to the nDllExport entry.
*/
struct direct *
-readdir(DIR *dirp)
+win32_readdir(DIR *dirp)
{
int len;
static int dummy = 0;
@@ -634,7 +743,7 @@ readdir(DIR *dirp)
/* Telldir returns the current string pointer position */
long
-telldir(DIR *dirp)
+win32_telldir(DIR *dirp)
{
return (long) dirp->curr;
}
@@ -644,21 +753,21 @@ telldir(DIR *dirp)
*(Saved by telldir).
*/
void
-seekdir(DIR *dirp, long loc)
+win32_seekdir(DIR *dirp, long loc)
{
dirp->curr = (char *)loc;
}
/* Rewinddir resets the string pointer to the start */
void
-rewinddir(DIR *dirp)
+win32_rewinddir(DIR *dirp)
{
dirp->curr = dirp->start;
}
/* free the memory allocated by opendir */
int
-closedir(DIR *dirp)
+win32_closedir(DIR *dirp)
{
Safefree(dirp->start);
Safefree(dirp);
@@ -705,73 +814,90 @@ getegid(void)
}
int
-setuid(uid_t uid)
+setuid(uid_t auid)
{
- return (uid == ROOT_UID ? 0 : -1);
+ return (auid == ROOT_UID ? 0 : -1);
}
int
-setgid(gid_t gid)
+setgid(gid_t agid)
{
- return (gid == ROOT_GID ? 0 : -1);
+ return (agid == ROOT_GID ? 0 : -1);
+}
+
+char *
+getlogin(void)
+{
+ dTHR;
+ char *buf = getlogin_buffer;
+ DWORD size = sizeof(getlogin_buffer);
+ if (GetUserName(buf,&size))
+ return buf;
+ return (char*)NULL;
}
-/*
- * pretended kill
- */
int
-kill(int pid, int sig)
+chown(const char *path, uid_t owner, gid_t group)
{
+ /* XXX noop */
+ return 0;
+}
+
+static void
+remove_dead_process(HANDLE deceased)
+{
+#ifndef USE_RTL_WAIT
+ int child;
+ for (child = 0 ; child < w32_num_children ; ++child) {
+ if (w32_child_pids[child] == deceased) {
+ Copy(&w32_child_pids[child+1], &w32_child_pids[child],
+ (w32_num_children-child-1), HANDLE);
+ w32_num_children--;
+ break;
+ }
+ }
+#endif
+}
+
+DllExport int
+win32_kill(int pid, int sig)
+{
+#ifdef USE_RTL_WAIT
HANDLE hProcess= OpenProcess(PROCESS_ALL_ACCESS, TRUE, pid);
+#else
+ HANDLE hProcess = (HANDLE) pid;
+#endif
if (hProcess == NULL) {
- CROAK("kill process failed!\n");
+ croak("kill process failed!\n");
}
else {
if (!TerminateProcess(hProcess, sig))
- CROAK("kill process failed!\n");
+ croak("kill process failed!\n");
CloseHandle(hProcess);
+
+ /* WaitForMultipleObjects() on a pid that was killed returns error
+ * so if we know the pid is gone we remove it from process list */
+ remove_dead_process(hProcess);
}
return 0;
}
-
+
/*
* File system stuff
*/
-#if 0
-int
-ioctl(int i, unsigned int u, char *data)
-{
- CROAK("ioctl not implemented!\n");
- return -1;
-}
-#endif
-
-unsigned int
-sleep(unsigned int t)
+DllExport unsigned int
+win32_sleep(unsigned int t)
{
Sleep(t*1000);
return 0;
}
-
-#undef rename
-
-int
-myrename(char *OldFileName, char *newname)
-{
- if(_access(newname, 0) != -1) { /* file exists */
- _unlink(newname);
- }
- return rename(OldFileName, newname);
-}
-
-
DllExport int
win32_stat(const char *path, struct stat *buffer)
{
- char t[MAX_PATH];
+ char t[MAX_PATH+1];
const char *p = path;
int l = strlen(path);
int res;
@@ -787,9 +913,32 @@ win32_stat(const char *path, struct stat *buffer)
};
}
}
- res = pIOSubSystem->pfnstat(p,buffer);
+ res = stat(p,buffer);
+ if (res < 0) {
+ /* CRT is buggy on sharenames, so make sure it really isn't.
+ * XXX using GetFileAttributesEx() will enable us to set
+ * buffer->st_*time (but note that's not available on the
+ * Windows of 1995) */
+ DWORD r = GetFileAttributes(p);
+ if (r != 0xffffffff && (r & FILE_ATTRIBUTE_DIRECTORY)) {
+ buffer->st_mode |= S_IFDIR | S_IREAD;
+ errno = 0;
+ if (!(r & FILE_ATTRIBUTE_READONLY))
+ buffer->st_mode |= S_IWRITE | S_IEXEC;
+ return 0;
+ }
+ }
+ else {
+ if (l == 3 && path[l-2] == ':'
+ && (path[l-1] == '\\' || path[l-1] == '/'))
+ {
+ /* The drive can be inaccessible, some _stat()s are buggy */
+ if (!GetVolumeInformation(path,NULL,0,NULL,NULL,NULL,NULL,0)) {
+ errno = ENOENT;
+ return -1;
+ }
+ }
#ifdef __BORLANDC__
- if (res == 0) {
if (S_ISDIR(buffer->st_mode))
buffer->st_mode |= S_IWRITE | S_IEXEC;
else if (S_ISREG(buffer->st_mode)) {
@@ -806,8 +955,8 @@ win32_stat(const char *path, struct stat *buffer)
else
buffer->st_mode &= ~S_IEXEC;
}
- }
#endif
+ }
return res;
}
@@ -816,46 +965,443 @@ win32_stat(const char *path, struct stat *buffer)
DllExport char *
win32_getenv(const char *name)
{
- static char *curitem = Nullch;
- static DWORD curlen = 512;
+ static char *curitem = Nullch; /* XXX threadead */
+ static DWORD curlen = 0; /* XXX threadead */
DWORD needlen;
- if (!curitem)
+ if (!curitem) {
+ curlen = 512;
New(1305,curitem,curlen,char);
- if (!(needlen = GetEnvironmentVariable(name,curitem,curlen)))
- return Nullch;
- while (needlen > curlen) {
- Renew(curitem,needlen,char);
- curlen = needlen;
- needlen = GetEnvironmentVariable(name,curitem,curlen);
}
+
+ needlen = GetEnvironmentVariable(name,curitem,curlen);
+ if (needlen != 0) {
+ while (needlen > curlen) {
+ Renew(curitem,needlen,char);
+ curlen = needlen;
+ needlen = GetEnvironmentVariable(name,curitem,curlen);
+ }
+ }
+ else {
+ /* allow any environment variables that begin with 'PERL'
+ to be stored in the registry */
+ if (curitem)
+ *curitem = '\0';
+
+ if (strncmp(name, "PERL", 4) == 0) {
+ if (curitem) {
+ Safefree(curitem);
+ curitem = Nullch;
+ curlen = 0;
+ }
+ curitem = GetRegStr(name, &curitem, &curlen);
+ }
+ }
+ if (curitem && *curitem == '\0')
+ return Nullch;
+
return curitem;
}
+DllExport int
+win32_putenv(const char *name)
+{
+ char* curitem;
+ char* val;
+ int relval = -1;
+ if(name) {
+ New(1309,curitem,strlen(name)+1,char);
+ strcpy(curitem, name);
+ val = strchr(curitem, '=');
+ if(val) {
+ /* The sane way to deal with the environment.
+ * Has these advantages over putenv() & co.:
+ * * enables us to store a truly empty value in the
+ * environment (like in UNIX).
+ * * we don't have to deal with RTL globals, bugs and leaks.
+ * * Much faster.
+ * Why you may want to enable USE_WIN32_RTL_ENV:
+ * * environ[] and RTL functions will not reflect changes,
+ * which might be an issue if extensions want to access
+ * the env. via RTL. This cuts both ways, since RTL will
+ * not see changes made by extensions that call the Win32
+ * functions directly, either.
+ * GSAR 97-06-07
+ */
+ *val++ = '\0';
+ if(SetEnvironmentVariable(curitem, *val ? val : NULL))
+ relval = 0;
+ }
+ Safefree(curitem);
+ }
+ return relval;
+}
+
#endif
-#undef times
-int
-mytimes(struct tms *timebuf)
+static long
+filetime_to_clock(PFILETIME ft)
{
- clock_t t = clock();
- timebuf->tms_utime = t;
- timebuf->tms_stime = 0;
- timebuf->tms_cutime = 0;
- timebuf->tms_cstime = 0;
+ __int64 qw = ft->dwHighDateTime;
+ qw <<= 32;
+ qw |= ft->dwLowDateTime;
+ qw /= 10000; /* File time ticks at 0.1uS, clock at 1mS */
+ return (long) qw;
+}
+DllExport int
+win32_times(struct tms *timebuf)
+{
+ FILETIME user;
+ FILETIME kernel;
+ FILETIME dummy;
+ if (GetProcessTimes(GetCurrentProcess(), &dummy, &dummy,
+ &kernel,&user)) {
+ timebuf->tms_utime = filetime_to_clock(&user);
+ timebuf->tms_stime = filetime_to_clock(&kernel);
+ timebuf->tms_cutime = 0;
+ timebuf->tms_cstime = 0;
+
+ } else {
+ /* That failed - e.g. Win95 fallback to clock() */
+ clock_t t = clock();
+ timebuf->tms_utime = t;
+ timebuf->tms_stime = 0;
+ timebuf->tms_cutime = 0;
+ timebuf->tms_cstime = 0;
+ }
return 0;
}
-#undef alarm
-unsigned int
-myalarm(unsigned int sec)
+/* fix utime() so it works on directories in NT
+ * thanks to Jan Dubois <jan.dubois@ibm.net>
+ */
+static BOOL
+filetime_from_time(PFILETIME pFileTime, time_t Time)
+{
+ struct tm *pTM = gmtime(&Time);
+ SYSTEMTIME SystemTime;
+
+ if (pTM == NULL)
+ return FALSE;
+
+ SystemTime.wYear = pTM->tm_year + 1900;
+ SystemTime.wMonth = pTM->tm_mon + 1;
+ SystemTime.wDay = pTM->tm_mday;
+ SystemTime.wHour = pTM->tm_hour;
+ SystemTime.wMinute = pTM->tm_min;
+ SystemTime.wSecond = pTM->tm_sec;
+ SystemTime.wMilliseconds = 0;
+
+ return SystemTimeToFileTime(&SystemTime, pFileTime);
+}
+
+DllExport int
+win32_utime(const char *filename, struct utimbuf *times)
+{
+ HANDLE handle;
+ FILETIME ftCreate;
+ FILETIME ftAccess;
+ FILETIME ftWrite;
+ struct utimbuf TimeBuffer;
+
+ int rc = utime(filename,times);
+ /* EACCES: path specifies directory or readonly file */
+ if (rc == 0 || errno != EACCES /* || !IsWinNT() */)
+ return rc;
+
+ if (times == NULL) {
+ times = &TimeBuffer;
+ time(&times->actime);
+ times->modtime = times->actime;
+ }
+
+ /* This will (and should) still fail on readonly files */
+ handle = CreateFile(filename, GENERIC_READ | GENERIC_WRITE,
+ FILE_SHARE_READ | FILE_SHARE_DELETE, NULL,
+ OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, NULL);
+ if (handle == INVALID_HANDLE_VALUE)
+ return rc;
+
+ if (GetFileTime(handle, &ftCreate, &ftAccess, &ftWrite) &&
+ filetime_from_time(&ftAccess, times->actime) &&
+ filetime_from_time(&ftWrite, times->modtime) &&
+ SetFileTime(handle, &ftCreate, &ftAccess, &ftWrite))
+ {
+ rc = 0;
+ }
+
+ CloseHandle(handle);
+ return rc;
+}
+
+DllExport int
+win32_waitpid(int pid, int *status, int flags)
+{
+ int rc;
+ if (pid == -1)
+ return win32_wait(status);
+ else {
+ rc = cwait(status, pid, WAIT_CHILD);
+ /* cwait() returns "correctly" on Borland */
+#ifndef __BORLANDC__
+ if (status)
+ *status *= 256;
+#endif
+ remove_dead_process((HANDLE)pid);
+ }
+ return rc >= 0 ? pid : rc;
+}
+
+DllExport int
+win32_wait(int *status)
{
- /* we warn the usuage of alarm function */
- if (sec != 0)
- WARN("dummy function alarm called, program might not function as expected\n");
+#ifdef USE_RTL_WAIT
+ return wait(status);
+#else
+ /* XXX this wait emulation only knows about processes
+ * spawned via win32_spawnvp(P_NOWAIT, ...).
+ */
+ int i, retval;
+ DWORD exitcode, waitcode;
+
+ if (!w32_num_children) {
+ errno = ECHILD;
+ return -1;
+ }
+
+ /* if a child exists, wait for it to die */
+ waitcode = WaitForMultipleObjects(w32_num_children,
+ w32_child_pids,
+ FALSE,
+ INFINITE);
+ if (waitcode != WAIT_FAILED) {
+ if (waitcode >= WAIT_ABANDONED_0
+ && waitcode < WAIT_ABANDONED_0 + w32_num_children)
+ i = waitcode - WAIT_ABANDONED_0;
+ else
+ i = waitcode - WAIT_OBJECT_0;
+ if (GetExitCodeProcess(w32_child_pids[i], &exitcode) ) {
+ CloseHandle(w32_child_pids[i]);
+ *status = (int)((exitcode & 0xff) << 8);
+ retval = (int)w32_child_pids[i];
+ Copy(&w32_child_pids[i+1], &w32_child_pids[i],
+ (w32_num_children-i-1), HANDLE);
+ w32_num_children--;
+ return retval;
+ }
+ }
+
+FAILED:
+ errno = GetLastError();
+ return -1;
+
+#endif
+}
+
+static UINT timerid = 0;
+
+static VOID CALLBACK TimerProc(HWND win, UINT msg, UINT id, DWORD time)
+{
+ KillTimer(NULL,timerid);
+ timerid=0;
+ sighandler(14);
+}
+
+DllExport unsigned int
+win32_alarm(unsigned int sec)
+{
+ /*
+ * the 'obvious' implentation is SetTimer() with a callback
+ * which does whatever receiving SIGALRM would do
+ * we cannot use SIGALRM even via raise() as it is not
+ * one of the supported codes in <signal.h>
+ *
+ * Snag is unless something is looking at the message queue
+ * nothing happens :-(
+ */
+ if (sec)
+ {
+ timerid = SetTimer(NULL,timerid,sec*1000,(TIMERPROC)TimerProc);
+ if (!timerid)
+ croak("Cannot set timer");
+ }
+ else
+ {
+ if (timerid)
+ {
+ KillTimer(NULL,timerid);
+ timerid=0;
+ }
+ }
return 0;
}
+#if defined(HAVE_DES_FCRYPT) || defined(PERL_OBJECT)
+#ifdef HAVE_DES_FCRYPT
+extern char * des_fcrypt(const char *txt, const char *salt, char *cbuf);
+#endif
+
+DllExport char *
+win32_crypt(const char *txt, const char *salt)
+{
+#ifdef HAVE_DES_FCRYPT
+ dTHR;
+ return des_fcrypt(txt, salt, crypt_buffer);
+#else
+ die("The crypt() function is unimplemented due to excessive paranoia.");
+ return Nullch;
+#endif
+}
+#endif
+
+#ifdef USE_FIXED_OSFHANDLE
+
+EXTERN_C int __cdecl _alloc_osfhnd(void);
+EXTERN_C int __cdecl _set_osfhnd(int fh, long value);
+EXTERN_C void __cdecl _lock_fhandle(int);
+EXTERN_C void __cdecl _unlock_fhandle(int);
+EXTERN_C void __cdecl _unlock(int);
+
+#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;
+
+EXTERN_C 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 my_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:
+*
+*******************************************************************************/
+
+static int
+my_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 */
+}
+
+#define _open_osfhandle my_open_osfhandle
+#endif /* USE_FIXED_OSFHANDLE */
+
+/* simulate flock by locking a range on the file */
+
+#define LK_ERR(f,i) ((f) ? (i = 0) : (errno = GetLastError()))
+#define LK_LEN 0xffff0000
+
+DllExport int
+win32_flock(int fd, int oper)
+{
+ OVERLAPPED o;
+ int i = -1;
+ HANDLE fh;
+
+ if (!IsWinNT()) {
+ croak("flock() unimplemented on this platform");
+ return -1;
+ }
+ fh = (HANDLE)_get_osfhandle(fd);
+ memset(&o, 0, sizeof(o));
+
+ switch(oper) {
+ case LOCK_SH: /* shared lock */
+ LK_ERR(LockFileEx(fh, 0, 0, LK_LEN, 0, &o),i);
+ break;
+ case LOCK_EX: /* exclusive lock */
+ LK_ERR(LockFileEx(fh, LOCKFILE_EXCLUSIVE_LOCK, 0, LK_LEN, 0, &o),i);
+ break;
+ case LOCK_SH|LOCK_NB: /* non-blocking shared lock */
+ LK_ERR(LockFileEx(fh, LOCKFILE_FAIL_IMMEDIATELY, 0, LK_LEN, 0, &o),i);
+ break;
+ case LOCK_EX|LOCK_NB: /* non-blocking exclusive lock */
+ LK_ERR(LockFileEx(fh,
+ LOCKFILE_EXCLUSIVE_LOCK|LOCKFILE_FAIL_IMMEDIATELY,
+ 0, LK_LEN, 0, &o),i);
+ break;
+ case LOCK_UN: /* unlock lock */
+ LK_ERR(UnlockFileEx(fh, 0, LK_LEN, 0, &o),i);
+ break;
+ default: /* unknown */
+ errno = EINVAL;
+ break;
+ }
+ return i;
+}
+
+#undef LK_ERR
+#undef LK_LEN
+
/*
* redirected io subsystem for all XS modules
*
@@ -864,45 +1410,45 @@ myalarm(unsigned int sec)
DllExport int *
win32_errno(void)
{
- return (pIOSubSystem->pfnerrno());
+ return (&errno);
}
DllExport char ***
win32_environ(void)
{
- return (pIOSubSystem->pfnenviron());
+ return (&(_environ));
}
/* the rest are the remapped stdio routines */
DllExport FILE *
win32_stderr(void)
{
- return (pIOSubSystem->pfnstderr());
+ return (stderr);
}
DllExport FILE *
win32_stdin(void)
{
- return (pIOSubSystem->pfnstdin());
+ return (stdin);
}
DllExport FILE *
win32_stdout()
{
- return (pIOSubSystem->pfnstdout());
+ return (stdout);
}
DllExport int
win32_ferror(FILE *fp)
{
- return (pIOSubSystem->pfnferror(fp));
+ return (ferror(fp));
}
DllExport int
win32_feof(FILE *fp)
{
- return (pIOSubSystem->pfnfeof(fp));
+ return (feof(fp));
}
/*
@@ -911,8 +1457,6 @@ win32_feof(FILE *fp)
* we have to roll our own.
*/
-__declspec(thread) char strerror_buffer[512];
-
DllExport char *
win32_strerror(int e)
{
@@ -921,26 +1465,54 @@ win32_strerror(int e)
#endif
DWORD source = 0;
- if(e < 0 || e > sys_nerr) {
- if(e < 0)
+ if (e < 0 || e > sys_nerr) {
+ dTHR;
+ if (e < 0)
e = GetLastError();
- if(FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, &source, e, 0,
+ if (FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, &source, e, 0,
strerror_buffer, sizeof(strerror_buffer), NULL) == 0)
strcpy(strerror_buffer, "Unknown Error");
return strerror_buffer;
}
- return pIOSubSystem->pfnstrerror(e);
+ return strerror(e);
+}
+
+DllExport void
+win32_str_os_error(void *sv, DWORD dwErr)
+{
+ DWORD dwLen;
+ char *sMsg;
+ dwLen = FormatMessageA(FORMAT_MESSAGE_ALLOCATE_BUFFER
+ |FORMAT_MESSAGE_IGNORE_INSERTS
+ |FORMAT_MESSAGE_FROM_SYSTEM, NULL,
+ dwErr, 0, (char *)&sMsg, 1, NULL);
+ if (0 < dwLen) {
+ while (0 < dwLen && isspace(sMsg[--dwLen]))
+ ;
+ if ('.' != sMsg[dwLen])
+ dwLen++;
+ sMsg[dwLen]= '\0';
+ }
+ if (0 == dwLen) {
+ sMsg = (char*)LocalAlloc(0, 64/**sizeof(TCHAR)*/);
+ dwLen = sprintf(sMsg,
+ "Unknown error #0x%lX (lookup 0x%lX)",
+ dwErr, GetLastError());
+ }
+ sv_setpvn((SV*)sv, sMsg, dwLen);
+ LocalFree(sMsg);
}
+
DllExport int
win32_fprintf(FILE *fp, const char *format, ...)
{
va_list marker;
va_start(marker, format); /* Initialize variable arguments. */
- return (pIOSubSystem->pfnvfprintf(fp, format, marker));
+ return (vfprintf(fp, format, marker));
}
DllExport int
@@ -949,188 +1521,409 @@ win32_printf(const char *format, ...)
va_list marker;
va_start(marker, format); /* Initialize variable arguments. */
- return (pIOSubSystem->pfnvprintf(format, marker));
+ return (vprintf(format, marker));
}
DllExport int
win32_vfprintf(FILE *fp, const char *format, va_list args)
{
- return (pIOSubSystem->pfnvfprintf(fp, format, args));
+ return (vfprintf(fp, format, args));
}
DllExport int
win32_vprintf(const char *format, va_list args)
{
- return (pIOSubSystem->pfnvprintf(format, args));
+ return (vprintf(format, args));
}
DllExport size_t
win32_fread(void *buf, size_t size, size_t count, FILE *fp)
{
- return pIOSubSystem->pfnfread(buf, size, count, fp);
+ return fread(buf, size, count, fp);
}
DllExport size_t
win32_fwrite(const void *buf, size_t size, size_t count, FILE *fp)
{
- return pIOSubSystem->pfnfwrite(buf, size, count, fp);
+ return fwrite(buf, size, count, fp);
}
DllExport FILE *
win32_fopen(const char *filename, const char *mode)
{
if (stricmp(filename, "/dev/null")==0)
- return pIOSubSystem->pfnfopen("NUL", mode);
- return pIOSubSystem->pfnfopen(filename, mode);
+ return fopen("NUL", mode);
+ return fopen(filename, mode);
}
+#ifndef USE_SOCKETS_AS_HANDLES
+#undef fdopen
+#define fdopen my_fdopen
+#endif
+
DllExport FILE *
win32_fdopen( int handle, const char *mode)
{
- return pIOSubSystem->pfnfdopen(handle, mode);
+ return fdopen(handle, (char *) mode);
}
DllExport FILE *
win32_freopen( const char *path, const char *mode, FILE *stream)
{
if (stricmp(path, "/dev/null")==0)
- return pIOSubSystem->pfnfreopen("NUL", mode, stream);
- return pIOSubSystem->pfnfreopen(path, mode, stream);
+ return freopen("NUL", mode, stream);
+ return freopen(path, mode, stream);
}
DllExport int
win32_fclose(FILE *pf)
{
- return pIOSubSystem->pfnfclose(pf);
+ return my_fclose(pf); /* defined in win32sck.c */
}
DllExport int
win32_fputs(const char *s,FILE *pf)
{
- return pIOSubSystem->pfnfputs(s, pf);
+ return fputs(s, pf);
}
DllExport int
win32_fputc(int c,FILE *pf)
{
- return pIOSubSystem->pfnfputc(c,pf);
+ return fputc(c,pf);
}
DllExport int
win32_ungetc(int c,FILE *pf)
{
- return pIOSubSystem->pfnungetc(c,pf);
+ return ungetc(c,pf);
}
DllExport int
win32_getc(FILE *pf)
{
- return pIOSubSystem->pfngetc(pf);
+ return getc(pf);
}
DllExport int
win32_fileno(FILE *pf)
{
- return pIOSubSystem->pfnfileno(pf);
+ return fileno(pf);
}
DllExport void
win32_clearerr(FILE *pf)
{
- pIOSubSystem->pfnclearerr(pf);
+ clearerr(pf);
return;
}
DllExport int
win32_fflush(FILE *pf)
{
- return pIOSubSystem->pfnfflush(pf);
+ return fflush(pf);
}
DllExport long
win32_ftell(FILE *pf)
{
- return pIOSubSystem->pfnftell(pf);
+ return ftell(pf);
}
DllExport int
win32_fseek(FILE *pf,long offset,int origin)
{
- return pIOSubSystem->pfnfseek(pf, offset, origin);
+ return fseek(pf, offset, origin);
}
DllExport int
win32_fgetpos(FILE *pf,fpos_t *p)
{
- return pIOSubSystem->pfnfgetpos(pf, p);
+ return fgetpos(pf, p);
}
DllExport int
win32_fsetpos(FILE *pf,const fpos_t *p)
{
- return pIOSubSystem->pfnfsetpos(pf, p);
+ return fsetpos(pf, p);
}
DllExport void
win32_rewind(FILE *pf)
{
- pIOSubSystem->pfnrewind(pf);
+ rewind(pf);
return;
}
DllExport FILE*
win32_tmpfile(void)
{
- return pIOSubSystem->pfntmpfile();
+ return tmpfile();
}
DllExport void
win32_abort(void)
{
- pIOSubSystem->pfnabort();
+ abort();
return;
}
DllExport int
-win32_fstat(int fd,struct stat *bufptr)
+win32_fstat(int fd,struct stat *sbufptr)
{
- return pIOSubSystem->pfnfstat(fd,bufptr);
+ return fstat(fd,sbufptr);
}
DllExport int
win32_pipe(int *pfd, unsigned int size, int mode)
{
- return pIOSubSystem->pfnpipe(pfd, size, mode);
+ return _pipe(pfd, size, mode);
}
+/*
+ * a popen() clone that respects PERL5SHELL
+ */
+
DllExport FILE*
win32_popen(const char *command, const char *mode)
{
- return pIOSubSystem->pfnpopen(command, mode);
+#ifdef USE_RTL_POPEN
+ return _popen(command, mode);
+#else
+ int p[2];
+ int parent, child;
+ int stdfd, oldfd;
+ int ourmode;
+ int childpid;
+
+ /* establish which ends read and write */
+ if (strchr(mode,'w')) {
+ stdfd = 0; /* stdin */
+ parent = 1;
+ child = 0;
+ }
+ else if (strchr(mode,'r')) {
+ stdfd = 1; /* stdout */
+ parent = 0;
+ child = 1;
+ }
+ else
+ return NULL;
+
+ /* set the correct mode */
+ if (strchr(mode,'b'))
+ ourmode = O_BINARY;
+ else if (strchr(mode,'t'))
+ ourmode = O_TEXT;
+ else
+ ourmode = _fmode & (O_TEXT | O_BINARY);
+
+ /* the child doesn't inherit handles */
+ ourmode |= O_NOINHERIT;
+
+ if (win32_pipe( p, 512, ourmode) == -1)
+ return NULL;
+
+ /* save current stdfd */
+ if ((oldfd = win32_dup(stdfd)) == -1)
+ goto cleanup;
+
+ /* make stdfd go to child end of pipe (implicitly closes stdfd) */
+ /* stdfd will be inherited by the child */
+ if (win32_dup2(p[child], stdfd) == -1)
+ goto cleanup;
+
+ /* close the child end in parent */
+ win32_close(p[child]);
+
+ /* start the child */
+ if ((childpid = do_spawn_nowait((char*)command)) == -1)
+ goto cleanup;
+
+ /* revert stdfd to whatever it was before */
+ if (win32_dup2(oldfd, stdfd) == -1)
+ goto cleanup;
+
+ /* close saved handle */
+ win32_close(oldfd);
+
+ sv_setiv(*av_fetch(w32_fdpid, p[parent], TRUE), childpid);
+
+ /* we have an fd, return a file stream */
+ return (win32_fdopen(p[parent], (char *)mode));
+
+cleanup:
+ /* we don't need to check for errors here */
+ win32_close(p[0]);
+ win32_close(p[1]);
+ if (oldfd != -1) {
+ win32_dup2(oldfd, stdfd);
+ win32_close(oldfd);
+ }
+ return (NULL);
+
+#endif /* USE_RTL_POPEN */
}
+/*
+ * pclose() clone
+ */
+
DllExport int
win32_pclose(FILE *pf)
{
- return pIOSubSystem->pfnpclose(pf);
+#ifdef USE_RTL_POPEN
+ return _pclose(pf);
+#else
+
+ int childpid, status;
+ SV *sv;
+
+ sv = *av_fetch(w32_fdpid, win32_fileno(pf), TRUE);
+ if (SvIOK(sv))
+ childpid = SvIVX(sv);
+ else
+ childpid = 0;
+
+ if (!childpid) {
+ errno = EBADF;
+ return -1;
+ }
+
+ win32_fclose(pf);
+ SvIVX(sv) = 0;
+
+ remove_dead_process((HANDLE)childpid);
+
+ /* wait for the child */
+ if (cwait(&status, childpid, WAIT_CHILD) == -1)
+ return (-1);
+ /* cwait() returns "correctly" on Borland */
+#ifndef __BORLANDC__
+ status *= 256;
+#endif
+ return (status);
+
+#endif /* USE_RTL_POPEN */
+}
+
+DllExport int
+win32_rename(const char *oname, const char *newname)
+{
+ /* XXX despite what the documentation says about MoveFileEx(),
+ * it doesn't work under Windows95!
+ */
+ if (IsWinNT()) {
+ if (!MoveFileEx(oname,newname,
+ MOVEFILE_COPY_ALLOWED|MOVEFILE_REPLACE_EXISTING)) {
+ DWORD err = GetLastError();
+ switch (err) {
+ case ERROR_BAD_NET_NAME:
+ case ERROR_BAD_NETPATH:
+ case ERROR_BAD_PATHNAME:
+ case ERROR_FILE_NOT_FOUND:
+ case ERROR_FILENAME_EXCED_RANGE:
+ case ERROR_INVALID_DRIVE:
+ case ERROR_NO_MORE_FILES:
+ case ERROR_PATH_NOT_FOUND:
+ errno = ENOENT;
+ break;
+ default:
+ errno = EACCES;
+ break;
+ }
+ return -1;
+ }
+ return 0;
+ }
+ else {
+ int retval = 0;
+ char tmpname[MAX_PATH+1];
+ char dname[MAX_PATH+1];
+ char *endname = Nullch;
+ STRLEN tmplen = 0;
+ DWORD from_attr, to_attr;
+
+ /* if oname doesn't exist, do nothing */
+ from_attr = GetFileAttributes(oname);
+ if (from_attr == 0xFFFFFFFF) {
+ errno = ENOENT;
+ return -1;
+ }
+
+ /* if newname exists, rename it to a temporary name so that we
+ * don't delete it in case oname happens to be the same file
+ * (but perhaps accessed via a different path)
+ */
+ to_attr = GetFileAttributes(newname);
+ if (to_attr != 0xFFFFFFFF) {
+ /* if newname is a directory, we fail
+ * XXX could overcome this with yet more convoluted logic */
+ if (to_attr & FILE_ATTRIBUTE_DIRECTORY) {
+ errno = EACCES;
+ return -1;
+ }
+ tmplen = strlen(newname);
+ strcpy(tmpname,newname);
+ endname = tmpname+tmplen;
+ for (; endname > tmpname ; --endname) {
+ if (*endname == '/' || *endname == '\\') {
+ *endname = '\0';
+ break;
+ }
+ }
+ if (endname > tmpname)
+ endname = strcpy(dname,tmpname);
+ else
+ endname = ".";
+
+ /* get a temporary filename in same directory
+ * XXX is this really the best we can do? */
+ if (!GetTempFileName((LPCTSTR)endname, "plr", 0, tmpname)) {
+ errno = ENOENT;
+ return -1;
+ }
+ DeleteFile(tmpname);
+
+ retval = rename(newname, tmpname);
+ if (retval != 0) {
+ errno = EACCES;
+ return retval;
+ }
+ }
+
+ /* rename oname to newname */
+ retval = rename(oname, newname);
+
+ /* if we created a temporary file before ... */
+ if (endname != Nullch) {
+ /* ...and rename succeeded, delete temporary file/directory */
+ if (retval == 0)
+ DeleteFile(tmpname);
+ /* else restore it to what it was */
+ else
+ (void)rename(tmpname, newname);
+ }
+ return retval;
+ }
}
DllExport int
win32_setmode(int fd, int mode)
{
- return pIOSubSystem->pfnsetmode(fd, mode);
+ return setmode(fd, mode);
}
DllExport long
win32_lseek(int fd, long offset, int origin)
{
- return pIOSubSystem->pfnlseek(fd, offset, origin);
+ return lseek(fd, offset, origin);
}
DllExport long
win32_tell(int fd)
{
- return pIOSubSystem->pfntell(fd);
+ return tell(fd);
}
DllExport int
@@ -1144,198 +1937,290 @@ win32_open(const char *path, int flag, ...)
va_end(ap);
if (stricmp(path, "/dev/null")==0)
- return pIOSubSystem->pfnopen("NUL", flag, pmode);
- return pIOSubSystem->pfnopen(path,flag,pmode);
+ return open("NUL", flag, pmode);
+ return open(path,flag,pmode);
}
DllExport int
win32_close(int fd)
{
- return pIOSubSystem->pfnclose(fd);
+ return close(fd);
}
DllExport int
win32_eof(int fd)
{
- return pIOSubSystem->pfneof(fd);
+ return eof(fd);
}
DllExport int
win32_dup(int fd)
{
- return pIOSubSystem->pfndup(fd);
+ return dup(fd);
}
DllExport int
win32_dup2(int fd1,int fd2)
{
- return pIOSubSystem->pfndup2(fd1,fd2);
+ return dup2(fd1,fd2);
}
DllExport int
win32_read(int fd, void *buf, unsigned int cnt)
{
- return pIOSubSystem->pfnread(fd, buf, cnt);
+ return read(fd, buf, cnt);
}
DllExport int
win32_write(int fd, const void *buf, unsigned int cnt)
{
- return pIOSubSystem->pfnwrite(fd, buf, cnt);
+ return write(fd, buf, cnt);
}
DllExport int
win32_mkdir(const char *dir, int mode)
{
- return pIOSubSystem->pfnmkdir(dir); /* just ignore mode */
+ return mkdir(dir); /* just ignore mode */
}
DllExport int
win32_rmdir(const char *dir)
{
- return pIOSubSystem->pfnrmdir(dir);
+ return rmdir(dir);
}
DllExport int
win32_chdir(const char *dir)
{
- return pIOSubSystem->pfnchdir(dir);
+ return chdir(dir);
}
DllExport int
win32_spawnvp(int mode, const char *cmdname, const char *const *argv)
{
- return pIOSubSystem->pfnspawnvp(mode, cmdname, argv);
+ int status;
+
+#ifndef USE_RTL_WAIT
+ if (mode == P_NOWAIT && w32_num_children >= MAXIMUM_WAIT_OBJECTS)
+ return -1;
+#endif
+
+ status = spawnvp(mode, cmdname, (char * const *) argv);
+#ifndef USE_RTL_WAIT
+ /* XXX For the P_NOWAIT case, Borland RTL returns pinfo.dwProcessId
+ * while VC RTL returns pinfo.hProcess. For purposes of the custom
+ * implementation of win32_wait(), we assume the latter.
+ */
+ if (mode == P_NOWAIT && status >= 0)
+ w32_child_pids[w32_num_children++] = (HANDLE)status;
+#endif
+ return status;
+}
+
+DllExport int
+win32_execv(const char *cmdname, const char *const *argv)
+{
+ return execv(cmdname, (char *const *)argv);
}
DllExport int
win32_execvp(const char *cmdname, const char *const *argv)
{
- return pIOSubSystem->pfnexecvp(cmdname, argv);
+ return execvp(cmdname, (char *const *)argv);
}
DllExport void
win32_perror(const char *str)
{
- pIOSubSystem->pfnperror(str);
+ perror(str);
}
DllExport void
win32_setbuf(FILE *pf, char *buf)
{
- pIOSubSystem->pfnsetbuf(pf, buf);
+ setbuf(pf, buf);
}
DllExport int
win32_setvbuf(FILE *pf, char *buf, int type, size_t size)
{
- return pIOSubSystem->pfnsetvbuf(pf, buf, type, size);
+ return setvbuf(pf, buf, type, size);
}
DllExport int
win32_flushall(void)
{
- return pIOSubSystem->pfnflushall();
+ return flushall();
}
DllExport int
win32_fcloseall(void)
{
- return pIOSubSystem->pfnfcloseall();
+ return fcloseall();
}
DllExport char*
win32_fgets(char *s, int n, FILE *pf)
{
- return pIOSubSystem->pfnfgets(s, n, pf);
+ return fgets(s, n, pf);
}
DllExport char*
win32_gets(char *s)
{
- return pIOSubSystem->pfngets(s);
+ return gets(s);
}
DllExport int
win32_fgetc(FILE *pf)
{
- return pIOSubSystem->pfnfgetc(pf);
+ return fgetc(pf);
}
DllExport int
win32_putc(int c, FILE *pf)
{
- return pIOSubSystem->pfnputc(c,pf);
+ return putc(c,pf);
}
DllExport int
win32_puts(const char *s)
{
- return pIOSubSystem->pfnputs(s);
+ return puts(s);
}
DllExport int
win32_getchar(void)
{
- return pIOSubSystem->pfngetchar();
+ return getchar();
}
DllExport int
win32_putchar(int c)
{
- return pIOSubSystem->pfnputchar(c);
+ return putchar(c);
+}
+
+#ifdef MYMALLOC
+
+#ifndef USE_PERL_SBRK
+
+static char *committed = NULL;
+static char *base = NULL;
+static char *reserved = NULL;
+static char *brk = NULL;
+static DWORD pagesize = 0;
+static DWORD allocsize = 0;
+
+void *
+sbrk(int need)
+{
+ void *result;
+ if (!pagesize)
+ {SYSTEM_INFO info;
+ GetSystemInfo(&info);
+ /* Pretend page size is larger so we don't perpetually
+ * 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;
+ char *addr;
+ 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)
+ committed = reserved;
+ }
+ /* Reserve some (more) space
+ * 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
+ */
+ addr = (char *) VirtualAlloc(reserved,size,MEM_RESERVE,PAGE_NOACCESS);
+ if (addr)
+ {
+ reserved = addr+size;
+ if (!base)
+ base = addr;
+ if (!committed)
+ committed = base;
+ if (!brk)
+ brk = committed;
+ }
+ else
+ {
+ return (void *) -1;
+ }
+ }
+ result = brk;
+ brk += need;
+ if (brk > committed)
+ {
+ DWORD size = ((brk-committed + pagesize -1)/pagesize) * pagesize;
+ char *addr = (char *) VirtualAlloc(committed,size,MEM_COMMIT,PAGE_READWRITE);
+ if (addr)
+ {
+ committed += size;
+ }
+ else
+ return (void *) -1;
+ }
+ return result;
}
+#endif
+#endif
+
DllExport void*
win32_malloc(size_t size)
{
- return pIOSubSystem->pfnmalloc(size);
+ return malloc(size);
}
DllExport void*
win32_calloc(size_t numitems, size_t size)
{
- return pIOSubSystem->pfncalloc(numitems,size);
+ return calloc(numitems,size);
}
DllExport void*
win32_realloc(void *block, size_t size)
{
- return pIOSubSystem->pfnrealloc(block,size);
+ return realloc(block,size);
}
DllExport void
win32_free(void *block)
{
- pIOSubSystem->pfnfree(block);
+ free(block);
}
+
int
-stolen_open_osfhandle(long handle, int flags)
+win32_open_osfhandle(long handle, int flags)
{
- return pIOSubSystem->pfn_open_osfhandle(handle, flags);
+ return _open_osfhandle(handle, flags);
}
long
-stolen_get_osfhandle(int fd)
+win32_get_osfhandle(int fd)
{
- return pIOSubSystem->pfn_get_osfhandle(fd);
+ return _get_osfhandle(fd);
}
/*
* Extras.
*/
-DllExport int
-win32_flock(int fd, int oper)
-{
- if (!IsWinNT()) {
- croak("flock() unimplemented on this platform");
- return -1;
- }
- return pIOSubSystem->pfnflock(fd, oper);
-}
-
static
XS(w32_GetCwd)
{
@@ -1353,7 +2238,7 @@ XS(w32_GetCwd)
*/
if (SvCUR(sv))
SvPOK_on(sv);
- EXTEND(sp,1);
+ EXTEND(SP,1);
ST(0) = sv;
XSRETURN(1);
}
@@ -1362,9 +2247,10 @@ static
XS(w32_SetCwd)
{
dXSARGS;
+ STRLEN n_a;
if (items != 1)
croak("usage: Win32::SetCurrentDirectory($cwd)");
- if (SetCurrentDirectory(SvPV(ST(0),na)))
+ if (SetCurrentDirectory(SvPV(ST(0),n_a)))
XSRETURN_YES;
XSRETURN_NO;
@@ -1397,8 +2283,8 @@ static
XS(w32_LoginName)
{
dXSARGS;
- char name[256];
- DWORD size = sizeof(name);
+ char *name = getlogin_buffer;
+ DWORD size = sizeof(getlogin_buffer);
if (GetUserName(name,&size)) {
/* size includes NULL */
ST(0) = sv_2mortal(newSVpv(name,size-1));
@@ -1426,6 +2312,8 @@ static
XS(w32_DomainName)
{
dXSARGS;
+#ifndef HAS_NETWKSTAGETINFO
+ /* mingw32 (and Win95) don't have NetWksta*(), so do it the old way */
char name[256];
DWORD size = sizeof(name);
if (GetUserName(name,&size)) {
@@ -1434,11 +2322,31 @@ XS(w32_DomainName)
char dname[256];
DWORD dnamelen = sizeof(dname);
SID_NAME_USE snu;
- if (LookupAccountName(NULL, name, &sid, &sidlen,
+ if (LookupAccountName(NULL, name, (PSID)&sid, &sidlen,
dname, &dnamelen, &snu)) {
XSRETURN_PV(dname); /* all that for this */
}
}
+#else
+ /* this way is more reliable, in case user has a local account.
+ * XXX need dynamic binding of netapi32.dll symbols or this will fail on
+ * Win95. Probably makes more sense to move it into libwin32. */
+ char dname[256];
+ DWORD dnamelen = sizeof(dname);
+ PWKSTA_INFO_100 pwi;
+ if (NERR_Success == NetWkstaGetInfo(NULL, 100, (LPBYTE*)&pwi)) {
+ if (pwi->wki100_langroup && *(pwi->wki100_langroup)) {
+ WideCharToMultiByte(CP_ACP, NULL, pwi->wki100_langroup,
+ -1, (LPSTR)dname, dnamelen, NULL, NULL);
+ }
+ else {
+ WideCharToMultiByte(CP_ACP, NULL, pwi->wki100_computername,
+ -1, (LPSTR)dname, dnamelen, NULL, NULL);
+ }
+ NetApiBufferFree(pwi);
+ XSRETURN_PV(dname);
+ }
+#endif
XSRETURN_UNDEF;
}
@@ -1521,19 +2429,20 @@ XS(w32_Spawn)
PROCESS_INFORMATION stProcInfo;
STARTUPINFO stStartInfo;
BOOL bSuccess = FALSE;
+ STRLEN n_a;
- if(items != 3)
+ if (items != 3)
croak("usage: Win32::Spawn($cmdName, $args, $PID)");
- cmd = SvPV(ST(0),na);
- args = SvPV(ST(1), na);
+ cmd = SvPV(ST(0),n_a);
+ args = SvPV(ST(1), n_a);
memset(&stStartInfo, 0, sizeof(stStartInfo)); /* Clear the block */
stStartInfo.cb = sizeof(stStartInfo); /* Set the structure size */
stStartInfo.dwFlags = STARTF_USESHOWWINDOW; /* Enable wShowWindow control */
stStartInfo.wShowWindow = SW_SHOWMINNOACTIVE; /* Start min (normal) */
- if(CreateProcess(
+ if (CreateProcess(
cmd, /* Image path */
args, /* Arguments for command line */
NULL, /* Default process security */
@@ -1566,7 +2475,7 @@ XS(w32_GetShortPathName)
SV *shortpath;
DWORD len;
- if(items != 1)
+ if (items != 1)
croak("usage: Win32::GetShortPathName($longPathName)");
shortpath = sv_mortalcopy(ST(0));
@@ -1582,18 +2491,32 @@ XS(w32_GetShortPathName)
ST(0) = shortpath;
}
else
- ST(0) = &sv_undef;
+ ST(0) = &PL_sv_undef;
XSRETURN(1);
}
+static
+XS(w32_Sleep)
+{
+ dXSARGS;
+ if (items != 1)
+ croak("usage: Win32::Sleep($milliseconds)");
+ Sleep(SvIV(ST(0)));
+ XSRETURN_YES;
+}
+
void
-init_os_extras()
+Perl_init_os_extras()
{
char *file = __FILE__;
dXSUB_SYS;
- /* XXX should be removed after checking with Nick */
- newXS("Win32::GetCurrentDirectory", w32_GetCwd, file);
+ w32_perlshell_tokens = Nullch;
+ w32_perlshell_items = -1;
+ w32_fdpid = newAV(); /* XXX needs to be in Perl_win32_init()? */
+#ifndef USE_RTL_WAIT
+ w32_num_children = 0;
+#endif
/* these names are Activeware compatible */
newXS("Win32::GetCwd", w32_GetCwd, file);
@@ -1611,6 +2534,7 @@ init_os_extras()
newXS("Win32::Spawn", w32_Spawn, file);
newXS("Win32::GetTickCount", w32_GetTickCount, file);
newXS("Win32::GetShortPathName", w32_GetShortPathName, file);
+ newXS("Win32::Sleep", w32_Sleep, file);
/* XXX Bloat Alert! The following Activeware preloads really
* ought to be part of Win32::Sys::*, so they're not included
@@ -1633,7 +2557,33 @@ Perl_win32_init(int *argcp, char ***argvp)
* want to be at the vendor's whim on the default, we set
* it explicitly here.
*/
-#if !defined(_ALPHA_)
+#if !defined(_ALPHA_) && !defined(__GNUC__)
_control87(MCW_EM, MCW_EM);
#endif
+ MALLOC_INIT;
+}
+
+#ifdef USE_BINMODE_SCRIPTS
+
+void
+win32_strip_return(SV *sv)
+{
+ char *s = SvPVX(sv);
+ char *e = s+SvCUR(sv);
+ char *d = s;
+ while (s < e)
+ {
+ if (*s == '\r' && s[1] == '\n')
+ {
+ *d++ = '\n';
+ s += 2;
+ }
+ else
+ {
+ *d++ = *s++;
+ }
+ }
+ SvCUR_set(sv,d-SvPVX(sv));
}
+
+#endif
diff --git a/gnu/usr.bin/perl/win32/win32.h b/gnu/usr.bin/perl/win32/win32.h
index dc069ba366c..961347d5fea 100644
--- a/gnu/usr.bin/perl/win32/win32.h
+++ b/gnu/usr.bin/perl/win32/win32.h
@@ -9,23 +9,128 @@
#ifndef _INC_WIN32_PERL5
#define _INC_WIN32_PERL5
+#ifdef PERL_OBJECT
+# define DYNAMIC_ENV_FETCH
+# define ENV_HV_NAME "___ENV_HV_NAME___"
+# define prime_env_iter()
+# define WIN32IO_IS_STDIO /* don't pull in custom stdio layer */
+# ifdef PERL_GLOBAL_STRUCT
+# error PERL_GLOBAL_STRUCT cannot be defined with PERL_OBJECT
+# endif
+# define win32_get_privlib PerlEnv_lib_path
+# define win32_get_sitelib PerlEnv_sitelib_path
+#endif
+
+#ifdef __GNUC__
+typedef long long __int64;
+# define Win32_Winsock
+/* GCC does not do __declspec() - render it a nop
+ * and turn on options to avoid importing data
+ */
+#ifndef __declspec
+# define __declspec(x)
+#endif
+# ifndef PERL_OBJECT
+# define PERL_GLOBAL_STRUCT
+# define MULTIPLICITY
+# endif
+#endif
+
+/* Define DllExport akin to perl's EXT,
+ * If we are in the DLL or mimicing the DLL for Win95 work round
+ * then Export the symbol,
+ * otherwise import it.
+ */
+
+#if defined(PERL_OBJECT)
+#define DllExport
+#else
+#if defined(PERLDLL) || defined(WIN95FIX)
+#define DllExport
+/*#define DllExport __declspec(dllexport)*/ /* noises with VC5+sp3 */
+#else
+#define DllExport __declspec(dllimport)
+#endif
+#endif
+
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#ifdef WIN32_LEAN_AND_MEAN /* C file is NOT a Perl5 original. */
#define CONTEXT PERL_CONTEXT /* Avoid conflict of CONTEXT defs. */
-#define index strchr /* Why 'index'? */
#endif /*WIN32_LEAN_AND_MEAN */
+#ifndef TLS_OUT_OF_INDEXES
+#define TLS_OUT_OF_INDEXES (DWORD)0xFFFFFFFF
+#endif
+
#include <dirent.h>
#include <io.h>
#include <process.h>
#include <stdio.h>
#include <direct.h>
+#include <stdlib.h>
+#ifndef EXT
+#include "EXTERN.h"
+#endif
-/* For UNIX compatibility. */
+struct tms {
+ long tms_utime;
+ long tms_stime;
+ long tms_cutime;
+ long tms_cstime;
+};
+
+#ifndef START_EXTERN_C
+#undef EXTERN_C
+#ifdef __cplusplus
+# define START_EXTERN_C extern "C" {
+# define END_EXTERN_C }
+# define EXTERN_C extern "C"
+#else
+# define START_EXTERN_C
+# define END_EXTERN_C
+# define EXTERN_C
+#endif
+#endif
+
+#define STANDARD_C 1
+#define DOSISH 1 /* no escaping our roots */
+#define OP_BINARY O_BINARY /* mistake in in pp_sys.c? */
+
+/* Define USE_SOCKETS_AS_HANDLES to enable emulation of windows sockets as
+ * real filehandles. XXX Should always be defined (the other version is untested) */
+#define USE_SOCKETS_AS_HANDLES
+
+/* read() and write() aren't transparent for socket handles */
+#define PERL_SOCK_SYSREAD_IS_RECV
+#define PERL_SOCK_SYSWRITE_IS_SEND
+
+
+/* if USE_WIN32_RTL_ENV is not defined, Perl uses direct Win32 calls
+ * to read the environment, bypassing the runtime's (usually broken)
+ * facilities for accessing the same. See note in util.c/my_setenv(). */
+/*#define USE_WIN32_RTL_ENV */
+
+/* Define USE_FIXED_OSFHANDLE to fix VC's _open_osfhandle() on W95.
+ * Can only enable it if not using the DLL CRT (it doesn't expose internals) */
+#if defined(_MSC_VER) && !defined(_DLL) && defined(_M_IX86)
+#define USE_FIXED_OSFHANDLE
+#endif
+
+#define ENV_IS_CASELESS
+
+#ifndef VER_PLATFORM_WIN32_WINDOWS /* VC-2.0 headers don't have this */
+#define VER_PLATFORM_WIN32_WINDOWS 1
+#endif
+
+#ifndef FILE_SHARE_DELETE /* VC-4.0 headers don't have this */
+#define FILE_SHARE_DELETE 0x00000004
+#endif
-#ifdef __BORLANDC__
+/* Compiler-specific stuff. */
+
+#ifdef __BORLANDC__ /* Borland C++ */
#define _access access
#define _chdir chdir
@@ -35,120 +140,230 @@
#define DllMain DllEntryPoint
#endif
-#pragma warn -ccc
-#pragma warn -rch
-#pragma warn -sig
-#pragma warn -pia
-#pragma warn -par
-#pragma warn -aus
-#pragma warn -use
-#pragma warn -csu
-#pragma warn -pro
+#pragma warn -ccc /* "condition is always true/false" */
+#pragma warn -rch /* "unreachable code" */
+#pragma warn -sig /* "conversion may lose significant digits" */
+#pragma warn -pia /* "possibly incorrect assignment" */
+#pragma warn -par /* "parameter 'foo' is never used" */
+#pragma warn -aus /* "'foo' is assigned a value that is never used" */
+#pragma warn -use /* "'foo' is declared but never used" */
+#pragma warn -csu /* "comparing signed and unsigned values" */
+#pragma warn -pro /* "call to function with no prototype" */
+
+#define USE_RTL_WAIT /* Borland has a working wait() */
+
+/* Borland is picky about a bare member function name used as its ptr */
+#ifdef PERL_OBJECT
+#define FUNC_NAME_TO_PTR(name) &(name)
+#endif
-#else
+#endif
+
+#ifdef _MSC_VER /* Microsoft Visual C++ */
typedef long uid_t;
typedef long gid_t;
+#pragma warning(disable: 4018 4035 4101 4102 4244 4245 4761)
-#endif
-
-extern uid_t getuid(void);
-extern gid_t getgid(void);
-extern uid_t geteuid(void);
-extern gid_t getegid(void);
-extern int setuid(uid_t uid);
-extern int setgid(gid_t gid);
-
-extern int kill(int pid, int sig);
+#ifndef PERL_OBJECT
+
+/* Visual C thinks that a pointer to a member variable is 16 bytes in size. */
+#define STRUCT_MGVTBL_DEFINITION \
+struct mgvtbl { \
+ union { \
+ int (CPERLscope(*svt_get)) _((SV *sv, MAGIC* mg)); \
+ char handle_VC_problem1[16]; \
+ }; \
+ union { \
+ int (CPERLscope(*svt_set)) _((SV *sv, MAGIC* mg)); \
+ char handle_VC_problem2[16]; \
+ }; \
+ union { \
+ U32 (CPERLscope(*svt_len)) _((SV *sv, MAGIC* mg)); \
+ char handle_VC_problem3[16]; \
+ }; \
+ union { \
+ int (CPERLscope(*svt_clear)) _((SV *sv, MAGIC* mg)); \
+ char handle_VC_problem4[16]; \
+ }; \
+ union { \
+ int (CPERLscope(*svt_free)) _((SV *sv, MAGIC* mg)); \
+ char handle_VC_problem5[16]; \
+ }; \
+}
+
+#define BASEOP_DEFINITION \
+ OP* op_next; \
+ OP* op_sibling; \
+ OP* (CPERLscope(*op_ppaddr))_((ARGSproto)); \
+ char handle_VC_problem[12]; \
+ PADOFFSET op_targ; \
+ OPCODE op_type; \
+ U16 op_seq; \
+ U8 op_flags; \
+ U8 op_private;
+
+#define UNION_ANY_DEFINITION union any { \
+ void* any_ptr; \
+ I32 any_i32; \
+ IV any_iv; \
+ long any_long; \
+ void (CPERLscope(*any_dptr)) _((void*)); \
+ char handle_VC_problem[16]; \
+}
+
+#endif /* PERL_OBJECT */
+
+#endif /* _MSC_VER */
+
+#ifdef __MINGW32__ /* Minimal Gnu-Win32 */
-extern char *staticlinkmodules[];
+typedef long uid_t;
+typedef long gid_t;
+#ifndef _environ
+#define _environ environ
+#endif
+#define flushall _flushall
+#define fcloseall _fcloseall
-/* if USE_WIN32_RTL_ENV is not defined, Perl uses direct Win32 calls
- * to read the environment, bypassing the runtime's (usually broken)
- * facilities for accessing the same. See note in util.c/my_setenv().
- */
-/*#define USE_WIN32_RTL_ENV */
+#ifdef PERL_OBJECT
+#define FUNC_NAME_TO_PTR(name) &(name)
+#endif
-#ifndef USE_WIN32_RTL_ENV
-#include <stdlib.h>
-#ifndef EXT
-#include "EXTERN.h"
+#ifndef _O_NOINHERIT
+# define _O_NOINHERIT 0x0080
+# ifndef _NO_OLDNAMES
+# define O_NOINHERIT _O_NOINHERIT
+# endif
#endif
-#undef getenv
-#define getenv win32_getenv
-EXT char *win32_getenv(const char *name);
+
+#ifndef _O_NOINHERIT
+# define _O_NOINHERIT 0x0080
+# ifndef _NO_OLDNAMES
+# define O_NOINHERIT _O_NOINHERIT
+# endif
#endif
-EXT void Perl_win32_init(int *argcp, char ***argvp);
+#endif /* __MINGW32__ */
-#define USE_SOCKETS_AS_HANDLES
-#ifndef USE_SOCKETS_AS_HANDLES
-extern FILE *myfdopen(int, char *);
+/* compatibility stuff for other compilers goes here */
-#undef fdopen
-#define fdopen myfdopen
-#endif /* USE_SOCKETS_AS_HANDLES */
-#define STANDARD_C 1 /* Perl5 likes standard C. */
-#define DOSISH 1 /* Take advantage of DOSish code in Perl5. */
+START_EXTERN_C
-#define OP_BINARY O_BINARY /* Mistake in in pp_sys.c. */
+/* For UNIX compatibility. */
-#undef pipe
-#define pipe(fd) win32_pipe((fd), 512, O_BINARY) /* the pipe call is a bit different */
+extern uid_t getuid(void);
+extern gid_t getgid(void);
+extern uid_t geteuid(void);
+extern gid_t getegid(void);
+extern int setuid(uid_t uid);
+extern int setgid(gid_t gid);
+extern int kill(int pid, int sig);
+extern void *sbrk(int need);
+extern char * getlogin(void);
+extern int chown(const char *p, uid_t o, gid_t g);
-#undef pause
-#define pause() sleep((32767L << 16) + 32767)
+#undef Stat
+#define Stat win32_stat
+#undef init_os_extras
+#define init_os_extras Perl_init_os_extras
-#undef times
-#define times mytimes
+DllExport void Perl_win32_init(int *argcp, char ***argvp);
+DllExport void Perl_init_os_extras(void);
+DllExport void win32_str_os_error(void *sv, DWORD err);
-#undef alarm
-#define alarm myalarm
+#ifndef USE_SOCKETS_AS_HANDLES
+extern FILE * my_fdopen(int, char *);
+#endif
+extern int my_fclose(FILE *);
+extern int do_aspawn(void *really, void **mark, void **sp);
+extern int do_spawn(char *cmd);
+extern int do_spawn_nowait(char *cmd);
+extern char do_exec(char *cmd);
+extern char * win32_get_privlib(char *pl);
+extern char * win32_get_sitelib(char *pl);
+extern int IsWin95(void);
+extern int IsWinNT(void);
-struct tms {
- long tms_utime;
- long tms_stime;
- long tms_cutime;
- long tms_cstime;
-};
+extern char * staticlinkmodules[];
-unsigned int sleep(unsigned int);
-char *win32PerlLibPath(void);
-char *win32SiteLibPath(void);
-int mytimes(struct tms *timebuf);
-unsigned int myalarm(unsigned int sec);
-int do_aspawn(void* really, void** mark, void** arglast);
-int do_spawn(char *cmd);
-char do_exec(char *cmd);
-void init_os_extras(void);
+END_EXTERN_C
typedef char * caddr_t; /* In malloc.c (core address). */
/*
- * Extension Library, only good for VC
- */
-
-#define DllExport __declspec(dllexport)
-#define DllImport __declspec(dllimport)
-
-/*
* handle socket stuff, assuming socket is always available
*/
-
#include <sys/socket.h>
#include <netdb.h>
-#ifdef _MSC_VER
-#pragma warning(disable: 4018 4035 4101 4102 4244 4245 4761)
+#ifdef MYMALLOC
+#define EMBEDMYMALLOC /**/
+/* #define USE_PERL_SBRK /**/
+/* #define PERL_SBRK_VIA_MALLOC /**/
#endif
-int IsWin95(void);
-int IsWinNT(void);
+#if defined(PERLDLL) && !defined(PERL_CORE)
+#define PERL_CORE
+#endif
-#ifndef VER_PLATFORM_WIN32_WINDOWS /* VC-2.0 headers dont have this */
-#define VER_PLATFORM_WIN32_WINDOWS 1
+#ifdef USE_BINMODE_SCRIPTS
+#define PERL_SCRIPT_MODE "rb"
+EXT void win32_strip_return(struct sv *sv);
+#else
+#define PERL_SCRIPT_MODE "r"
+#define win32_strip_return(sv) NOOP
#endif
+#define HAVE_INTERP_INTERN
+struct interp_intern {
+ char * w32_perlshell_tokens;
+ char ** w32_perlshell_vec;
+ long w32_perlshell_items;
+ struct av * w32_fdpid;
+#ifndef USE_RTL_WAIT
+ long w32_num_children;
+ HANDLE w32_child_pids[MAXIMUM_WAIT_OBJECTS];
+#endif
+};
+
+#define w32_perlshell_tokens (PL_sys_intern.w32_perlshell_tokens)
+#define w32_perlshell_vec (PL_sys_intern.w32_perlshell_vec)
+#define w32_perlshell_items (PL_sys_intern.w32_perlshell_items)
+#define w32_fdpid (PL_sys_intern.w32_fdpid)
+
+#ifndef USE_RTL_WAIT
+# define w32_num_children (PL_sys_intern.w32_num_children)
+# define w32_child_pids (PL_sys_intern.w32_child_pids)
+#endif
+
+/*
+ * Now Win32 specific per-thread data stuff
+ */
+
+#ifdef USE_THREADS
+# ifndef USE_DECLSPEC_THREAD
+# define HAVE_THREAD_INTERN
+
+struct thread_intern {
+ /* XXX can probably use one buffer instead of several */
+ char Wstrerror_buffer[512];
+ struct servent Wservent;
+ char Wgetlogin_buffer[128];
+ char Ww32_perllib_root[MAX_PATH+1];
+# ifdef USE_SOCKETS_AS_HANDLES
+ int Winit_socktype;
+# endif
+# ifdef HAVE_DES_FCRYPT
+ char Wcrypt_buffer[30];
+# endif
+# ifdef USE_RTL_THREAD_API
+ void * retv; /* slot for thread return value */
+# endif
+};
+# endif /* !USE_DECLSPEC_THREAD */
+#endif /* USE_THREADS */
+
#endif /* _INC_WIN32_PERL5 */
diff --git a/gnu/usr.bin/perl/win32/win32iop.h b/gnu/usr.bin/perl/win32/win32iop.h
index 4606563d0e8..c7a74444e06 100644
--- a/gnu/usr.bin/perl/win32/win32iop.h
+++ b/gnu/usr.bin/perl/win32/win32iop.h
@@ -1,6 +1,31 @@
#ifndef WIN32IOP_H
#define WIN32IOP_H
+#ifndef START_EXTERN_C
+#ifdef __cplusplus
+# define START_EXTERN_C extern "C" {
+# define END_EXTERN_C }
+# define EXTERN_C extern "C"
+#else
+# define START_EXTERN_C
+# define END_EXTERN_C
+# define EXTERN_C
+#endif
+#endif
+
+#if defined(_MSC_VER) || defined(__MINGW32__)
+# include <sys/utime.h>
+#else
+# include <utime.h>
+#endif
+
+/*
+ * defines for flock emulation
+ */
+#define LOCK_SH 1
+#define LOCK_EX 2
+#define LOCK_NB 4
+#define LOCK_UN 8
/*
* Make this as close to original stdio as possible.
@@ -9,96 +34,105 @@
/*
* function prototypes for our own win32io layer
*/
-EXT int * win32_errno(void);
-EXT char *** win32_environ(void);
-EXT FILE* win32_stdin(void);
-EXT FILE* win32_stdout(void);
-EXT FILE* win32_stderr(void);
-EXT int win32_ferror(FILE *fp);
-EXT int win32_feof(FILE *fp);
-EXT char* win32_strerror(int e);
-
-EXT int win32_fprintf(FILE *pf, const char *format, ...);
-EXT int win32_printf(const char *format, ...);
-EXT int win32_vfprintf(FILE *pf, const char *format, va_list arg);
-EXT int win32_vprintf(const char *format, va_list arg);
-EXT size_t win32_fread(void *buf, size_t size, size_t count, FILE *pf);
-EXT size_t win32_fwrite(const void *buf, size_t size, size_t count, FILE *pf);
-EXT FILE* win32_fopen(const char *path, const char *mode);
-EXT FILE* win32_fdopen(int fh, const char *mode);
-EXT FILE* win32_freopen(const char *path, const char *mode, FILE *pf);
-EXT int win32_fclose(FILE *pf);
-EXT int win32_fputs(const char *s,FILE *pf);
-EXT int win32_fputc(int c,FILE *pf);
-EXT int win32_ungetc(int c,FILE *pf);
-EXT int win32_getc(FILE *pf);
-EXT int win32_fileno(FILE *pf);
-EXT void win32_clearerr(FILE *pf);
-EXT int win32_fflush(FILE *pf);
-EXT long win32_ftell(FILE *pf);
-EXT int win32_fseek(FILE *pf,long offset,int origin);
-EXT int win32_fgetpos(FILE *pf,fpos_t *p);
-EXT int win32_fsetpos(FILE *pf,const fpos_t *p);
-EXT void win32_rewind(FILE *pf);
-EXT FILE* win32_tmpfile(void);
-EXT void win32_abort(void);
-EXT int win32_fstat(int fd,struct stat *bufptr);
-EXT int win32_stat(const char *name,struct stat *bufptr);
-EXT int win32_pipe( int *phandles, unsigned int psize, int textmode );
-EXT FILE* win32_popen( const char *command, const char *mode );
-EXT int win32_pclose( FILE *pf);
-EXT int win32_setmode( int fd, int mode);
-EXT long win32_lseek( int fd, long offset, int origin);
-EXT long win32_tell( int fd);
-EXT int win32_dup( int fd);
-EXT int win32_dup2(int h1, int h2);
-EXT int win32_open(const char *path, int oflag,...);
-EXT int win32_close(int fd);
-EXT int win32_eof(int fd);
-EXT int win32_read(int fd, void *buf, unsigned int cnt);
-EXT int win32_write(int fd, const void *buf, unsigned int cnt);
-EXT int win32_spawnvp(int mode, const char *cmdname,
+START_EXTERN_C
+
+DllExport int * win32_errno(void);
+DllExport char *** win32_environ(void);
+DllExport FILE* win32_stdin(void);
+DllExport FILE* win32_stdout(void);
+DllExport FILE* win32_stderr(void);
+DllExport int win32_ferror(FILE *fp);
+DllExport int win32_feof(FILE *fp);
+DllExport char* win32_strerror(int e);
+
+DllExport int win32_fprintf(FILE *pf, const char *format, ...);
+DllExport int win32_printf(const char *format, ...);
+DllExport int win32_vfprintf(FILE *pf, const char *format, va_list arg);
+DllExport int win32_vprintf(const char *format, va_list arg);
+DllExport size_t win32_fread(void *buf, size_t size, size_t count, FILE *pf);
+DllExport size_t win32_fwrite(const void *buf, size_t size, size_t count, FILE *pf);
+DllExport FILE* win32_fopen(const char *path, const char *mode);
+DllExport FILE* win32_fdopen(int fh, const char *mode);
+DllExport FILE* win32_freopen(const char *path, const char *mode, FILE *pf);
+DllExport int win32_fclose(FILE *pf);
+DllExport int win32_fputs(const char *s,FILE *pf);
+DllExport int win32_fputc(int c,FILE *pf);
+DllExport int win32_ungetc(int c,FILE *pf);
+DllExport int win32_getc(FILE *pf);
+DllExport int win32_fileno(FILE *pf);
+DllExport void win32_clearerr(FILE *pf);
+DllExport int win32_fflush(FILE *pf);
+DllExport long win32_ftell(FILE *pf);
+DllExport int win32_fseek(FILE *pf,long offset,int origin);
+DllExport int win32_fgetpos(FILE *pf,fpos_t *p);
+DllExport int win32_fsetpos(FILE *pf,const fpos_t *p);
+DllExport void win32_rewind(FILE *pf);
+DllExport FILE* win32_tmpfile(void);
+DllExport void win32_abort(void);
+DllExport int win32_fstat(int fd,struct stat *sbufptr);
+DllExport int win32_stat(const char *name,struct stat *sbufptr);
+DllExport int win32_pipe( int *phandles, unsigned int psize, int textmode );
+DllExport FILE* win32_popen( const char *command, const char *mode );
+DllExport int win32_pclose( FILE *pf);
+DllExport int win32_rename( const char *oname, const char *newname);
+DllExport int win32_setmode( int fd, int mode);
+DllExport long win32_lseek( int fd, long offset, int origin);
+DllExport long win32_tell( int fd);
+DllExport int win32_dup( int fd);
+DllExport int win32_dup2(int h1, int h2);
+DllExport int win32_open(const char *path, int oflag,...);
+DllExport int win32_close(int fd);
+DllExport int win32_eof(int fd);
+DllExport int win32_read(int fd, void *buf, unsigned int cnt);
+DllExport int win32_write(int fd, const void *buf, unsigned int cnt);
+DllExport int win32_spawnvp(int mode, const char *cmdname,
const char *const *argv);
-EXT int win32_mkdir(const char *dir, int mode);
-EXT int win32_rmdir(const char *dir);
-EXT int win32_chdir(const char *dir);
-EXT int win32_flock(int fd, int oper);
-EXT int win32_execvp(const char *cmdname, const char *const *argv);
-EXT void win32_perror(const char *str);
-EXT void win32_setbuf(FILE *pf, char *buf);
-EXT int win32_setvbuf(FILE *pf, char *buf, int type, size_t size);
-EXT int win32_flushall(void);
-EXT int win32_fcloseall(void);
-EXT char* win32_fgets(char *s, int n, FILE *pf);
-EXT char* win32_gets(char *s);
-EXT int win32_fgetc(FILE *pf);
-EXT int win32_putc(int c, FILE *pf);
-EXT int win32_puts(const char *s);
-EXT int win32_getchar(void);
-EXT int win32_putchar(int c);
-EXT void* win32_malloc(size_t size);
-EXT void* win32_calloc(size_t numitems, size_t size);
-EXT void* win32_realloc(void *block, size_t size);
-EXT void win32_free(void *block);
+DllExport int win32_mkdir(const char *dir, int mode);
+DllExport int win32_rmdir(const char *dir);
+DllExport int win32_chdir(const char *dir);
+DllExport int win32_flock(int fd, int oper);
+DllExport int win32_execv(const char *cmdname, const char *const *argv);
+DllExport int win32_execvp(const char *cmdname, const char *const *argv);
+DllExport void win32_perror(const char *str);
+DllExport void win32_setbuf(FILE *pf, char *buf);
+DllExport int win32_setvbuf(FILE *pf, char *buf, int type, size_t size);
+DllExport int win32_flushall(void);
+DllExport int win32_fcloseall(void);
+DllExport char* win32_fgets(char *s, int n, FILE *pf);
+DllExport char* win32_gets(char *s);
+DllExport int win32_fgetc(FILE *pf);
+DllExport int win32_putc(int c, FILE *pf);
+DllExport int win32_puts(const char *s);
+DllExport int win32_getchar(void);
+DllExport int win32_putchar(int c);
+DllExport void* win32_malloc(size_t size);
+DllExport void* win32_calloc(size_t numitems, size_t size);
+DllExport void* win32_realloc(void *block, size_t size);
+DllExport void win32_free(void *block);
-/*
- * these two are win32 specific but still io related
- */
-int stolen_open_osfhandle(long handle, int flags);
-long stolen_get_osfhandle(int fd);
+DllExport int win32_open_osfhandle(long handle, int flags);
+DllExport long win32_get_osfhandle(int fd);
-/*
- * defines for flock emulation
- */
-#define LOCK_SH 1
-#define LOCK_EX 2
-#define LOCK_NB 4
-#define LOCK_UN 8
+#ifndef USE_WIN32_RTL_ENV
+DllExport char* win32_getenv(const char *name);
+DllExport int win32_putenv(const char *name);
+#endif
-#include <win32io.h> /* pull in the io sub system structure */
+DllExport unsigned win32_sleep(unsigned int);
+DllExport int win32_times(struct tms *timebuf);
+DllExport unsigned win32_alarm(unsigned int sec);
+DllExport int win32_stat(const char *path, struct stat *buf);
+DllExport int win32_ioctl(int i, unsigned int u, char *data);
+DllExport int win32_utime(const char *f, struct utimbuf *t);
+DllExport int win32_wait(int *status);
+DllExport int win32_waitpid(int pid, int *status, int flags);
+DllExport int win32_kill(int pid, int sig);
+
+#if defined(HAVE_DES_FCRYPT) || defined(PERL_OBJECT)
+DllExport char * win32_crypt(const char *txt, const char *salt);
+#endif
-EXT PWIN32_IOSUBSYSTEM SetIOSubSystem(void *piosubsystem);
-EXT PWIN32_IOSUBSYSTEM GetIOSubSystem(void);
+END_EXTERN_C
/*
* the following six(6) is #define in stdio.h
@@ -111,6 +145,15 @@ EXT PWIN32_IOSUBSYSTEM GetIOSubSystem(void);
#undef stdout
#undef ferror
#undef feof
+#undef fclose
+#undef pipe
+#undef pause
+#undef sleep
+#undef times
+#undef alarm
+#undef ioctl
+#undef utime
+#undef wait
#ifdef __BORLANDC__
#undef ungetc
@@ -133,6 +176,7 @@ EXT PWIN32_IOSUBSYSTEM GetIOSubSystem(void);
/*
* redirect to our own version
*/
+#undef fprintf
#define fprintf win32_fprintf
#define vfprintf win32_vfprintf
#define printf win32_printf
@@ -140,12 +184,14 @@ EXT PWIN32_IOSUBSYSTEM GetIOSubSystem(void);
#define fread(buf,size,count,f) win32_fread(buf,size,count,f)
#define fwrite(buf,size,count,f) win32_fwrite(buf,size,count,f)
#define fopen win32_fopen
+#undef fdopen
#define fdopen win32_fdopen
#define freopen win32_freopen
#define fclose(f) win32_fclose(f)
#define fputs(s,f) win32_fputs(s,f)
#define fputc(c,f) win32_fputc(c,f)
#define ungetc(c,f) win32_ungetc(c,f)
+#undef getc
#define getc(f) win32_getc(f)
#define fileno(f) win32_fileno(f)
#define clearerr(f) win32_clearerr(f)
@@ -159,6 +205,7 @@ EXT PWIN32_IOSUBSYSTEM GetIOSubSystem(void);
#define abort() win32_abort()
#define fstat(fd,bufptr) win32_fstat(fd,bufptr)
#define stat(pth,bufptr) win32_stat(pth,bufptr)
+#define rename(old,new) win32_rename(old,new)
#define setmode(fd,mode) win32_setmode(fd,mode)
#define lseek(fd,offset,orig) win32_lseek(fd,offset,orig)
#define tell(fd) win32_tell(fd)
@@ -169,32 +216,74 @@ EXT PWIN32_IOSUBSYSTEM GetIOSubSystem(void);
#define eof(fd) win32_eof(fd)
#define read(fd,b,s) win32_read(fd,b,s)
#define write(fd,b,s) win32_write(fd,b,s)
-#define _open_osfhandle stolen_open_osfhandle
-#define _get_osfhandle stolen_get_osfhandle
+#define _open_osfhandle win32_open_osfhandle
+#define _get_osfhandle win32_get_osfhandle
#define spawnvp win32_spawnvp
#define mkdir win32_mkdir
#define rmdir win32_rmdir
#define chdir win32_chdir
#define flock(fd,o) win32_flock(fd,o)
+#define execv win32_execv
#define execvp win32_execvp
#define perror win32_perror
#define setbuf win32_setbuf
#define setvbuf win32_setvbuf
+#undef flushall
#define flushall win32_flushall
+#undef fcloseall
#define fcloseall win32_fcloseall
#define fgets win32_fgets
#define gets win32_gets
#define fgetc win32_fgetc
+#undef putc
#define putc win32_putc
#define puts win32_puts
+#undef getchar
#define getchar win32_getchar
+#undef putchar
#define putchar win32_putchar
-#define fscanf (GetIOSubSystem()->pfnfscanf)
-#define scanf (GetIOSubSystem()->pfnscanf)
+
+#if !defined(MYMALLOC) || !defined(PERL_CORE)
+#undef malloc
+#undef calloc
+#undef realloc
+#undef free
#define malloc win32_malloc
#define calloc win32_calloc
#define realloc win32_realloc
#define free win32_free
-#endif /* WIN32IO_IS_STDIO */
+#endif
+
+#define pipe(fd) win32_pipe((fd), 512, O_BINARY)
+#define pause() win32_sleep((32767L << 16) + 32767)
+#define sleep win32_sleep
+#define times win32_times
+#define alarm win32_alarm
+#define ioctl win32_ioctl
+#define utime win32_utime
+#define wait win32_wait
+#define waitpid win32_waitpid
+#define kill win32_kill
+
+#define opendir win32_opendir
+#define readdir win32_readdir
+#define telldir win32_telldir
+#define seekdir win32_seekdir
+#define rewinddir win32_rewinddir
+#define closedir win32_closedir
+
+#ifdef HAVE_DES_FCRYPT
+#undef crypt
+#define crypt win32_crypt
+#endif
+
+#ifndef USE_WIN32_RTL_ENV
+#undef getenv
+#define getenv win32_getenv
+#undef putenv
+#define putenv win32_putenv
+#endif
+#endif /* WIN32IO_IS_STDIO */
#endif /* WIN32IOP_H */
+
diff --git a/gnu/usr.bin/perl/win32/win32sck.c b/gnu/usr.bin/perl/win32/win32sck.c
index 3653fc8b884..27136058402 100644
--- a/gnu/usr.bin/perl/win32/win32sck.c
+++ b/gnu/usr.bin/perl/win32/win32sck.c
@@ -1,4 +1,4 @@
-/* NTSock.C
+/* win32sck.c
*
* (c) 1995 Microsoft Corporation. All rights reserved.
* Developed by hip communications inc., http://info.hip.com/info/
@@ -8,229 +8,146 @@
* License or the Artistic License, as specified in the README file.
*/
-#include <windows.h>
+#define WIN32IO_IS_STDIO
+#define WIN32SCK_IS_STDSCK
#define WIN32_LEAN_AND_MEAN
+#ifdef __GNUC__
+#define Win32_Winsock
+#endif
+#include <windows.h>
#include "EXTERN.h"
#include "perl.h"
+
+#if defined(PERL_OBJECT)
+#define NO_XSLOCKS
+extern CPerlObj* pPerl;
+#include "XSUB.h"
+#endif
+
+#include "Win32iop.h"
#include <sys/socket.h>
#include <fcntl.h>
#include <sys/stat.h>
#include <assert.h>
+#include <io.h>
-#define CROAK croak
-
-#ifdef USE_SOCKETS_AS_HANDLES
/* thanks to Beverly Brown (beverly@datacube.com) */
-
-#define OPEN_SOCKET(x) _open_osfhandle(x,O_RDWR|O_BINARY)
-#define TO_SOCKET(x) _get_osfhandle(x)
-
+#ifdef USE_SOCKETS_AS_HANDLES
+# define OPEN_SOCKET(x) win32_open_osfhandle(x,O_RDWR|O_BINARY)
+# define TO_SOCKET(x) _get_osfhandle(x)
#else
-
# define OPEN_SOCKET(x) (x)
# define TO_SOCKET(x) (x)
-
#endif /* USE_SOCKETS_AS_HANDLES */
+#ifdef USE_THREADS
+#define StartSockets() \
+ STMT_START { \
+ if (!wsock_started) \
+ start_sockets(); \
+ set_socktype(); \
+ } STMT_END
+#else
+#define StartSockets() \
+ STMT_START { \
+ if (!wsock_started) { \
+ start_sockets(); \
+ set_socktype(); \
+ } \
+ } STMT_END
+#endif
+
+#define EndSockets() \
+ STMT_START { \
+ if (wsock_started) \
+ WSACleanup(); \
+ } STMT_END
+
+#define SOCKET_TEST(x, y) \
+ STMT_START { \
+ StartSockets(); \
+ if((x) == (y)) \
+ errno = WSAGetLastError(); \
+ } STMT_END
+
+#define SOCKET_TEST_ERROR(x) SOCKET_TEST(x, SOCKET_ERROR)
+
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 *);
-typedef int (SOCKETAPI *LPSOCKBIND)(SOCKET, const struct sockaddr *, int);
-typedef int (SOCKETAPI *LPSOCKCLOSESOCKET)(SOCKET);
-typedef int (SOCKETAPI *LPSOCKCONNECT)(SOCKET, const struct sockaddr *, int);
-typedef int (SOCKETAPI *LPSOCKIOCTLSOCKET)(SOCKET, long, u_long *);
-typedef int (SOCKETAPI *LPSOCKGETPEERNAME)(SOCKET, struct sockaddr *, int *);
-typedef int (SOCKETAPI *LPSOCKGETSOCKNAME)(SOCKET, struct sockaddr *, int *);
-typedef int (SOCKETAPI *LPSOCKGETSOCKOPT)(SOCKET, int, int, char *, int *);
-typedef u_long (SOCKETAPI *LPSOCKHTONL)(u_long);
-typedef u_short (SOCKETAPI *LPSOCKHTONS)(u_short);
-typedef int (SOCKETAPI *LPSOCKLISTEN)(SOCKET, int);
-typedef u_long (SOCKETAPI *LPSOCKNTOHL)(u_long);
-typedef u_short (SOCKETAPI *LPSOCKNTOHS)(u_short);
-typedef int (SOCKETAPI *LPSOCKRECV)(SOCKET, char *, int, int);
-typedef int (SOCKETAPI *LPSOCKRECVFROM)(SOCKET, char *, int, int, struct sockaddr *, int *);
-typedef int (SOCKETAPI *LPSOCKSELECT)(int, fd_set *, fd_set *, fd_set *, const struct timeval *);
-typedef int (SOCKETAPI *LPSOCKSEND)(SOCKET, const char *, int, int);
-typedef int (SOCKETAPI *LPSOCKSENDTO)(SOCKET, const char *, int, int, const struct sockaddr *, int);
-typedef int (SOCKETAPI *LPSOCKSETSOCKOPT)(SOCKET, int, int, const char *, int);
-typedef int (SOCKETAPI *LPSOCKSHUTDOWN)(SOCKET, int);
-typedef SOCKET (SOCKETAPI *LPSOCKSOCKET)(int, int, int);
-typedef char FAR *(SOCKETAPI *LPSOCKINETNTOA)(struct in_addr in);
-typedef unsigned long (SOCKETAPI *LPSOCKINETADDR)(const char FAR * cp);
-
-
-/* Database function prototypes */
-typedef struct hostent *(SOCKETAPI *LPSOCKGETHOSTBYADDR)(const char *, int, int);
-typedef struct hostent *(SOCKETAPI *LPSOCKGETHOSTBYNAME)(const char *);
-typedef int (SOCKETAPI *LPSOCKGETHOSTNAME)(char *, int);
-typedef struct servent *(SOCKETAPI *LPSOCKGETSERVBYPORT)(int, const char *);
-typedef struct servent *(SOCKETAPI *LPSOCKGETSERVBYNAME)(const char *, const char *);
-typedef struct protoent *(SOCKETAPI *LPSOCKGETPROTOBYNUMBER)(int);
-typedef struct protoent *(SOCKETAPI *LPSOCKGETPROTOBYNAME)(const char *);
-
-/* Microsoft Windows Extension function prototypes */
-typedef int (SOCKETAPI *LPSOCKWSASTARTUP)(unsigned short, LPWSADATA);
-typedef int (SOCKETAPI *LPSOCKWSACLEANUP)(void);
-typedef int (SOCKETAPI *LPSOCKWSAGETLASTERROR)(void);
-typedef int (SOCKETAPI *LPWSAFDIsSet)(SOCKET, fd_set *);
-
-static HINSTANCE hWinSockDll = 0;
-/* extern CRITICAL_SECTION csSock; */
-
-static LPSOCKACCEPT paccept = 0;
-static LPSOCKBIND pbind = 0;
-static LPSOCKCLOSESOCKET pclosesocket = 0;
-static LPSOCKCONNECT pconnect = 0;
-static LPSOCKIOCTLSOCKET pioctlsocket = 0;
-static LPSOCKGETPEERNAME pgetpeername = 0;
-static LPSOCKGETSOCKNAME pgetsockname = 0;
-static LPSOCKGETSOCKOPT pgetsockopt = 0;
-static LPSOCKHTONL phtonl = 0;
-static LPSOCKHTONS phtons = 0;
-static LPSOCKLISTEN plisten = 0;
-static LPSOCKNTOHL pntohl = 0;
-static LPSOCKNTOHS pntohs = 0;
-static LPSOCKRECV precv = 0;
-static LPSOCKRECVFROM precvfrom = 0;
-static LPSOCKSELECT pselect = 0;
-static LPSOCKSEND psend = 0;
-static LPSOCKSENDTO psendto = 0;
-static LPSOCKSETSOCKOPT psetsockopt = 0;
-static LPSOCKSHUTDOWN pshutdown = 0;
-static LPSOCKSOCKET psocket = 0;
-static LPSOCKGETHOSTBYADDR pgethostbyaddr = 0;
-static LPSOCKGETHOSTBYNAME pgethostbyname = 0;
-static LPSOCKGETHOSTNAME pgethostname = 0;
-static LPSOCKGETSERVBYPORT pgetservbyport = 0;
-static LPSOCKGETSERVBYNAME pgetservbyname = 0;
-static LPSOCKGETPROTOBYNUMBER pgetprotobynumber = 0;
-static LPSOCKGETPROTOBYNAME pgetprotobyname = 0;
-static LPSOCKWSASTARTUP pWSAStartup = 0;
-static LPSOCKWSACLEANUP pWSACleanup = 0;
-static LPSOCKWSAGETLASTERROR pWSAGetLastError = 0;
-static LPWSAFDIsSet pWSAFDIsSet = 0;
-static LPSOCKINETNTOA pinet_ntoa = 0;
-static LPSOCKINETADDR pinet_addr = 0;
+#ifdef USE_THREADS
+#ifdef USE_DECLSPEC_THREAD
__declspec(thread) struct servent myservent;
+__declspec(thread) int init_socktype;
+#else
+#define myservent (thr->i.Wservent)
+#define init_socktype (thr->i.Winit_socktype)
+#endif
+#else
+static struct servent myservent;
+#endif
-
-void *
-GetAddress(HINSTANCE hInstance, char *lpFunctionName)
-{
- FARPROC proc = GetProcAddress(hInstance, lpFunctionName);
- if(proc == 0)
- CROAK("Unable to get address of %s in WSock32.dll", lpFunctionName);
- return proc;
-}
-
-void
-LoadWinSock(void)
-{
-/* EnterCriticalSection(&csSock); */
- if(hWinSockDll == NULL) {
- HINSTANCE hLib = LoadLibrary("WSock32.DLL");
- if(hLib == NULL)
- CROAK("Could not load WSock32.dll\n");
-
- paccept = (LPSOCKACCEPT)GetAddress(hLib, "accept");
- pbind = (LPSOCKBIND)GetAddress(hLib, "bind");
- pclosesocket = (LPSOCKCLOSESOCKET)GetAddress(hLib, "closesocket");
- pconnect = (LPSOCKCONNECT)GetAddress(hLib, "connect");
- pioctlsocket = (LPSOCKIOCTLSOCKET)GetAddress(hLib, "ioctlsocket");
- pgetpeername = (LPSOCKGETPEERNAME)GetAddress(hLib, "getpeername");
- pgetsockname = (LPSOCKGETSOCKNAME)GetAddress(hLib, "getsockname");
- pgetsockopt = (LPSOCKGETSOCKOPT)GetAddress(hLib, "getsockopt");
- phtonl = (LPSOCKHTONL)GetAddress(hLib, "htonl");
- phtons = (LPSOCKHTONS)GetAddress(hLib, "htons");
- plisten = (LPSOCKLISTEN)GetAddress(hLib, "listen");
- pntohl = (LPSOCKNTOHL)GetAddress(hLib, "ntohl");
- pntohs = (LPSOCKNTOHS)GetAddress(hLib, "ntohs");
- precv = (LPSOCKRECV)GetAddress(hLib, "recv");
- precvfrom = (LPSOCKRECVFROM)GetAddress(hLib, "recvfrom");
- pselect = (LPSOCKSELECT)GetAddress(hLib, "select");
- psend = (LPSOCKSEND)GetAddress(hLib, "send");
- psendto = (LPSOCKSENDTO)GetAddress(hLib, "sendto");
- psetsockopt = (LPSOCKSETSOCKOPT)GetAddress(hLib, "setsockopt");
- pshutdown = (LPSOCKSHUTDOWN)GetAddress(hLib, "shutdown");
- psocket = (LPSOCKSOCKET)GetAddress(hLib, "socket");
- pgethostbyaddr = (LPSOCKGETHOSTBYADDR)GetAddress(hLib, "gethostbyaddr");
- pgethostbyname = (LPSOCKGETHOSTBYNAME)GetAddress(hLib, "gethostbyname");
- pgethostname = (LPSOCKGETHOSTNAME)GetAddress(hLib, "gethostname");
- pgetservbyport = (LPSOCKGETSERVBYPORT)GetAddress(hLib, "getservbyport");
- pgetservbyname = (LPSOCKGETSERVBYNAME)GetAddress(hLib, "getservbyname");
- pgetprotobynumber = (LPSOCKGETPROTOBYNUMBER)GetAddress(hLib, "getprotobynumber");
- pgetprotobyname = (LPSOCKGETPROTOBYNAME)GetAddress(hLib, "getprotobyname");
- pWSAStartup = (LPSOCKWSASTARTUP)GetAddress(hLib, "WSAStartup");
- pWSACleanup = (LPSOCKWSACLEANUP)GetAddress(hLib, "WSACleanup");
- pWSAGetLastError = (LPSOCKWSAGETLASTERROR)GetAddress(hLib, "WSAGetLastError");
- pWSAFDIsSet = (LPWSAFDIsSet)GetAddress(hLib, "__WSAFDIsSet");
- pinet_addr = (LPSOCKINETADDR)GetAddress(hLib,"inet_addr");
- pinet_ntoa = (LPSOCKINETNTOA)GetAddress(hLib,"inet_ntoa");
-
- hWinSockDll = hLib;
- }
-/* LeaveCriticalSection(&csSock); */
-}
-
-void
-EndSockets(void)
-{
- if(hWinSockDll != NULL) {
- pWSACleanup();
- FreeLibrary(hWinSockDll);
- }
- hWinSockDll = NULL;
-}
+static int wsock_started = 0;
void
-StartSockets(void)
+start_sockets(void)
{
unsigned short version;
WSADATA retdata;
int ret;
- int iSockOpt = SO_SYNCHRONOUS_NONALERT;
- LoadWinSock();
/*
* initalize the winsock interface and insure that it is
* cleaned up at exit.
*/
version = 0x101;
- if(ret = pWSAStartup(version, &retdata))
- CROAK("Unable to locate winsock library!\n");
+ if(ret = WSAStartup(version, &retdata))
+ croak("Unable to locate winsock library!\n");
if(retdata.wVersion != version)
- CROAK("Could not find version 1.1 of winsock dll\n");
+ croak("Could not find version 1.1 of winsock dll\n");
/* atexit((void (*)(void)) EndSockets); */
+ wsock_started = 1;
+}
+void
+set_socktype(void)
+{
#ifdef USE_SOCKETS_AS_HANDLES
+#ifdef USE_THREADS
+ dTHR;
+ if(!init_socktype) {
+#endif
+ int iSockOpt = SO_SYNCHRONOUS_NONALERT;
/*
* Enable the use of sockets as filehandles
*/
- psetsockopt(INVALID_SOCKET, SOL_SOCKET, SO_OPENTYPE,
+ setsockopt(INVALID_SOCKET, SOL_SOCKET, SO_OPENTYPE,
(char *)&iSockOpt, sizeof(iSockOpt));
+#ifdef USE_THREADS
+ init_socktype = 1;
+ }
+#endif
#endif /* USE_SOCKETS_AS_HANDLES */
}
#ifndef USE_SOCKETS_AS_HANDLES
+#undef fdopen
FILE *
-myfdopen(int fd, char *mode)
+my_fdopen(int fd, char *mode)
{
FILE *fp;
char sockbuf[256];
int optlen = sizeof(sockbuf);
int retval;
- if (hWinSockDll == 0)
+ if (!wsock_started)
return(fdopen(fd, mode));
- retval = pgetsockopt((SOCKET)fd, SOL_SOCKET, SO_TYPE, sockbuf, &optlen);
- if(retval == SOCKET_ERROR && pWSAGetLastError() == WSAENOTSOCK) {
+ retval = getsockopt((SOCKET)fd, SOL_SOCKET, SO_TYPE, sockbuf, &optlen);
+ if(retval == SOCKET_ERROR && WSAGetLastError() == WSAENOTSOCK) {
return(fdopen(fd, mode));
}
@@ -257,51 +174,39 @@ myfdopen(int fd, char *mode)
u_long
win32_htonl(u_long hostlong)
{
- if(hWinSockDll == 0)
- StartSockets();
-
- return phtonl(hostlong);
+ StartSockets();
+ return htonl(hostlong);
}
u_short
win32_htons(u_short hostshort)
{
- if(hWinSockDll == 0)
- StartSockets();
-
- return phtons(hostshort);
+ StartSockets();
+ return htons(hostshort);
}
u_long
win32_ntohl(u_long netlong)
{
- if(hWinSockDll == 0)
- StartSockets();
-
- return pntohl(netlong);
+ StartSockets();
+ return ntohl(netlong);
}
u_short
win32_ntohs(u_short netshort)
{
- if(hWinSockDll == 0)
- StartSockets();
-
- return pntohs(netshort);
+ StartSockets();
+ return ntohs(netshort);
}
-#define SOCKET_TEST(x, y) if(hWinSockDll == 0) StartSockets();\
- if((x) == (y)) errno = pWSAGetLastError()
-
-#define SOCKET_TEST_ERROR(x) SOCKET_TEST(x, SOCKET_ERROR)
SOCKET
win32_accept(SOCKET s, struct sockaddr *addr, int *addrlen)
{
SOCKET r;
- SOCKET_TEST((r = paccept(TO_SOCKET(s), addr, addrlen)), INVALID_SOCKET);
+ SOCKET_TEST((r = accept(TO_SOCKET(s), addr, addrlen)), INVALID_SOCKET);
return OPEN_SOCKET(r);
}
@@ -310,7 +215,7 @@ win32_bind(SOCKET s, const struct sockaddr *addr, int addrlen)
{
int r;
- SOCKET_TEST_ERROR(r = pbind(TO_SOCKET(s), addr, addrlen));
+ SOCKET_TEST_ERROR(r = bind(TO_SOCKET(s), addr, addrlen));
return r;
}
@@ -319,7 +224,7 @@ win32_connect(SOCKET s, const struct sockaddr *addr, int addrlen)
{
int r;
- SOCKET_TEST_ERROR(r = pconnect(TO_SOCKET(s), addr, addrlen));
+ SOCKET_TEST_ERROR(r = connect(TO_SOCKET(s), addr, addrlen));
return r;
}
@@ -329,7 +234,7 @@ win32_getpeername(SOCKET s, struct sockaddr *addr, int *addrlen)
{
int r;
- SOCKET_TEST_ERROR(r = pgetpeername(TO_SOCKET(s), addr, addrlen));
+ SOCKET_TEST_ERROR(r = getpeername(TO_SOCKET(s), addr, addrlen));
return r;
}
@@ -338,7 +243,7 @@ win32_getsockname(SOCKET s, struct sockaddr *addr, int *addrlen)
{
int r;
- SOCKET_TEST_ERROR(r = pgetsockname(TO_SOCKET(s), addr, addrlen));
+ SOCKET_TEST_ERROR(r = getsockname(TO_SOCKET(s), addr, addrlen));
return r;
}
@@ -347,7 +252,7 @@ win32_getsockopt(SOCKET s, int level, int optname, char *optval, int *optlen)
{
int r;
- SOCKET_TEST_ERROR(r = pgetsockopt(TO_SOCKET(s), level, optname, optval, optlen));
+ SOCKET_TEST_ERROR(r = getsockopt(TO_SOCKET(s), level, optname, optval, optlen));
return r;
}
@@ -356,7 +261,7 @@ win32_ioctlsocket(SOCKET s, long cmd, u_long *argp)
{
int r;
- SOCKET_TEST_ERROR(r = pioctlsocket(TO_SOCKET(s), cmd, argp));
+ SOCKET_TEST_ERROR(r = ioctlsocket(TO_SOCKET(s), cmd, argp));
return r;
}
@@ -365,7 +270,7 @@ win32_listen(SOCKET s, int backlog)
{
int r;
- SOCKET_TEST_ERROR(r = plisten(TO_SOCKET(s), backlog));
+ SOCKET_TEST_ERROR(r = listen(TO_SOCKET(s), backlog));
return r;
}
@@ -374,7 +279,7 @@ win32_recv(SOCKET s, char *buf, int len, int flags)
{
int r;
- SOCKET_TEST_ERROR(r = precv(TO_SOCKET(s), buf, len, flags));
+ SOCKET_TEST_ERROR(r = recv(TO_SOCKET(s), buf, len, flags));
return r;
}
@@ -382,20 +287,41 @@ int
win32_recvfrom(SOCKET s, char *buf, int len, int flags, struct sockaddr *from, int *fromlen)
{
int r;
+ int frombufsize = *fromlen;
- SOCKET_TEST_ERROR(r = precvfrom(TO_SOCKET(s), buf, len, flags, from, fromlen));
+ SOCKET_TEST_ERROR(r = recvfrom(TO_SOCKET(s), buf, len, flags, from, fromlen));
+ /* Winsock's recvfrom() only returns a valid 'from' when the socket
+ * is connectionless. Perl expects a valid 'from' for all types
+ * of sockets, so go the extra mile.
+ */
+ if (r != SOCKET_ERROR && frombufsize == *fromlen)
+ (void)win32_getpeername(s, from, fromlen);
return r;
}
/* select contributed by Vincent R. Slyngstad (vrs@ibeam.intel.com) */
int
-win32_select(int nfds, int* rd, int* wr, int* ex, const struct timeval* timeout)
+win32_select(int nfds, Perl_fd_set* rd, Perl_fd_set* wr, Perl_fd_set* ex, const struct timeval* timeout)
{
- long r;
- int dummy = 0;
+ int r;
+#ifdef USE_SOCKETS_AS_HANDLES
+ Perl_fd_set dummy;
int i, fd, bit, offset;
- FD_SET nrd, nwr, nex,*prd,*pwr,*pex;
+ FD_SET nrd, nwr, nex, *prd, *pwr, *pex;
+ /* winsock seems incapable of dealing with all three null fd_sets,
+ * so do the (millisecond) sleep as a special case
+ */
+ if (!(rd || wr || ex)) {
+ if (timeout)
+ Sleep(timeout->tv_sec * 1000 +
+ timeout->tv_usec / 1000); /* do the best we can */
+ else
+ Sleep(UINT_MAX);
+ return 0;
+ }
+ StartSockets();
+ PERL_FD_ZERO(&dummy);
if (!rd)
rd = &dummy, prd = NULL;
else
@@ -414,35 +340,28 @@ win32_select(int nfds, int* rd, int* wr, int* ex, const struct timeval* timeout)
FD_ZERO(&nex);
for (i = 0; i < nfds; i++) {
fd = TO_SOCKET(i);
- bit = 1L<<(i % (sizeof(int)*8));
- offset = i / (sizeof(int)*8);
- if (rd[offset] & bit)
+ if (PERL_FD_ISSET(i,rd))
FD_SET(fd, &nrd);
- if (wr[offset] & bit)
+ if (PERL_FD_ISSET(i,wr))
FD_SET(fd, &nwr);
- if (ex[offset] & bit)
+ if (PERL_FD_ISSET(i,ex))
FD_SET(fd, &nex);
}
- SOCKET_TEST_ERROR(r = pselect(nfds, prd, pwr, pex, timeout));
+ SOCKET_TEST_ERROR(r = select(nfds, prd, pwr, pex, timeout));
for (i = 0; i < nfds; i++) {
fd = TO_SOCKET(i);
- bit = 1L<<(i % (sizeof(int)*8));
- offset = i / (sizeof(int)*8);
- if (rd[offset] & bit) {
- if (!pWSAFDIsSet(fd, &nrd))
- rd[offset] &= ~bit;
- }
- if (wr[offset] & bit) {
- if (!pWSAFDIsSet(fd, &nwr))
- wr[offset] &= ~bit;
- }
- if (ex[offset] & bit) {
- if (!pWSAFDIsSet(fd, &nex))
- ex[offset] &= ~bit;
- }
+ if (PERL_FD_ISSET(i,rd) && !FD_ISSET(fd, &nrd))
+ PERL_FD_CLR(i,rd);
+ if (PERL_FD_ISSET(i,wr) && !FD_ISSET(fd, &nwr))
+ PERL_FD_CLR(i,wr);
+ if (PERL_FD_ISSET(i,ex) && !FD_ISSET(fd, &nex))
+ PERL_FD_CLR(i,ex);
}
+#else
+ SOCKET_TEST_ERROR(r = select(nfds, rd, wr, ex, timeout));
+#endif
return r;
}
@@ -451,7 +370,7 @@ win32_send(SOCKET s, const char *buf, int len, int flags)
{
int r;
- SOCKET_TEST_ERROR(r = psend(TO_SOCKET(s), buf, len, flags));
+ SOCKET_TEST_ERROR(r = send(TO_SOCKET(s), buf, len, flags));
return r;
}
@@ -461,7 +380,7 @@ win32_sendto(SOCKET s, const char *buf, int len, int flags,
{
int r;
- SOCKET_TEST_ERROR(r = psendto(TO_SOCKET(s), buf, len, flags, to, tolen));
+ SOCKET_TEST_ERROR(r = sendto(TO_SOCKET(s), buf, len, flags, to, tolen));
return r;
}
@@ -470,7 +389,7 @@ win32_setsockopt(SOCKET s, int level, int optname, const char *optval, int optle
{
int r;
- SOCKET_TEST_ERROR(r = psetsockopt(TO_SOCKET(s), level, optname, optval, optlen));
+ SOCKET_TEST_ERROR(r = setsockopt(TO_SOCKET(s), level, optname, optval, optlen));
return r;
}
@@ -479,7 +398,16 @@ win32_shutdown(SOCKET s, int how)
{
int r;
- SOCKET_TEST_ERROR(r = pshutdown(TO_SOCKET(s), how));
+ SOCKET_TEST_ERROR(r = shutdown(TO_SOCKET(s), how));
+ return r;
+}
+
+int
+win32_closesocket(SOCKET s)
+{
+ int r;
+
+ SOCKET_TEST_ERROR(r = closesocket(TO_SOCKET(s)));
return r;
}
@@ -489,13 +417,11 @@ win32_socket(int af, int type, int protocol)
SOCKET s;
#ifndef USE_SOCKETS_AS_HANDLES
- SOCKET_TEST(s = psocket(af, type, protocol), INVALID_SOCKET);
+ SOCKET_TEST(s = socket(af, type, protocol), INVALID_SOCKET);
#else
- if(hWinSockDll == 0)
- StartSockets();
-
- if((s = psocket(af, type, protocol)) == INVALID_SOCKET)
- errno = pWSAGetLastError();
+ StartSockets();
+ if((s = socket(af, type, protocol)) == INVALID_SOCKET)
+ errno = WSAGetLastError();
else
s = OPEN_SOCKET(s);
#endif /* USE_SOCKETS_AS_HANDLES */
@@ -507,16 +433,18 @@ win32_socket(int af, int type, int protocol)
int
my_fclose (FILE *pf)
{
- int osf, retval;
- if (hWinSockDll == 0) /* No WinSockDLL? */
- return(fclose(pf)); /* Then not a socket. */
- osf = TO_SOCKET(fileno(pf)); /* Get it now before it's gone! */
- retval = fclose(pf); /* Must fclose() before closesocket() */
- if (osf != -1
- && pclosesocket(osf) == SOCKET_ERROR
- && WSAGetLastError() != WSAENOTSOCK)
- retval = EOF;
- return retval;
+ int osf, retval;
+ if (!wsock_started) /* No WinSock? */
+ return(fclose(pf)); /* Then not a socket. */
+ osf = TO_SOCKET(fileno(pf));/* Get it now before it's gone! */
+ retval = fclose(pf); /* Must fclose() before closesocket() */
+ if (osf != -1
+ && closesocket(osf) == SOCKET_ERROR
+ && WSAGetLastError() != WSAENOTSOCK)
+ {
+ return EOF;
+ }
+ return retval;
}
struct hostent *
@@ -524,7 +452,7 @@ win32_gethostbyaddr(const char *addr, int len, int type)
{
struct hostent *r;
- SOCKET_TEST(r = pgethostbyaddr(addr, len, type), NULL);
+ SOCKET_TEST(r = gethostbyaddr(addr, len, type), NULL);
return r;
}
@@ -533,7 +461,7 @@ win32_gethostbyname(const char *name)
{
struct hostent *r;
- SOCKET_TEST(r = pgethostbyname(name), NULL);
+ SOCKET_TEST(r = gethostbyname(name), NULL);
return r;
}
@@ -542,7 +470,7 @@ win32_gethostname(char *name, int len)
{
int r;
- SOCKET_TEST_ERROR(r = pgethostname(name, len));
+ SOCKET_TEST_ERROR(r = gethostname(name, len));
return r;
}
@@ -551,7 +479,7 @@ win32_getprotobyname(const char *name)
{
struct protoent *r;
- SOCKET_TEST(r = pgetprotobyname(name), NULL);
+ SOCKET_TEST(r = getprotobyname(name), NULL);
return r;
}
@@ -560,7 +488,7 @@ win32_getprotobynumber(int num)
{
struct protoent *r;
- SOCKET_TEST(r = pgetprotobynumber(num), NULL);
+ SOCKET_TEST(r = getprotobynumber(num), NULL);
return r;
}
@@ -568,8 +496,9 @@ struct servent *
win32_getservbyname(const char *name, const char *proto)
{
struct servent *r;
-
- SOCKET_TEST(r = pgetservbyname(name, proto), NULL);
+ dTHR;
+
+ SOCKET_TEST(r = getservbyname(name, proto), NULL);
if (r) {
r = win32_savecopyservent(&myservent, r, proto);
}
@@ -580,130 +509,142 @@ struct servent *
win32_getservbyport(int port, const char *proto)
{
struct servent *r;
+ dTHR;
- SOCKET_TEST(r = pgetservbyport(port, proto), NULL);
+ SOCKET_TEST(r = getservbyport(port, proto), NULL);
if (r) {
r = win32_savecopyservent(&myservent, r, proto);
}
return r;
}
+int
+win32_ioctl(int i, unsigned int u, char *data)
+{
+ u_long argp = (u_long)data;
+ int retval;
+
+ if (!wsock_started) {
+ croak("ioctl implemented only on sockets");
+ /* NOTREACHED */
+ }
+
+ retval = ioctlsocket(TO_SOCKET(i), (long)u, &argp);
+ if (retval == SOCKET_ERROR) {
+ if (WSAGetLastError() == WSAENOTSOCK) {
+ croak("ioctl implemented only on sockets");
+ /* NOTREACHED */
+ }
+ errno = WSAGetLastError();
+ }
+ return retval;
+}
+
char FAR *
win32_inet_ntoa(struct in_addr in)
{
- if(hWinSockDll == 0)
- StartSockets();
-
- return pinet_ntoa(in);
+ StartSockets();
+ return inet_ntoa(in);
}
unsigned long
win32_inet_addr(const char FAR *cp)
{
- if(hWinSockDll == 0)
- StartSockets();
-
- return pinet_addr(cp);
-
+ StartSockets();
+ return inet_addr(cp);
}
/*
* Networking stubs
*/
-#undef CROAK
-#define CROAK croak
void
win32_endhostent()
{
- CROAK("endhostent not implemented!\n");
+ croak("endhostent not implemented!\n");
}
void
win32_endnetent()
{
- CROAK("endnetent not implemented!\n");
+ croak("endnetent not implemented!\n");
}
void
win32_endprotoent()
{
- CROAK("endprotoent not implemented!\n");
+ croak("endprotoent not implemented!\n");
}
void
win32_endservent()
{
- CROAK("endservent not implemented!\n");
+ croak("endservent not implemented!\n");
}
struct netent *
win32_getnetent(void)
{
- CROAK("getnetent not implemented!\n");
+ croak("getnetent not implemented!\n");
return (struct netent *) NULL;
}
struct netent *
win32_getnetbyname(char *name)
{
- CROAK("getnetbyname not implemented!\n");
+ croak("getnetbyname not implemented!\n");
return (struct netent *)NULL;
}
struct netent *
win32_getnetbyaddr(long net, int type)
{
- CROAK("getnetbyaddr not implemented!\n");
+ croak("getnetbyaddr not implemented!\n");
return (struct netent *)NULL;
}
struct protoent *
win32_getprotoent(void)
{
- CROAK("getprotoent not implemented!\n");
+ croak("getprotoent not implemented!\n");
return (struct protoent *) NULL;
}
struct servent *
win32_getservent(void)
{
- CROAK("getservent not implemented!\n");
+ croak("getservent not implemented!\n");
return (struct servent *) NULL;
}
void
win32_sethostent(int stayopen)
{
- CROAK("sethostent not implemented!\n");
+ croak("sethostent not implemented!\n");
}
void
win32_setnetent(int stayopen)
{
- CROAK("setnetent not implemented!\n");
+ croak("setnetent not implemented!\n");
}
void
win32_setprotoent(int stayopen)
{
- CROAK("setprotoent not implemented!\n");
+ croak("setprotoent not implemented!\n");
}
void
win32_setservent(int stayopen)
{
- CROAK("setservent not implemented!\n");
+ 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)
{
@@ -715,7 +656,7 @@ win32_savecopyservent(struct servent*d, struct servent*s, const char *proto)
d->s_proto = s->s_proto;
else
#endif
- if (proto && strlen(proto))
+ if (proto && strlen(proto))
d->s_proto = (char *)proto;
else
d->s_proto = "tcp";