1#!/usr/bin/perl 2#*************************************************************************** 3# _ _ ____ _ 4# Project ___| | | | _ \| | 5# / __| | | | |_) | | 6# | (__| |_| | _ <| |___ 7# \___|\___/|_| \_\_____| 8# 9# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al. 10# 11# This software is licensed as described in the file COPYING, which 12# you should have received as part of this distribution. The terms 13# are also available at https://curl.se/docs/copyright.html. 14# 15# You may opt to use, copy, modify, merge, publish, distribute and/or sell 16# copies of the Software, and permit persons to whom the Software is 17# furnished to do so, under the terms of the COPYING file. 18# 19# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY 20# KIND, either express or implied. 21# 22# SPDX-License-Identifier: curl 23# 24########################################################################### 25 26# these options are enabled by default in the sense that they will attempt to 27# check for and use this feature without the configure flag 28my %defaulton = ( 29 # --enable- 30 'shared' => 1, 31 'static' => 1, 32 'fast-install' => 1, 33 'silent-rules' => 1, 34 'optimize' => 1, 35 'http' => 1, 36 'ftp' => 1, 37 'file' => 1, 38 'ldap' => 1, 39 'ldaps' => 1, 40 'rtsp' => 1, 41 'proxy' => 1, 42 'dict' => 1, 43 'telnet' => 1, 44 'tftp' => 1, 45 'pop3' => 1, 46 'imap' => 1, 47 'smb' => 1, 48 'smtp' => 1, 49 'gopher' => 1, 50 'mqtt' => 1, 51 'manual' => 1, 52 'libcurl-option' => 1, 53 'libgcc' => 1, 54 'ipv6' => 1, 55 'openssl-auto-load-config' => 1, 56 'versioned-symbols' => 1, 57 'symbol-hiding' => 1, 58 'threaded-resolver' => 1, 59 'pthreads' => 1, 60 'verbose' => 1, 61 'crypto-auth' => 1, 62 'ntlm' => 1, 63 'ntlm-wb' => 1, 64 'tls-srp' => 1, 65 'unix-sockets' => 1, 66 'cookies' => 1, 67 'socketpair' => 1, 68 'http-auth' => 1, 69 'doh' => 1, 70 'mime' => 1, 71 'dateparse' => 1, 72 'netrc' => 1, 73 'progress-meter' => 1, 74 'dnsshuffle' => 1, 75 'get-easy-options' => 1, 76 'alt-svc' => 1, 77 'hsts' => 1, 78 79 # --with- 80 'aix-soname' => 1, 81 'pic' => 1, 82 'zlib' => 1, 83 'zstd' => 1, 84 'brotli' => 1, 85 'random' => 1, 86 'egd-socket' => 1, 87 'ca-bundle' => 1, 88 'ca-path' => 1, 89 'libssh2' => 1, 90 'nghttp2' => 1, 91 'librtmp' => 1, 92 'libidn2' => 1, 93 'sysroot' => 1, 94 'lber-lib' => 1, 95 'ldap-lib' => 1, 96 97 ); 98 99 100sub configureopts { 101 my ($opts)=@_; 102 my %thisin; 103 my %thisout; 104 105 while($opts =~ s/--with-([^ =]*)//) { 106 $with{$1}++; 107 $used{$1}++; 108 $thisin{$1}++; 109 } 110 while($opts =~ s/--enable-([^ =]*)//) { 111 $with{$1}++; 112 $used{$1}++; 113 $thisin{$1}++; 114 } 115 116 while($opts =~ s/--without-([^ =]*)//) { 117 $without{$1}++; 118 $used{$1}++; 119 $thisout{$1}++; 120 } 121 while($opts =~ s/--disable-([^ =]*)//) { 122 $without{$1}++; 123 $used{$1}++; 124 $thisout{$1}++; 125 } 126 return join(" ", sort(keys %thisin), "/", sort(keys %thisout)); 127} 128 129# run configure --help and check what available WITH/ENABLE options that exist 130sub configurehelp { 131 open(C, "./configure --help|"); 132 while(<C>) { 133 if($_ =~ /^ --(with|enable)-([a-z0-9-]+)/) { 134 $avail{$2}++; 135 } 136 } 137 close(C); 138} 139 140sub scanjobs { 141 142 my $jobs; 143 open(CI, "./scripts/cijobs.pl|"); 144 while(<CI>) { 145 if($_ =~ /^\#\#\#/) { 146 $jobs++; 147 } 148 if($_ =~ /^configure: (.*)/) { 149 my $c= configureopts($1); 150 #print "C: $c\n"; 151 } 152 } 153 close(CI); 154} 155 156configurehelp(); 157scanjobs(); 158 159print "Used configure options (with / without)\n"; 160for my $w (sort keys %used) { 161 printf " %s: %d %d%s\n", $w, $with{$w}, $without{$w}, 162 $defaulton{$w} ? " (auto)":""; 163} 164 165print "Never used configure options\n"; 166for my $w (sort keys %avail) { 167 if(!$used{$w}) { 168 printf " %s%s\n", $w, 169 $defaulton{$w} ? " (auto)":""; 170 } 171} 172 173print "Never ENABLED configure options that aren't on by default\n"; 174for my $w (sort keys %avail) { 175 if(!$with{$w} && !$defaulton{$w}) { 176 printf " %s\n", $w; 177 } 178} 179 180 181print "ENABLED configure options that aren't available\n"; 182for my $w (sort keys %with) { 183 if(!$avail{$w}) { 184 printf " %s\n", $w; 185 } 186} 187