2007-10-31 20:36:55 -04:00
|
|
|
#!/usr/bin/env perl
|
2008-02-07 20:21:03 -05:00
|
|
|
# Determine if curl-config --protocols/--features matches the
|
|
|
|
# curl --version protocols/features
|
2010-02-14 14:40:18 -05:00
|
|
|
if ( $#ARGV != 2 )
|
2007-10-31 20:36:55 -04:00
|
|
|
{
|
2010-02-16 08:32:45 -05:00
|
|
|
print "Usage: $0 curl-config-script curl-version-output-file features|protocols\n";
|
|
|
|
exit 3;
|
2007-10-31 20:36:55 -04:00
|
|
|
}
|
|
|
|
|
2007-10-31 23:09:27 -04:00
|
|
|
my $what=$ARGV[2];
|
|
|
|
|
2007-11-01 17:20:24 -04:00
|
|
|
# Read the output of curl --version
|
2007-10-31 20:36:55 -04:00
|
|
|
my $curl_protocols="";
|
2007-11-01 17:20:24 -04:00
|
|
|
open(CURL, "$ARGV[1]") || die "Can't get curl $what list\n";
|
2007-10-31 20:36:55 -04:00
|
|
|
while( <CURL> )
|
|
|
|
{
|
2012-07-20 11:22:10 -04:00
|
|
|
$curl_protocols = lc($_) if ( /$what:/i );
|
2007-10-31 20:36:55 -04:00
|
|
|
}
|
|
|
|
close CURL;
|
|
|
|
|
2012-07-20 11:22:10 -04:00
|
|
|
$curl_protocols =~ s/\r//;
|
2007-10-31 23:09:27 -04:00
|
|
|
$curl_protocols =~ /\w+: (.*)$/;
|
2007-10-31 20:36:55 -04:00
|
|
|
@curl = split / /,$1;
|
2007-11-01 17:20:24 -04:00
|
|
|
|
|
|
|
# These features are not supported by curl-config
|
2012-05-27 17:43:23 -04:00
|
|
|
@curl = grep(!/^(Debug|TrackMemory|Metalink|Largefile|CharConv|GSS-Negotiate|SPNEGO)$/i, @curl);
|
2007-10-31 20:36:55 -04:00
|
|
|
@curl = sort @curl;
|
|
|
|
|
2007-11-01 17:20:24 -04:00
|
|
|
# Read the output of curl-config
|
2007-10-31 20:36:55 -04:00
|
|
|
my @curl_config;
|
2007-11-01 17:20:24 -04:00
|
|
|
open(CURLCONFIG, "sh $ARGV[0] --$what|") || die "Can't get curl-config $what list\n";
|
2007-10-31 20:36:55 -04:00
|
|
|
while( <CURLCONFIG> )
|
|
|
|
{
|
|
|
|
chomp;
|
|
|
|
push @curl_config, lc($_);
|
|
|
|
}
|
|
|
|
close CURLCONFIG;
|
|
|
|
|
|
|
|
@curl_config = sort @curl_config;
|
|
|
|
|
|
|
|
my $curlproto = join ' ', @curl;
|
|
|
|
my $curlconfigproto = join ' ', @curl_config;
|
|
|
|
|
|
|
|
my $different = $curlproto ne $curlconfigproto;
|
|
|
|
if ($different) {
|
2010-02-16 08:32:45 -05:00
|
|
|
print "Mismatch in $what lists:\n";
|
|
|
|
print "curl: $curlproto\n";
|
|
|
|
print "curl-config: $curlconfigproto\n";
|
2007-10-31 20:36:55 -04:00
|
|
|
}
|
|
|
|
exit $different;
|