You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

78 lines
1.9 KiB

  1. #!/bin/bash
  2. #
  3. # Functions for building MinGW port in Docker
  4. #
  5. # This file is part of the shadowsocks-libev.
  6. #
  7. # shadowsocks-libev is free software; you can redistribute it and/or modify
  8. # it under the terms of the GNU General Public License as published by
  9. # the Free Software Foundation; either version 3 of the License, or
  10. # (at your option) any later version.
  11. #
  12. # shadowsocks-libev is distributed in the hope that it will be useful,
  13. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. # GNU General Public License for more details.
  16. #
  17. # You should have received a copy of the GNU General Public License
  18. # along with shadowsocks-libev; see the file COPYING. If not, see
  19. # <http://www.gnu.org/licenses/>.
  20. #
  21. # Exit on error
  22. set -e
  23. . /prepare.sh
  24. build_deps() {
  25. arch=$1
  26. host=$arch-w64-mingw32
  27. prefix=${PREFIX}/$arch
  28. args="--host=${host} --prefix=${prefix} --disable-shared --enable-static"
  29. # libev
  30. cd "$SRC/$LIBEV_SRC"
  31. ./configure $args
  32. make clean
  33. make install
  34. # mbedtls
  35. cd "$SRC/$MBEDTLS_SRC"
  36. make clean
  37. make lib WINDOWS=1 CC="${host}-gcc" AR="${host}-ar"
  38. ## "make install" command from mbedtls
  39. DESTDIR="${prefix}"
  40. mkdir -p "${DESTDIR}"/include/mbedtls
  41. cp -r include/mbedtls "${DESTDIR}"/include
  42. mkdir -p "${DESTDIR}"/lib
  43. cp -RP library/libmbedtls.* "${DESTDIR}"/lib
  44. cp -RP library/libmbedx509.* "${DESTDIR}"/lib
  45. cp -RP library/libmbedcrypto.* "${DESTDIR}"/lib
  46. unset DESTDIR
  47. # sodium
  48. cd "$SRC/$SODIUM_SRC"
  49. ./configure $args
  50. make clean
  51. make install
  52. # pcre
  53. cd "$SRC/$PCRE_SRC"
  54. ./configure $args \
  55. --enable-jit --disable-cpp \
  56. --enable-unicode-properties
  57. make clean
  58. make install
  59. # c-ares
  60. cd "$SRC/$CARES_SRC"
  61. ./configure $args
  62. make clean
  63. make install
  64. }
  65. dk_deps() {
  66. for arch in i686 x86_64; do
  67. build_deps $arch
  68. done
  69. }