summaryrefslogtreecommitdiff
path: root/make
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2008-01-17 21:36:02 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2008-01-17 21:36:02 +0000
commit207af6fb2fede5788d2e99809b5b36d11aefa706 (patch)
treed95334bd048c41c7ddb0f29b8b7bee735b3776e3 /make
parent89fffcee883763cff9d8d44605a54db1ec22feed (diff)
Aquanight's configure strict/fatal warnings patch
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8731 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'make')
-rw-r--r--make/configure.pm23
-rw-r--r--make/gnutlscert.pm5
-rw-r--r--make/opensslcert.pm5
-rw-r--r--make/utilities.pm50
4 files changed, 49 insertions, 34 deletions
diff --git a/make/configure.pm b/make/configure.pm
index d244a49d5..538dffcc8 100644
--- a/make/configure.pm
+++ b/make/configure.pm
@@ -14,17 +14,20 @@ package make::configure;
require 5.8.0;
+use strict;
+use warnings FATAL => qw(all);
+
use Exporter 'import';
use POSIX;
use make::utilities;
-@EXPORT = qw(promptnumeric dumphash is_dir getmodules getrevision getcompilerflags getlinkerflags getdependencies nopedantic resolve_directory yesno showhelp promptstring_s);
+our @EXPORT = qw(promptnumeric dumphash is_dir getmodules getrevision getcompilerflags getlinkerflags getdependencies nopedantic resolve_directory yesno showhelp promptstring_s);
my $no_svn = 0;
sub yesno {
my ($flag,$prompt) = @_;
print "$prompt [\033[1;32m$main::config{$flag}\033[0m] -> ";
- chomp($tmp = <STDIN>);
+ chomp(my $tmp = <STDIN>);
if ($tmp eq "") { $tmp = $main::config{$flag} }
if (($tmp eq "") || ($tmp =~ /^y/i))
{
@@ -57,7 +60,7 @@ sub getrevision {
if ($data eq "")
{
$no_svn = 1;
- $rev = "0";
+ my $rev = "0";
return $rev;
}
$data =~ /Revision: (\d+)/;
@@ -79,7 +82,7 @@ sub getcompilerflags {
}
}
close(FLAGS);
- return undef;
+ return "";
}
sub getlinkerflags {
@@ -92,7 +95,7 @@ sub getlinkerflags {
}
}
close(FLAGS);
- return undef;
+ return "";
}
sub getdependencies {
@@ -105,7 +108,7 @@ sub getdependencies {
}
}
close(FLAGS);
- return undef;
+ return "";
}
sub nopedantic {
@@ -126,11 +129,11 @@ sub getmodules
my $i = 0;
print "Detecting modules ";
opendir(DIRHANDLE, "src/modules");
- foreach $name (sort readdir(DIRHANDLE))
+ foreach my $name (sort readdir(DIRHANDLE))
{
if ($name =~ /^m_(.+)\.cpp$/)
{
- $mod = $1;
+ my $mod = $1;
$main::modlist[$i++] = $mod;
print ".";
}
@@ -147,7 +150,7 @@ sub promptnumeric($$)
{
print "Please enter the maximum $prompt?\n";
print "[\033[1;32m$main::config{$configitem}\033[0m] -> ";
- chomp($var = <STDIN>);
+ chomp(my $var = <STDIN>);
if ($var eq "")
{
$var = $main::config{$configitem};
@@ -218,7 +221,7 @@ sub is_dir
sub showhelp
{
- chomp($PWD = `pwd`);
+ chomp(my $PWD = `pwd`);
print "Usage: configure [options]
*** NOTE: NON-INTERACTIVE CONFIGURE IS *NOT* SUPPORTED BY THE ***
diff --git a/make/gnutlscert.pm b/make/gnutlscert.pm
index 77328e233..1ab70420d 100644
--- a/make/gnutlscert.pm
+++ b/make/gnutlscert.pm
@@ -2,9 +2,12 @@ package make::gnutlscert;
require 5.8.0;
+use strict;
+use warnings FATAL => qw(all);
+
use Exporter 'import';
use make::configure;
-@EXPORT = qw(make_gnutls_cert);
+our @EXPORT = qw(make_gnutls_cert);
sub make_gnutls_cert()
diff --git a/make/opensslcert.pm b/make/opensslcert.pm
index 327b80378..1cadd9f82 100644
--- a/make/opensslcert.pm
+++ b/make/opensslcert.pm
@@ -2,9 +2,12 @@ package make::opensslcert;
require 5.8.0;
+use strict;
+use warnings FATAL => qw(all);
+
use Exporter 'import';
use make::configure;
-@EXPORT = qw(make_openssl_cert);
+our @EXPORT = qw(make_openssl_cert);
sub make_openssl_cert()
diff --git a/make/utilities.pm b/make/utilities.pm
index c3909c1e4..59c2905cb 100644
--- a/make/utilities.pm
+++ b/make/utilities.pm
@@ -14,10 +14,14 @@ package make::utilities;
require 5.8.0;
+use strict;
+use warnings FATAL => qw(all);
+
use Exporter 'import';
use POSIX;
use Getopt::Long;
-@EXPORT = qw(make_rpath pkgconfig_get_include_dirs pkgconfig_get_lib_dirs pkgconfig_check_version translate_functions promptstring vcheck);
+use Fcntl;
+our @EXPORT = qw(make_rpath pkgconfig_get_include_dirs pkgconfig_get_lib_dirs pkgconfig_check_version translate_functions promptstring vcheck);
# Parse the output of a *_config program,
# such as pcre_config, take out the -L
@@ -33,7 +37,7 @@ sub promptstring($$$$$)
my $var;
if (!$main::interactive)
{
- undef $opt_commandlineswitch;
+ my $opt_commandlineswitch;
GetOptions ("$commandlineswitch=s" => \$opt_commandlineswitch);
if (defined $opt_commandlineswitch)
{
@@ -61,11 +65,11 @@ sub promptstring($$$$$)
sub make_rpath($;$)
{
my ($executable, $module) = @_;
- chomp($data = `$executable`);
+ chomp(my $data = `$executable`);
my $output = "";
while ($data =~ /-L(\S+)/)
{
- $libpath = $1;
+ my $libpath = $1;
if (!exists $already_added{$libpath})
{
print "Adding extra library path to \033[1;32m$module\033[0m ... \033[1;32m$libpath\033[0m\n";
@@ -97,7 +101,7 @@ sub pkgconfig_get_include_dirs($$$;$)
if (exists $main::config{$key})
{
print "Locating include directory for package \033[1;32m$packagename\033[0m for module \033[1;32m$module\033[0m... ";
- $ret = $main::config{$key};
+ my $ret = $main::config{$key};
print "\033[1;32m$ret\033[0m (cached)\n";
return $ret;
}
@@ -106,14 +110,15 @@ sub pkgconfig_get_include_dirs($$$;$)
print "Locating include directory for package \033[1;32m$packagename\033[0m for module \033[1;32m$module\033[0m... ";
- $v = `pkg-config --modversion $packagename 2>/dev/null`;
- $ret = `pkg-config --cflags $packagename 2>/dev/null`;
+ my $v = `pkg-config --modversion $packagename 2>/dev/null`;
+ my $ret = `pkg-config --cflags $packagename 2>/dev/null`;
+ my $foo = "";
if ((!defined $v) || ($v eq ""))
{
$foo = `locate "$headername" | head -n 1`;
$foo =~ /(.+)\Q$headername\E/;
- $find = $1;
+ my $find = $1;
chomp($find);
if ((defined $find) && ($find ne "") && ($find ne $packagename))
{
@@ -167,17 +172,17 @@ sub pkgconfig_get_include_dirs($$$;$)
sub vcheck($$)
{
my ($version1, $version2) = @_;
- $version1 =~ s/\-r(\d+)/\.\1/g; # minor revs/patchlevels
- $version2 =~ s/\-r(\d+)/\.\1/g;
- $version1 =~ s/p(\d+)/\.\1/g;
- $version2 =~ s/p(\d+)/\.\1/g;
+ $version1 =~ s/\-r(\d+)/\.$1/g; # minor revs/patchlevels
+ $version2 =~ s/\-r(\d+)/\.$1/g;
+ $version1 =~ s/p(\d+)/\.$1/g;
+ $version2 =~ s/p(\d+)/\.$1/g;
$version1 =~ s/\-//g;
$version2 =~ s/\-//g;
- $version1 =~ s/a-z//g;
- $version2 =~ s/a-z//g;
+ $version1 =~ s/[a-z]//g;
+ $version2 =~ s/[a-z]//g;
my @v1 = split('\.', $version1);
my @v2 = split('\.', $version2);
- for ($curr = 0; $curr < scalar(@v1); $curr++)
+ for (my $curr = 0; $curr < scalar(@v1); $curr++)
{
if ($v1[$curr] < $v2[$curr])
{
@@ -195,7 +200,7 @@ sub pkgconfig_check_version($$;$)
print "Checking version of package \033[1;32m$packagename\033[0m is >= \033[1;32m$version\033[0m... ";
- $v = `pkg-config --modversion $packagename 2>/dev/null`;
+ my $v = `pkg-config --modversion $packagename 2>/dev/null`;
if (defined $v)
{
chomp($v);
@@ -228,7 +233,7 @@ sub pkgconfig_get_lib_dirs($$$;$)
if (exists $main::config{$key})
{
print "Locating library directory for package \033[1;32m$packagename\033[0m for module \033[1;32m$module\033[0m... ";
- $ret = $main::config{$key};
+ my $ret = $main::config{$key};
print "\033[1;32m$ret\033[0m (cached)\n";
return $ret;
}
@@ -237,14 +242,15 @@ sub pkgconfig_get_lib_dirs($$$;$)
print "Locating library directory for package \033[1;32m$packagename\033[0m for module \033[1;32m$module\033[0m... ";
- $v = `pkg-config --modversion $packagename 2>/dev/null`;
- $ret = `pkg-config --libs $packagename 2>/dev/null`;
+ my $v = `pkg-config --modversion $packagename 2>/dev/null`;
+ my $ret = `pkg-config --libs $packagename 2>/dev/null`;
+ my $foo = "";
if ((!defined $v) || ($v eq ""))
{
$foo = `locate "$libname" | head -n 1`;
$foo =~ /(.+)\Q$libname\E/;
- $find = $1;
+ my $find = $1;
chomp($find);
if ((defined $find) && ($find ne "") && ($find ne $packagename))
{
@@ -323,7 +329,7 @@ sub translate_functions($$)
}
while ($line =~ /execruntime\("(.+?)"\)/)
{
- $line =~ s/execruntime\("(.+?)"\)/`\1`/;
+ $line =~ s/execruntime\("(.+?)"\)/`$1`/;
}
while ($line =~ /eval\("(.+?)"\)/)
{
@@ -378,7 +384,7 @@ sub translate_functions($$)
};
if ($@)
{
- $err = $@;
+ my $err = $@;
$err =~ s/at .+? line \d+.*//g;
print "\n\nConfiguration failed. The following error occured:\n\n$err\n";
exit;