@@ -79,6 +79,15 @@ fn check_ssl_kind() {
79
79
println ! ( "cargo:rustc-cfg=awslc" ) ;
80
80
println ! ( "cargo:awslc=true" ) ;
81
81
82
+ // The aws-lc-sys and aws-lc-fips-sys crate use a link name that embeds
83
+ // the version number of crate. Examples (crate-name => links name):
84
+ // * aws-lc-sys => aws_lc_0_26_0
85
+ // * aws-lc-fips-sys => aws_lc_fips_0_13_3
86
+ // This is done to avoid issues if the cargo dependency graph for an application
87
+ // were to resolve to multiple versions for the same crate.
88
+ //
89
+ // Due to this we need to determine what version of the AWS-LC has been selected (fips or non-fips)
90
+ // and then need to parse out the pieces we are interested in ignoring the version componenet of the name.
82
91
let env_var_prefix = match ( is_aws_lc, is_aws_lc_fips) {
83
92
( true , false ) => "DEP_AWS_LC_" ,
84
93
( false , true ) => "DEP_AWS_LC_FIPS_" ,
@@ -98,13 +107,16 @@ fn check_ssl_kind() {
98
107
}
99
108
let version = version. expect ( "aws-lc version detected" ) ;
100
109
110
+ // Read the OpenSSL configuration statements and emit rust-cfg for each.
101
111
if let Ok ( vars) = std:: env:: var ( format ! ( "{env_var_prefix}{version}_CONF" ) ) {
102
112
for var in vars. split ( ',' ) {
103
113
println ! ( "cargo:rustc-cfg=osslconf=\" {var}\" " ) ;
104
114
}
105
115
println ! ( "cargo:conf={vars}" ) ;
106
116
}
107
117
118
+ // Emit the include header directory from the aws-lc(-fips)-sys crate so that it can be used if needed
119
+ // by crates consuming openssl-sys.
108
120
if let Ok ( val) = std:: env:: var ( format ! ( "{env_var_prefix}{version}_INCLUDE" ) ) {
109
121
println ! ( "cargo:include={val}" ) ;
110
122
}
0 commit comments