before_script.sh 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  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. ###########################################################################
  23. set -eo pipefail
  24. ./buildconf
  25. if [ "$NGTCP2" = yes ]; then
  26. if [ "$TRAVIS_OS_NAME" = linux -a "$GNUTLS" ]; then
  27. cd $HOME
  28. git clone --depth 1 https://gitlab.com/gnutls/nettle.git
  29. cd nettle
  30. ./.bootstrap
  31. ./configure LDFLAGS="-Wl,-rpath,$HOME/ngbuild/lib" --disable-documentation --prefix=$HOME/ngbuild
  32. make
  33. make install
  34. cd $HOME
  35. git clone --depth 1 https://gitlab.com/gnutls/gnutls.git pgtls
  36. cd pgtls
  37. ./bootstrap
  38. ./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
  39. make
  40. make install
  41. else
  42. cd $HOME
  43. git clone --depth 1 -b OpenSSL_1_1_1g-quic-draft-29 https://github.com/tatsuhiro-t/openssl possl
  44. cd possl
  45. ./config enable-tls1_3 --prefix=$HOME/ngbuild
  46. make
  47. make install_sw
  48. fi
  49. cd $HOME
  50. git clone --depth 1 https://github.com/ngtcp2/nghttp3
  51. cd nghttp3
  52. autoreconf -i
  53. ./configure --prefix=$HOME/ngbuild --enable-lib-only
  54. make
  55. make install
  56. cd $HOME
  57. git clone --depth 1 https://github.com/ngtcp2/ngtcp2
  58. cd ngtcp2
  59. autoreconf -i
  60. if test -n "$GNUTLS"; then
  61. WITHGNUTLS="--with-gnutls"
  62. fi
  63. ./configure PKG_CONFIG_PATH=$HOME/ngbuild/lib/pkgconfig LDFLAGS="-Wl,-rpath,$HOME/ngbuild/lib" --prefix=$HOME/ngbuild --enable-lib-only $WITHGNUTLS
  64. make
  65. make install
  66. fi
  67. if [ "$TRAVIS_OS_NAME" = linux -a "$BORINGSSL" ]; then
  68. cd $HOME
  69. git clone --depth=1 https://boringssl.googlesource.com/boringssl
  70. cd boringssl
  71. CXX="g++" CC="gcc" cmake -H. -Bbuild -GNinja -DCMAKE_BUILD_TYPE=release -DBUILD_SHARED_LIBS=1
  72. cmake --build build
  73. mkdir lib
  74. cp ./build/crypto/libcrypto.so ./lib/
  75. cp ./build/ssl/libssl.so ./lib/
  76. echo "BoringSSL lib dir: "`pwd`"/lib"
  77. cmake --build build --target clean
  78. rm -f build/CMakeCache.txt
  79. CXX="g++" CC="gcc" cmake -H. -Bbuild -GNinja -DCMAKE_POSITION_INDEPENDENT_CODE=on
  80. cmake --build build
  81. export LIBS=-lpthread
  82. fi
  83. if [ "$TRAVIS_OS_NAME" = linux -a "$OPENSSL3" ]; then
  84. cd $HOME
  85. git clone --depth=1 https://github.com/openssl/openssl
  86. cd openssl
  87. ./config enable-tls1_3 --prefix=$HOME/openssl3
  88. make
  89. make install_sw
  90. fi
  91. if [ "$TRAVIS_OS_NAME" = linux -a "$LIBRESSL" ]; then
  92. cd $HOME
  93. git clone --depth=1 -b v3.1.4 https://github.com/libressl-portable/portable.git libressl-git
  94. cd libressl-git
  95. ./autogen.sh
  96. ./configure --prefix=$HOME/libressl
  97. make
  98. make install
  99. fi
  100. if [ "$TRAVIS_OS_NAME" = linux -a "$HYPER" ]; then
  101. cd $HOME
  102. git clone --depth=1 https://github.com/hyperium/hyper.git
  103. curl https://sh.rustup.rs -sSf | sh -s -- -y
  104. source $HOME/.cargo/env
  105. cd $HOME/hyper
  106. RUSTFLAGS="--cfg hyper_unstable_ffi" cargo build --features client,http1,http2,ffi
  107. fi
  108. if [ "$TRAVIS_OS_NAME" = linux -a "$QUICHE" ]; then
  109. cd $HOME
  110. git clone --depth=1 --recursive https://github.com/cloudflare/quiche.git
  111. curl https://sh.rustup.rs -sSf | sh -s -- -y
  112. source $HOME/.cargo/env
  113. cd $HOME/quiche
  114. cargo build -v --release --features ffi,pkg-config-meta,qlog
  115. mkdir -v deps/boringssl/src/lib
  116. ln -vnf $(find target/release -name libcrypto.a -o -name libssl.a) deps/boringssl/src/lib/
  117. fi
  118. # Install common libraries.
  119. # The library build directories are set to be cached by .travis.yml. If you are
  120. # changing a build directory name below (eg a version change) then you must
  121. # change it in .travis.yml `cache: directories:` as well.
  122. if [ $TRAVIS_OS_NAME = linux ]; then
  123. if [ ! -e $HOME/wolfssl-4.4.0-stable/Makefile ]; then
  124. cd $HOME
  125. curl -LO https://github.com/wolfSSL/wolfssl/archive/v4.4.0-stable.tar.gz
  126. tar -xzf v4.4.0-stable.tar.gz
  127. cd wolfssl-4.4.0-stable
  128. ./autogen.sh
  129. ./configure --enable-tls13 --enable-all
  130. touch wolfssl/wolfcrypt/fips.h
  131. make
  132. fi
  133. cd $HOME/wolfssl-4.4.0-stable
  134. sudo make install
  135. if [ "$MESALINK" = "yes" ]; then
  136. if [ ! -e $HOME/mesalink-1.0.0/Makefile ]; then
  137. cd $HOME
  138. curl https://sh.rustup.rs -sSf | sh -s -- -y
  139. source $HOME/.cargo/env
  140. curl -LO https://github.com/mesalock-linux/mesalink/archive/v1.0.0.tar.gz
  141. tar -xzf v1.0.0.tar.gz
  142. cd mesalink-1.0.0
  143. ./autogen.sh
  144. ./configure --enable-tls13
  145. make
  146. fi
  147. cd $HOME/mesalink-1.0.0
  148. sudo make install
  149. fi
  150. if [ ! -e $HOME/nghttp2-1.39.2/Makefile ]; then
  151. cd $HOME
  152. curl -LO https://github.com/nghttp2/nghttp2/releases/download/v1.39.2/nghttp2-1.39.2.tar.gz
  153. tar -xzf nghttp2-1.39.2.tar.gz
  154. cd nghttp2-1.39.2
  155. CXX="g++-8" CC="gcc-8" CFLAGS="" LDFLAGS="" LIBS="" ./configure --disable-threads --enable-app
  156. make
  157. fi
  158. cd $HOME/nghttp2-1.39.2
  159. sudo make install
  160. fi