-foreach (@ARGV)
- {
- push(@files,$_);
- $str="\t{FUNC_TYPE_GENERAL,\"$_\",${_}_main},\n";
- if (($_ =~ /^s_/) || ($_ =~ /^ciphers$/))
- { print "#if !defined(NO_SOCK) && !(defined(NO_SSL2) && defined(O_SSL3))\n${str}#endif\n"; }
- elsif ( ($_ =~ /^rsa$/) || ($_ =~ /^genrsa$/) )
- { print "#ifndef NO_RSA\n${str}#endif\n"; }
- elsif ( ($_ =~ /^dsa$/) || ($_ =~ /^gendsa$/) || ($_ =~ /^dsaparam$/))
- { print "#ifndef NO_DSA\n${str}#endif\n"; }
- elsif ( ($_ =~ /^dh$/) || ($_ =~ /^gendh$/))
- { print "#ifndef NO_DH\n${str}#endif\n"; }
- else
- { print $str; }
+foreach (@ARGV) {
+ printf "extern OPTIONS %s_options[];\n", $_;
+}
+print "\n#ifdef INCLUDE_FUNCTION_TABLE\n";
+print "static FUNCTION functions[] = {\n";
+foreach (@ARGV) {
+ $str=" { FT_general, \"$_\", ${_}_main, ${_}_options },\n";
+ if (/^s_/ || /^ciphers$/) {
+ print "#if !defined(OPENSSL_NO_SOCK)\n${str}#endif\n";
+ } elsif (/^engine$/) {
+ print "#ifndef OPENSSL_NO_ENGINE\n${str}#endif\n";
+ } elsif (/^rsa$/ || /^genrsa$/ || /^rsautl$/) {
+ print "#ifndef OPENSSL_NO_RSA\n${str}#endif\n";
+ } elsif (/^dsa$/ || /^gendsa$/ || /^dsaparam$/) {
+ print "#ifndef OPENSSL_NO_DSA\n${str}#endif\n";
+ } elsif (/^ec$/ || /^ecparam$/) {
+ print "#ifndef OPENSSL_NO_EC\n${str}#endif\n";
+ } elsif (/^dh$/ || /^gendh$/ || /^dhparam$/) {
+ print "#ifndef OPENSSL_NO_DH\n${str}#endif\n";
+ } elsif (/^pkcs12$/) {
+ print "#if !defined(OPENSSL_NO_DES)\n${str}#endif\n";
+ } elsif (/^cms$/) {
+ print "#ifndef OPENSSL_NO_CMS\n${str}#endif\n";
+ } elsif (/^ocsp$/) {
+ print "#ifndef OPENSSL_NO_OCSP\n${str}#endif\n";
+ } elsif (/^srp$/) {
+ print "#ifndef OPENSSL_NO_SRP\n${str}#endif\n";
+ } else {
+ print $str;