diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 1999-05-17 21:25:54 +0000 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 1999-05-17 21:25:54 +0000 |
commit | e0721b194eb92292b2e8df7063d6c95f6d0df0ed (patch) | |
tree | ea8be35b729d4347a2e6aa2054c498ccb42dbd1d | |
parent | ab59c3aa07165586a14f7f4b0eee3be63f4e2b76 (diff) | |
parent | 0c1a8ec7bddcb61a4b45cf947cb375e7d350aaa6 (diff) | |
download | perl-e0721b194eb92292b2e8df7063d6c95f6d0df0ed.tar.gz |
Integrate from mainperl.
p4raw-id: //depot/cfgperl@3434
-rw-r--r-- | MANIFEST | 2 | ||||
-rw-r--r-- | README.cygwin32 | 119 | ||||
-rw-r--r-- | XSUB.h | 2 | ||||
-rw-r--r-- | cygwin32/Makefile.SHs | 10 | ||||
-rw-r--r-- | cygwin32/impure_ptr.c | 18 | ||||
-rw-r--r-- | cygwin32/perlld.in | 2 | ||||
-rw-r--r-- | dosish.h | 3 | ||||
-rw-r--r-- | ext/DynaLoader/dl_cygwin32.xs | 23 | ||||
-rw-r--r-- | ext/POSIX/POSIX.xs | 3 | ||||
-rw-r--r-- | gv.c | 2 | ||||
-rw-r--r-- | hints/cygwin32.sh | 69 | ||||
-rwxr-xr-x | installman | 2 | ||||
-rwxr-xr-x | installperl | 4 | ||||
-rw-r--r-- | lib/ExtUtils/MM_Cygwin.pm | 117 | ||||
-rw-r--r-- | perl.h | 2 | ||||
-rw-r--r-- | pod/perldiag.pod | 4 | ||||
-rw-r--r-- | pp.c | 2 | ||||
-rw-r--r-- | pp_hot.c | 11 | ||||
-rw-r--r-- | util.c | 2 | ||||
-rw-r--r-- | x2p/find2perl.PL | 7 |
20 files changed, 228 insertions, 176 deletions
@@ -75,7 +75,6 @@ cv.h Code value header cygwin32/Makefile.SHs Shared library generation for Cygwin32 port cygwin32/ld2.in ld wrapper template for Cygwin32 port cygwin32/perlld.in dll generator template for Cygwin32 port -cygwin32/impure_ptr.c impure pointer stub for dlls cygwin32/build-instructions.charles-wilson Cygwin32 porters notes cygwin32/build-instructions.READFIRST Cygwin32 porters notes cygwin32/build-instructions.steven-morlock2 Cygwin32 porters notes @@ -545,6 +544,7 @@ lib/ExtUtils/Install.pm Handles 'make install' on extensions lib/ExtUtils/Installed.pm Information on installed extensions lib/ExtUtils/Liblist.pm Locates libraries lib/ExtUtils/MM_OS2.pm MakeMaker methods for OS/2 +lib/ExtUtils/MM_Cygwin.pm MakeMaker methods for Cygwin lib/ExtUtils/MM_Unix.pm MakeMaker base class for Unix lib/ExtUtils/MM_VMS.pm MakeMaker methods for VMS lib/ExtUtils/MM_Win32.pm MakeMaker methods for Win32 diff --git a/README.cygwin32 b/README.cygwin32 index fee1fb3bee..7c44dbefd9 100644 --- a/README.cygwin32 +++ b/README.cygwin32 @@ -18,15 +18,11 @@ provides the UNIX system calls and environment these programs expect. More info about this project can be found at it's home page http://sourceware.cygnus.com/cygwin/ - Cygnus Solutions also made the first set of notes and tools for -building perl under Cygwin32 beta17. +=item libperl.dll -=item als +These instructions and the default cygwin32 hints build a a shared +libperl.dll Perl library and enables dynamically loaded extensions. -no, i am not hunting the patch pumpkin. i just wanted to have working -non-ActiveState perl binaries for Windows NT that can load dynamic -extensions. after several days of internet searching i went to conclusion -that the most promising way is to build it myself. i was wrong. =back @@ -38,51 +34,37 @@ that the most promising way is to build it myself. i was wrong. =item Cygwin b20.1 -since you are willing to build things yourself, you are supposed to use -not-so-archaic tools. the latest stable Cygwin suite is beta20.1. it may be +The latest stable Cygwin suite is beta20.1. It may be downloaded from ftp://go.cygnus.com/pub/sourceware.cygnus.com/cygwin/latest/ or many mirror sites around the world. =item egcs-1.1.2 -i've tried to build with egcs-1.1 that comes with cygwin b20.1, and -had no luck. maybe, if a week ago i was as experienced as now, -things would go different... maybe. but this port was built with -egcs-1.1.2 downloaded from +This port was built with egcs-1.1.2 downloaded from ftp://ftp.xraylith.wisc.edu/pub/khan/gnu-win32/cygwin/egcs-1.1.2/ -=item my patches +=item install executable -if you are reading this, those are probably applied already. +To make life easier, you should download +ftp://ftp.franken.de/pub/win32/develop/gnuwin32/cygwin/porters/Humblet_Pierre_A/install-cygwin-b20.sh, +and use it as your install "executable." Just follow the instructions +that are embedding as comments in the .sh file. =item crypt library -you do not want to see messages about excessive paranoia, do you? -well, http://miracle.geol.msu.ru/sos/ points to two different crypt -libraries ported to cygwin. i used libcrypt.tgz by Andy Piper. -his home page can be found at http://www.xemacs.freeserve.co.uk/ - -=item environment - -the locations of cygwin instllation are, well, a little unusual. -Configure will run smoother if you make more common aliases for cygwin -directories. it can be made either by C<mount>ing or by creating -directory symlinks like this: - -ln -s /cygnus/cygwin-b20/H-i586-cygwin32/bin/ $prefix/bin -ln -s /cygnus/cygwin-b20/H-i586-cygwin32/i586-cygwin32/include/ \ - $prefix/include -ln -s /cygnus/cygwin-b20/H-i586-cygwin32/i586-cygwin32/lib/ $prefix/lib - -$prefix may be empty (root), /usr, or /usr/local, as you preffer. -i used /usr. futhermore, t/io/taint.t requires cygwin1.dll to be -present in build directory or somewhere in system path (/WINNT, -/WINNT/System, /WINNT/System32). +http://miracle.geol.msu.ru/sos/ points to two different crypt +libraries ported to cygwin. This has been tested with the libcrypt.tgz +by Andy Piper. His home page can be found at +http://www.xemacs.freeserve.co.uk/ =back =head2 Configure +Check hints/cygwin32.sh for any system specific settings. In +particular change libpth if Cygwin is installed somewhere other +than /cygnus. + run "sh Configure". When confronted with this prompt: @@ -98,22 +80,21 @@ When confronted with this prompt: =end text -guess what system do you have. (hint: select "cygwin32"). +select "cygwin32". -i do not use malloc that comes with perl, but haven't put this setting -to hints file. perl defaults to use own malloc. - -Configure proposes additional -fpic flag for shared library module -compilation. say "none" because gcc complains that -fpic is useless. - -i hope that further defaults are ok. please double-chek it. +Do not use the malloc that comes with perl--using the perl malloc +collides with some cygwin startup routines. =head2 make -run "make". after that, run "make test" to see how unstable your system is. -for me, lib/io_sock.t waits for died child that has to be killed manually. -other test scripts seem to be more or less harmless. the result of -./perl harness reads: +Run "make". After that, run "make test" to see how stable your system is. +For me, at io/taint.t you may see several Win32 "Unable To Locate DLL" +messages (just click Ok) that requires cygwin1.dll to be present in the +build directory or somewhere in system path (/WINNT, /WINNT/System, +/WINNT/System32). And, at lib/io_sock.t you may see several Win32 +"Application Error" messages (just click Ok) and the test waits for a +died child that has to be killed manually. Other test scripts seem to +be more or less harmless. The result of ./perl harness reads: =begin text @@ -121,51 +102,55 @@ Failed Test Status Wstat Total Fail Failed List of failed ------------------------------------------------------------------------------- lib/anydbm.t 2 512 12 8 66.67% 5-12 lib/findbin.t 1 1 100.00% 1 -lib/io_sock.t 1 256 5 4 80.00% 2-5 +lib/io_sock.t 9 2304 5 4 80.00% 2-5 lib/sdbm.t 2 512 18 15 83.33% 2, 5-18 -op/magic.t 35 3 8.57% 1, 23, 30 -op/stat.t 58 3 5.17% 2, 9, 26 +op/magic.t 35 2 5.71% 23, 29 +op/split.t 25 1 4.00% 11 +op/stat.t 58 2 3.45% 9, 26 +op/taint.t 149 3 2.01% 1, 3, 31 pragma/locale.t 11 2816 102 4 3.92% 99-102 -8 tests skipped, plus 35 subtests skipped. -Failed 7/190 test scripts, 96.32% okay. 38/6454 subtests failed, 99.41% okay. +9 tests skipped, plus 35 subtests skipped. +Failed 9/190 test scripts, 95.26% okay. 40/6452 subtests failed, 99.38% okay. =end text =head1 BUGS -a lot of warnings about incompatible pointer types and comparison -lacking a cast. this is because of __declspec(dllimport). +A lot of warnings about incompatible pointer types and comparison +lacking a cast. This is because of __declspec(dllimport). -upon each start, make warns that a rule for perlmain.o is overrided. -yes, it is. in order to use libperl.dll, perlmain needs to import -symbols from there. i saw no better solution than adding an explicit +Upon each start, make warns that a rule for perlmain.o is overrided. +Yes, it is. In order to use libperl.dll, perlmain needs to import +symbols from there. I saw no better solution than adding an explicit define to the rule. -as said above, IO::Socket generates access violation. don't know why. -don't need IO::Socket for now. +The lib/io_sock.t failure seems to be a problem with a forked child +not having its DLLs remapped. -make clean does not remove library .def and .exe.core files +make clean does not remove library .def and .exe.core files. -ld2 script is installed with reference to source directory. you should +ld2 script is installed with reference to source directory. You should change this to /usr/local/bin (or whatever) after install. .bat wrappers for installed utility scripts are not made during installation. -library man pages are not installed correctly due to file system limitations. -use perldoc script to read about things like foo::bar. - =head1 AUTHOR alexander smishlajev <als@turnhere.com> =head1 DISCLAIMER -i am not going to maintain this document or this port. i only wanted -to make perl porting a bit easier. if failed, i can't be helpful for you. +I am not going to maintain this document or this port. I only wanted +to make perl porting a bit easier. If failed, I can't be helpful for you. =head1 HISTORY 17..25-apr-1999. perl 5.005_03. cygwin b20.1 egcs 1.1.2. far 1.60. nescafe classic. +efifer@sanwaint.com - Wed May 12 17:22:42 BST 1999 + + Removed all references to the impure_ptr hack since it is no longer + needed. Some minor cleanup of Alexander's work and a few bug fixes. + =cut @@ -6,8 +6,6 @@ # else # if defined(CYGWIN32) && defined(USE_DYNAMIC_LOADING) # define XS(name) __declspec(dllexport) void name(CV* cv) - extern struct _reent *_impure_ptr; - void impure_setup(struct _reent *_impure_ptrMain); # else # define XS(name) void name(CV* cv) # endif diff --git a/cygwin32/Makefile.SHs b/cygwin32/Makefile.SHs index fcbc318022..a675d7433d 100644 --- a/cygwin32/Makefile.SHs +++ b/cygwin32/Makefile.SHs @@ -26,7 +26,7 @@ addtopath=`pwd` $spitshell >>Makefile <<!GROK!THIS! # shell script feeding perlld to decent perl -ld2: $& Makefile perlld ${src}/cygwin32/ld2.in ${src}/impure_ptr\$(OBJ_EXT) +ld2: $& Makefile perlld ${src}/cygwin32/ld2.in @echo "extracting ld2 (with variable substitutions)" @$sed s,@buildpath@,$addtopath,g <${src}/cygwin32/ld2.in >ld2 !GROK!THIS! @@ -49,7 +49,7 @@ EXPORT_ALL = 1 DEF_EXT = .def EXP_EXT = .exp -perlld: $& Makefile ${src}/cygwin32/perlld.in ${src}/impure_ptr\$(OBJ_EXT) +perlld: $& Makefile ${src}/cygwin32/perlld.in @echo "extracting perlld (with variable substitutions)" @$sed -e s,@CC@,\${CC}, -e s,@DLLWRAP@,\${DLLWRAP},g \\ -e s,@WRAPDRIVER@,\${WRAPDRIVER},g -e s,@DLLTOOL@,\${DLLTOOL},g \\ @@ -83,8 +83,7 @@ AWK = $awk case "$useshrplib" in true) $spitshell >>Makefile <<'!NO!SUBS!' -# impure pointer initialisation -cwobj = impure_ptr$(OBJ_EXT) $(obj) +cwobj = $(obj) # override default rule (NB: make croaks!) to force dll usage perlmain$(OBJ_EXT): perlmain.c @@ -95,9 +94,6 @@ perlmain$(OBJ_EXT): perlmain.c $(LIBPERL)s$(LIB_EXT): $& perl$(OBJ_EXT) $(cwobj) $(AR) rcu $@ perl$(OBJ_EXT) $(cwobj) -impure_ptr$(OBJ_EXT): cygwin32/impure_ptr.c - $(CCCMD) $(PLDLFLAGS) cygwin32/impure_ptr.c - # dll and import library $(LIBPERL)$(LIB_EXT): $& perl$(OBJ_EXT) $(cwobj) ld2 $(LDLIBPTH) ld2 $(SHRPLDFLAGS) -o $(LIBPERL)$(DLSUFFIX) \ diff --git a/cygwin32/impure_ptr.c b/cygwin32/impure_ptr.c deleted file mode 100644 index bbe98714fe..0000000000 --- a/cygwin32/impure_ptr.c +++ /dev/null @@ -1,18 +0,0 @@ -/* - * impure_ptr initialization routine. This is needed - * for any DLL that needs to output to the main (calling) - * executable's stdout, stderr, etc. - */ - -struct _reent *_impure_ptr; /* this will be the Dlls local copy of impure ptr */ - -/********************************************* - * Function to set our local (in this dll) - * copy of impure_ptr to the main's - * (calling executable's) impure_ptr - */ -void impure_setup(struct _reent *_impure_ptrMain){ - - _impure_ptr = _impure_ptrMain; - -} diff --git a/cygwin32/perlld.in b/cygwin32/perlld.in index 1e82877178..19a1a2f7b9 100644 --- a/cygwin32/perlld.in +++ b/cygwin32/perlld.in @@ -55,7 +55,7 @@ if ($args !~ /\-o (\S+)/) { $libname ="lib$libname" unless ($libname =~ /^lib/); print DEBUGFILE "dll name: $dllname\nimport library: $libname\npath: $path\n" if $DEBUG; - $command ="$DLLWRAP --dllname $dllname --exclude-symbol=_impure_ptr"; + $command ="$DLLWRAP --dllname $dllname"; $command .=" --driver-name $WRAPDRIVER" if $WRAPDRIVER; $command .=" --dlltool $DLLTOOL" if $DLLTOOL; $command .=" --export-all-symbols" if $EXPORT_ALL; @@ -24,9 +24,8 @@ # define BIT_BUCKET "nul" # else # ifdef CYGWIN32 - extern struct _reent *__imp_reent_data; /* global impure pointer */ # define PERL_SYS_INIT(c,v) \ - MALLOC_INIT; impure_setup(__imp_reent_data); + MALLOC_INIT; # define OP_BINARY O_BINARY # define BIT_BUCKET "nul" # define HAS_IOCTL diff --git a/ext/DynaLoader/dl_cygwin32.xs b/ext/DynaLoader/dl_cygwin32.xs index b64ab3e345..95afcf5453 100644 --- a/ext/DynaLoader/dl_cygwin32.xs +++ b/ext/DynaLoader/dl_cygwin32.xs @@ -26,9 +26,7 @@ calls. // modules are dynamically built. This should be similar to the behavoir on sunOS. // Leaving in the logic would have required changes to the standard perlmain.c code // -// // Includes call a dll function to initialize it's impure_ptr. #include <stdio.h> -void (*impure_setupptr)(struct _reent *); // pointer to the impure_setup routine //#include <windows.h> #define LOAD_WITH_ALTERED_SEARCH_PATH (8) @@ -36,6 +34,7 @@ typedef void *HANDLE; typedef HANDLE HINSTANCE; #define STDCALL __attribute__ ((stdcall)) typedef int STDCALL (*FARPROC)(); +#define MAX_PATH 260 HINSTANCE STDCALL @@ -82,6 +81,11 @@ dl_load_file(filename,flags=0) int flags PREINIT: CODE: + { + char win32_path[MAX_PATH]; + cygwin_conv_to_full_win32_path(filename, win32_path); + filename = win32_path; + DLDEBUG(1,PerlIO_printf(PerlIO_stderr(),"dl_load_file(%s):\n", filename)); RETVAL = (void*) LoadLibraryExA(filename, NULL, LOAD_WITH_ALTERED_SEARCH_PATH ) ; @@ -90,20 +94,9 @@ dl_load_file(filename,flags=0) ST(0) = sv_newmortal() ; if (RETVAL == NULL){ SaveError("%d",GetLastError()) ; + } else { + sv_setiv( ST(0), (IV)RETVAL); } - else{ - // setup the dll's impure_ptr: - impure_setupptr = GetProcAddress(RETVAL, "impure_setup"); - if( impure_setupptr == NULL){ - printf( - "Cygwin32 dynaloader error: could not load impure_setup symbol\n"); - RETVAL = NULL; - } - else{ - // setup the DLLs impure_ptr: - (*impure_setupptr)(_impure_ptr); - sv_setiv( ST(0), (IV)RETVAL); - } } diff --git a/ext/POSIX/POSIX.xs b/ext/POSIX/POSIX.xs index c83587f5ef..80e92ff2fc 100644 --- a/ext/POSIX/POSIX.xs +++ b/ext/POSIX/POSIX.xs @@ -102,6 +102,9 @@ } # define times(t) vms_times(t) #else +#if defined (CYGWIN32) +# define tzname _tzname +#endif #if defined (WIN32) # undef mkfifo # define mkfifo(a,b) not_here("mkfifo") @@ -1130,7 +1130,7 @@ Gv_AMupdate(HV *stash) (SvPOK(GvSV(gv)) ? SvPVX(GvSV(gv)) : "???" ), cp, HvNAME(stash)); } else - croak("Cannot resolve method `%.256s' overloading `%s' in package `%.256s'", + croak("Can't resolve method `%.256s' overloading `%s' in package `%.256s'", (SvPOK(GvSV(gv)) ? SvPVX(GvSV(gv)) : "???" ), cp, HvNAME(stash)); } diff --git a/hints/cygwin32.sh b/hints/cygwin32.sh index ced980069f..bd2dc768bd 100644 --- a/hints/cygwin32.sh +++ b/hints/cygwin32.sh @@ -2,58 +2,31 @@ # cygwin32.sh - hintsfile for building perl on Windows NT using the # Cygnus Win32 Development Kit. # -_a='.a' + _exe='.exe' -_o='.o' +exe_ext='.exe' +# work around case-insensitive file names +firstmakefile='GNUmakefile' +sharpbang='#!' +startsh='#!/bin/sh' + archname='cygwin32' -# hmm... why Configure doesn't look for this? -#bash='/usr/bin/bash' -bin='/usr/local/bin' -binexp='/usr/local/bin' -byteorder='1234' cc='gcc' -cccdlflags='' -# ccflags='-I/usr/local/include -ggdb3 -DCYGWIN32 -DDEBUGGING' -# ok, debugging may be not appropriate for everyone +libpth='/cygnus/cygwin-b20/H-i586-cygwin32/i586-cygwin32/lib /usr/local/lib' +so='dll' +libs='-lcygwin -lm -lc -lkernel32' +#optimize='-g' ccflags='-DCYGWIN32' -clocktype='clock_t' -cryptlib='-lcrypt' -dlext='dll' +ldflags='-L. -L/usr/local/lib' +usemymalloc='n' dlsrc='dl_cygwin32.xs' -exe_ext='.exe' -# work around case-insensitive file names -firstmakefile='GNUmakefile' -gidtype='gid_t' -installman1dir='/usr/local/man/man1' -installman3dir='/usr/local/man/man3' -installscript='/usr/local/bin' -installsitelib='/usr/local/lib/perl5/site_perl' -installusrbinperl='undef' +cccdlflags=' ' ld='ld2' -lddlflags='-DCYGWIN32 --export-dynamic --strip-debug' -ldflags="-L. -L`pwd`" -lib_ext='.a' -libperl='libperl.a' -libpth='/usr/lib /usr/local/lib /cygnus/cygwin-b20/H-i586-cygwin32/lib' -libs='-lcygwin -lm -lc -lkernel32' -man1dir='/usr/local/man/man1' -man1direxp='/usr/local/man/man1' -man1ext='1' -man3dir='/usr/local/man/man3' -man3direxp='/usr/local/man/man3' -man3ext='3' -obj_ext='.o' -optimize='-O' -path_sep=':' -prefix='/usr/local' -prefixexp='/usr/local' -scriptdir='/usr/local/bin' -scriptdirexp='/usr/local/bin' -sitelib='/usr/local/lib/perl5/site_perl' -sitelibexp='/usr/local/lib/perl5/site_perl' -sysman='/usr/local/man/man1' -usenm='false' -useperlio='define' +lddlflags='--export-dynamic -L. -L/usr/local/lib' useshrplib='true' -usevfork='true' -usrinc='/usr/i586-cygwin32/include' +libperl='libperl.a' +dlext='dll' + +man1dir=/usr/local/man/man1 +man3dir=/usr/local/man/man3 +sitelib=/usr/local/lib/perl5/site_perl diff --git a/installman b/installman index 4f62be5860..ccb007c980 100755 --- a/installman +++ b/installman @@ -138,7 +138,7 @@ sub runpod2man { # Convert name from File/Basename.pm to File::Basename.3 format, # if necessary. $manpage =~ s#\.p(m|od)$##; - if ($^O eq 'os2' || $^O eq 'amigaos' || $^O eq 'uwin') { + if ($^O eq 'os2' || $^O eq 'amigaos' || $^O eq 'uwin' || $^O =~ /cygwin/) { $manpage =~ s#/#.#g; } else { $manpage =~ s#/#::#g; diff --git a/installperl b/installperl index 7689005edd..208c276c8d 100755 --- a/installperl +++ b/installperl @@ -245,10 +245,6 @@ else { # [als] hard-coded 'libperl' name... not good! @corefiles = <*.h libperl*.*>; - # cygwin needs special stub for dll loading - push @corefiles, 'impure_ptr.o' - if ($Is_Cygwin and $Config{useshrplib} eq 'true'); - # AIX needs perl.exp installed as well. push(@corefiles,'perl.exp') if $^O eq 'aix'; if ($^O eq 'mpeix') { diff --git a/lib/ExtUtils/MM_Cygwin.pm b/lib/ExtUtils/MM_Cygwin.pm new file mode 100644 index 0000000000..ffc72e349f --- /dev/null +++ b/lib/ExtUtils/MM_Cygwin.pm @@ -0,0 +1,117 @@ +package ExtUtils::MM_Cygwin; + +use Config; +#use Cwd; +#use File::Basename; +require Exporter; + +Exporter::import('ExtUtils::MakeMaker', + qw( $Verbose &neatvalue)); + +unshift @MM::ISA, 'ExtUtils::MM_Cygwin'; + +sub canonpath { + my($self,$path) = @_; + $path =~ s|\\|/|g; + return $self->ExtUtils::MM_Unix::canonpath($path); +} + +sub cflags { + my($self,$libperl)=@_; + return $self->{CFLAGS} if $self->{CFLAGS}; + my $base =$self->ExtUtils::MM_Unix::cflags($libperl); + foreach (split /\n/, $base) { + / *= */ and $self->{$`} = $'; + }; + $self->{CCFLAGS} .= " -DUSEIMPORTLIB" if ($Config{useshrplib} eq 'true'); + $self->{CCFLAGS} .= " -DCYGWIN32" unless ($self->{CCFLAGS} =~ /\-DCYGWIN32/); + + return $self->{CFLAGS} = qq{ +CCFLAGS = $self->{CCFLAGS} +OPTIMIZE = $self->{OPTIMIZE} +PERLTYPE = $self->{PERLTYPE} +LARGE = $self->{LARGE} +SPLIT = $self->{SPLIT} +}; + +} + +sub manifypods { + my($self, %attribs) = @_; + return "\nmanifypods : pure_all\n\t$self->{NOECHO}\$(NOOP)\n" unless + %{$self->{MAN3PODS}} or %{$self->{MAN1PODS}}; + my($dist); + my($pod2man_exe); + if (defined $self->{PERL_SRC}) { + $pod2man_exe = $self->catfile($self->{PERL_SRC},'pod','pod2man'); + } else { + $pod2man_exe = $self->catfile($Config{scriptdirexp},'pod2man'); + } + unless ($self->perl_script($pod2man_exe)) { + # No pod2man but some MAN3PODS to be installed + print <<END; + +Warning: I could not locate your pod2man program. Please make sure, + your pod2man program is in your PATH before you execute 'make' + +END + $pod2man_exe = "-S pod2man"; + } + my(@m); + push @m, +qq[POD2MAN_EXE = $pod2man_exe\n], +qq[POD2MAN = \$(PERL) -we '%m=\@ARGV;for (keys %m){' \\\n], +q[-e 'next if -e $$m{$$_} && -M $$m{$$_} < -M $$_ && -M $$m{$$_} < -M "], + $self->{MAKEFILE}, q[";' \\ +-e 'print "Manifying $$m{$$_}\n"; $$m{$$_} =~ s/::/./g;' \\ +-e 'system(qq[$$^X ].q["-I$(PERL_ARCHLIB)" "-I$(PERL_LIB)" $(POD2MAN_EXE) ].qq[$$_>$$m{$$_}])==0 or warn "Couldn\\047t install $$m{$$_}\n";' \\ +-e 'chmod(oct($(PERM_RW))), $$m{$$_} or warn "chmod $(PERM_RW) $$m{$$_}: $$!\n";}' +]; + push @m, "\nmanifypods : pure_all "; + push @m, join " \\\n\t", keys %{$self->{MAN1PODS}}, keys %{$self->{MAN3PODS}}; + + push(@m,"\n"); + if (%{$self->{MAN1PODS}} || %{$self->{MAN3PODS}}) { + push @m, "\t$self->{NOECHO}\$(POD2MAN) \\\n\t"; + push @m, join " \\\n\t", %{$self->{MAN1PODS}}, %{$self->{MAN3PODS}}; + } + join('', @m); +} + +sub perl_archive +{ + return '$(PERL_INC)' .'/'. ("$Config{libperl}" or "libperl.a"); +} + +1; +__END__ + +=head1 NAME + +ExtUtils::MM_Cygwin - methods to override UN*X behaviour in ExtUtils::MakeMaker + +=head1 SYNOPSIS + + use ExtUtils::MM_Cygwin; # Done internally by ExtUtils::MakeMaker if needed + +=head1 DESCRIPTION + +See ExtUtils::MM_Unix for a documentation of the methods provided there. + +=over + +=item canonpath + +replaces backslashes with forward ones. then acts as *nixish. + +=item cflags + +if configured for dynamic loading, triggers #define EXT in EXTERN.h + +=item manifypods + +replaces strings '::' with '.' in man page names + +=item perl_archive + +points to libperl.a @@ -2436,7 +2436,7 @@ PERLVAR(object_compatibility[30], char) #undef PERLVARI #undef PERLVARIC -#if defined(HASATTRIBUTE) && defined(WIN32) +#if defined(HASATTRIBUTE) && defined(WIN32) && !defined(CYGWIN32) /* * This provides a layer of functions and macros to ensure extensions will * get to use the same RTL functions as the core. diff --git a/pod/perldiag.pod b/pod/perldiag.pod index 7ed806eb82..1213231051 100644 --- a/pod/perldiag.pod +++ b/pod/perldiag.pod @@ -987,12 +987,12 @@ references can be weakened. an assignment operator, which implies modifying the value itself. Perhaps you need to copy the value to a temporary, and repeat that. -=item Cannot find an opnumber for "%s" +=item Can't find an opnumber for "%s" (F) A string of a form C<CORE::word> was given to prototype(), but there is no builtin with the name C<word>. -=item Cannot resolve method `%s' overloading `%s' in package `%s' +=item Can't resolve method `%s' overloading `%s' in package `%s' (F|P) Error resolving overloading specified by a method name (as opposed to a subroutine reference): no such method callable via the @@ -472,7 +472,7 @@ PP(pp_prototype) goto set; else { /* None such */ nonesuch: - croak("Cannot find an opnumber for \"%s\"", s+6); + croak("Can't find an opnumber for \"%s\"", s+6); } } } @@ -1270,9 +1270,14 @@ do_readline(void) SP--; } if (!fp) { - if (ckWARN(WARN_CLOSED) && io && !(IoFLAGS(io) & IOf_START)) - warner(WARN_CLOSED, - "Read on closed filehandle <%s>", GvENAME(PL_last_in_gv)); + if (ckWARN(WARN_CLOSED) && io && !(IoFLAGS(io) & IOf_START)) { + if (type == OP_GLOB) + warner(WARN_CLOSED, "glob failed (can't start child: %s)", + Strerror(errno)); + else + warner(WARN_CLOSED, "Read on closed filehandle <%s>", + GvENAME(PL_last_in_gv)); + } if (gimme == G_SCALAR) { (void)SvOK_off(TARG); PUSHTARG; @@ -1518,7 +1518,7 @@ warner(U32 err, const char* pat,...) } #ifndef VMS /* VMS' my_setenv() is in VMS.c */ -#ifndef WIN32 +#if !defined(WIN32) && !defined(CYGWIN32) void my_setenv(char *nam, char *val) { diff --git a/x2p/find2perl.PL b/x2p/find2perl.PL index f82b6602e7..cbb32fdb65 100644 --- a/x2p/find2perl.PL +++ b/x2p/find2perl.PL @@ -140,7 +140,12 @@ while (@ARGV) { $out .= &tab . '($ino ' . &n(shift); } elsif ($_ eq 'size') { - $out .= &tab . '(int(((-s _) + 511) / 512) ' . &n(shift); + $_ = shift; + if (s/c$//) { + $out .= &tab . '(int(-s _) ' . &n($_); + } else { + $out .= &tab . '(int(((-s _) + 511) / 512) ' . &n($_); + } } elsif ($_ eq 'atime') { $out .= &tab . '(int(-A _) ' . &n(shift); |