summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xConfigure5
-rw-r--r--INSTALL2
-rw-r--r--MANIFEST3
-rw-r--r--ext/IPC/SysV/hints/cygwin.pl2
-rw-r--r--ext/NDBM_File/hints/cygwin.pl2
-rw-r--r--ext/ODBM_File/hints/cygwin.pl2
-rw-r--r--ext/POSIX/Makefile.PL4
-rw-r--r--hints/cygwin.sh23
-rwxr-xr-xinstallman2
-rwxr-xr-xinstallperl2
-rw-r--r--lib/Cwd.pm2
-rw-r--r--lib/ExtUtils/MakeMaker.pm2
-rw-r--r--lib/File/Spec/Unix.pm2
-rw-r--r--lib/perl5db.pl2
-rw-r--r--perlsdio.h6
-rwxr-xr-xt/op/magic.t2
-rwxr-xr-xt/op/stat.t2
-rw-r--r--utils/perlcc.PL6
18 files changed, 41 insertions, 30 deletions
diff --git a/Configure b/Configure
index 475a8dfcc5..4fe41b2b33 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 1fc85c09c5..47cb37de40 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 92ff563ad4..d7c381039a 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 0000000000..e1a1dea217
--- /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 0000000000..0a4b7628a4
--- /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 0000000000..a0d33c8807
--- /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 fda7528857..15256cf198 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 ba84df49d5..71c9a8334e 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 9e27f762b0..cf5c45d3a7 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 d1d299559c..1bc5a8e9d2 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 8a99da975a..ee1bc28367 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 3b51900651..0426575f87 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 87ad643fe2..85df2c2d3b 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 b71e539363..d2bd98e654 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 71a9e752cd..7afda68191 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 fe55521814..0d5190a2bb 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 b44617d2b6..37237f0bdf 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 24eb0b30c3..6c1fa45879 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";