Resync
[CMakeLuaTailorHgBridge.git] / CMakeLua / Utilities / cmcurl-7.19.0 / tests / libtest / test1013.pl
blob6127df82ae6529782e08addbc6586149a1ce106f
1 #!/usr/bin/env perl
2 # Determine if curl-config --protocols/--features matches the
3 # curl --version protocols/features
4 if ( $#ARGV != 2 )
6 print "Usage: $0 curl-config-script curl-version-output-file features|protocols\n";
7 exit 3;
10 my $what=$ARGV[2];
12 # Read the output of curl --version
13 my $curl_protocols="";
14 open(CURL, "$ARGV[1]") || die "Can't get curl $what list\n";
15 while( <CURL> )
17 $curl_protocols = lc($_) if ( /$what:/i );
19 close CURL;
21 $curl_protocols =~ /\w+: (.*)$/;
22 @curl = split / /,$1;
24 # These features are not supported by curl-config
25 @curl = grep(!/^(Debug|Largefile|CharConv|GSS-Negotiate|SPNEGO)$/i, @curl);
26 @curl = sort @curl;
28 # Read the output of curl-config
29 my @curl_config;
30 open(CURLCONFIG, "sh $ARGV[0] --$what|") || die "Can't get curl-config $what list\n";
31 while( <CURLCONFIG> )
33 chomp;
34 push @curl_config, lc($_);
36 close CURLCONFIG;
38 @curl_config = sort @curl_config;
40 my $curlproto = join ' ', @curl;
41 my $curlconfigproto = join ' ', @curl_config;
43 my $different = $curlproto ne $curlconfigproto;
44 if ($different) {
45 print "Mismatch in $what lists:\n";
46 print "curl: $curlproto\n";
47 print "curl-config: $curlconfigproto\n";
49 exit $different;