Skip to content

Commit

Permalink
Merge 2238db2 into 61d18b6
Browse files Browse the repository at this point in the history
  • Loading branch information
Corion committed May 4, 2021
2 parents 61d18b6 + 2238db2 commit 82331ae
Show file tree
Hide file tree
Showing 31 changed files with 222 additions and 43 deletions.
20 changes: 17 additions & 3 deletions Configure
Expand Up @@ -1429,7 +1429,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 @@ -3469,6 +3469,9 @@ EOM
cygwin*) osname=cygwin
osvers="$3"
;;
msys*) osname=msys
osvers="$3"
;;
*dc.osx) osname=dcosx
osvers="$3"
;;
Expand Down Expand Up @@ -8620,7 +8623,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 @@ -8691,6 +8694,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 @@ -8782,6 +8792,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 @@ -23166,7 +23179,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 @@ -23792,6 +23805,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
Expand Up @@ -64,6 +64,9 @@ true)
cygwin*)
linklibperl="-lperl"
;;
msys*)
linklibperl="-L. -lperl"
;;
sunos*)
linklibperl="-lperl"
;;
Expand Down Expand Up @@ -156,7 +159,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 @@ -467,7 +470,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 @@ -524,9 +527,9 @@ MINIPERLEXP = $(MINIPERL_NONSHR)
LIBPERLEXPORT = perl.exp
!NO!SUBS!

;;
*)
*)
$spitshell >>$Makefile <<'!NO!SUBS!'
MINIPERLEXP = miniperl$(EXE_EXT)
Expand Down Expand Up @@ -926,7 +929,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 @@ -955,6 +958,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.* microperl
-rm -f config.over
Expand Down
2 changes: 2 additions & 0 deletions MANIFEST
Expand Up @@ -3566,6 +3566,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 @@ -4673,6 +4674,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
15 changes: 8 additions & 7 deletions Makefile.SH
Expand Up @@ -320,7 +320,7 @@ STATIC_LDFLAGS = $static_ldflags
LDLIBPTH = $ldlibpth
# Sometimes running an executable is an adventure.
RUN =
RUN =
# When cross-compiling we want to use a (mini)perl built for the host, not the target
HOST_PERL = $hostperl
Expand Down Expand Up @@ -625,7 +625,7 @@ lintflags = \
-erroff=E_STATIC_UNUSED \
-erroff=E_TRUE_LOGICAL_EXPR
.c$(OBJ_EXT):
.c$(OBJ_EXT):
@echo `$(CCCMD)` $(PLDLFLAGS) $*.c
@`$(CCCMD)` $(PLDLFLAGS) $*.c
Expand Down Expand Up @@ -835,9 +835,9 @@ MINIPERLEXP = $(MINIPERL_NONSHR)
LIBPERLEXPORT = perl.exp
!NO!SUBS!

;;
*)
*)
$spitshell >>$Makefile <<'!NO!SUBS!'
MINIPERLEXP = $(MINIPERL_EXE)
Expand All @@ -861,7 +861,7 @@ perl5.def: $(MINIPERLEXP) makedef.pl $(CONFIGPM) $(SYM) $(SYMH) miniperl.map
!NO!SUBS!
;;
cygwin)
cygwin|msys)
$spitshell >>$Makefile <<'!NO!SUBS!'
cygwin.c: cygwin/cygwin.c
$(LNS) cygwin/cygwin.c
Expand Down Expand Up @@ -999,7 +999,7 @@ lib/buildcustomize.pl: $& $(miniperl_objs)
lib/buildcustomize.pl: $& $(miniperl_objs) write ldcustomize.pl
$(CC) -o $(MINIPERL_EXE) $(miniperl_objs libs)
$(LDLIBPTH) ./miniperl$(HOST _EXT) -w -Ilib -Idist/Exporter/lib -MExporter -e '<?>' || sh -c 'echo >&2 Failed to build miniperl. Please run make minitest; exit 1'
$(MINIPERL) -f write_buildcustomize.pl
$(MINIPERL) -f write_buildcustomize.pl
!NO!SUBS!
;;
darwin*)
Expand Down Expand Up @@ -1383,6 +1383,7 @@ _mopup:
-rm -f perl.export perl.dll perl.libexp perl.map perl.def
-rm -f *perl.xok
-rm -f cygwin.c libperl*.def libperl*.dll cygperl*.dll *.exe.stackdump
-rm -f msys-perl*.dll
-rm -f $(PERL_EXE) $(MINIPERL_EXE) $(LIBPERL) libperl.* microperl
-rm -f config.arch config.over $(DTRACE_H)
Expand Down Expand Up @@ -1542,7 +1543,7 @@ case "$targethost" in
'') $spitshell >>$Makefile <<'!NO!SUBS!'
test_prep test-prep: test_prep_pre $(MINIPERL_EXE) $(unidatafiles) $(PERL_EXE) \
$(dynamic_ext) $(TEST_PERL_DLL) runtests $(generated_pods) common_build
cd t && (rm -f $(PERL_EXE); $(LNS) ../$(PERL_EXE) $(PERL_EXE))
cd t && (rm -f $(PERL_EXE) $(LIBPERL); $(LNS) ../$(PERL_EXE) $(PERL_EXE); $(LNS) ../$(LIBPERL) $(LIBPERL))
!NO!SUBS!
;;
Expand Down
8 changes: 6 additions & 2 deletions configpm
Expand Up @@ -459,8 +459,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 <<'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
@@ -0,0 +1,33 @@
package ExtUtils::CBuilder::Platform::msys;

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;
3 changes: 3 additions & 0 deletions ext/DynaLoader/DynaLoader_pm.PL
Expand Up @@ -482,6 +482,9 @@ sub dl_findfile {
<<$^O-eq-cygwin>>
push(@names,"cyg$_.$dl_so") unless m:/:;
<</$^O-eq-cygwin>>
<<$^O-eq-msys>>
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
Expand Up @@ -117,7 +117,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
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
Expand Up @@ -141,7 +141,7 @@ SKIP: {
# should return an empty list, and set ERROR
SKIP: {
skip $^O, 2 if $^O eq 'MSWin32' or $^O eq 'NetWare'
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
@@ -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"],
LIBS => \@LIBS,
XSPROTOARG => '-noprototypes', # XXX remove later?
VERSION_FROM => 'NDBM_File.pm',
);
11 changes: 10 additions & 1 deletion ext/ODBM_File/Makefile.PL
@@ -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
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
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
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" || $^O eq "djgpp" ||
if $^O eq "VMS" || $^O eq "cygwin" || $^O eq "msys" || $^O eq "djgpp" ||
$^O eq "MSWin32" || $^O eq "dos" || $^O eq "interix";
tzset();
my @tzname = tzname();
Expand Down
4 changes: 2 additions & 2 deletions ext/Win32CORE/t/win32core.t
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
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

0 comments on commit 82331ae

Please sign in to comment.