Skip to content
20 changes: 17 additions & 3 deletions Configure
Original file line number Diff line number Diff line change
Expand Up @@ -1451,7 +1451,7 @@ elif test -f /kern/cookiejar; then
: MiNT
_exe=""
elif test -d c:/. -o -n "$is_os2" ; then
: OS/2 or cygwin
: OS/2 or cygwin or msys
_exe=".exe"
fi

Expand Down Expand Up @@ -3503,6 +3503,9 @@ EOM
cygwin*) osname=cygwin
osvers="$3"
;;
msys*) osname=msys
osvers="$3"
;;
*dc.osx) osname=dcosx
osvers="$3"
;;
Expand Down Expand Up @@ -8665,7 +8668,7 @@ $undef)
;;
*) case "$useshrplib" in
'') case "$osname" in
svr4*|nonstopux|dgux|dynixptx|esix|powerux|haiku|cygwin*)
svr4*|nonstopux|dgux|dynixptx|esix|powerux|haiku|cygwin*|msys*)
dflt=y
also='Building a shared libperl is required for dynamic loading to work on your system.'
;;
Expand Down Expand Up @@ -8736,6 +8739,13 @@ true)
majonly=cygperl5.$majonly.$so
dflt=$majmin
;;
msys*) # ld links now against the dll directly
majmin="msys-perl5_${patchlevel}_${subversion}.${so}"
majonly=`echo $patchlevel $subversion |
$awk '{printf "%03d%03d", $1, $2}'`
majonly=msys-perl5.$majonly.$so
dflt=$majmin
;;
*) # Try to guess based on whether libc has major.minor.
case "$libc" in
*libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
Expand Down Expand Up @@ -8827,6 +8837,9 @@ if "$useshrplib"; then
cygwin)
# cygwin needs only ldlibpth
;;
msys)
# cygwin needs only ldlibpth
;;
*)
tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
;;
Expand Down Expand Up @@ -23881,7 +23894,7 @@ BeOS BIG_ENDIAN BIT_MSF BSD bsd bsd43 bsd4_2 BSD4_3 bsd4_3 bsd4_4
BSDCOMPAT bsdi BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES bull
byteorder byte_order
c cadmus clang clipper CMU COFF COMPILER_VERSION concurrent
convex cpu CRAY cray CRAYMPP ctix CX_UX CYGWIN
convex cpu CRAY cray CRAYMPP ctix CX_UX MSYS CYGWIN
DECC DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO Dynix DynixPTX
ELF encore EPI EXTENSIONS
FAVOR_BSD FILE_OFFSET_BITS FORTIFY_SOURCE FreeBSD
Expand Down Expand Up @@ -24507,6 +24520,7 @@ for xxx in $xs_extensions ; do
Win32*)
case "$osname" in
cygwin) avail_ext="$avail_ext $xxx" ;;
msys) avail_ext="$avail_ext $xxx" ;;
esac
;;
XS/APItest|xs/apitest)
Expand Down
14 changes: 9 additions & 5 deletions Cross/Makefile-cross-SH
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ true)
cygwin*)
linklibperl="-lperl"
;;
msys*)
linklibperl="-L. -lperl"
;;
sunos*)
linklibperl="-lperl"
;;
Expand Down Expand Up @@ -150,7 +153,7 @@ extra_dep=''
for f in $dynamic_ext; do
: the dependency named here will never exist
base=`echo "$f" | sed 's/.*\///'`
this_target="lib/auto/$f/$base.$dlext"
this_target="lib/auto/$f/$base.$dlext"
dynamic_list="$dynamic_list $this_target"

: Parallel makes reveal that we have some interdependencies
Expand Down Expand Up @@ -461,7 +464,7 @@ perlmain.c: miniperlmain.c config.sh $(FIRSTMAKEFILE)

!NO!SUBS!
case "$osname" in
cygwin)
cygwin | msys)
;; # Let cygwin/Makefile.SHs do its work.
*)
$spitshell >>$Makefile <<'!NO!SUBS!'
Expand Down Expand Up @@ -518,9 +521,9 @@ MINIPERLEXP = $(MINIPERL_NONSHR)
LIBPERLEXPORT = perl.exp

!NO!SUBS!

;;
*)
*)
$spitshell >>$Makefile <<'!NO!SUBS!'
MINIPERLEXP = miniperl$(EXE_EXT)

Expand Down Expand Up @@ -912,7 +915,7 @@ printconfig:
realclean _realcleaner clobber _clobber \
distclean veryclean _verycleaner

clean: _tidy _mopup
clean: _tidy _mopup

realclean: _realcleaner _mopup
@echo "Note that '$(MAKE) realclean' does not delete config.sh or Policy.sh"
Expand Down Expand Up @@ -941,6 +944,7 @@ _mopup:
-rm -f perl.pixie lib*.so.perl.pixie lib*.so.Addrs
-rm -f perl.Addrs perl.Counts t/perl.Addrs t/perl.Counts *perl.xok
-rm -f cygwin.c libperl*.def libperl*.dll cygperl*.dll *.exe.stackdump
-rm -f msys-perl*.dll
-rm -f perl$(EXE_EXT) miniperl$(EXE_EXT) $(LIBPERL) libperl.*
-rm -f config.over

Expand Down
2 changes: 2 additions & 0 deletions MANIFEST
Original file line number Diff line number Diff line change
Expand Up @@ -4124,6 +4124,7 @@ dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/android.pm CBuilder method
dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/cygwin.pm CBuilder methods for cygwin
dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/darwin.pm CBuilder methods for darwin
dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/dec_osf.pm CBuilder methods for OSF
dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/msys.pm CBuilder methods for Msys
dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/os2.pm CBuilder methods for OS/2
dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/Unix.pm CBuilder methods for Unix
dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/VMS.pm CBuilder methods for VMS
Expand Down Expand Up @@ -5263,6 +5264,7 @@ hints/minix.sh Hints for named architecture
hints/mips.sh Hints for named architecture
hints/mirbsd.sh Hints for named architecture
hints/mpc.sh Hints for named architecture
hints/msys.sh Hints for named architecture
hints/ncr_tower.sh Hints for named architecture
hints/netbsd.sh Hints for named architecture
hints/newsos4.sh Hints for named architecture
Expand Down
8 changes: 6 additions & 2 deletions configpm
Original file line number Diff line number Diff line change
Expand Up @@ -464,8 +464,12 @@ EOT

my $osname = fetch_string({}, 'osname');
my $from = $osname eq 'VMS' ? 'PERLSHR image' : 'binary (from libperl)';
my $env_cygwin = $osname eq 'cygwin'
? 'push @env, "CYGWIN=\"$ENV{CYGWIN}\"" if $ENV{CYGWIN};' . "\n" : "";
my $env_cygwin = '';
if( $^O eq 'cygwin' ) {
$env_cygwin = 'push @env, "CYGWIN=\"$ENV{CYGWIN}\"" if $ENV{CYGWIN};' . "\n";
} elsif( $^O eq 'msys' ) {
$env_cygwin = 'push @env, "MSYS=\"$ENV{MSYS}\"" if $ENV{MSYS};' . "\n";
};

$heavy_txt .= sprintf uncomment <<'ENDOFBEG', $osname, $osname, $from, $osname, $env_cygwin;
# # This file was created by configpm when Perl was built. Any changes
Expand Down
33 changes: 33 additions & 0 deletions dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/msys.pm
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
package ExtUtils::CBuilder::Platform::msys;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this is exactly the same as ExtUtils::CBuilder::Platform::cygwin, shouldn't it just inherit from that instead?


use warnings;
use strict;
use File::Spec;
use ExtUtils::CBuilder::Platform::Unix;

our $VERSION = '0.280234'; # VERSION
our @ISA = qw(ExtUtils::CBuilder::Platform::Unix);

# TODO: If a specific exe_file name is requested, if the exe created
# doesn't have that name, we might want to rename it. Apparently asking
# for an exe of "foo" might result in "foo.exe". Alternatively, we should
# make sure the return value is correctly "foo.exe".
# C.f http://rt.cpan.org/Public/Bug/Display.html?id=41003
sub link_executable {
my $self = shift;
return $self->SUPER::link_executable(@_);
}

sub link {
my ($self, %args) = @_;

my $lib = $self->{config}{useshrplib} ? 'libperl.dll.a' : 'libperl.a';
$args{extra_linker_flags} = [
File::Spec->catfile($self->perl_inc(), $lib),
$self->split_like_shell($args{extra_linker_flags})
];

return $self->SUPER::link(%args);
}

1;
5 changes: 4 additions & 1 deletion ext/DynaLoader/DynaLoader_pm.PL
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ package DynaLoader;
# Tim.Bunce@ig.co.uk, August 1994

BEGIN {
our $VERSION = '1.54';
our $VERSION = '1.55';
}

# Note: in almost any other piece of code "our" would have been a better
Expand Down Expand Up @@ -484,6 +484,9 @@ sub dl_findfile {
<<$^O-eq-cygwin>>
push(@names,"cyg$_.$dl_so") unless m:/:;
<</$^O-eq-cygwin>>
<<$^O-eq-msys>>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This commit should also update the version to '1.55'

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

push(@names,"msys-$_.$dl_so") unless m:/:;
<</$^O-eq-msys>>
push(@names,"lib$_.$dl_so") unless m:/:;
push(@names, $_);
}
Expand Down
2 changes: 1 addition & 1 deletion ext/DynaLoader/t/DynaLoader.t
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ SKIP: {
# (not at least by that name) that the dl_findfile()
# could find.
skip( "dl_findfile test not appropriate on $^O", 1 )
if $^O =~ /(win32|vms|openbsd|bitrig|cygwin|vos|os390)/i;
if $^O =~ /(win32|vms|openbsd|bitrig|cygwin|msys|vos|os390)/i;
# Play safe and only try this test if this system
# looks pretty much Unix-like.
skip( "dl_findfile test not appropriate on $^O", 1 )
Expand Down
2 changes: 1 addition & 1 deletion ext/File-Find/t/find.t
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ BEGIN {
}
$SIG{'__WARN__'} = sub { $warn_msg = $_[0]; warn "# $_[0]"; };

if ($^O eq 'MSWin32' || $^O eq 'cygwin' || $^O eq 'VMS') {
if ($^O eq 'MSWin32' || $^O eq 'cygwin' || $^O eq 'msys' || $^O eq 'VMS') {
# This is a hack - at present File::Find does not produce native names
# on Win32 or VMS, so force File::Spec to use Unix names.
# must be set *before* importing File::Find
Expand Down
2 changes: 1 addition & 1 deletion ext/File-Glob/t/basic.t
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ SKIP: {
# should return an empty list, and set ERROR
SKIP: {
skip $^O, 2 if $^O eq 'MSWin32'
or $^O eq 'os2' or $^O eq 'VMS' or $^O eq 'cygwin';
or $^O eq 'os2' or $^O eq 'VMS' or $^O eq 'cygwin' or $^O eq 'msys';
skip "AFS", 2 if Cwd::cwd() =~ m#^$Config{'afsroot'}#s;
skip "running as root", 2 if not $>;

Expand Down
11 changes: 10 additions & 1 deletion ext/NDBM_File/Makefile.PL
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
use strict;
use ExtUtils::MakeMaker;

our @LIBS;
if( $^O eq 'msys' ) {
@LIBS = ("-lgdbm -lgdbm_compat");
} else {
@LIBS = ("-L/usr/local/lib -lndbm", "-ldbm -lucb");
};

WriteMakefile(
NAME=> 'NDBM_File',
LIBS => ["-L/usr/local/lib -lndbm", "-ldbm -lucb"],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cygwin uses a hints/ file for this, msys should probably do exactly the same

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suspect this entire patch isn't needed, can we double check that?

LIBS => \@LIBS,
XSPROTOARG => '-noprototypes', # XXX remove later?
VERSION_FROM => 'NDBM_File.pm',
);
11 changes: 10 additions & 1 deletion ext/ODBM_File/Makefile.PL
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
use strict;
use ExtUtils::MakeMaker;

our @LIBS;
if( $^O eq 'msys' ) {
@LIBS = ("-lgdbm -lgdbm_compat");
} else {
@LIBS = ("-ldbm -lucb");
};

WriteMakefile(
NAME => 'ODBM_File',
LIBS => ["-ldbm -lucb"],
LIBS => \@LIBS,
XSPROTOARG => '-noprototypes', # XXX remove later?
VERSION_FROM => 'ODBM_File.pm',
);
2 changes: 1 addition & 1 deletion ext/POSIX/Makefile.PL
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ if ($^O eq 'solaris') {
if ($^O eq 'aix' && $Config{uselongdouble}) {
push @libs, qw(c128);
}
if ($^O eq 'cygwin' && $Config{usequadmath}) {
if (($^O eq 'cygwin' || $^O eq 'msys') && $Config{usequadmath}) {
push @libs, qw(quadmath);
}
WriteMakefile(
Expand Down
2 changes: 1 addition & 1 deletion ext/POSIX/t/sysconf.t
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ END {
}

SKIP: {
if($^O eq 'cygwin') {
if($^O eq 'cygwin' or $^O eq 'msys') {
pop @sys_consts;
skip("No _SC_TZNAME_MAX on Cygwin", 1);
}
Expand Down
2 changes: 1 addition & 1 deletion ext/POSIX/t/time.t
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ SKIP: {
# actually do anything. Cygwin works in some places, but not others. The
# other Win32's below are guesses.
skip "No tzset()", 2
if $^O eq "VMS" || $^O eq "cygwin" ||
if $^O eq "VMS" || $^O eq "cygwin" || $^O eq "msys" ||
$^O eq "MSWin32" || $^O eq "interix";
tzset();
my @tzname = tzname();
Expand Down
4 changes: 2 additions & 2 deletions ext/Win32CORE/t/win32core.t
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ ok(eval { Win32::GetLastError(); 1 }, 'GetLastError() works on the first call');
my $errno = 0 + $!;
my $sys_errno = 0 + $^E;
SKIP: {
$^O eq "cygwin"
and skip q($^E isn't useful on cygwin), 1;
$^O eq "cygwin" || $^O eq 'msys'
and skip q($^E isn't useful on cygwin/msys), 1;
# [perl #42925] - Loading Win32::GetLastError() via the forwarder function
# should not affect the last error being retrieved
is($sys_errno, 42, '$^E is preserved across Win32 autoload');
Expand Down
2 changes: 1 addition & 1 deletion ext/XS-APItest/t/call_checker.t
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use XS::APItest;

{
local $TODO = "[perl #78502] function pointers don't match on cygwin"
if $^O eq "cygwin";
if ($^O eq "cygwin" || $^O eq "msys");
ok( eval { XS::APItest::test_cv_getset_call_checker(); 1 },
"test_cv_getset_call_checker() works as expected")
or diag $@;
Expand Down
Loading