xref: /aosp_15_r20/external/executorch/.ci/docker/common/install_openssl.sh (revision 523fa7a60841cd1ecfb9cc4201f1ca8b03ed023a)
1#!/bin/bash
2# Copyright (c) Meta Platforms, Inc. and affiliates.
3# All rights reserved.
4#
5# This source code is licensed under the BSD-style license found in the
6# LICENSE file in the root directory of this source tree.
7
8# NB: This script is needed for sccache and is adopted from PyTorch core repo at
9# https://github.com/pytorch/pytorch/blob/main/.ci/docker/common/install_openssl.sh
10set -ex
11
12OPENSSL=openssl-1.1.1k
13
14wget -q -O "${OPENSSL}.tar.gz" "https://ossci-linux.s3.amazonaws.com/${OPENSSL}.tar.gz"
15tar xf "${OPENSSL}.tar.gz"
16
17pushd "${OPENSSL}" || true
18./config --prefix=/opt/openssl -d "-Wl,--enable-new-dtags,-rpath,$(LIBRPATH)"
19# NOTE: openssl install errors out when built with the -j option
20make -j6; make install_sw
21# Link the ssl libraries to the /usr/lib folder.
22ln -s /opt/openssl/lib/lib* /usr/lib
23popd || true
24
25rm -rf "${OPENSSL}"
26