Merge 3.16 (after 3.16.2-rc1) into 7.0
This commit is contained in:
@@ -0,0 +1,55 @@
|
||||
#!/usr/bin/env perl
|
||||
#*************************************************************************
|
||||
# Copyright (c) 2018 UChicago Argonne LLC, as Operator of Argonne
|
||||
# National Laboratory.
|
||||
# EPICS BASE is distributed subject to a Software License Agreement found
|
||||
# in file LICENSE that is included with this distribution.
|
||||
#*************************************************************************
|
||||
|
||||
# Returns an architecture name for EPICS_HOST_ARCH that should be
|
||||
# appropriate for the CPU that this version of Perl was built for.
|
||||
# Any arguments to the program will be appended with separator '-'
|
||||
# to allow flags like -gnu -debug and/or -static to be added.
|
||||
|
||||
# Before Base has been built, use a command like this:
|
||||
# bash$ export EPICS_HOST_ARCH=`perl src/tools/EpicsHostArch.pl`
|
||||
#
|
||||
# If Base is already built, use
|
||||
# tcsh% setenv EPICS_HOST_ARCH `perl base/lib/perl/EpicsHostArch.pl`
|
||||
|
||||
# If your architecture is not recognized by this script, please send
|
||||
# the output from running 'perl --version' to the EPICS tech-talk
|
||||
# mailing list to have it added.
|
||||
|
||||
use strict;
|
||||
|
||||
use Config;
|
||||
use POSIX;
|
||||
|
||||
print join('-', HostArch(), @ARGV), "\n";
|
||||
|
||||
sub HostArch {
|
||||
my $arch = $Config{archname};
|
||||
for ($arch) {
|
||||
return 'linux-x86_64' if m/^x86_64-linux/;
|
||||
return 'linux-x86' if m/^i[3-6]86-linux/;
|
||||
return 'linux-arm' if m/^arm-linux/;
|
||||
return 'windows-x64' if m/^MSWin32-x64/;
|
||||
return 'win32-x86' if m/^MSWin32-x86/;
|
||||
return "cygwin-x86_64" if m/^x86_64-cygwin/;
|
||||
return "cygwin-x86" if m/^i[3-6]86-cygwin/;
|
||||
return 'solaris-sparc' if m/^sun4-solaris/;
|
||||
return 'solaris-x86' if m/^i86pc-solaris/;
|
||||
|
||||
my ($kernel, $hostname, $release, $version, $cpu) = uname;
|
||||
if (m/^darwin/) {
|
||||
for ($cpu) {
|
||||
return 'darwin-x86' if m/^(i386|x86_64)/;
|
||||
return 'darwin-ppc' if m/Power Macintosh/;
|
||||
}
|
||||
die "$0: macOS CPU type '$cpu' not recognized\n";
|
||||
}
|
||||
|
||||
die "$0: Architecture '$arch' not recognized\n";
|
||||
}
|
||||
}
|
||||
@@ -17,6 +17,9 @@ PERL_MODULES += EPICS/Release.pm
|
||||
PERL_MODULES += EPICS/Readfile.pm
|
||||
PERL_MODULES += EPICS/Getopts.pm
|
||||
|
||||
# This goes into lib/perl, not bin/<host>
|
||||
PERL_MODULES += EpicsHostArch.pl
|
||||
|
||||
PERL_SCRIPTS += assembleSnippets.pl
|
||||
PERL_SCRIPTS += convertRelease.pl
|
||||
PERL_SCRIPTS += cvsclean.pl
|
||||
|
||||
@@ -23,18 +23,20 @@ my $tfmt = '%Y-%m-%dT%H:%M';
|
||||
$tfmt .= '%z' unless $^O eq 'MSWin32'; # %z returns zone name on Windows
|
||||
my $now = strftime($tfmt, localtime);
|
||||
|
||||
our ($opt_h, $opt_v, $opt_q);
|
||||
our ($opt_d, $opt_h, $opt_i, $opt_v, $opt_q);
|
||||
our $opt_t = '.';
|
||||
our $opt_N = 'VCSVERSION';
|
||||
our $opt_V = $now;
|
||||
|
||||
my $vcs;
|
||||
|
||||
getopts('hvqt:N:V:') && @ARGV == 1
|
||||
getopts('dhivqt:N:V:') && @ARGV == 1
|
||||
or HELP_MESSAGE();
|
||||
|
||||
my ($outfile) = @ARGV;
|
||||
|
||||
if ($opt_d) { exit 0 } # exit if make is run in dry-run mode
|
||||
|
||||
if (!$vcs && -d "$opt_t/_darcs") { # Darcs
|
||||
print "== Found <top>/_darcs directory\n" if $opt_v;
|
||||
# v1-4-dirty
|
||||
@@ -135,19 +137,36 @@ if (open($DST, '+<', $outfile)) {
|
||||
print "== Current:\n$actual==\n" if $opt_v;
|
||||
|
||||
if ($actual eq $output) {
|
||||
print "Keeping VCS header $outfile\n $opt_N = \"$opt_V\"\n"
|
||||
close $DST;
|
||||
print "Keeping VCS header $outfile\n",
|
||||
" $opt_N = \"$opt_V\"\n"
|
||||
unless $opt_q;
|
||||
exit 0;
|
||||
}
|
||||
print "Updating VCS header $outfile\n $opt_N = \"$opt_V\"\n"
|
||||
unless $opt_q;
|
||||
|
||||
# This regexp must match the #define in $output above:
|
||||
$actual =~ m/#define (\w+) ("[^"]*")\n/;
|
||||
if ($opt_i) {
|
||||
print "Outdated VCS header $outfile\n",
|
||||
" has: $1 = $2\n",
|
||||
" needs: $opt_N = \"$opt_V\"\n";
|
||||
}
|
||||
else {
|
||||
print "Updating VCS header $outfile\n",
|
||||
" from: $1 = $2\n",
|
||||
" to: $opt_N = \"$opt_V\"\n"
|
||||
unless $opt_q;
|
||||
}
|
||||
} else {
|
||||
print "Creating VCS header $outfile\n $opt_N = \"$opt_V\"\n"
|
||||
print "Creating VCS header $outfile\n",
|
||||
" $opt_N = \"$opt_V\"\n"
|
||||
unless $opt_q;
|
||||
open($DST, '>', $outfile)
|
||||
or die "Can't create $outfile: $!\n";
|
||||
}
|
||||
|
||||
if ($opt_i) { exit 1 }; # exit if make is run in "question" mode
|
||||
|
||||
seek $DST, 0, 0;
|
||||
truncate $DST, 0;
|
||||
print $DST $output;
|
||||
@@ -158,9 +177,11 @@ sub HELP_MESSAGE {
|
||||
Usage:
|
||||
genVersionHeader.pl -h
|
||||
Display this Usage message
|
||||
genVersionHeader.pl [-v] [-q] [-t top] [-N NAME] [-V version] output.h";
|
||||
genVersionHeader.pl [-v] [-d] [-q] [-t top] [-N NAME] [-V version] output.h";
|
||||
Generate or update the header file output.h
|
||||
-v - Verbose (debugging messages)
|
||||
-d - Dry-run
|
||||
-i - Question mode
|
||||
-q - Quiet
|
||||
-t top - Path to the module's top (default '$opt_t')
|
||||
-N NAME - Macro name to be defined (default '$opt_N')
|
||||
|
||||
+29
-11
@@ -15,18 +15,43 @@
|
||||
# If the script is given an argument -tap it sets HARNESS_ACTIVE in the
|
||||
# environment to make the epicsUnitTest code generate strict TAP output.
|
||||
|
||||
# Usage: makeTestfile.pl target.t executable
|
||||
# Usage: makeTestfile.pl <target-arch> <host-arch> target.t executable
|
||||
# target-arch and host-arch are EPICS build target names (eg. linux-x86)
|
||||
# target.t is the name of the Perl script to generate
|
||||
# executable is the name of the file the script runs
|
||||
|
||||
use strict;
|
||||
|
||||
my ($target, $exe) = @ARGV;
|
||||
my ($TA, $HA, $target, $exe) = @ARGV;
|
||||
my $exec;
|
||||
|
||||
# Use WINE to run windows target executables on non-windows host
|
||||
if( $TA =~ /^win32-x86/ && $HA !~ /^win/ ) {
|
||||
# new deb. derivatives have wine32 and wine64
|
||||
# older have wine and wine64
|
||||
# prefer wine32 if present
|
||||
my $wine32 = "/usr/bin/wine32";
|
||||
$wine32 = "/usr/bin/wine" if ! -x $wine32;
|
||||
$exec = "$wine32 $exe";
|
||||
} elsif( $TA =~ /^windows-x64/ && $HA !~ /^win/ ) {
|
||||
$exec = "wine64 $exe";
|
||||
|
||||
# Run pc386 test harness w/ QEMU
|
||||
} elsif( $TA =~ /^RTEMS-pc386-qemu$/ ) {
|
||||
$exec = "qemu-system-i386 -m 64 -no-reboot -serial stdio -display none -net nic,model=ne2k_pci -net user,restrict=yes -kernel $exe";
|
||||
|
||||
# Explicitly fail for other RTEMS targets
|
||||
} elsif( $TA =~ /^RTEMS-/ ) {
|
||||
die "$0: I don't know how to create scripts for testing $TA on $HA\n";
|
||||
|
||||
} else {
|
||||
$exec = "./$exe";
|
||||
}
|
||||
|
||||
open(my $OUT, '>', $target) or die "Can't create $target: $!\n";
|
||||
|
||||
print $OUT <<EOF;
|
||||
#!/usr/bin/perl
|
||||
#!/usr/bin/env perl
|
||||
|
||||
use strict;
|
||||
use Cwd 'abs_path';
|
||||
@@ -34,14 +59,7 @@ use Cwd 'abs_path';
|
||||
\$ENV{HARNESS_ACTIVE} = 1 if scalar \@ARGV && shift eq '-tap';
|
||||
\$ENV{TOP} = abs_path(\$ENV{TOP}) if exists \$ENV{TOP};
|
||||
|
||||
if (\$^O eq 'MSWin32') {
|
||||
# Use system on Windows, exec doesn't work the same there and
|
||||
# GNUmake thinks the test has finished as soon as Perl exits.
|
||||
system('./$exe') == 0 or die "Can't run $exe: \$!\\n";
|
||||
}
|
||||
else {
|
||||
exec './$exe' or die "Can't run $exe: \$!\\n";
|
||||
}
|
||||
system('$exec') == 0 or die "Can't run $exec: \$!\\n";
|
||||
EOF
|
||||
|
||||
close $OUT or die "Can't close $target: $!\n";
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/usr/local/bin/perl
|
||||
#!/usr/bin/perl
|
||||
=head1 NAME
|
||||
|
||||
tap-to-junit-xml - convert perl-style TAP test output to JUnit-style XML
|
||||
|
||||
Reference in New Issue
Block a user