2 # Generate progs.h file from list of "programs" passed on the command line.
6 * Automatically generated by progs.pl for openssl.c
7 * Copyright (c) 2008 The OpenSSL Project. All rights reserved.
8 * See the openssl.c for copyright details.
11 typedef enum FUNC_TYPE {
12 FT_none, FT_general, FT_md, FT_cipher, FT_pkey,
13 FT_md_alg, FT_cipher_alg
16 typedef struct function_st {
19 int (*func)(int argc,char *argv[]);
26 grep(s/^asn1pars$/asn1parse/, @ARGV);
27 grep(s/^crl2p7$/crl2pkcs7/, @ARGV);
33 printf "extern int %s_main(int argc, char *argv[]);\n", $_;
39 printf "extern OPTIONS %s_options[];\n", $_;
41 print "\n#ifdef INCLUDE_FUNCTION_TABLE\n";
42 print "static FUNCTION functions[] = {\n";
44 $str=" { FT_general, \"$_\", ${_}_main, ${_}_options },\n";
45 if (/^s_/ || /^ciphers$/) {
46 print "#if !defined(OPENSSL_NO_SOCK)\n${str}#endif\n";
47 } elsif (/^engine$/) {
48 print "#ifndef OPENSSL_NO_ENGINE\n${str}#endif\n";
49 } elsif (/^rsa$/ || /^genrsa$/ || /^rsautl$/) {
50 print "#ifndef OPENSSL_NO_RSA\n${str}#endif\n";
51 } elsif (/^dsa$/ || /^gendsa$/ || /^dsaparam$/) {
52 print "#ifndef OPENSSL_NO_DSA\n${str}#endif\n";
53 } elsif (/^ec$/ || /^ecparam$/) {
54 print "#ifndef OPENSSL_NO_EC\n${str}#endif\n";
55 } elsif (/^dh$/ || /^gendh$/ || /^dhparam$/) {
56 print "#ifndef OPENSSL_NO_DH\n${str}#endif\n";
57 } elsif (/^pkcs12$/) {
58 print "#if !defined(OPENSSL_NO_DES)\n${str}#endif\n";
60 print "#ifndef OPENSSL_NO_CMS\n${str}#endif\n";
62 print "#ifndef OPENSSL_NO_OCSP\n${str}#endif\n";
64 print "#ifndef OPENSSL_NO_SRP\n${str}#endif\n";
73 "sha", "sha1", "sha224", "sha256", "sha384", "sha512",
76 printf "#ifndef OPENSSL_NO_".uc($_)."\n" if ! /sha/;
77 printf " { FT_md, \"".$_."\", dgst_main},\n";
78 printf "#endif\n" if ! /sha/;
82 "aes-128-cbc", "aes-128-ecb",
83 "aes-192-cbc", "aes-192-ecb",
84 "aes-256-cbc", "aes-256-ecb",
85 "camellia-128-cbc", "camellia-128-ecb",
86 "camellia-192-cbc", "camellia-192-ecb",
87 "camellia-256-cbc", "camellia-256-ecb",
89 "des", "des3", "desx", "idea", "seed", "rc4", "rc4-40",
90 "rc2", "bf", "cast", "rc5",
91 "des-ecb", "des-ede", "des-ede3",
92 "des-cbc", "des-ede-cbc","des-ede3-cbc",
93 "des-cfb", "des-ede-cfb","des-ede3-cfb",
94 "des-ofb", "des-ede-ofb","des-ede3-ofb",
95 "idea-cbc","idea-ecb", "idea-cfb", "idea-ofb",
96 "seed-cbc","seed-ecb", "seed-cfb", "seed-ofb",
97 "rc2-cbc", "rc2-ecb", "rc2-cfb","rc2-ofb", "rc2-64-cbc", "rc2-40-cbc",
98 "bf-cbc", "bf-ecb", "bf-cfb", "bf-ofb",
99 "cast5-cbc","cast5-ecb", "cast5-cfb","cast5-ofb",
100 "cast-cbc", "rc5-cbc", "rc5-ecb", "rc5-cfb", "rc5-ofb"
102 $str=" { FT_cipher, \"$_\", enc_main, enc_options },\n";
104 printf "#ifndef OPENSSL_NO_DES\n${str}#endif\n";
106 printf "#ifndef OPENSSL_NO_AES\n${str}#endif\n";
107 } elsif (/camellia/) {
108 printf "#ifndef OPENSSL_NO_CAMELLIA\n${str}#endif\n";
110 printf "#ifndef OPENSSL_NO_IDEA\n${str}#endif\n";
112 printf "#ifndef OPENSSL_NO_SEED\n${str}#endif\n";
114 printf "#ifndef OPENSSL_NO_RC4\n${str}#endif\n";
116 printf "#ifndef OPENSSL_NO_RC2\n${str}#endif\n";
118 printf "#ifndef OPENSSL_NO_BF\n${str}#endif\n";
120 printf "#ifndef OPENSSL_NO_CAST\n${str}#endif\n";
122 printf "#ifndef OPENSSL_NO_RC5\n${str}#endif\n";
124 printf "#ifdef ZLIB\n${str}#endif\n";
130 print " { 0, NULL, NULL}\n};\n";