use ExtUtils::MakeMaker;
WriteMakefile(
NAME => 'POSIX',
- LIBS => ["-lm -lposix -lcposix"],
+ ($^O eq 'MSWin32' ? () : (LIBS => ["-lm -lposix -lcposix"])),
MAN3PODS => ' ', # Pods will be built by installman.
XSPROTOARG => '-noprototypes', # XXX remove later?
VERSION_FROM => 'POSIX.pm',
sub getcwd
{
usage "getcwd()" if @_ != 0;
- chop($cwd = `pwd`);
+ if ($^O eq 'MSWin32') {
+ # this perhaps applies to everyone else also?
+ require Cwd;
+ $cwd = &Cwd::cwd;
+ }
+ else {
+ chop($cwd = `pwd`);
+ }
$cwd;
}
+#ifdef WIN32
+#define _POSIX_
+#endif
#include "EXTERN.h"
#define PERLIO_NOT_STDIO 1
#include "perl.h"
#include <sys/stat.h>
#include <sys/types.h>
#include <time.h>
+#ifdef I_UNISTD
#include <unistd.h> /* see hints/sunos_4_1.sh */
+#endif
#include <fcntl.h>
#if defined(__VMS) && !defined(__POSIX_SOURCE)
}
# define times(t) vms_times(t)
#else
+#if defined (WIN32)
+# undef mkfifo /* #defined in perl.h */
+# define mkfifo(a,b) not_here("mkfifo")
+# define ttyname(a) not_here("ttyname")
+# define sigset_t long
+# define pid_t long
+# ifdef __BORLANDC__
+# define tzname _tzname
+# endif
+# ifdef _MSC_VER
+# define mode_t short
+# endif
+# define sigaction(a,b,c) not_here("sigaction")
+# define sigpending(a) not_here("sigpending")
+# define sigprocmask(a,b,c) not_here("sigprocmask")
+# define sigsuspend(a) not_here("sigsuspend")
+# define sigemptyset(a) not_here("sigemptyset")
+# define sigaddset(a,b) not_here("sigaddset")
+# define sigdelset(a,b) not_here("sigdelset")
+# define sigfillset(a) not_here("sigfillset")
+# define sigismember(a,b) not_here("sigismember")
+#else
# include <grp.h>
# include <sys/times.h>
# ifdef HAS_UNAME
# ifdef I_UTIME
# include <utime.h>
# endif
-#endif
+#endif /* WIN32 */
+#endif /* __VMS */
typedef int SysRet;
typedef long SysRetLong;
#define localeconv() not_here("localeconv")
#endif
+#ifndef WIN32
#ifdef HAS_TZNAME
extern char *tzname[];
#else
char *tzname[] = { "" , "" };
#endif
+#endif
/* XXX struct tm on some systems (SunOS4/BSD) contains extra (non POSIX)
* fields for which we don't have Configure support yet:
POSIX::SigAction action
POSIX::SigAction oldaction
CODE:
-
+#ifdef WIN32
+ RETVAL = not_here("sigaction");
+#else
# This code is really grody because we're trying to make the signal
# interface look beautiful, which is hard.
sv_setiv(*svp, oact.sa_flags);
}
}
+#endif
OUTPUT:
RETVAL
$| = 1;
print "1..18\n";
+$Is_W32 = $^O eq 'MSWin32';
+
$testfd = open("TEST", O_RDONLY, 0) and print "ok 1\n";
read($testfd, $buffer, 9) if $testfd > 2;
print $buffer eq "#!./perl\n" ? "ok 2\n" : "not ok 2\n";
print <$reader>;
close $reader;
+if ($Is_W32) {
+ for (6..11) {
+ print "ok $_ # skipped, no sigaction support on win32\n";
+ }
+}
+else {
$sigset = new POSIX::SigSet 1,3;
delset $sigset 1;
if (!ismember $sigset 1) { print "ok 6\n" }
sub SigINT {
print "ok 10\n";
}
+}
print &_POSIX_OPEN_MAX > $fds[1] ? "ok 12\n" : "not ok 12\n";
$have_setlocale++;
};
+# Visual C's CRT goes silly on strings of the form "en_US.ISO8859-1"
+$have_setlocale = 0 if $^O eq 'MSWin32' && $Config{cc} =~ /^cl/i;
+
print "1..", ($have_setlocale ? 102 : 98), "\n";
use vars qw($a
.\include\sys\socket.h \
.\win32.h
-DYNAMIC_EXT=Socket IO Fcntl Opcode SDBM_File attrs Thread B
+DYNAMIC_EXT=Socket IO Fcntl Opcode SDBM_File POSIX attrs Thread B
STATIC_EXT=DynaLoader
DYNALOADER=$(EXTDIR)\DynaLoader\DynaLoader
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
OPCODE_DLL=..\lib\auto\Opcode\Opcode.dll
SDBM_FILE_DLL=..\lib\auto\SDBM_File\SDBM_File.dll
IO_DLL=..\lib\auto\IO\IO.dll
+POSIX_DLL=..\lib\auto\POSIX\POSIX.dll
ATTRS_DLL=..\lib\auto\attrs\attrs.dll
THREAD_DLL=..\lib\auto\Thread\Thread.dll
B_DLL=..\lib\auto\B\B.dll
$(OPCODE_DLL) \
$(SDBM_FILE_DLL)\
$(IO_DLL) \
+ $(POSIX_DLL) \
$(ATTRS_DLL) \
$(THREAD_DLL) \
$(B_DLL)
$(MAKE)
cd ..\..\win32
+$(POSIX_DLL): $(PERLEXE) $(POSIX).xs
+ cd $(EXTDIR)\$(*B)
+ ..\..\miniperl -I..\..\lib Makefile.PL INSTALLDIRS=perl
+ $(MAKE)
+ cd ..\..\win32
+
$(IO_DLL): $(PERLEXE) $(CONFIGPM) $(IO).xs
cd $(EXTDIR)\$(*B)
..\..\miniperl -I..\..\lib Makefile.PL INSTALLDIRS=perl
$(PERLIMPLIB) ..\miniperl.lib $(MINIMOD)
-del /f *.def *.map
-del /f $(SOCKET_DLL) $(IO_DLL) $(SDBM_FILE_DLL) $(FCNTL_DLL) \
- $(OPCODE_DLL) $(ATTRS_DLL) $(THREAD_DLL) $(B_DLL)
+ $(OPCODE_DLL) $(POSIX_DLL) $(ATTRS_DLL) $(THREAD_DLL) $(B_DLL)
-del /f $(SOCKET).c $(IO).c $(SDBM_FILE).c $(FCNTL).c $(OPCODE).c \
- $(DYNALOADER).c $(ATTRS).c $(THREAD).c $(B).c
+ $(DYNALOADER).c $(POSIX).c $(ATTRS).c $(THREAD).c $(B).c
-del /f $(PODDIR)\*.html
-del /f $(PODDIR)\*.bat
-del /f ..\config.sh ..\splittree.pl perlmain.c dlutils.c \
-del /s *.lib *.def *.map *.bs Makefile *$(o) pm_to_blib
cd ..\win32
-install : all doc utils
+install : all installbare installutils installhtml
+
+installbare :
$(PERLEXE) ..\installperl
$(XCOPY) $(PERL95EXE) $(INST_BIN)\*.*
+
+installutils : utils
$(XCOPY) $(GLOBEXE) $(INST_BIN)\*.*
$(XCOPY) bin\*.bat $(INST_BIN)\*.*
$(XCOPY) ..\pod\*.bat $(INST_BIN)\*.*
+
+installhtml : doc
$(RCOPY) html\*.* $(INST_HTML)\*.*
inst_lib : $(CONFIGPM)
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
.\include\sys\socket.h \
.\win32.h
-DYNAMIC_EXT=Socket IO Fcntl Opcode SDBM_File attrs Thread B
+DYNAMIC_EXT=Socket IO Fcntl Opcode SDBM_File POSIX attrs Thread B
STATIC_EXT=DynaLoader
DYNALOADER=$(EXTDIR)\DynaLoader\DynaLoader
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
OPCODE_DLL=..\lib\auto\Opcode\Opcode.dll
SDBM_FILE_DLL=..\lib\auto\SDBM_File\SDBM_File.dll
IO_DLL=..\lib\auto\IO\IO.dll
+POSIX_DLL=..\lib\auto\POSIX\POSIX.dll
ATTRS_DLL=..\lib\auto\attrs\attrs.dll
THREAD_DLL=..\lib\auto\Thread\Thread.dll
B_DLL=..\lib\auto\B\B.dll
$(OPCODE_DLL) \
$(SDBM_FILE_DLL)\
$(IO_DLL) \
+ $(POSIX_DLL) \
$(ATTRS_DLL) \
$(THREAD_DLL) \
$(B_DLL)
..\..\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
$(PERLIMPLIB) ..\miniperl.lib $(MINIMOD)
-del /f *.def *.map
-del /f $(SOCKET_DLL) $(IO_DLL) $(SDBM_FILE_DLL) $(FCNTL_DLL) \
- $(OPCODE_DLL) $(ATTRS_DLL) $(THREAD_DLL) $(B_DLL)
+ $(OPCODE_DLL) $(POSIX_DLL) $(ATTRS_DLL) $(THREAD_DLL) $(B_DLL)
-del /f $(SOCKET).c $(IO).c $(SDBM_FILE).c $(FCNTL).c $(OPCODE).c \
- $(DYNALOADER).c $(ATTRS).c $(THREAD).c $(B).c
+ $(DYNALOADER).c $(POSIX).c $(ATTRS).c $(THREAD).c $(B).c
-del /f $(PODDIR)\*.html
-del /f $(PODDIR)\*.bat
-del /f ..\config.sh ..\splittree.pl perlmain.c dlutils.c config.h.new
-rmdir /s /q ..\lib\auto || rmdir /s ..\lib\auto
-rmdir /s /q $(COREDIR) || rmdir /s $(COREDIR)
-install : all doc utils
+install : all installbare installutils installhtml
+
+installbare :
$(PERLEXE) ..\installperl
.IF "$(PERL95EXE)" != ""
$(XCOPY) $(PERL95EXE) $(INST_BIN)\*.*
.ENDIF
+
+installutils : utils
$(XCOPY) $(GLOBEXE) $(INST_BIN)\*.*
$(XCOPY) bin\*.bat $(INST_BIN)\*.*
$(XCOPY) ..\pod\*.bat $(INST_BIN)\*.*
+
+installhtml : doc
$(RCOPY) html\*.* $(INST_HTML)\*.*
inst_lib : $(CONFIGPM)