ciconfig.pl 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190
  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. # these options are enabled by default in the sense that they will attempt to
  26. # check for and use this feature without the configure flag
  27. my %defaulton = (
  28. # --enable-
  29. 'shared' => 1,
  30. 'static' => 1,
  31. 'fast-install' => 1,
  32. 'silent-rules' => 1,
  33. 'optimize' => 1,
  34. 'http' => 1,
  35. 'ftp' => 1,
  36. 'file' => 1,
  37. 'ldap' => 1,
  38. 'ldaps' => 1,
  39. 'rtsp' => 1,
  40. 'proxy' => 1,
  41. 'dict' => 1,
  42. 'telnet' => 1,
  43. 'tftp' => 1,
  44. 'pop3' => 1,
  45. 'imap' => 1,
  46. 'smb' => 1,
  47. 'smtp' => 1,
  48. 'gopher' => 1,
  49. 'mqtt' => 1,
  50. 'manual' => 1,
  51. 'libcurl-option' => 1,
  52. 'libgcc' => 1,
  53. 'ipv6' => 1,
  54. 'openssl-auto-load-config' => 1,
  55. 'versioned-symbols' => 1,
  56. 'symbol-hiding' => 1,
  57. 'threaded-resolver' => 1,
  58. 'pthreads' => 1,
  59. 'verbose' => 1,
  60. 'basic-auth' => 1,
  61. 'bearer-auth' => 1,
  62. 'digest-auth' => 1,
  63. 'kerberos-auth' => 1,
  64. 'negotiate-auth' => 1,
  65. 'aws' => 1,
  66. 'ntlm' => 1,
  67. 'ntlm-wb' => 1,
  68. 'tls-srp' => 1,
  69. 'unix-sockets' => 1,
  70. 'cookies' => 1,
  71. 'socketpair' => 1,
  72. 'http-auth' => 1,
  73. 'doh' => 1,
  74. 'mime' => 1,
  75. 'dateparse' => 1,
  76. 'netrc' => 1,
  77. 'progress-meter' => 1,
  78. 'dnsshuffle' => 1,
  79. 'get-easy-options' => 1,
  80. 'alt-svc' => 1,
  81. 'hsts' => 1,
  82. # --with-
  83. 'aix-soname' => 1,
  84. 'pic' => 1,
  85. 'zlib' => 1,
  86. 'zstd' => 1,
  87. 'brotli' => 1,
  88. 'random' => 1,
  89. 'ca-bundle' => 1,
  90. 'ca-path' => 1,
  91. 'libssh2' => 1,
  92. 'nghttp2' => 1,
  93. 'librtmp' => 1,
  94. 'libidn2' => 1,
  95. 'sysroot' => 1,
  96. 'lber-lib' => 1,
  97. 'ldap-lib' => 1,
  98. );
  99. sub configureopts {
  100. my ($opts)=@_;
  101. my %thisin;
  102. my %thisout;
  103. while($opts =~ s/--with-([^ =]*)//) {
  104. $with{$1}++;
  105. $used{$1}++;
  106. $thisin{$1}++;
  107. }
  108. while($opts =~ s/--enable-([^ =]*)//) {
  109. $with{$1}++;
  110. $used{$1}++;
  111. $thisin{$1}++;
  112. }
  113. while($opts =~ s/--without-([^ =]*)//) {
  114. $without{$1}++;
  115. $used{$1}++;
  116. $thisout{$1}++;
  117. }
  118. while($opts =~ s/--disable-([^ =]*)//) {
  119. $without{$1}++;
  120. $used{$1}++;
  121. $thisout{$1}++;
  122. }
  123. return join(" ", sort(keys %thisin), "/", sort(keys %thisout));
  124. }
  125. # run configure --help and check what available WITH/ENABLE options that exist
  126. sub configurehelp {
  127. open(C, "./configure --help|");
  128. while(<C>) {
  129. if($_ =~ /^ --(with|enable)-([a-z0-9-]+)/) {
  130. $avail{$2}++;
  131. }
  132. }
  133. close(C);
  134. }
  135. sub scanjobs {
  136. my $jobs;
  137. open(CI, "./scripts/cijobs.pl|");
  138. while(<CI>) {
  139. if($_ =~ /^\#\#\#/) {
  140. $jobs++;
  141. }
  142. if($_ =~ /^configure: (.*)/) {
  143. my $c= configureopts($1);
  144. #print "C: $c\n";
  145. }
  146. }
  147. close(CI);
  148. }
  149. configurehelp();
  150. scanjobs();
  151. print "Used configure options (with / without)\n";
  152. for my $w (sort keys %used) {
  153. printf " %s: %d %d%s\n", $w, $with{$w}, $without{$w},
  154. $defaulton{$w} ? " (auto)":"";
  155. }
  156. print "Never used configure options\n";
  157. for my $w (sort keys %avail) {
  158. if(!$used{$w}) {
  159. printf " %s%s\n", $w,
  160. $defaulton{$w} ? " (auto)":"";
  161. }
  162. }
  163. print "Never ENABLED configure options that aren't on by default\n";
  164. for my $w (sort keys %avail) {
  165. if(!$with{$w} && !$defaulton{$w}) {
  166. printf " %s\n", $w;
  167. }
  168. }
  169. print "ENABLED configure options that aren't available\n";
  170. for my $w (sort keys %with) {
  171. if(!$avail{$w}) {
  172. printf " %s\n", $w;
  173. }
  174. }