case "$xxx" in
DynaLoader|dynaload) ;;
*)
- if $test -f $xxx/$xxx.xs; then
+ if $test -f $xxx/$xxx.xs -o -f $xxx/$xxx.c; then
known_extensions="$known_extensions $1$xxx";
elif $test -f $xxx/Makefile.PL; then
nonxs_extensions="$nonxs_extensions $1$xxx";
esac
esac
;;
- Win32)
+ Win32*)
case "$osname" in
cygwin) avail_ext="$avail_ext $xxx" ;;
esac
ext/Win32/Makefile.PL Win32 extension makefile writer
ext/Win32/Win32.pm Win32 extension Perl module
ext/Win32/Win32.xs Win32 extension external subroutines
+ext/Win32API/File/buffers.h Win32API::File extension
+ext/Win32API/File/cFile.h Win32API::File extension
+ext/Win32API/File/cFile.pc Win32API::File extension
+ext/Win32API/File/Changes Win32API::File extension changes
+ext/Win32API/File/const2perl.h Win32API::File extension
+ext/Win32API/File/ExtUtils/Myconst2perl.pm Win32API::File extension
+ext/Win32API/File/File.pm Win32API::File extension
+ext/Win32API/File/File.xs Win32API::File extension
+ext/Win32API/File/Makefile.PL Win32API::File extension makefile write
+ext/Win32API/File/README Win32API::File extension Readme
+ext/Win32API/File/t/file.t See if Win32API::File extension works
+ext/Win32API/File/t/tie.t See if Win32API::File extension works
+ext/Win32API/File/typemap Win32API::File extension interface types
+ext/Win32CORE/Makefile.PL Win32CORE extension
+ext/Win32CORE/t/win32core.t Win32CORE extension
+ext/Win32CORE/Win32CORE.c Win32CORE extension
+ext/Win32CORE/Win32CORE.pm Win32CORE extension (stubs for Win32 CORE subs)
ext/XS/APItest/APItest.pm XS::APItest extension
ext/XS/APItest/APItest.xs XS::APItest extension
ext/XS/APItest/core.c Test API functions when PERL_CORE is defined
win32/config.vc64 Win64 base line config.sh (Visual C++ build)
win32/distclean.bat Remove _ALL_ files not listed here in MANIFEST
win32/dl_win32.xs Win32 port
-win32/ext/Win32API/File/buffers.h Win32API::File extension
-win32/ext/Win32API/File/cFile.h Win32API::File extension
-win32/ext/Win32API/File/cFile.pc Win32API::File extension
-win32/ext/Win32API/File/Changes Win32API::File extension changes
-win32/ext/Win32API/File/const2perl.h Win32API::File extension
-win32/ext/Win32API/File/ExtUtils/Myconst2perl.pm Win32API::File extension
-win32/ext/Win32API/File/File.pm Win32API::File extension
-win32/ext/Win32API/File/File.xs Win32API::File extension
-win32/ext/Win32API/File/Makefile.PL Win32API::File extension makefile write
-win32/ext/Win32API/File/README Win32API::File extension Readme
-win32/ext/Win32API/File/t/file.t See if Win32API::File extension works
-win32/ext/Win32API/File/t/tie.t See if Win32API::File extension works
-win32/ext/Win32API/File/typemap Win32API::File extension interface types
win32/fcrypt.c crypt() implementation
win32/FindExt.pm Scan for extensions
win32/genmk95.pl Perl code to generate command.com-usable makefile.95
'win32' =>
{
'MAINTAINER' => 'jand',
- 'FILES' => q[win32 README.win32 t/win32],
+ 'FILES' => q[win32 README.win32 t/win32 ext/Win32 ext/Win32CORE],
'CPAN' => 0,
},
'Win32API::File' =>
{
'MAINTAINER' => 'tyemq',
- 'FILES' => q[win32/ext/Win32API/File],
+ 'FILES' => q[ext/Win32API/File],
'CPAN' => 1,
},
init_os_extras(void)
{
char *file = __FILE__;
+ CV *cv;
dTHX;
newXS("Cwd::cwd", Cygwin_cwd, file);
newXS("Cygwin::winpid_to_pid", XS_Cygwin_winpid_to_pid, file);
newXS("Cygwin::pid_to_winpid", XS_Cygwin_pid_to_winpid, file);
+
+ if ((cv = get_cv("Win32CORE::bootstrap", 0))) {
+ dSP;
+ PUSHMARK(SP);
+ (void)call_sv((SV *)cv, G_EVAL|G_DISCARD|G_VOID);
+ }
}
$ok or print "# ",fileLastError(),"\n";
print $ok ? "" : "not ", "ok ", ++$test, "\n"; # ok 35
-system( "attrib -r Moved.cp" );
+if ($^O eq 'cygwin') {
+ chmod( 0200 | 07777 & (stat("Moved.cp"))[2], "Moved.cp" );
+}
+else {
+ system( "attrib -r Moved.cp" );
+}
$ok= DeleteFile( "Moved.cp" );
$ok or print "# ",fileLastError(),"\n";
--- /dev/null
+use ExtUtils::MakeMaker;
+
+WriteMakefile(
+ 'NAME' => 'Win32CORE',
+ 'VERSION_FROM' => 'Win32CORE.pm',
+);
--- /dev/null
+/* Win32CORE.c
+ *
+ * Copyright (C) 2007 by Larry Wall and others
+ *
+ * You may distribute under the terms of either the GNU General Public
+ * License or the Artistic License, as specified in the README file.
+ *
+ */
+
+#include "EXTERN.h"
+#include "perl.h"
+#include "XSUB.h"
+
+static void
+forward(pTHX_ const char *function)
+{
+ dXSARGS;
+ Perl_load_module(aTHX_ PERL_LOADMOD_NOIMPORT, newSVpvn("Win32",5), newSVnv(0.27));
+ SPAGAIN;
+ PUSHMARK(SP-items);
+ call_pv(function, GIMME_V);
+}
+
+#define FORWARD(function) XS(w32_##function){ forward(aTHX_ "Win32::"#function); }
+FORWARD(GetCwd)
+FORWARD(SetCwd)
+FORWARD(GetNextAvailDrive)
+FORWARD(GetLastError)
+FORWARD(SetLastError)
+FORWARD(LoginName)
+FORWARD(NodeName)
+FORWARD(DomainName)
+FORWARD(FsType)
+FORWARD(GetOSVersion)
+FORWARD(IsWinNT)
+FORWARD(IsWin95)
+FORWARD(FormatMessage)
+FORWARD(Spawn)
+FORWARD(GetTickCount)
+FORWARD(GetShortPathName)
+FORWARD(GetFullPathName)
+FORWARD(GetLongPathName)
+FORWARD(CopyFile)
+FORWARD(Sleep)
+
+/* Don't forward Win32::SetChildShowWindow(). It accesses the internal variable
+ * w32_showwindow in thread_intern and is therefore not implemented in Win32.xs.
+ */
+/* FORWARD(SetChildShowWindow) */
+
+#undef FORWARD
+
+XS(boot_Win32CORE)
+{
+ dXSARGS;
+ char *file = __FILE__;
+
+ /* these names are Activeware compatible */
+ newXS("Win32::GetCwd", w32_GetCwd, file);
+ newXS("Win32::SetCwd", w32_SetCwd, file);
+ newXS("Win32::GetNextAvailDrive", w32_GetNextAvailDrive, file);
+ newXS("Win32::GetLastError", w32_GetLastError, file);
+ newXS("Win32::SetLastError", w32_SetLastError, file);
+ newXS("Win32::LoginName", w32_LoginName, file);
+ newXS("Win32::NodeName", w32_NodeName, file);
+ newXS("Win32::DomainName", w32_DomainName, file);
+ newXS("Win32::FsType", w32_FsType, file);
+ newXS("Win32::GetOSVersion", w32_GetOSVersion, file);
+ newXS("Win32::IsWinNT", w32_IsWinNT, file);
+ newXS("Win32::IsWin95", w32_IsWin95, file);
+ newXS("Win32::FormatMessage", w32_FormatMessage, file);
+ newXS("Win32::Spawn", w32_Spawn, file);
+ newXS("Win32::GetTickCount", w32_GetTickCount, file);
+ newXS("Win32::GetShortPathName", w32_GetShortPathName, file);
+ newXS("Win32::GetFullPathName", w32_GetFullPathName, file);
+ newXS("Win32::GetLongPathName", w32_GetLongPathName, file);
+ newXS("Win32::CopyFile", w32_CopyFile, file);
+ newXS("Win32::Sleep", w32_Sleep, file);
+ /* newXS("Win32::SetChildShowWindow", w32_SetChildShowWindow, file); */
+
+ XSRETURN_YES;
+}
--- /dev/null
+package Win32CORE;
+
+$VERSION = '0.01';
+
+use strict;
+use warnings;
+use vars qw($VERSION @ISA);
+use base qw(Exporter DynaLoader);
+no warnings "redefine";
+
+bootstrap Win32CORE $VERSION;
+
+1;
+__END__
+=head1 NAME
+
+Win32CORE - Win32 CORE functions
+
+=head1 DESCRIPTION
+
+This library provides the functions marked as [CORE] in L<Win32>. See that
+document for usage information. In cygwin, as of 5.8.6 it is no longer
+necessary to use this module; the functions should be available even without
+C<use Win32CORE;> or C<-MWin32CORE>.
+
+=cut
--- /dev/null
+#!perl
+
+use Test;
+BEGIN { plan tests => 1 };
+use Win32CORE;
+ok(1);
;;
esac;
+# compile Win32CORE "module" as static
+static_ext="$static_ext Win32CORE"
+
# Win9x problem with non-blocking read from a closed pipe
d_eofnblk='define'
ext/Digest/SHA
ext/Sys/Syslog
ext/Time/HiRes
-
-win32/ext/Win32API/File
+ext/Win32API/File
closedir $dh;
for my $xxx (@items) {
if ($xxx ne "DynaLoader") {
- if (-f "$xxx/$xxx.xs") {
+ if (-f "$xxx/$xxx.xs" || -f "$xxx/$xxx.c" ) {
$ext{"$_[0]$xxx"} = $static{"$_[0]$xxx"} ? 'static' : 'dynamic';
} elsif (-f "$xxx/Makefile.PL") {
$ext{"$_[0]$xxx"} = 'nonxs';
# specify static extensions here
#STATIC_EXT = Cwd Compress/Raw/Zlib
-STATIC_EXT =
+STATIC_EXT = Win32CORE
DYNALOADER = $(EXTDIR)\DynaLoader\DynaLoader
Extensions: buildext.pl $(PERLDEP) $(CONFIGPM)
$(XCOPY) ..\*.h $(COREDIR)\*.*
$(MINIPERL) -I..\lib buildext.pl $(MAKE) $(PERLDEP) $(EXTDIR) --dynamic
- $(MINIPERL) -I..\lib buildext.pl $(MAKE) $(PERLDEP) ext --dynamic
+ -if exist ext $(MINIPERL) -I..\lib buildext.pl $(MAKE) $(PERLDEP) ext --dynamic
Extensions_reonly: buildext.pl $(PERLDEP) $(CONFIGPM)
$(XCOPY) ..\*.h $(COREDIR)\*.*
$(MINIPERL) -I..\lib buildext.pl $(MAKE) $(PERLDEP) $(EXTDIR) --dynamic +re
- $(MINIPERL) -I..\lib buildext.pl $(MAKE) $(PERLDEP) ext --dynamic +re
+ -if exist ext $(MINIPERL) -I..\lib buildext.pl $(MAKE) $(PERLDEP) ext --dynamic +re
Extensions_static : buildext.pl $(PERLDEP) $(CONFIGPM)
$(XCOPY) ..\*.h $(COREDIR)\*.*
$(MINIPERL) -I..\lib buildext.pl $(MAKE) $(PERLDEP) $(EXTDIR) --static
- $(MINIPERL) -I..\lib buildext.pl $(MAKE) $(PERLDEP) ext --static
+ -if exist ext $(MINIPERL) -I..\lib buildext.pl $(MAKE) $(PERLDEP) ext --static
$(MINIPERL) -I..\lib buildext.pl --list-static-libs > Extensions_static
Extensions_clean:
-if exist $(MINIPERL) $(MINIPERL) -I..\lib buildext.pl $(MAKE) $(PERLDEP) $(EXTDIR) clean
- -if exist $(MINIPERL) $(MINIPERL) -I..\lib buildext.pl $(MAKE) $(PERLDEP) ext clean
+ -if exist $(MINIPERL) if exist ext $(MINIPERL) -I..\lib buildext.pl $(MAKE) $(PERLDEP) ext clean
Extensions_realclean:
-if exist $(MINIPERL) $(MINIPERL) -I..\lib buildext.pl $(MAKE) $(PERLDEP) $(EXTDIR) realclean
- -if exist $(MINIPERL) $(MINIPERL) -I..\lib buildext.pl $(MAKE) $(PERLDEP) ext realclean
+ -if exist $(MINIPERL) if exist ext $(MINIPERL) -I..\lib buildext.pl $(MAKE) $(PERLDEP) ext realclean
#-------------------------------------------------------------------------------
}
FindExt::scan_ext("../ext");
-FindExt::scan_ext("ext");
+FindExt::scan_ext("ext") if -d 'ext'; # also look in win32/ext/ if it exists
FindExt::set_static_extensions(split ' ', $opt{'static_ext'});
my @dynamic_ext = grep(!/Thread/,FindExt::dynamic_ext());
# specify static extensions here
#STATIC_EXT = Cwd Compress/Raw/Zlib
-STATIC_EXT =
+STATIC_EXT = Win32CORE
DYNALOADER = $(EXTDIR)\DynaLoader\DynaLoader
Extensions : buildext.pl $(PERLDEP) $(CONFIGPM)
$(XCOPY) ..\*.h $(COREDIR)\*.*
$(MINIPERL) -I..\lib buildext.pl $(MAKE) $(PERLDEP) $(EXTDIR) --dynamic
- $(MINIPERL) -I..\lib buildext.pl $(MAKE) $(PERLDEP) ext --dynamic
+ -if exist ext $(MINIPERL) -I..\lib buildext.pl $(MAKE) $(PERLDEP) ext --dynamic
Extensions_reonly : buildext.pl $(PERLDEP) $(CONFIGPM)
$(XCOPY) ..\*.h $(COREDIR)\*.*
$(MINIPERL) -I..\lib buildext.pl $(MAKE) $(PERLDEP) $(EXTDIR) --dynamic +re
- $(MINIPERL) -I..\lib buildext.pl $(MAKE) $(PERLDEP) ext --dynamic +re
+ -if exist ext $(MINIPERL) -I..\lib buildext.pl $(MAKE) $(PERLDEP) ext --dynamic +re
Extensions_static : buildext.pl $(PERLDEP) $(CONFIGPM)
$(XCOPY) ..\*.h $(COREDIR)\*.*
$(MINIPERL) -I..\lib buildext.pl $(MAKE) $(PERLDEP) $(EXTDIR) --static
- $(MINIPERL) -I..\lib buildext.pl $(MAKE) $(PERLDEP) ext --static
+ -if exist ext $(MINIPERL) -I..\lib buildext.pl $(MAKE) $(PERLDEP) ext --static
$(MINIPERL) -I..\lib buildext.pl --list-static-libs > Extensions_static
Extensions_clean :
-if exist $(MINIPERL) $(MINIPERL) -I..\lib buildext.pl $(MAKE) $(PERLDEP) $(EXTDIR) clean
- -if exist $(MINIPERL) $(MINIPERL) -I..\lib buildext.pl $(MAKE) $(PERLDEP) ext clean
+ -if exist $(MINIPERL) if exist ext $(MINIPERL) -I..\lib buildext.pl $(MAKE) $(PERLDEP) ext clean
Extensions_realclean :
-if exist $(MINIPERL) $(MINIPERL) -I..\lib buildext.pl $(MAKE) $(PERLDEP) $(EXTDIR) realclean
- -if exist $(MINIPERL) $(MINIPERL) -I..\lib buildext.pl $(MAKE) $(PERLDEP) ext realclean
+ -if exist $(MINIPERL) if exist ext $(MINIPERL) -I..\lib buildext.pl $(MAKE) $(PERLDEP) ext realclean
#-------------------------------------------------------------------------------
XSRETURN(1);
}
-static void
-forward(pTHX_ const char *function)
-{
- dXSARGS;
- Perl_load_module(aTHX_ PERL_LOADMOD_NOIMPORT, newSVpvn("Win32",5), newSVnv(0.27));
- SPAGAIN;
- PUSHMARK(SP-items);
- call_pv(function, GIMME_V);
-}
-
-#define FORWARD(function) XS(w32_##function){ forward(aTHX_ "Win32::"#function); }
-FORWARD(GetCwd)
-FORWARD(SetCwd)
-FORWARD(GetNextAvailDrive)
-FORWARD(GetLastError)
-FORWARD(SetLastError)
-FORWARD(LoginName)
-FORWARD(NodeName)
-FORWARD(DomainName)
-FORWARD(FsType)
-FORWARD(GetOSVersion)
-FORWARD(IsWinNT)
-FORWARD(IsWin95)
-FORWARD(FormatMessage)
-FORWARD(Spawn)
-FORWARD(GetTickCount)
-FORWARD(GetShortPathName)
-FORWARD(GetFullPathName)
-FORWARD(GetLongPathName)
-FORWARD(CopyFile)
-FORWARD(Sleep)
-
-/* Don't forward Win32::SetChildShowWindow(). It accesses the internal variable
- * w32_showwindow in thread_intern and is therefore not implemented in Win32.xs.
- */
-/* FORWARD(SetChildShowWindow) */
-
-#undef FORWARD
-
void
Perl_init_os_extras(void)
{
dTHX;
char *file = __FILE__;
+ CV *cv;
dXSUB_SYS;
- /* these names are Activeware compatible */
- newXS("Win32::GetCwd", w32_GetCwd, file);
- newXS("Win32::SetCwd", w32_SetCwd, file);
- newXS("Win32::GetNextAvailDrive", w32_GetNextAvailDrive, file);
- newXS("Win32::GetLastError", w32_GetLastError, file);
- newXS("Win32::SetLastError", w32_SetLastError, file);
- newXS("Win32::LoginName", w32_LoginName, file);
- newXS("Win32::NodeName", w32_NodeName, file);
- newXS("Win32::DomainName", w32_DomainName, file);
- newXS("Win32::FsType", w32_FsType, file);
- newXS("Win32::GetOSVersion", w32_GetOSVersion, file);
- newXS("Win32::IsWinNT", w32_IsWinNT, file);
- newXS("Win32::IsWin95", w32_IsWin95, file);
- newXS("Win32::FormatMessage", w32_FormatMessage, file);
- newXS("Win32::Spawn", w32_Spawn, file);
- newXS("Win32::GetTickCount", w32_GetTickCount, file);
- newXS("Win32::GetShortPathName", w32_GetShortPathName, file);
- newXS("Win32::GetFullPathName", w32_GetFullPathName, file);
- newXS("Win32::GetLongPathName", w32_GetLongPathName, file);
- newXS("Win32::CopyFile", w32_CopyFile, file);
- newXS("Win32::Sleep", w32_Sleep, file);
+ /* load Win32 CORE stubs, assuming Win32CORE was statically linked */
+ if ((cv = get_cv("Win32CORE::bootstrap", 0))) {
+ dSP;
+ PUSHMARK(SP);
+ (void)call_sv((SV *)cv, G_EVAL|G_DISCARD|G_VOID);
+ }
+
newXS("Win32::SetChildShowWindow", w32_SetChildShowWindow, file);
}