• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#!/bin/bash
2#***************************************************************************
3#                                  _   _ ____  _
4#  Project                     ___| | | |  _ \| |
5#                             / __| | | | |_) | |
6#                            | (__| |_| |  _ <| |___
7#                             \___|\___/|_| \_\_____|
8#
9# Copyright (C) 1998 - 2021, Daniel Stenberg, <daniel@haxx.se>, et al.
10#
11# This software is licensed as described in the file COPYING, which
12# you should have received as part of this distribution. The terms
13# are also available at https://curl.se/docs/copyright.html.
14#
15# You may opt to use, copy, modify, merge, publish, distribute and/or sell
16# copies of the Software, and permit persons to whom the Software is
17# furnished to do so, under the terms of the COPYING file.
18#
19# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
20# KIND, either express or implied.
21#
22###########################################################################
23set -eo pipefail
24
25./buildconf
26
27if [ "$NGTCP2" = yes ]; then
28  if [ "$TRAVIS_OS_NAME" = linux -a "$GNUTLS" ]; then
29    cd $HOME
30    git clone --depth 1 https://gitlab.com/gnutls/nettle.git
31    cd nettle
32    ./.bootstrap
33    ./configure LDFLAGS="-Wl,-rpath,$HOME/ngbuild/lib" --disable-documentation --prefix=$HOME/ngbuild
34    make
35    make install
36
37    cd $HOME
38    git clone --depth 1 https://gitlab.com/gnutls/gnutls.git pgtls
39    cd pgtls
40    ./bootstrap
41    ./configure PKG_CONFIG_PATH=$HOME/ngbuild/lib/pkgconfig LDFLAGS="-Wl,-rpath,$HOME/ngbuild/lib" --with-included-libtasn1 --with-included-unistring --disable-guile --disable-doc --prefix=$HOME/ngbuild
42    make
43    make install
44  else
45    cd $HOME
46    git clone --depth 1 -b OpenSSL_1_1_1j+quic https://github.com/quictls/openssl possl
47    cd possl
48    ./config enable-tls1_3 --prefix=$HOME/ngbuild
49    make
50    make install_sw
51  fi
52
53  cd $HOME
54  git clone --depth 1 https://github.com/ngtcp2/nghttp3
55  cd nghttp3
56  autoreconf -i
57  ./configure --prefix=$HOME/ngbuild --enable-lib-only
58  make
59  make install
60
61  cd $HOME
62  git clone --depth 1 https://github.com/ngtcp2/ngtcp2
63  cd ngtcp2
64  autoreconf -i
65  if test -n "$GNUTLS"; then
66      WITHGNUTLS="--with-gnutls"
67  fi
68  ./configure PKG_CONFIG_PATH=$HOME/ngbuild/lib/pkgconfig LDFLAGS="-Wl,-rpath,$HOME/ngbuild/lib" --prefix=$HOME/ngbuild --enable-lib-only $WITHGNUTLS
69  make
70  make install
71fi
72
73if [ "$TRAVIS_OS_NAME" = linux -a "$BORINGSSL" ]; then
74  cd $HOME
75  git clone --depth=1 https://boringssl.googlesource.com/boringssl
76  cd boringssl
77  CXX="g++" CC="gcc" cmake -H. -Bbuild -GNinja -DCMAKE_BUILD_TYPE=release -DBUILD_SHARED_LIBS=1
78  cmake --build build
79  mkdir lib
80  cp ./build/crypto/libcrypto.so ./lib/
81  cp ./build/ssl/libssl.so ./lib/
82  echo "BoringSSL lib dir: "`pwd`"/lib"
83  cmake --build build --target clean
84  rm -f build/CMakeCache.txt
85  CXX="g++" CC="gcc" cmake -H. -Bbuild -GNinja -DCMAKE_POSITION_INDEPENDENT_CODE=on
86  cmake --build build
87  export LIBS=-lpthread
88fi
89
90if [ "$TRAVIS_OS_NAME" = linux -a "$OPENSSL3" ]; then
91  cd $HOME
92  git clone --depth=1 https://github.com/openssl/openssl
93  cd openssl
94  ./config enable-tls1_3 --prefix=$HOME/openssl3
95  make
96  make install_sw
97fi
98
99if [ "$TRAVIS_OS_NAME" = linux -a "$LIBRESSL" ]; then
100  cd $HOME
101  git clone --depth=1 -b v3.1.4 https://github.com/libressl-portable/portable.git libressl-git
102  cd libressl-git
103  ./autogen.sh
104  ./configure --prefix=$HOME/libressl
105  make
106  make install
107fi
108
109if [ "$TRAVIS_OS_NAME" = linux -a "$QUICHE" ]; then
110  cd $HOME
111  git clone --depth=1 --recursive https://github.com/cloudflare/quiche.git
112  curl https://sh.rustup.rs -sSf | sh -s -- -y
113  source $HOME/.cargo/env
114  cd $HOME/quiche
115  cargo build -v --release --features ffi,pkg-config-meta,qlog
116  mkdir -v deps/boringssl/src/lib
117  ln -vnf $(find target/release -name libcrypto.a -o -name libssl.a) deps/boringssl/src/lib/
118fi
119
120if [ "$TRAVIS_OS_NAME" = linux -a "$RUSTLS_VERSION" ]; then
121  cd $HOME
122  git clone --depth=1 --recursive https://github.com/rustls/rustls-ffi.git -b "$RUSTLS_VERSION"
123  curl https://sh.rustup.rs -sSf | sh -s -- -y
124  source $HOME/.cargo/env
125  cargo install cbindgen
126  cd $HOME/rustls-ffi
127  make
128  make DESTDIR=$HOME/crust install
129fi
130
131if [ $TRAVIS_OS_NAME = linux -a "$WOLFSSL" ]; then
132  if [ ! -e $HOME/wolfssl-4.7.0-stable/Makefile ]; then
133    cd $HOME
134    curl -LO https://github.com/wolfSSL/wolfssl/archive/v4.7.0-stable.tar.gz
135    tar -xzf v4.7.0-stable.tar.gz
136    cd wolfssl-4.7.0-stable
137    ./autogen.sh
138    ./configure --enable-tls13 --enable-all
139    touch wolfssl/wolfcrypt/fips.h
140    make
141  fi
142
143  cd $HOME/wolfssl-4.7.0-stable
144  sudo make install
145fi
146
147# Install common libraries.
148if [ $TRAVIS_OS_NAME = linux ]; then
149
150  if [ "$MESALINK" = "yes" ]; then
151    if [ ! -e $HOME/mesalink-1.0.0/Makefile ]; then
152      cd $HOME
153      curl https://sh.rustup.rs -sSf | sh -s -- -y
154      source $HOME/.cargo/env
155      curl -LO https://github.com/mesalock-linux/mesalink/archive/v1.0.0.tar.gz
156      tar -xzf v1.0.0.tar.gz
157      cd mesalink-1.0.0
158      ./autogen.sh
159      ./configure --enable-tls13
160      make
161    fi
162    cd $HOME/mesalink-1.0.0
163    sudo make install
164
165  fi
166
167  if [ "$BEARSSL" = "yes" ]; then
168    if [ ! -e $HOME/bearssl-0.6/Makefile ]; then
169      cd $HOME
170      curl -LO https://bearssl.org/bearssl-0.6.tar.gz
171      tar -xzf bearssl-0.6.tar.gz
172      cd bearssl-0.6
173      make
174    fi
175    cd $HOME/bearssl-0.6
176    sudo cp inc/*.h /usr/local/include
177    sudo cp build/libbearssl.* /usr/local/lib
178  fi
179
180fi
181