You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spamassassin.apache.org by km...@apache.org on 2018/02/05 06:20:30 UTC
svn commit: r1823127 - in /spamassassin/trunk: Makefile.PL
build/preprocessor sa-compile.raw
Author: kmcgrail
Date: Mon Feb 5 06:20:30 2018
New Revision: 1823127
URL: http://svn.apache.org/viewvc?rev=1823127&view=rev
Log:
Bug 7481 - Adding build time specification of re2c binary
Modified:
spamassassin/trunk/Makefile.PL
spamassassin/trunk/build/preprocessor
spamassassin/trunk/sa-compile.raw
Modified: spamassassin/trunk/Makefile.PL
URL: http://svn.apache.org/viewvc/spamassassin/trunk/Makefile.PL?rev=1823127&r1=1823126&r2=1823127&view=diff
==============================================================================
--- spamassassin/trunk/Makefile.PL (original)
+++ spamassassin/trunk/Makefile.PL Mon Feb 5 06:20:30 2018
@@ -67,6 +67,8 @@ my @ATT_KEYS = (
'SITELOCALSTATEDIR',
'VENDORLOCALSTATEDIR',
+ 'RE2C_BIN', # hard code the path for re2c if possible
+
'PERL_BIN', # Sets the Perl interpreter used by the scripts.
'PERL_WARN', # Can be used to disable warnings in the scripts
'PERL_TAINT', # " " " " " taint mode for the scripts (DON'T)
@@ -111,6 +113,7 @@ my %opt = (
'enable_ssl' => undef,
'contact_address' => undef,
'destdir' => undef,
+ 're2c_bin' => 're2c',
);
ARGV: foreach (@ARGV) {
foreach my $key (keys %opt) {
@@ -905,6 +908,7 @@ sub MY::constants {
{
set_macro('SYSCONFDIR', "") unless get_macro('SYSCONFDIR');
set_macro('LOCALSTATEDIR', "") unless get_macro('LOCALSTATEDIR');
+ set_macro('RE2C_BIN', $opt{'re2c_bin'});
# Determine the correct settings for each repository...
foreach my $r (@REPOSITORIES) {
@@ -965,6 +969,7 @@ sub MY::constants {
push(@code, macro_def('PREPROCESS'));
push(@code, macro_def('CONFIGURE'));
push(@code, macro_def('SYMLINK'));
+ push(@code, macro_def('RE2C_BIN'));
}
# Set some additional helper/shortcut macros; the B_FOO are the ones which
@@ -1033,7 +1038,8 @@ FIXVARS = -Mvars \
-DLOCAL_RULES_DIR="$(I_CONFDIR)" \
-DLOCAL_STATE_DIR="$(I_LOCALSTATEDIR)" \
-DINSTALLSITELIB="$(I_LIBDIR)" \
- -DCONTACT_ADDRESS="$(CONTACT_ADDRESS)"
+ -DCONTACT_ADDRESS="$(CONTACT_ADDRESS)" \
+ -DRE2C_BIN="$(RE2C_BIN)"
FIXBANG = -Msharpbang \
-Mconditional \
Modified: spamassassin/trunk/build/preprocessor
URL: http://svn.apache.org/viewvc/spamassassin/trunk/build/preprocessor?rev=1823127&r1=1823126&r2=1823127&view=diff
==============================================================================
--- spamassassin/trunk/build/preprocessor (original)
+++ spamassassin/trunk/build/preprocessor Mon Feb 5 06:20:30 2018
@@ -69,7 +69,7 @@ foreach (keys %ENV) {
foreach (@ARGV) {
if (/^-M([a-z]+)$/) { $modules{$1} = 1; }
- elsif (/^-D([A-Z_]+)=(.*)$/) { $defines{$1} = $2; }
+ elsif (/^-D([A-Z0-9_]+)=(.*)$/) { $defines{$1} = $2; }
elsif (/^-D([^=]+)$/) { read_defs($1); }
elsif (/^-i(.+)$/) { $infile = $1; }
elsif (/^-o(.+)$/) { $outfile = $1; }
Modified: spamassassin/trunk/sa-compile.raw
URL: http://svn.apache.org/viewvc/spamassassin/trunk/sa-compile.raw?rev=1823127&r1=1823126&r2=1823127&view=diff
==============================================================================
--- spamassassin/trunk/sa-compile.raw (original)
+++ spamassassin/trunk/sa-compile.raw Mon Feb 5 06:20:30 2018
@@ -25,6 +25,7 @@ my $PREFIX = '@@PREFIX@@';
my $DEF_RULES_DIR = '@@DEF_RULES_DIR@@'; # substituted at 'make' time
my $LOCAL_RULES_DIR = '@@LOCAL_RULES_DIR@@'; # substituted at 'make' time
my $LOCAL_STATE_DIR = '@@LOCAL_STATE_DIR@@'; # substituted at 'make' time
+my $RE2C_BIN = '@@RE2C_BIN@@'; # substituted at 'make' time
use lib '@@INSTALLSITELIB@@'; # substituted at 'make' time
use Errno qw(EBADF);
@@ -108,8 +109,8 @@ if ($@) {
or die "error writing: $!";
exit 1;
}
-unless (qx(re2c -V)) {
- print "$0 requires re2c for proper operation.\n"
+unless (qx($RE2C_BIN -V)) {
+ print "$0 requires $RE2C_BIN for proper operation.\n"
or die "error writing: $!";
exit 1;
}
@@ -451,13 +452,13 @@ EOT
}
for (1..$numscans) {
- my $cmd = "re2c -i -b -o scanner$_.c scanner$_.re";
+ my $cmd = "$RE2C_BIN -i -b -o scanner$_.c scanner$_.re";
if (!run($cmd)) {
# this must be fatal; it can result in corrupt output modules missing
# scannerN() functions
my $cwd = `pwd`; chop $cwd;
die "'$cmd' failed, dying!\n".
- "Have you got a sufficiently-recent version of re2c?\n".
+ "Have you got a sufficiently-recent version of $RE2C_BIN?\n".
"see $cwd/scanner$_.re\n";
}
}