2007-10-31 20:36:55 -04:00
|
|
|
#!/usr/bin/env perl
|
2020-03-23 09:44:29 -04:00
|
|
|
#***************************************************************************
|
|
|
|
# _ _ ____ _
|
|
|
|
# Project ___| | | | _ \| |
|
|
|
|
# / __| | | | |_) | |
|
|
|
|
# | (__| |_| | _ <| |___
|
|
|
|
# \___|\___/|_| \_\_____|
|
|
|
|
#
|
2021-03-09 18:38:21 -05:00
|
|
|
# Copyright (C) 1998 - 2021, Daniel Stenberg, <daniel@haxx.se>, et al.
|
2020-03-23 09:44:29 -04:00
|
|
|
#
|
|
|
|
# This software is licensed as described in the file COPYING, which
|
|
|
|
# you should have received as part of this distribution. The terms
|
2020-11-04 08:02:01 -05:00
|
|
|
# are also available at https://curl.se/docs/copyright.html.
|
2020-03-23 09:44:29 -04:00
|
|
|
#
|
|
|
|
# You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
|
|
|
# copies of the Software, and permit persons to whom the Software is
|
|
|
|
# furnished to do so, under the terms of the COPYING file.
|
|
|
|
#
|
|
|
|
# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
|
|
|
# KIND, either express or implied.
|
|
|
|
#
|
|
|
|
###########################################################################
|
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
|
2021-06-01 10:24:00 -04:00
|
|
|
@curl = grep(!/^(Debug|TrackMemory|CharConv)$/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;
|
2014-05-18 11:07:29 -04:00
|
|
|
# ignore curl-config --features not in curl's feature list
|
2014-07-22 05:01:04 -04:00
|
|
|
push @curl_config, lc($_);
|
2007-10-31 20:36:55 -04:00
|
|
|
}
|
|
|
|
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;
|