diff options
author | Peter Powell <petpow@saberuk.com> | 2013-08-15 18:55:16 +0100 |
---|---|---|
committer | Peter Powell <petpow@saberuk.com> | 2013-08-16 00:35:34 +0100 |
commit | b86fe63a3a368d304632a3dfcba77048315c9241 (patch) | |
tree | 9e50da1608c399f880a05b20f67a23af76bebd25 /make | |
parent | b7e793d96131e7813fe42984ec3a04254720ad20 (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')
-rw-r--r-- | make/configure.pm | 77 | ||||
-rwxr-xr-x | make/unit-cc.pl | 8 | ||||
-rw-r--r-- | make/utilities.pm | 18 |
3 files changed, 19 insertions, 84 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) = @_; diff --git a/make/unit-cc.pl b/make/unit-cc.pl index 55c491e0d..5b0c50021 100755 --- a/make/unit-cc.pl +++ b/make/unit-cc.pl @@ -52,7 +52,7 @@ exit 1; sub do_static_find { my @flags; for my $file (@ARGV) { - push @flags, getlinkerflags($file); + push @flags, get_property($file, 'LinkerFlags'); } open F, '>', $out; print F join ' ', @flags; @@ -97,9 +97,7 @@ sub do_compile { my $libs = ''; my $binary = $ENV{RUNCC}; if ($do_compile) { - $flags = $ENV{CORECXXFLAGS}; - $flags =~ s/ -pedantic// if nopedantic($file); - $flags .= ' ' . getcompilerflags($file); + $flags = $ENV{CORECXXFLAGS} . ' ' . get_property($file, 'CompileFlags'); if ($file =~ m#(?:^|/)((?:m|cmd)_[^/. ]+)(?:\.cpp|/.*\.cpp)$#) { $flags .= ' -DMODNAME=\\"'.$1.'\\"'; @@ -110,7 +108,7 @@ sub do_compile { if ($do_link) { $flags = join ' ', $flags, $ENV{PICLDFLAGS}; - $libs = join ' ', getlinkerflags($file); + $libs = get_property($file, 'LinkerFlags'); } else { $flags .= ' -c'; } diff --git a/make/utilities.pm b/make/utilities.pm index 245ddd916..9bafe372e 100644 --- a/make/utilities.pm +++ b/make/utilities.pm @@ -108,15 +108,6 @@ sub pkgconfig_get_include_dirs($$$;$) { my ($packagename, $headername, $defaults, $module) = @_; - my $key = "default_includedir_$packagename"; - if (exists $main::config{$key}) - { - print "Locating include directory for package \e[1;32m$packagename\e[0m for module \e[1;32m$module\e[0m... "; - my $ret = $main::config{$key}; - print "\e[1;32m$ret\e[0m (cached)\n"; - return $ret; - } - extend_pkg_path(); print "Locating include directory for package \e[1;32m$packagename\e[0m for module \e[1;32m$module\e[0m... "; @@ -223,15 +214,6 @@ sub pkgconfig_get_lib_dirs($$$;$) { my ($packagename, $libname, $defaults, $module) = @_; - my $key = "default_libdir_$packagename"; - if (exists $main::config{$key}) - { - print "Locating library directory for package \e[1;32m$packagename\e[0m for module \e[1;32m$module\e[0m... "; - my $ret = $main::config{$key}; - print "\e[1;32m$ret\e[0m (cached)\n"; - return $ret; - } - extend_pkg_path(); print "Locating library directory for package \e[1;32m$packagename\e[0m for module \e[1;32m$module\e[0m... "; |