2007-11-01 03:36:55 +03:00
|
|
|
#!/usr/bin/env perl
|
2020-03-23 16:44:29 +03:00
|
|
|
#***************************************************************************
|
|
|
|
# _ _ ____ _
|
|
|
|
# Project ___| | | | _ \| |
|
|
|
|
# / __| | | | |_) | |
|
|
|
|
# | (__| |_| | _ <| |___
|
|
|
|
# \___|\___/|_| \_\_____|
|
|
|
|
#
|
2023-01-02 15:51:48 +03:00
|
|
|
# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
|
2020-03-23 16:44:29 +03: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 16:02:01 +03:00
|
|
|
# are also available at https://curl.se/docs/copyright.html.
|
2020-03-23 16:44:29 +03: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.
|
|
|
|
#
|
|
|
|
# SPDX-License-Identifier: curl
|
2022-05-17 12:16:50 +03:00
|
|
|
#
|
2020-03-23 16:44:29 +03:00
|
|
|
###########################################################################
|
2008-02-08 04:21:03 +03:00
|
|
|
# Determine if curl-config --protocols/--features matches the
|
|
|
|
# curl --version protocols/features
|
2010-02-14 22:40:18 +03:00
|
|
|
if ( $#ARGV != 2 )
|
2007-11-01 03:36:55 +03:00
|
|
|
{
|
2010-02-16 16:32:45 +03:00
|
|
|
print "Usage: $0 curl-config-script curl-version-output-file features|protocols\n";
|
|
|
|
exit 3;
|
2007-11-01 03:36:55 +03:00
|
|
|
}
|
|
|
|
|
2007-11-01 06:09:27 +03:00
|
|
|
my $what=$ARGV[2];
|
|
|
|
|
2007-11-02 00:20:24 +03:00
|
|
|
# Read the output of curl --version
|
2007-11-01 03:36:55 +03:00
|
|
|
my $curl_protocols="";
|
2007-11-02 00:20:24 +03:00
|
|
|
open(CURL, "$ARGV[1]") || die "Can't get curl $what list\n";
|
2007-11-01 03:36:55 +03:00
|
|
|
while( <CURL> )
|
|
|
|
{
|
2012-07-20 19:22:10 +04:00
|
|
|
$curl_protocols = lc($_) if ( /$what:/i );
|
2007-11-01 03:36:55 +03:00
|
|
|
}
|
|
|
|
close CURL;
|
|
|
|
|
2012-07-20 19:22:10 +04:00
|
|
|
$curl_protocols =~ s/\r//;
|
2007-11-01 06:09:27 +03:00
|
|
|
$curl_protocols =~ /\w+: (.*)$/;
|
2007-11-01 03:36:55 +03:00
|
|
|
@curl = split / /,$1;
|
|
|
|
@curl = sort @curl;
|
|
|
|
|
2007-11-02 00:20:24 +03:00
|
|
|
# Read the output of curl-config
|
2007-11-01 03:36:55 +03:00
|
|
|
my @curl_config;
|
2007-11-02 00:20:24 +03:00
|
|
|
open(CURLCONFIG, "sh $ARGV[0] --$what|") || die "Can't get curl-config $what list\n";
|
2007-11-01 03:36:55 +03:00
|
|
|
while( <CURLCONFIG> )
|
|
|
|
{
|
|
|
|
chomp;
|
2014-05-18 19:07:29 +04:00
|
|
|
# ignore curl-config --features not in curl's feature list
|
2014-07-22 13:01:04 +04:00
|
|
|
push @curl_config, lc($_);
|
2007-11-01 03:36:55 +03: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 16:32:45 +03:00
|
|
|
print "Mismatch in $what lists:\n";
|
|
|
|
print "curl: $curlproto\n";
|
|
|
|
print "curl-config: $curlconfigproto\n";
|
2007-11-01 03:36:55 +03:00
|
|
|
}
|
|
|
|
exit $different;
|