summaryrefslogtreecommitdiff
path: root/make/configure.pm
diff options
context:
space:
mode:
authorPeter Powell <petpow@saberuk.com>2013-08-15 18:55:16 +0100
committerPeter Powell <petpow@saberuk.com>2013-08-16 00:35:34 +0100
commitb86fe63a3a368d304632a3dfcba77048315c9241 (patch)
tree9e50da1608c399f880a05b20f67a23af76bebd25 /make/configure.pm
parentb7e793d96131e7813fe42984ec3a04254720ad20 (diff)
Clean up the build system properties and related code.
- Deduplicate getcompilerflags, getdependancies, getlinkerflags. - Remove $NoPedantic (add -Wno-pedantic to $CompileFlags instead). - Remove --enable-freebsd-ports-openssl and all related code (this will be replaced with --no-pkg-config=[name] in the future). - Remove some unused build system properties. - Remove support for caching third party include and library paths (can cause unexpected problems when they change).
Diffstat (limited to 'make/configure.pm')
-rw-r--r--make/configure.pm77
1 files changed, 16 insertions, 61 deletions
diff --git a/make/configure.pm b/make/configure.pm
index 94b847e16..ba67545ac 100644
--- a/make/configure.pm
+++ b/make/configure.pm
@@ -31,7 +31,7 @@ use warnings FATAL => qw(all);
use Exporter 'import';
use POSIX;
use make::utilities;
-our @EXPORT = qw(get_compiler_info find_compiler run_test test_file test_header promptnumeric dumphash getmodules getrevision getcompilerflags getlinkerflags getdependencies nopedantic yesno showhelp promptstring_s module_installed);
+our @EXPORT = qw(get_compiler_info find_compiler run_test test_file test_header promptnumeric dumphash getmodules getrevision get_property yesno showhelp promptstring_s module_installed);
my $revision;
@@ -110,6 +110,21 @@ sub yesno {
return;
}
+sub get_property($$;$)
+{
+ my ($file, $property, $default) = @_;
+ open(MODULE, $file) or return $default;
+ while (<MODULE>) {
+ if ($_ =~ /^\/\* \$(\S+): (.+) \*\/$/) {
+ next unless $1 eq $property;
+ close(MODULE);
+ return translate_functions($2, $file);
+ }
+ }
+ close(MODULE);
+ return defined $default ? $default : '';
+}
+
sub getrevision {
return $revision if defined $revision;
chomp(my $tags = `git describe --tags 2>/dev/null`);
@@ -117,66 +132,6 @@ sub getrevision {
return $revision;
}
-sub getcompilerflags {
- my ($file) = @_;
- open(FLAGS, $file) or return "";
- while (<FLAGS>) {
- if ($_ =~ /^\/\* \$CompileFlags: (.+) \*\/$/) {
- my $x = translate_functions($1, $file);
- next if ($x eq "");
- close(FLAGS);
- return $x;
- }
- }
- close(FLAGS);
- return "";
-}
-
-sub getlinkerflags {
- my ($file) = @_;
- open(FLAGS, $file) or return "";
- while (<FLAGS>) {
- if ($_ =~ /^\/\* \$LinkerFlags: (.+) \*\/$/) {
- my $x = translate_functions($1, $file);
- next if ($x eq "");
- close(FLAGS);
- return $x;
- }
- }
- close(FLAGS);
- return "";
-}
-
-sub getdependencies {
- my ($file) = @_;
- open(FLAGS, $file) or return "";
- while (<FLAGS>) {
- if ($_ =~ /^\/\* \$ModDep: (.+) \*\/$/) {
- my $x = translate_functions($1, $file);
- next if ($x eq "");
- close(FLAGS);
- return $x;
- }
- }
- close(FLAGS);
- return "";
-}
-
-sub nopedantic {
- my ($file) = @_;
- open(FLAGS, $file) or return "";
- while (<FLAGS>) {
- if ($_ =~ /^\/\* \$NoPedantic \*\/$/) {
- my $x = translate_functions($_, $file);
- next if ($x eq "");
- close(FLAGS);
- return 1;
- }
- }
- close(FLAGS);
- return 0;
-}
-
sub getmodules
{
my ($silent) = @_;