The unified diff between revisions [53fb8f53..] and [439c12c5..] is displayed below. It can also be downloaded as a raw diff.
This diff has been restricted to the following files: 'configure.pl'
#
#
# patch "configure.pl"
# from [504427877fcbc5b6b982e22011159af6c24a5bb3]
# to [38686941749f2e7195e0588ad8640feec0fc8737]
#
============================================================
--- configure.pl 504427877fcbc5b6b982e22011159af6c24a5bb3
+++ configure.pl 38686941749f2e7195e0588ad8640feec0fc8737
@@ -9,7 +9,7 @@ my $MINOR_VERSION = 7;
my $MAJOR_VERSION = 1;
my $MINOR_VERSION = 7;
-my $PATCH_VERSION = 5;
+my $PATCH_VERSION = 6;
my $VERSION_STRING = "$MAJOR_VERSION.$MINOR_VERSION.$PATCH_VERSION";
@@ -139,14 +139,14 @@ sub main {
write_pkg_config($config);
+ generate_makefile($config);
+
process_template(File::Spec->catfile($$config{'config-dir'}, 'buildh.in'),
File::Spec->catfile($$config{'build-dir'}, 'build.h'),
$config);
$$config{'includes'}{'build.h'} = $$config{'build-dir'};
copy_include_files($config);
-
- generate_makefile($config);
}
sub where_am_i {
@@ -325,7 +325,7 @@ sub module_info {
}
##################################################
-#
+#
##################################################
sub choose_target {
my ($config) = @_;
@@ -1175,6 +1175,21 @@ sub process_template {
if($contents =~ /@\{var:([a-z_]*)\}/ or
$contents =~ /@\{if:(.*) /) {
+
+ sub summarize {
+ my ($n, $s) = @_;
+
+ $s =~ s/\n/\\n/; # escape newlines
+
+ return $s if(length($s) <= $n);
+
+ return substr($s, 0, 57) . '...';
+ }
+
+ foreach my $key (sort keys %$config) {
+ print with_diagnostic("debug", "In %config:", $key, " -> ", summarize(60, $$config{$key}));
+ }
+
croak("Unbound variable '$1' in $in");
}
@@ -1204,13 +1219,11 @@ sub match_any_of {
}
sub match_any_of {
- my ($line, $hash, $quoted, $any_of) = @_;
+ my ($line, $hash, $quoted, @any_of) = @_;
$quoted = ($quoted eq 'quoted') ? 1 : 0;
- my @match_these = split(/:/, $any_of);
-
- foreach my $what (split(/:/, $any_of)) {
+ foreach my $what (@any_of) {
$$hash{$what} = $1 if(not $quoted and $line =~ /^$what (.*)/);
$$hash{$what} = $1 if($quoted and $line =~ /^$what \"(.*)\"/);
}
@@ -1295,8 +1308,8 @@ sub get_module_info {
$info{'libs'} = {};
while($_ = &$reader()) {
- match_any_of($_, \%info, 'quoted', 'realname:note');
- match_any_of($_, \%info, 'unquoted', 'define:mp_bits:modset:load_on');
+ match_any_of($_, \%info, 'quoted', 'realname', 'note');
+ match_any_of($_, \%info, 'unquoted', 'define', 'mp_bits', 'modset', 'load_on');
read_list($_, $reader, 'arch', list_push(\@{$info{'arch'}}));
read_list($_, $reader, 'cc', list_push(\@{$info{'cc'}}));
@@ -1347,7 +1360,7 @@ sub get_arch_info {
while($_ = &$reader()) {
match_any_of($_, \%info, 'quoted', 'realname');
match_any_of($_, \%info, 'unquoted',
- 'default_submodel:endian:unaligned');
+ 'default_submodel', 'endian', 'unaligned');
read_list($_, $reader, 'aliases', list_push(\@{$info{'aliases'}}));
read_list($_, $reader, 'submodels', list_push(\@{$info{'submodels'}}));
@@ -1373,12 +1386,19 @@ sub get_os_info {
$info{'name'} = $name;
while($_ = &$reader()) {
- match_any_of($_, \%info, 'quoted', 'realname:ar_command');
+ match_any_of($_, \%info, 'quoted', 'realname', 'ar_command');
match_any_of($_, \%info, 'unquoted',
- 'os_type:obj_suffix:so_suffix:static_suffix:' .
- 'install_root:header_dir:lib_dir:doc_dir:' .
- 'ar_needs_ranlib:install_cmd_data:install_cmd_exec');
+ 'os_type',
+ 'obj_suffix',
+ 'so_suffix',
+ 'static_suffix',
+ 'install_root',
+ 'header_dir',
+ 'lib_dir', 'doc_dir',
+ 'ar_needs_ranlib',
+ 'install_cmd_data',
+ 'install_cmd_exec');
read_list($_, $reader, 'aliases', list_push(\@{$info{'aliases'}}));
@@ -1389,7 +1409,8 @@ sub get_os_info {
}
##################################################
-# #
+# Read a file from misc/config/cc and set the values from
+# there into a hash for later reference
##################################################
sub get_cc_info {
my ($name,$file) = @_;
@@ -1400,12 +1421,23 @@ sub get_cc_info {
while($_ = &$reader()) {
match_any_of($_, \%info, 'quoted',
- 'realname:binary_name:' .
- 'compile_option:output_to_option:add_include_dir_option:' .
- 'add_lib_dir_option:add_lib_option:' .
- 'lib_opt_flags:check_opt_flags:' .
- 'lang_flags:warning_flags:so_obj_flags:ar_command:' .
- 'debug_flags:no_debug_flags');
+ 'realname',
+ 'binary_name',
+ 'compile_option',
+ 'output_to_option',
+ 'add_include_dir_option',
+ 'add_lib_dir_option',
+ 'add_lib_option',
+ 'lib_opt_flags',
+ 'check_opt_flags',
+ 'dll_import_flags',
+ 'dll_export_flags',
+ 'lang_flags',
+ 'warning_flags',
+ 'shared_flags',
+ 'ar_command',
+ 'debug_flags',
+ 'no_debug_flags');
match_any_of($_, \%info, 'unquoted', 'makefile_style');
@@ -1461,34 +1493,31 @@ sub file_list {
##################################################
sub file_list {
my ($put_in, $from, $to, %files) = @_;
- my $spaces = 16;
my $list = '';
- my $len = $spaces;
+ my $spaces = 16;
+
foreach (sort keys %files) {
my $file = $_;
- if($len > 60) {
- $list .= "\\\n" . ' 'x$spaces;
- $len = $spaces;
- }
-
$file =~ s/$from/$to/ if(defined($from) and defined($to));
my $dir = $files{$_};
$dir = $put_in if defined $put_in;
if(defined($dir)) {
- $list .= File::Spec->catfile ($dir, $file) . ' ';
- $len += length($file) + length($dir);
+ $list .= File::Spec->catfile ($dir, $file);
}
else {
- $list .= $file . ' ';
- $len += length($file);
+ $list .= $file;
}
+
+ $list .= " \\\n ";
}
+ $list =~ s/\\\n +$//; # remove trailing escape
+
return $list;
}
@@ -1603,7 +1632,7 @@ sub generate_makefile {
(in_array('all', $OPERATING_SYSTEM{$os}{'supports_shared'}) or
in_array($arch, $OPERATING_SYSTEM{$os}{'supports_shared'}))) {
- $$config{'so_obj_flags'} = &$empty_if_nil($ccinfo{'so_obj_flags'});
+ $$config{'shared_flags'} = &$empty_if_nil($ccinfo{'shared_flags'});
$$config{'so_link'} = &$empty_if_nil($ccinfo{'so_link_flags'}{$os});
if($$config{'so_link'} eq '') {
@@ -1611,7 +1640,7 @@ sub generate_makefile {
&$empty_if_nil($ccinfo{'so_link_flags'}{'default'})
}
- if($$config{'so_obj_flags'} eq '' and $$config{'so_link'} eq '') {
+ if($$config{'shared_flags'} eq '' and $$config{'so_link'} eq '') {
$$config{'shared'} = 'no';
warning($$config{'compiler'}, ' has no shared object flags set ',
@@ -1620,7 +1649,7 @@ sub generate_makefile {
}
else {
$$config{'shared'} = 'no';
- $$config{'so_obj_flags'} = '';
+ $$config{'shared_flags'} = '';
$$config{'so_link'} = '';
}
@@ -1638,6 +1667,9 @@ sub generate_makefile {
'so_suffix' => os_info_for($os, 'so_suffix'),
'obj_suffix' => os_info_for($os, 'obj_suffix'),
+ 'dll_export_flags' => $ccinfo{'dll_export_flags'},
+ 'dll_import_flags' => $ccinfo{'dll_import_flags'},
+
'install_cmd_exec' => os_info_for($os, 'install_cmd_exec'),
'install_cmd_data' => os_info_for($os, 'install_cmd_data'),
});
@@ -1783,7 +1815,7 @@ sub guess_compiler
foreach (@CCS)
{
my $bin_name = $COMPILER{$_}{'binary_name'};
- autoconfig("Guessing you want to use $_ as the compiler");
+ autoconfig("Guessing you want to use $_ as the compiler (use --cc to set)");
return $_ if(which($bin_name) ne '');
}
@@ -1799,7 +1831,7 @@ sub guess_os
{
my $os = os_alias($_[0]);
if(defined($OPERATING_SYSTEM{$os})) {
- autoconfig("Guessing your operating system is $os");
+ autoconfig("Guessing your operating system is $os (use --os to set)");
return $os;
}
return undef;
@@ -1833,7 +1865,7 @@ sub guess_cpu
{
my $cpu = guess_cpu_from_this(slurp_file($cpuinfo));
if($cpu) {
- autoconfig("Guessing (based on $cpuinfo) that your CPU is a $cpu");
+ autoconfig("Guessing (based on $cpuinfo) that your CPU is a $cpu (use --arch to set)");
return $cpu;
}
}