From: Gurusamy Sarathy Date: Fri, 7 Jan 2000 18:23:16 +0000 (+0000) Subject: cygwin update (from Eric Fifer ) X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=4fabb5965cb13ba2085b455bf751c89110c43659;p=p5sagit%2Fp5-mst-13.2.git cygwin update (from Eric Fifer ) p4raw-id: //depot/perl@4769 --- diff --git a/Configure b/Configure index 475a8df..4fe41b2 100755 --- a/Configure +++ b/Configure @@ -5908,7 +5908,7 @@ $undef) ;; *) case "$useshrplib" in '') case "$osname" in - svr4*|dgux|dynixptx|esix|powerux|beos) + svr4*|dgux|dynixptx|esix|powerux|beos|cygwin*) dflt=y also='Building a shared libperl is required for dynamic loading to work on your system.' ;; @@ -5978,6 +5978,9 @@ true) linux*) # ld won't link with a bare -lperl otherwise. dflt=libperl.$so ;; + cygwin*) # include version + dflt=`echo libperl$version | sed -e 's/\./_/g'`$lib_ext + ;; *) # Try to guess based on whether libc has major.minor. case "$libc" in *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;; diff --git a/INSTALL b/INSTALL index 1fc85c0..47cb37d 100644 --- a/INSTALL +++ b/INSTALL @@ -721,7 +721,7 @@ You can elect to build a shared libperl by To build a shared libperl, the environment variable controlling shared library search (LD_LIBRARY_PATH in most systems, DYLD_LIBRARY_PATH for NeXTSTEP/OPENSTEP/Rhapsody, LIBRARY_PATH for BeOS, SHLIB_PATH for -HP-UX, LIBPATH for AIX, PATH for cygwin) must be set up to include +HP-UX, LIBPATH for AIX, PATH for Cygwin) must be set up to include the Perl build directory because that's where the shared libperl will be created. Configure arranges makefile to have the correct shared library search settings. diff --git a/MANIFEST b/MANIFEST index 92ff563..d7c3810 100644 --- a/MANIFEST +++ b/MANIFEST @@ -290,12 +290,14 @@ ext/IPC/SysV/README IPC::SysV extension Perl module ext/IPC/SysV/Semaphore.pm IPC::SysV extension Perl module ext/IPC/SysV/SysV.pm IPC::SysV extension Perl module ext/IPC/SysV/SysV.xs IPC::SysV extension Perl module +ext/IPC/SysV/hints/cygwin.pl Hint for IPC::SysV for named architecture ext/IPC/SysV/hints/next_3.pl Hint for IPC::SysV for named architecture ext/IPC/SysV/t/msg.t IPC::SysV extension Perl module ext/IPC/SysV/t/sem.t IPC::SysV extension Perl module ext/NDBM_File/Makefile.PL NDBM extension makefile writer ext/NDBM_File/NDBM_File.pm NDBM extension Perl module ext/NDBM_File/NDBM_File.xs NDBM extension external subroutines +ext/NDBM_File/hints/cygwin.pl Hint for NDBM_File for named architecture ext/NDBM_File/hints/dec_osf.pl Hint for NDBM_File for named architecture ext/NDBM_File/hints/dynixptx.pl Hint for NDBM_File for named architecture ext/NDBM_File/hints/solaris.pl Hint for NDBM_File for named architecture @@ -305,6 +307,7 @@ ext/NDBM_File/typemap NDBM extension interface types ext/ODBM_File/Makefile.PL ODBM extension makefile writer ext/ODBM_File/ODBM_File.pm ODBM extension Perl module ext/ODBM_File/ODBM_File.xs ODBM extension external subroutines +ext/ODBM_File/hints/cygwin.pl Hint for ODBM_File for named architecture ext/ODBM_File/hints/dec_osf.pl Hint for ODBM_File for named architecture ext/ODBM_File/hints/hpux.pl Hint for ODBM_File for named architecture ext/ODBM_File/hints/sco.pl Hint for ODBM_File for named architecture diff --git a/ext/IPC/SysV/hints/cygwin.pl b/ext/IPC/SysV/hints/cygwin.pl new file mode 100644 index 0000000..e1a1dea --- /dev/null +++ b/ext/IPC/SysV/hints/cygwin.pl @@ -0,0 +1,2 @@ +# SysV IPC is an optional Cygwin package +$self->{LIBS} = ['-lcygipc'] diff --git a/ext/NDBM_File/hints/cygwin.pl b/ext/NDBM_File/hints/cygwin.pl new file mode 100644 index 0000000..0a4b762 --- /dev/null +++ b/ext/NDBM_File/hints/cygwin.pl @@ -0,0 +1,2 @@ +# uses GDBM ndbm compatibility feature +$self->{LIBS} = ['-lgdbm']; diff --git a/ext/ODBM_File/hints/cygwin.pl b/ext/ODBM_File/hints/cygwin.pl new file mode 100644 index 0000000..a0d33c8 --- /dev/null +++ b/ext/ODBM_File/hints/cygwin.pl @@ -0,0 +1,2 @@ +# uses GDBM dbm compatibility feature +$self->{LIBS} = ['-lgdbm']; diff --git a/ext/POSIX/Makefile.PL b/ext/POSIX/Makefile.PL index fda7528..15256cf 100644 --- a/ext/POSIX/Makefile.PL +++ b/ext/POSIX/Makefile.PL @@ -1,9 +1,7 @@ use ExtUtils::MakeMaker; WriteMakefile( NAME => 'POSIX', - ($^O eq 'MSWin32' ? () : ($^O =~ /cygwin/ ? () : - (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', diff --git a/hints/cygwin.sh b/hints/cygwin.sh index ba84df4..71c9a83 100644 --- a/hints/cygwin.sh +++ b/hints/cygwin.sh @@ -9,27 +9,30 @@ case "$ldlibpthname" in '') ldlibpthname=PATH ;; esac -# mandatory (overrides defaults) +# mandatory (overrides incorrect defaults) test -z "$cc" && cc='gcc' -if test -z "$libpth" +if test -z "$plibpth" then - libpth=`gcc -print-file-name=libc.a` - libpth=`dirname $libpth` - libpth=`cd $libpth && pwd` + plibpth=`gcc -print-file-name=libc.a` + plibpth=`dirname $plibpth` + plibpth=`cd $plibpth && pwd` fi so='dll' -libs='-lcygwin -lm -lkernel32' +# - eliminate -lc, implied by gcc +libswanted=`echo " $libswanted " | sed -e 's/ c / /g'` +libswanted="$libswanted cygipc cygwin kernel32" ccflags="$ccflags -DCYGWIN" +# - otherwise i686-cygwin archname='cygwin' -cccdlflags=' ' + +# dynamic loading ld='ld2' +# - otherwise -fpic +cccdlflags=' ' # optional(ish) # - perl malloc needs to be unpolluted bincompat5005='undef' -# - build shared libperl.dll -useshrplib='true' -libperl='libperl.a' # strip exe's and dll's #ldflags="$ldflags -s" diff --git a/installman b/installman index 9e27f76..cf5c45d 100755 --- a/installman +++ b/installman @@ -141,7 +141,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' || $^O =~ /cygwin/) { + if ($^O eq 'os2' || $^O eq 'amigaos' || $^O eq 'uwin' || $^O eq 'cygwin') { $manpage =~ s#/#.#g; } else { diff --git a/installperl b/installperl index d1d2995..1bc5a8e 100755 --- a/installperl +++ b/installperl @@ -14,7 +14,7 @@ BEGIN { $Is_VMS = $^O eq 'VMS'; $Is_W32 = $^O eq 'MSWin32'; $Is_OS2 = $^O eq 'os2'; - $Is_Cygwin = $^O =~ /cygwin/i; + $Is_Cygwin = $^O eq 'cygwin'; if ($Is_VMS) { eval 'use VMS::Filespec;' } } diff --git a/lib/Cwd.pm b/lib/Cwd.pm index 8a99da9..ee1bc28 100644 --- a/lib/Cwd.pm +++ b/lib/Cwd.pm @@ -372,7 +372,7 @@ sub _qnx_abs_path { *abs_path = \&_qnx_abs_path; *fast_abs_path = \&_qnx_abs_path; } - elsif ($^O =~ /cygwin/) { + elsif ($^O eq 'cygwin') { *getcwd = \&cwd; *fastgetcwd = \&cwd; *fastcwd = \&cwd; diff --git a/lib/ExtUtils/MakeMaker.pm b/lib/ExtUtils/MakeMaker.pm index 3b51900..0426575 100644 --- a/lib/ExtUtils/MakeMaker.pm +++ b/lib/ExtUtils/MakeMaker.pm @@ -70,7 +70,7 @@ $Is_VMS = $^O eq 'VMS'; $Is_OS2 = $^O eq 'os2'; $Is_Mac = $^O eq 'MacOS'; $Is_Win32 = $^O eq 'MSWin32'; -$Is_Cygwin= $^O =~ /cygwin/i; +$Is_Cygwin= $^O eq 'cygwin'; require ExtUtils::MM_Unix; diff --git a/lib/File/Spec/Unix.pm b/lib/File/Spec/Unix.pm index 87ad643..85df2c2 100644 --- a/lib/File/Spec/Unix.pm +++ b/lib/File/Spec/Unix.pm @@ -41,7 +41,7 @@ ricochet (some scripts depend on it). sub canonpath { my ($self,$path,$reduce_ricochet) = @_; - $path =~ s|/+|/|g unless($^O =~ /cygwin/); # xx////xx -> xx/xx + $path =~ s|/+|/|g unless($^O eq 'cygwin'); # xx////xx -> xx/xx $path =~ s|(/\.)+/|/|g; # xx/././xx -> xx/xx $path =~ s|^(\./)+|| unless $path eq "./"; # ./xx -> xx $path =~ s|^/(\.\./)+|/|; # /../../xx -> xx diff --git a/lib/perl5db.pl b/lib/perl5db.pl index b71e539..d2bd98e 100644 --- a/lib/perl5db.pl +++ b/lib/perl5db.pl @@ -301,7 +301,7 @@ if ($notty) { #require Term::ReadLine; - if ($^O =~ /cygwin/) { + if ($^O eq 'cygwin') { # /dev/tty is binary. use stdin for textmode undef $console; } elsif (-e "/dev/tty") { diff --git a/perlsdio.h b/perlsdio.h index 71a9e75..7afda68 100644 --- a/perlsdio.h +++ b/perlsdio.h @@ -85,11 +85,7 @@ #ifdef HAS_SETLINEBUF #define PerlIO_setlinebuf(f) setlinebuf(f); #else -# ifdef CYGWIN -# define PerlIO_setlinebuf(f) -# else -# define PerlIO_setlinebuf(f) setvbuf(f, Nullch, _IOLBF, 0); -# endif +#define PerlIO_setlinebuf(f) setvbuf(f, Nullch, _IOLBF, 0); #endif /* Now our interface to Configure's FILE_xxx macros */ diff --git a/t/op/magic.t b/t/op/magic.t index fe55521..0d5190a 100755 --- a/t/op/magic.t +++ b/t/op/magic.t @@ -23,7 +23,7 @@ $Is_MSWin32 = $^O eq 'MSWin32'; $Is_VMS = $^O eq 'VMS'; $Is_Dos = $^O eq 'dos'; $Is_os2 = $^O eq 'os2'; -$Is_Cygwin = $^O =~ /cygwin/; +$Is_Cygwin = $^O eq 'cygwin'; $PERL = ($Is_MSWin32 ? '.\perl' : './perl'); print "1..35\n"; diff --git a/t/op/stat.t b/t/op/stat.t index b44617d..37237f0 100755 --- a/t/op/stat.t +++ b/t/op/stat.t @@ -14,7 +14,7 @@ print "1..58\n"; $Is_MSWin32 = $^O eq 'MSWin32'; $Is_Dos = $^O eq 'dos'; $Is_Dosish = $Is_Dos || $^O eq 'os2' || $Is_MSWin32; -$Is_Cygwin = $^O =~ /cygwin/; +$Is_Cygwin = $^O eq 'cygwin'; chop($cwd = ($Is_MSWin32 ? `cd` : `pwd`)); $DEV = `ls -l /dev` unless $Is_Dosish or $Is_Cygwin; diff --git a/utils/perlcc.PL b/utils/perlcc.PL index 24eb0b3..6c1fa45 100644 --- a/utils/perlcc.PL +++ b/utils/perlcc.PL @@ -368,6 +368,8 @@ sub _ccharness my $lperl = $^O eq 'os2' ? '-llibperl' : $^O eq 'MSWin32' ? "$Config{archlibexp}\\CORE\\perl.lib" : '-lperl'; + ($lperl = $Config{libperl}) =~ s/lib(.*)\Q$Config{_a}\E/-l$1/ + if($^O eq 'cygwin'); $optimize = $Config{'optimize'} =~ /-O\d/ ? '' : $Config{'optimize'}; @@ -377,10 +379,10 @@ sub _ccharness my $libs = _getSharedObjects($sourceprog); @$libs = grep { !(/DynaLoader\.a$/ && ($dynaloader = $_)) } @$libs - if($^O =~ /cygwin/i); + if($^O eq 'cygwin'); my $ccflags = $Config{ccflags}; - $ccflags .= ' -DUSEIMPORTLIB' if $Config{osname} =~ /cygwin/i; + $ccflags .= ' -DUSEIMPORTLIB' if $^O eq 'cygwin'; my $cccmd = "$Config{cc} $ccflags $optimize $incdir " ."@args $dynaloader $linkargs @$libs";