xref: /freebsd/contrib/libfido2/.actions/build-linux-openssl3-gcc (revision 95eb4b873b6a8b527c5bd78d7191975dfca38998)
1#!/bin/sh -eux
2
3# Copyright (c) 2022 Yubico AB. All rights reserved.
4# Use of this source code is governed by a BSD-style
5# license that can be found in the LICENSE file.
6# SPDX-License-Identifier: BSD-2-Clause
7
8${CC} --version
9FAKEROOT="$(mktemp -d)"
10
11# Build and install OpenSSL 3.0.12.
12git clone --branch openssl-3.0.12 \
13	--depth=1 https://github.com/openssl/openssl
14cd openssl
15./Configure linux-x86_64 --prefix="${FAKEROOT}" \
16	--openssldir="${FAKEROOT}/openssl" --libdir=lib
17make install_sw
18cd ..
19
20# Build and install libfido2.
21for T in Debug Release; do
22	mkdir build-$T
23	export PKG_CONFIG_PATH="${FAKEROOT}/lib/pkgconfig"
24	(cd build-$T && cmake -DCMAKE_BUILD_TYPE=$T ..)
25	make -j"$(nproc)" -C build-$T
26	make -C build-$T regress
27	sudo make -C build-$T install
28done
29