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", $_;
36 printf "\n#ifdef INCLUDE_FUNCTION_TABLE\n";
38 printf "extern OPTIONS %s_options[];\n", $_;
40 printf "FUNCTION functions[] = {\n";
42 $str=" { FT_general, \"$_\", ${_}_main, ${_}_options },\n";
43 if (/^s_/ || /^ciphers$/) {
44 print "#if !defined(OPENSSL_NO_SOCK)\n${str}#endif\n";
45 } elsif (/^engine$/) {
46 print "#ifndef OPENSSL_NO_ENGINE\n${str}#endif\n";
47 } elsif (/^rsa$/ || /^genrsa$/ || /^rsautl$/) {
48 print "#ifndef OPENSSL_NO_RSA\n${str}#endif\n";
49 } elsif (/^dsa$/ || /^gendsa$/ || /^dsaparam$/) {
50 print "#ifndef OPENSSL_NO_DSA\n${str}#endif\n";
51 } elsif (/^ec$/ || /^ecparam$/) {
52 print "#ifndef OPENSSL_NO_EC\n${str}#endif\n";
53 } elsif (/^dh$/ || /^gendh$/ || /^dhparam$/) {
54 print "#ifndef OPENSSL_NO_DH\n${str}#endif\n";
55 } elsif (/^pkcs12$/) {
56 print "#if !defined(OPENSSL_NO_DES)\n${str}#endif\n";
58 print "#ifndef OPENSSL_NO_CMS\n${str}#endif\n";
60 print "#ifndef OPENSSL_NO_OCSP\n${str}#endif\n";
62 print "#ifndef OPENSSL_NO_SRP\n${str}#endif\n";
71 "sha", "sha1", "sha224", "sha256", "sha384", "sha512",
74 printf "#ifndef OPENSSL_NO_".uc($_)."\n" if ! /sha/;
75 printf " { FT_md, \"".$_."\", dgst_main},\n";
76 printf "#endif\n" if ! /sha/;
80 "aes-128-cbc", "aes-128-ecb",
81 "aes-192-cbc", "aes-192-ecb",
82 "aes-256-cbc", "aes-256-ecb",
83 "camellia-128-cbc", "camellia-128-ecb",
84 "camellia-192-cbc", "camellia-192-ecb",
85 "camellia-256-cbc", "camellia-256-ecb",
87 "des", "des3", "desx", "idea", "seed", "rc4", "rc4-40",
88 "rc2", "bf", "cast", "rc5",
89 "des-ecb", "des-ede", "des-ede3",
90 "des-cbc", "des-ede-cbc","des-ede3-cbc",
91 "des-cfb", "des-ede-cfb","des-ede3-cfb",
92 "des-ofb", "des-ede-ofb","des-ede3-ofb",
93 "idea-cbc","idea-ecb", "idea-cfb", "idea-ofb",
94 "seed-cbc","seed-ecb", "seed-cfb", "seed-ofb",
95 "rc2-cbc", "rc2-ecb", "rc2-cfb","rc2-ofb", "rc2-64-cbc", "rc2-40-cbc",
96 "bf-cbc", "bf-ecb", "bf-cfb", "bf-ofb",
97 "cast5-cbc","cast5-ecb", "cast5-cfb","cast5-ofb",
98 "cast-cbc", "rc5-cbc", "rc5-ecb", "rc5-cfb", "rc5-ofb"
100 $str=" { FT_cipher, \"$_\", enc_main, enc_options },\n";
102 printf "#ifndef OPENSSL_NO_DES\n${str}#endif\n";
104 printf "#ifndef OPENSSL_NO_AES\n${str}#endif\n";
105 } elsif (/camellia/) {
106 printf "#ifndef OPENSSL_NO_CAMELLIA\n${str}#endif\n";
108 printf "#ifndef OPENSSL_NO_IDEA\n${str}#endif\n";
110 printf "#ifndef OPENSSL_NO_SEED\n${str}#endif\n";
112 printf "#ifndef OPENSSL_NO_RC4\n${str}#endif\n";
114 printf "#ifndef OPENSSL_NO_RC2\n${str}#endif\n";
116 printf "#ifndef OPENSSL_NO_BF\n${str}#endif\n";
118 printf "#ifndef OPENSSL_NO_CAST\n${str}#endif\n";
120 printf "#ifndef OPENSSL_NO_RC5\n${str}#endif\n";
122 printf "#ifdef ZLIB\n${str}#endif\n";
128 print " { 0, NULL, NULL}\n};\n";