2
0

before_script.sh 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. #!/bin/bash
  2. #***************************************************************************
  3. # _ _ ____ _
  4. # Project ___| | | | _ \| |
  5. # / __| | | | |_) | |
  6. # | (__| |_| | _ <| |___
  7. # \___|\___/|_| \_\_____|
  8. #
  9. # Copyright (C) 1998 - 2020, 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.haxx.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 -b tmp-quic 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_1d-quic-draft-27 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. ./configure PKG_CONFIG_PATH=$HOME/ngbuild/lib/pkgconfig LDFLAGS="-Wl,-rpath,$HOME/ngbuild/lib" --prefix=$HOME/ngbuild --enable-lib-only
  61. make
  62. make install
  63. fi
  64. if [ "$TRAVIS_OS_NAME" = linux -a "$BORINGSSL" ]; then
  65. cd $HOME
  66. git clone --depth=1 https://boringssl.googlesource.com/boringssl
  67. cd boringssl
  68. mkdir build
  69. cd build
  70. CXX="g++" CC="gcc" cmake -DCMAKE_BUILD_TYPE=release -DBUILD_SHARED_LIBS=1 ..
  71. make
  72. cd ..
  73. mkdir lib
  74. cd lib
  75. cp ../build/crypto/libcrypto.so .
  76. cp ../build/ssl/libssl.so .
  77. echo "BoringSSL lib dir: "`pwd`
  78. cd ../build
  79. make clean
  80. rm -f CMakeCache.txt
  81. CXX="g++" CC="gcc" cmake -DCMAKE_POSITION_INDEPENDENT_CODE=on ..
  82. make
  83. export LIBS=-lpthread
  84. fi
  85. if [ "$TRAVIS_OS_NAME" = linux -a "$QUICHE" ]; then
  86. cd $HOME
  87. git clone --depth=1 https://github.com/cloudflare/quiche.git
  88. curl https://sh.rustup.rs -sSf | sh -s -- -y
  89. source $HOME/.cargo/env
  90. cd $HOME/quiche
  91. QUICHE_BSSL_PATH=$HOME/boringssl cargo build -v --release --features pkg-config-meta,qlog
  92. fi
  93. # Install common libraries.
  94. # The library build directories are set to be cached by .travis.yml. If you are
  95. # changing a build directory name below (eg a version change) then you must
  96. # change it in .travis.yml `cache: directories:` as well.
  97. if [ $TRAVIS_OS_NAME = linux ]; then
  98. if [ ! -e $HOME/wolfssl-4.4.0-stable/Makefile ]; then
  99. cd $HOME
  100. curl -LO https://github.com/wolfSSL/wolfssl/archive/v4.4.0-stable.tar.gz
  101. tar -xzf v4.4.0-stable.tar.gz
  102. cd wolfssl-4.4.0-stable
  103. ./autogen.sh
  104. ./configure --enable-tls13 --enable-all
  105. touch wolfssl/wolfcrypt/fips.h
  106. make
  107. fi
  108. cd $HOME/wolfssl-4.4.0-stable
  109. sudo make install
  110. if [ ! -e $HOME/mesalink-1.0.0/Makefile ]; then
  111. cd $HOME
  112. curl https://sh.rustup.rs -sSf | sh -s -- -y
  113. source $HOME/.cargo/env
  114. curl -LO https://github.com/mesalock-linux/mesalink/archive/v1.0.0.tar.gz
  115. tar -xzf v1.0.0.tar.gz
  116. cd mesalink-1.0.0
  117. ./autogen.sh
  118. ./configure --enable-tls13
  119. make
  120. fi
  121. cd $HOME/mesalink-1.0.0
  122. sudo make install
  123. if [ ! -e $HOME/nghttp2-1.39.2/Makefile ]; then
  124. cd $HOME
  125. curl -LO https://github.com/nghttp2/nghttp2/releases/download/v1.39.2/nghttp2-1.39.2.tar.gz
  126. tar -xzf nghttp2-1.39.2.tar.gz
  127. cd nghttp2-1.39.2
  128. CXX="g++-8" CC="gcc-8" CFLAGS="" LDFLAGS="" LIBS="" ./configure --disable-threads --enable-app
  129. make
  130. fi
  131. cd $HOME/nghttp2-1.39.2
  132. sudo make install
  133. fi