ciconfig.pl 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186
  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. 'crypto-auth' => 1,
  61. 'ntlm' => 1,
  62. 'ntlm-wb' => 1,
  63. 'tls-srp' => 1,
  64. 'unix-sockets' => 1,
  65. 'cookies' => 1,
  66. 'socketpair' => 1,
  67. 'http-auth' => 1,
  68. 'doh' => 1,
  69. 'mime' => 1,
  70. 'dateparse' => 1,
  71. 'netrc' => 1,
  72. 'progress-meter' => 1,
  73. 'dnsshuffle' => 1,
  74. 'get-easy-options' => 1,
  75. 'alt-svc' => 1,
  76. 'hsts' => 1,
  77. # --with-
  78. 'aix-soname' => 1,
  79. 'pic' => 1,
  80. 'zlib' => 1,
  81. 'zstd' => 1,
  82. 'brotli' => 1,
  83. 'random' => 1,
  84. 'egd-socket' => 1,
  85. 'ca-bundle' => 1,
  86. 'ca-path' => 1,
  87. 'libssh2' => 1,
  88. 'nghttp2' => 1,
  89. 'librtmp' => 1,
  90. 'libidn2' => 1,
  91. 'sysroot' => 1,
  92. 'lber-lib' => 1,
  93. 'ldap-lib' => 1,
  94. );
  95. sub configureopts {
  96. my ($opts)=@_;
  97. my %thisin;
  98. my %thisout;
  99. while($opts =~ s/--with-([^ =]*)//) {
  100. $with{$1}++;
  101. $used{$1}++;
  102. $thisin{$1}++;
  103. }
  104. while($opts =~ s/--enable-([^ =]*)//) {
  105. $with{$1}++;
  106. $used{$1}++;
  107. $thisin{$1}++;
  108. }
  109. while($opts =~ s/--without-([^ =]*)//) {
  110. $without{$1}++;
  111. $used{$1}++;
  112. $thisout{$1}++;
  113. }
  114. while($opts =~ s/--disable-([^ =]*)//) {
  115. $without{$1}++;
  116. $used{$1}++;
  117. $thisout{$1}++;
  118. }
  119. return join(" ", sort(keys %thisin), "/", sort(keys %thisout));
  120. }
  121. # run configure --help and check what available WITH/ENABLE options that exist
  122. sub configurehelp {
  123. open(C, "./configure --help|");
  124. while(<C>) {
  125. if($_ =~ /^ --(with|enable)-([a-z0-9-]+)/) {
  126. $avail{$2}++;
  127. }
  128. }
  129. close(C);
  130. }
  131. sub scanjobs {
  132. my $jobs;
  133. open(CI, "./scripts/cijobs.pl|");
  134. while(<CI>) {
  135. if($_ =~ /^\#\#\#/) {
  136. $jobs++;
  137. }
  138. if($_ =~ /^configure: (.*)/) {
  139. my $c= configureopts($1);
  140. #print "C: $c\n";
  141. }
  142. }
  143. close(CI);
  144. }
  145. configurehelp();
  146. scanjobs();
  147. print "Used configure options (with / without)\n";
  148. for my $w (sort keys %used) {
  149. printf " %s: %d %d%s\n", $w, $with{$w}, $without{$w},
  150. $defaulton{$w} ? " (auto)":"";
  151. }
  152. print "Never used configure options\n";
  153. for my $w (sort keys %avail) {
  154. if(!$used{$w}) {
  155. printf " %s%s\n", $w,
  156. $defaulton{$w} ? " (auto)":"";
  157. }
  158. }
  159. print "Never ENABLED configure options that aren't on by default\n";
  160. for my $w (sort keys %avail) {
  161. if(!$with{$w} && !$defaulton{$w}) {
  162. printf " %s\n", $w;
  163. }
  164. }
  165. print "ENABLED configure options that aren't available\n";
  166. for my $w (sort keys %with) {
  167. if(!$avail{$w}) {
  168. printf " %s\n", $w;
  169. }
  170. }