diff options
author | Gurusamy Sarathy <gsar@cpan.org> | 1998-02-22 03:09:55 +0000 |
---|---|---|
committer | Gurusamy Sarathy <gsar@cpan.org> | 1998-02-22 03:09:55 +0000 |
commit | 611e57134ef8720264c53f5e0589f41461af4dcb (patch) | |
tree | 7901de389646fca2b4f19dc03c78c679f294afa4 /win32 | |
parent | 6ad2b1bc3b01dc0cbc9f3d6840532b8e64de9f53 (diff) | |
parent | 2a321948466e7bb48bfd30dd6612a9a479df612a (diff) | |
download | perl-611e57134ef8720264c53f5e0589f41461af4dcb.tar.gz |
[asperl] integrate latest win32 branch
p4raw-id: //depot/asperl@569
Diffstat (limited to 'win32')
-rw-r--r-- | win32/Makefile | 22 | ||||
-rw-r--r-- | win32/config.gc | 2 | ||||
-rw-r--r-- | win32/makefile.mk | 30 | ||||
-rw-r--r-- | win32/win32.c | 6 | ||||
-rw-r--r-- | win32/win32.h | 5 | ||||
-rw-r--r-- | win32/win32iop.h | 2 | ||||
-rw-r--r-- | win32/win32thread.h | 6 |
7 files changed, 47 insertions, 26 deletions
diff --git a/win32/Makefile b/win32/Makefile index 682c5d823e..05fe4ffb16 100644 --- a/win32/Makefile +++ b/win32/Makefile @@ -113,9 +113,9 @@ OPTIMIZE = -Od $(RUNTIME)d -Z7 -D_DEBUG -DDEBUGGING LINK_DBG = -debug -pdb:none !ELSE ! IF "$(CCTYPE)" == "MSVC20" -OPTIMIZE = -Od $(RUNTIME) -DNDEBUG +OPTIMIZE = -O1 $(RUNTIME) -DNDEBUG ! ELSE -OPTIMIZE = -Od $(RUNTIME) -DNDEBUG +OPTIMIZE = -O1 $(RUNTIME) -DNDEBUG ! ENDIF LINK_DBG = -release !ENDIF @@ -315,7 +315,7 @@ CORE_H = ..\av.h \ .\include\sys\socket.h \ .\win32.h -DYNAMIC_EXT=Socket IO Fcntl Opcode SDBM_File attrs Thread +DYNAMIC_EXT=Socket IO Fcntl Opcode SDBM_File attrs Thread B STATIC_EXT=DynaLoader DYNALOADER=$(EXTDIR)\DynaLoader\DynaLoader @@ -326,6 +326,7 @@ SDBM_FILE=$(EXTDIR)\SDBM_File\SDBM_File IO=$(EXTDIR)\IO\IO ATTRS=$(EXTDIR)\attrs\attrs THREAD=$(EXTDIR)\Thread\Thread +B=$(EXTDIR)\B\B SOCKET_DLL=..\lib\auto\Socket\Socket.dll FCNTL_DLL=..\lib\auto\Fcntl\Fcntl.dll @@ -334,6 +335,7 @@ SDBM_FILE_DLL=..\lib\auto\SDBM_File\SDBM_File.dll IO_DLL=..\lib\auto\IO\IO.dll ATTRS_DLL=..\lib\auto\attrs\attrs.dll THREAD_DLL=..\lib\auto\Thread\Thread.dll +B_DLL=..\lib\auto\B\B.dll STATICLINKMODULES=DynaLoader DYNALOADMODULES= \ @@ -343,7 +345,8 @@ DYNALOADMODULES= \ $(SDBM_FILE_DLL)\ $(IO_DLL) \ $(ATTRS_DLL) \ - $(THREAD_DLL) + $(THREAD_DLL) \ + $(B_DLL) POD2HTML=$(PODDIR)\pod2html POD2MAN=$(PODDIR)\pod2man @@ -478,7 +481,7 @@ $(DYNALOADER).c: $(MINIPERL) $(EXTDIR)\DynaLoader\dl_win32.xs $(CONFIGPM) $(EXTDIR)\DynaLoader\dl_win32.xs: dl_win32.xs copy dl_win32.xs $(EXTDIR)\DynaLoader\dl_win32.xs -$(ATTRS_DLL): $(PERLEXE) $(ATTRS).xs +$(B_DLL): $(PERLEXE) $(B).xs cd $(EXTDIR)\$(*B) ..\..\miniperl -I..\..\lib Makefile.PL INSTALLDIRS=perl $(MAKE) @@ -490,6 +493,11 @@ $(THREAD_DLL): $(PERLEXE) $(THREAD).xs $(MAKE) cd ..\..\win32 +$(ATTRS_DLL): $(PERLEXE) $(ATTRS).xs + cd $(EXTDIR)\$(*B) + ..\..\miniperl -I..\..\lib Makefile.PL INSTALLDIRS=perl + $(MAKE) + cd ..\..\win32 $(IO_DLL): $(PERLEXE) $(CONFIGPM) $(IO).xs cd $(EXTDIR)\$(*B) @@ -547,9 +555,9 @@ distclean: clean $(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) + $(OPCODE_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 + $(DYNALOADER).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 \ diff --git a/win32/config.gc b/win32/config.gc index c8d11d88ca..e0617be2ab 100644 --- a/win32/config.gc +++ b/win32/config.gc @@ -372,7 +372,7 @@ known_extensions='DB_File Fcntl GDBM_File NDBM_File ODBM_File Opcode POSIX SDBM_ ksh='' large='' ld='gcc' -lddlflags='-dll ~LINK_FLAGS~' +lddlflags='-mdll ~LINK_FLAGS~' ldflags='~LINK_FLAGS~' less='less' lib_ext='.lib' diff --git a/win32/makefile.mk b/win32/makefile.mk index 73a7858351..5aceb31794 100644 --- a/win32/makefile.mk +++ b/win32/makefile.mk @@ -48,7 +48,7 @@ CCTYPE *= BORLAND # set the install locations of the compiler include/libraries #CCHOME *= f:\msdev\vc CCHOME *= C:\bc5 -#CCHOME *= C:\mingw32 +#CCHOME *= D:\packages\mingw32 CCINCDIR *= $(CCHOME)\include CCLIBDIR *= $(CCHOME)\lib @@ -136,7 +136,7 @@ EXEOUT_FLAG = -e .ELIF "$(CCTYPE)" == "GCC" CC = gcc -pipe -LINK32 = gcc +LINK32 = gcc -pipe LIB32 = ar IMPLIB = dlltool @@ -207,9 +207,9 @@ OPTIMIZE = -Od $(RUNTIME)d -Z7 -D_DEBUG -DDEBUGGING LINK_DBG = -debug -pdb:none .ELSE .IF "$(CCTYPE)" == "MSVC20" -OPTIMIZE = -Od $(RUNTIME) -DNDEBUG +OPTIMIZE = -O1 $(RUNTIME) -DNDEBUG .ELSE -OPTIMIZE = -Od $(RUNTIME) -DNDEBUG +OPTIMIZE = -O1 $(RUNTIME) -DNDEBUG .ENDIF LINK_DBG = -release .ENDIF @@ -243,7 +243,7 @@ o *= .obj .SUFFIXES : .c $(o) .dll .lib .exe .a .c$(o): - $(CC) -c -I$(<:d) $(CFLAGS) $(OBJOUT_FLAG)$@ $< + $(CC) -c $(null,$(<:d) $(NULL) -I$(<:d)) $(CFLAGS) $(OBJOUT_FLAG)$@ $< .y.c: $(NOOP) @@ -434,7 +434,7 @@ CORE_H = ..\av.h \ .\include\sys\socket.h \ .\win32.h -DYNAMIC_EXT=Socket IO Fcntl Opcode SDBM_File attrs Thread +DYNAMIC_EXT=Socket IO Fcntl Opcode SDBM_File attrs Thread B STATIC_EXT=DynaLoader DYNALOADER=$(EXTDIR)\DynaLoader\DynaLoader @@ -445,6 +445,7 @@ SDBM_FILE=$(EXTDIR)\SDBM_File\SDBM_File IO=$(EXTDIR)\IO\IO ATTRS=$(EXTDIR)\attrs\attrs THREAD=$(EXTDIR)\Thread\Thread +B=$(EXTDIR)\B\B SOCKET_DLL=..\lib\auto\Socket\Socket.dll FCNTL_DLL=..\lib\auto\Fcntl\Fcntl.dll @@ -453,6 +454,7 @@ SDBM_FILE_DLL=..\lib\auto\SDBM_File\SDBM_File.dll IO_DLL=..\lib\auto\IO\IO.dll ATTRS_DLL=..\lib\auto\attrs\attrs.dll THREAD_DLL=..\lib\auto\Thread\Thread.dll +B_DLL=..\lib\auto\B\B.dll STATICLINKMODULES=DynaLoader DYNALOADMODULES= \ @@ -462,7 +464,8 @@ DYNALOADMODULES= \ $(SDBM_FILE_DLL)\ $(IO_DLL) \ $(ATTRS_DLL) \ - $(THREAD_DLL) + $(THREAD_DLL) \ + $(B_DLL) POD2HTML=$(PODDIR)\pod2html POD2MAN=$(PODDIR)\pod2man @@ -568,7 +571,7 @@ $(PERLDLL): perldll.def $(CORE_OBJ) $(WIN32_OBJ) $(DLL_OBJ) perldll.def\n) $(IMPLIB) $*.lib $@ .ELIF "$(CCTYPE)" == "GCC" - $(LINK32) -dll -o $@ -Wl,--base-file -Wl,perl.base $(LINK_FLAGS) \ + $(LINK32) -mdll -o $@ -Wl,--base-file -Wl,perl.base $(LINK_FLAGS) \ $(mktmp $(LKPRE) $(CORE_OBJ:s,\,\\) $(WIN32_OBJ:s,\,\\) \ $(DLL_OBJ:s,\,\\) $(LIBFILES) $(LKPOST)) dlltool --output-lib $(PERLIMPLIB) \ @@ -576,7 +579,7 @@ $(PERLDLL): perldll.def $(CORE_OBJ) $(WIN32_OBJ) $(DLL_OBJ) --def perldll.def \ --base-file perl.base \ --output-exp perl.exp - $(LINK32) -dll -o $@ $(LINK_FLAGS) \ + $(LINK32) -mdll -o $@ $(LINK_FLAGS) \ $(mktmp $(LKPRE) $(CORE_OBJ:s,\,\\) $(WIN32_OBJ:s,\,\\) \ $(DLL_OBJ:s,\,\\) $(LIBFILES) perl.exp $(LKPOST)) .ELSE @@ -659,6 +662,11 @@ $(DYNALOADER).c: $(MINIPERL) $(EXTDIR)\DynaLoader\dl_win32.xs $(CONFIGPM) $(EXTDIR)\DynaLoader\dl_win32.xs: dl_win32.xs copy dl_win32.xs $(EXTDIR)\DynaLoader\dl_win32.xs +$(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 @@ -716,9 +724,9 @@ distclean: clean $(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) + $(OPCODE_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 + $(DYNALOADER).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 diff --git a/win32/win32.c b/win32/win32.c index 3eeaa6a988..9d819b518f 100644 --- a/win32/win32.c +++ b/win32/win32.c @@ -36,7 +36,7 @@ #include <stdarg.h> #include <float.h> #include <time.h> -#ifdef _MSC_VER +#if defined(_MSC_VER) || defined(__MINGW32__) #include <sys/utime.h> #else #include <utime.h> @@ -1193,7 +1193,7 @@ win32_strerror(int e) } DllExport void -win32_str_os_error(SV *sv, unsigned long dwErr) +win32_str_os_error(void *sv, DWORD dwErr) { DWORD dwLen; char *sMsg; @@ -1214,7 +1214,7 @@ win32_str_os_error(SV *sv, unsigned long dwErr) "Unknown error #0x%lX (lookup 0x%lX)", dwErr, GetLastError()); } - sv_setpvn(sv, sMsg, dwLen); + sv_setpvn((SV*)sv, sMsg, dwLen); LocalFree(sMsg); } diff --git a/win32/win32.h b/win32/win32.h index 31aadf960e..8b9be40130 100644 --- a/win32/win32.h +++ b/win32/win32.h @@ -143,6 +143,9 @@ typedef long gid_t; typedef long uid_t; typedef long gid_t; +#define _environ environ +#define flushall _flushall +#define fcloseall _fcloseall #endif /* __MINGW32__ */ @@ -171,7 +174,7 @@ extern char * getlogin(void); DllExport void Perl_win32_init(int *argcp, char ***argvp); DllExport void Perl_init_os_extras(void); -DllExport void win32_str_os_error(struct sv *s, DWORD err); +DllExport void win32_str_os_error(void *sv, DWORD err); #ifndef USE_SOCKETS_AS_HANDLES extern FILE * my_fdopen(int, char *); diff --git a/win32/win32iop.h b/win32/win32iop.h index 7e03a9aeb4..a17134b0ff 100644 --- a/win32/win32iop.h +++ b/win32/win32iop.h @@ -13,7 +13,7 @@ #endif #endif -#ifdef _MSC_VER +#if defined(_MSC_VER) || defined(__MINGW32__) # include <sys/utime.h> #else # include <utime.h> diff --git a/win32/win32thread.h b/win32/win32thread.h index acb136c690..512e6296e5 100644 --- a/win32/win32thread.h +++ b/win32/win32thread.h @@ -166,7 +166,8 @@ END_EXTERN_C #define JOIN(t, avp) \ STMT_START { \ if ((WaitForSingleObject((t)->self,INFINITE) == WAIT_FAILED) \ - || (GetExitCodeThread((t)->self,(LPDWORD)(avp)) == 0)) \ + || (GetExitCodeThread((t)->self,(LPDWORD)(avp)) == 0) \ + || (CloseHandle((t)->self) == 0)) \ croak("panic: JOIN"); \ *avp = (AV *)((t)->i.retv); \ } STMT_END @@ -174,7 +175,8 @@ END_EXTERN_C #define JOIN(t, avp) \ STMT_START { \ if ((WaitForSingleObject((t)->self,INFINITE) == WAIT_FAILED) \ - || (GetExitCodeThread((t)->self,(LPDWORD)(avp)) == 0)) \ + || (GetExitCodeThread((t)->self,(LPDWORD)(avp)) == 0) \ + || (CloseHandle((t)->self) == 0)) \ croak("panic: JOIN"); \ } STMT_END #endif /* !USE_RTL_THREAD_API || _MSC_VER */ |