1e927466d140d66e2495cece0ff40daba178b725
[pti/rtp.git] / meta-stx / classes / openssl10.bbclass
1 #
2 ## Copyright (C) 2019 Wind River Systems, Inc.
3 #
4 #  Licensed under the Apache License, Version 2.0 (the "License");
5 #  you may not use this file except in compliance with the License.
6 #  You may obtain a copy of the License at
7 #
8 #      http://www.apache.org/licenses/LICENSE-2.0
9 #
10 #  Unless required by applicable law or agreed to in writing, software
11 #  distributed under the License is distributed on an "AS IS" BASIS,
12 #  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 #  See the License for the specific language governing permissions and
14 #  limitations under the License.
15
16 python __anonymous() {
17    if bb.utils.contains('DEPENDS', 'openssl', True, False, d) or \
18       bb.utils.contains('DEPENDS', 'openssl-native', True, False, d):
19           d.setVar('DEPENDS', d.getVar('DEPENDS').replace('openssl', 'openssl10'))
20           d.setVar('DEPENDS', d.getVar('DEPENDS').replace('openssl-native', 'openssl10-native'))
21 }
22
23
24 python do_ssl10_mk_symlink() {
25
26     import shutil
27     l = d.getVar("STAGING_INCDIR") + "/openssl"
28
29     if os.path.islink(l):
30         os.unlink(l)
31     elif os.path.isdir(l):
32         shutil.rmtree(l)
33
34     os.symlink("openssl10/openssl",l)
35
36     l = d.getVar("STAGING_LIBDIR")
37     if os.path.islink(l + "/libssl.so"):
38         os.unlink(l + "/libssl.so")
39         os.unlink(l + "/libcrypto.so")
40
41     os.symlink("libssl.so.1.0.2", l + "/libssl.so")
42     os.symlink("libcrypto.so.1.0.2", l + "/libcrypto.so")
43 }
44
45 addtask ssl10_mk_symlink before do_configure after do_prepare_recipe_sysroot