unified build scheme: add a "unified" template for VMS descrip.mms
[openssl.git] / include / openssl / opensslconf.h.in
1 /*
2  * {- join("\n * ", @autowarntext) -}
3  */
4
5 #ifdef  __cplusplus
6 extern "C" {
7 #endif
8
9 #ifdef OPENSSL_ALGORITHM_DEFINES
10 # error OPENSSL_ALGORITHM_DEFINES no longer supported
11 #endif
12
13 /*
14  * OpenSSL was configured with the following options:
15  */
16
17 {- if (@{$config{openssl_sys_defines}}) {
18       foreach (@{$config{openssl_sys_defines}}) {
19         $OUT .= "#ifndef $_\n";
20         $OUT .= "# define $_ 1\n";
21         $OUT .= "#endif\n";
22       }
23     }
24     if (@{$config{openssl_experimental_defines}}) {
25       foreach (@{$config{openssl_experimental_defines}}) {
26         (my $ex = $_) =~ s/_NO_/_EXPERIMENTAL_/;
27         $OUT .= "# ifndef $ex\n";
28         $OUT .= "#  ifndef $_\n";
29         $OUT .= "#   define $_\n";
30         $OUT .= "#  endif\n";
31         $OUT .= "# endif\n";
32       }
33     }
34     foreach (@{$config{openssl_api_defines}}) {
35         (my $macro, my $value) = $_ =~ /^(.*?)=(.*?)$/;
36         $OUT .= "# define OPENSSL_MIN_API $value\n";
37     }
38     if (@{$config{openssl_algorithm_defines}}) {
39       foreach (@{$config{openssl_algorithm_defines}}) {
40         $OUT .= "# ifndef $_\n";
41         $OUT .= "#  define $_\n";
42         $OUT .= "# endif\n";
43       }
44     }
45     if ($OUT) {
46         $OUT = <<"EOF";
47 #ifndef OPENSSL_DOING_MAKEDEPEND
48
49 $OUT
50 #endif /* OPENSSL_DOING_MAKEDEPEND */
51 EOF
52     }
53     "";
54 -}
55
56 {-
57     if (@{$config{openssl_thread_defines}}) {
58       foreach (@{$config{openssl_thread_defines}}) {
59         $OUT .= "#ifndef $_\n";
60         $OUT .= "# define $_\n";
61         $OUT .= "#endif\n";
62       }
63     }
64     if (@{$config{openssl_other_defines}}) {
65       foreach (@{$config{openssl_other_defines}}) {
66         $OUT .= "#ifndef $_\n";
67         $OUT .= "# define $_\n";
68         $OUT .= "#endif\n";
69       }
70     }
71     "";
72 -}
73
74 /*
75  * Sometimes OPENSSSL_NO_xxx ends up with an empty file and some compilers
76  * don't like that.  This will hopefully silence them.
77  */
78 #define NON_EMPTY_TRANSLATION_UNIT static void *dummy = &dummy;
79
80 /*
81  * Applications should use -DOPENSSL_API_COMPAT=<version> to suppress the
82  * declarations of functions deprecated in or before <version>. Otherwise, they
83  * still won't see them if the library has been built to disable deprecated
84  * functions.
85  */
86 #if defined(OPENSSL_NO_DEPRECATED)
87 # define DECLARE_DEPRECATED(f)
88 #elif __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 0)
89 # define DECLARE_DEPRECATED(f)    f __attribute__ ((deprecated));
90 #else
91 # define DECLARE_DEPRECATED(f)   f;
92 #endif
93
94 #ifndef OPENSSL_MIN_API
95 # define OPENSSL_MIN_API 0
96 #endif
97
98 #if !defined(OPENSSL_API_COMPAT) || OPENSSL_API_COMPAT < OPENSSL_MIN_API
99 # undef OPENSSL_API_COMPAT
100 # define OPENSSL_API_COMPAT OPENSSL_MIN_API
101 #endif
102
103 #if OPENSSL_API_COMPAT < 0x10100000L
104 # define DEPRECATEDIN_1_1_0(f)   DECLARE_DEPRECATED(f)
105 #else
106 # define DEPRECATEDIN_1_1_0(f)
107 #endif
108
109 #if OPENSSL_API_COMPAT < 0x10000000L
110 # define DEPRECATEDIN_1_0_0(f)   DECLARE_DEPRECATED(f)
111 #else
112 # define DEPRECATEDIN_1_0_0(f)
113 #endif
114
115 #if OPENSSL_API_COMPAT < 0x00908000L
116 # define DEPRECATEDIN_0_9_8(f)   DECLARE_DEPRECATED(f)
117 #else
118 # define DEPRECATEDIN_0_9_8(f)
119 #endif
120
121 {- $target{cpuid_obj} ne "mem_clr.o" ? "#define OPENSSL_CPUID_OBJ" : "" -}
122
123 /* Generate 80386 code? */
124 {- $config{processor} eq "386" ? "#define" : "#undef" -} I386_ONLY
125
126 #undef OPENSSL_UNISTD
127 #define OPENSSL_UNISTD {- $target{unistd} -}
128
129 {- $config{export_var_as_fn} ? "#define" : "#undef" -} OPENSSL_EXPORT_VAR_AS_FUNCTION
130
131 /*
132  * The following are cipher-specific, but are part of the public API.
133  */
134 #if !defined(OPENSSL_SYS_UEFI)
135 {- $config{bn_ll} ? "# define" : "# undef" -} BN_LLONG
136 /* Only one for the following should be defined */
137 {- $config{b64l} ? "# define" : "# undef" -} SIXTY_FOUR_BIT_LONG
138 {- $config{b64}  ? "# define" : "# undef" -} SIXTY_FOUR_BIT
139 {- $config{b32}  ? "# define" : "# undef" -} THIRTY_TWO_BIT
140 #endif
141
142 #define RC4_INT {- $config{rc4_int} -}
143
144 #ifdef  __cplusplus
145 }
146 #endif