Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

[GH #867] Provide icu_version config value

icu4.4 ships with an -Werror=strict-prototypes incompatible
header file. Currently we disable this warning for  src/string/encoding/shared.c
but we should rather check which icu versions ships this header, and change the
Configure logic (and order) to strip -Werror=strict-prototypes only with a bad icu_version
  • Loading branch information...
commit 619aa95c5f9e7ae15e424f7081e90311376f4e4d 1 parent 1cc9caa
@rurban rurban authored
Showing with 10 additions and 2 deletions.
  1. +10 −2 config/auto/icu.pm
View
12 config/auto/icu.pm
@@ -39,6 +39,7 @@ sub _init {
$data{icuconfig_default} = q{icu-config};
$data{icu_headers} = [ qw(ucnv.h utypes.h uchar.h) ];
$data{icu_shared_pattern} = qr/-licui18n\w*/;
+ $data{icu_version} = q{};
return \%data;
}
@@ -81,6 +82,7 @@ sub runstep {
my $icuheaders = (defined $icuheaders_opt)
? $icuheaders_opt
: undef;
+ my $icuversion;
# $without_opt holds user's command-line value for --without-icu=?
# If it's a true value, there's no point in going further. We set the
@@ -117,7 +119,7 @@ sub runstep {
return 1;
}
- ($without, $icushared, $icuheaders) =
+ ($without, $icushared, $icuheaders, $icuversion) =
$self->_try_icuconfig(
$conf,
{
@@ -149,6 +151,7 @@ sub runstep {
has_icu => 1,
icu_shared => $icushared,
icu_dir => $icudir,
+ $icuversion ? ( icu_version => $icuversion ) : (),
);
# Add -I $Icuheaders if necessary.
@@ -272,6 +275,7 @@ sub _try_icuconfig {
my $icuheaders = ( defined $arg->{icuheaders} )
? $arg->{icuheaders}
: undef;
+ my $icuversion;
if (
( ! $arg->{without} ) &&
$arg->{autodetect} &&
@@ -295,9 +299,13 @@ sub _try_icuconfig {
($icuheaders, $arg->{without}) =
$self->_handle_icuheaders($conf, $icuheaders, $arg->{without});
$conf->debug("For icuheaders, found $icuheaders and $arg->{without}\n");
+
+ # icu-config --version for missing (void) declarations with 4.4
+ $conf->debug("Trying $arg->{icuconfig} with '--version'\n");
+ $icuversion = capture_output("$arg->{icuconfig} --version");
}
- return ($arg->{without}, $icushared, $icuheaders);
+ return ($arg->{without}, $icushared, $icuheaders, $icuversion);
}
sub _handle_icushared {
Please sign in to comment.
Something went wrong with that request. Please try again.