Cross-Platform build scripts for audio plugins
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.

449 lines
17KB

  1. #!/bin/bash
  2. set -e
  3. cd $(dirname ${0})
  4. PAWPAW_ROOT="${PWD}"
  5. # ---------------------------------------------------------------------------------------------------------------------
  6. # check target
  7. target="${1}"
  8. if [ -z "${target}" ]; then
  9. echo "usage: ${0} <target>"
  10. exit 1
  11. fi
  12. # ---------------------------------------------------------------------------------------------------------------------
  13. # source setup code
  14. source setup/check_target.sh
  15. source setup/env.sh
  16. source setup/functions.sh
  17. source setup/versions.sh
  18. # ---------------------------------------------------------------------------------------------------------------------
  19. # check for depedencies
  20. if ! command -v curl >/dev/null; then
  21. echo "missing 'curl' program, cannot continue!"
  22. exit 2
  23. fi
  24. if ! command -v make >/dev/null; then
  25. echo "missing 'make' program, cannot continue!"
  26. exit 2
  27. fi
  28. if ! command -v patch >/dev/null; then
  29. echo "missing 'patch' program, cannot continue!"
  30. exit 2
  31. fi
  32. if ! command -v python3 >/dev/null; then
  33. echo "missing 'python3' program, cannot continue!"
  34. exit 2
  35. fi
  36. if ! command -v sed >/dev/null; then
  37. echo "missing 'sed' program, cannot continue!"
  38. exit 2
  39. fi
  40. if ! command -v tar >/dev/null; then
  41. echo "missing 'tar' program, cannot continue!"
  42. exit 2
  43. fi
  44. if [ "${LINUX}" -eq 1 ] && ! command -v pkg-config >/dev/null; then
  45. echo "missing 'pkg-config' program, cannot continue!"
  46. exit 2
  47. fi
  48. if [ -z "${cmake}" ]; then
  49. echo "missing 'cmake' program, cannot continue!"
  50. exit 2
  51. fi
  52. # ---------------------------------------------------------------------------------------------------------------------
  53. # create common directories
  54. mkdir -p "${PAWPAW_BUILDDIR}"
  55. mkdir -p "${PAWPAW_DOWNLOADDIR}"
  56. mkdir -p "${PAWPAW_PREFIX}"
  57. mkdir -p "${PAWPAW_TMPDIR}"
  58. # ---------------------------------------------------------------------------------------------------------------------
  59. # merged usr mode
  60. mkdir -p "${PAWPAW_PREFIX}/bin"
  61. mkdir -p "${PAWPAW_PREFIX}/docs"
  62. mkdir -p "${PAWPAW_PREFIX}/etc"
  63. mkdir -p "${PAWPAW_PREFIX}/include"
  64. mkdir -p "${PAWPAW_PREFIX}/lib"
  65. mkdir -p "${PAWPAW_PREFIX}/share"
  66. mkdir -p "${PAWPAW_PREFIX}/usr"
  67. if [ ! -e "${PAWPAW_PREFIX}/usr/bin" ]; then
  68. ln -s ../bin "${PAWPAW_PREFIX}/usr/bin"
  69. fi
  70. if [ ! -e "${PAWPAW_PREFIX}/usr/docs" ]; then
  71. ln -s ../docs "${PAWPAW_PREFIX}/usr/docs"
  72. fi
  73. if [ ! -e "${PAWPAW_PREFIX}/usr/etc" ]; then
  74. ln -s ../etc "${PAWPAW_PREFIX}/usr/etc"
  75. fi
  76. if [ ! -e "${PAWPAW_PREFIX}/usr/include" ]; then
  77. ln -s ../include "${PAWPAW_PREFIX}/usr/include"
  78. fi
  79. if [ ! -e "${PAWPAW_PREFIX}/usr/lib" ]; then
  80. ln -s ../lib "${PAWPAW_PREFIX}/usr/lib"
  81. fi
  82. if [ ! -e "${PAWPAW_PREFIX}/usr/share" ]; then
  83. ln -s ../share "${PAWPAW_PREFIX}/usr/share"
  84. fi
  85. # ---------------------------------------------------------------------------------------------------------------------
  86. # merged usr mode (host)
  87. mkdir -p "${PAWPAW_PREFIX}-host/bin"
  88. mkdir -p "${PAWPAW_PREFIX}-host/usr"
  89. if [ ! -e "${PAWPAW_PREFIX}-host/usr/bin" ]; then
  90. ln -s ../bin "${PAWPAW_PREFIX}-host/usr/bin"
  91. fi
  92. # ---------------------------------------------------------------------------------------------------------------------
  93. # GNU tools by default on macOS
  94. if [ "${MACOS}" -eq 1 ]; then
  95. if ! command -v gawk >/dev/null; then
  96. echo "missing 'gawk' program, cannot continue!"
  97. exit 2
  98. elif [ ! -e "${PAWPAW_PREFIX}-host/bin/awk" ]; then
  99. ln -s $(command -v gawk) "${PAWPAW_PREFIX}-host/bin/awk"
  100. fi
  101. if ! command -v gcp >/dev/null; then
  102. echo "missing 'gcp' program, cannot continue!"
  103. exit 2
  104. elif [ ! -e "${PAWPAW_PREFIX}-host/bin/cp" ]; then
  105. ln -s $(command -v gcp) "${PAWPAW_PREFIX}-host/bin/cp"
  106. fi
  107. if ! command -v ginstall >/dev/null; then
  108. echo "missing 'ginstall' program, cannot continue!"
  109. exit 2
  110. elif [ ! -e "${PAWPAW_PREFIX}-host/bin/install" ]; then
  111. ln -s $(command -v ginstall) "${PAWPAW_PREFIX}-host/bin/install"
  112. fi
  113. if ! command -v glibtool >/dev/null; then
  114. echo "missing 'glibtool' program, cannot continue!"
  115. exit 2
  116. elif [ ! -e "${PAWPAW_PREFIX}-host/bin/libtool" ]; then
  117. ln -s $(command -v glibtool) "${PAWPAW_PREFIX}-host/bin/libtool"
  118. fi
  119. if ! command -v glibtoolize >/dev/null; then
  120. echo "missing 'glibtoolize' program, cannot continue!"
  121. exit 2
  122. elif [ ! -e "${PAWPAW_PREFIX}-host/bin/libtoolize" ]; then
  123. ln -s $(command -v glibtoolize) "${PAWPAW_PREFIX}-host/bin/libtoolize"
  124. fi
  125. if ! command -v gm4 >/dev/null; then
  126. echo "missing 'curl' gm4, cannot continue!"
  127. exit 2
  128. elif [ ! -e "${PAWPAW_PREFIX}-host/bin/m4" ]; then
  129. ln -s $(command -v gm4) "${PAWPAW_PREFIX}-host/bin/m4"
  130. fi
  131. if ! command -v gmake >/dev/null; then
  132. echo "missing 'curl' gmake, cannot continue!"
  133. exit 2
  134. elif [ ! -e "${PAWPAW_PREFIX}-host/bin/make" ]; then
  135. ln -s $(command -v gmake) "${PAWPAW_PREFIX}-host/bin/make"
  136. fi
  137. if ! command -v greadlink >/dev/null; then
  138. echo "missing 'curl' greadlink, cannot continue!"
  139. exit 2
  140. elif [ ! -e "${PAWPAW_PREFIX}-host/bin/readlink" ]; then
  141. ln -s $(command -v greadlink) "${PAWPAW_PREFIX}-host/bin/readlink"
  142. fi
  143. if ! command -v grealpath >/dev/null; then
  144. echo "missing 'curl' grealpath, cannot continue!"
  145. exit 2
  146. elif [ ! -e "${PAWPAW_PREFIX}-host/bin/realpath" ]; then
  147. ln -s $(command -v grealpath) "${PAWPAW_PREFIX}-host/bin/realpath"
  148. fi
  149. if ! command -v gsed >/dev/null; then
  150. echo "missing 'curl' gsed, cannot continue!"
  151. exit 2
  152. elif [ ! -e "${PAWPAW_PREFIX}-host/bin/sed" ]; then
  153. ln -s $(command -v gsed) "${PAWPAW_PREFIX}-host/bin/sed"
  154. fi
  155. fi
  156. # ---------------------------------------------------------------------------------------------------------------------
  157. # use some native libs for linux builds
  158. if [ "${LINUX}" -eq 1 ]; then
  159. mkdir -p ${TARGET_PKG_CONFIG_PATH}
  160. if [ "${LINUX_TARGET}" = "linux-aarch64" ]; then
  161. export PKG_CONFIG_PATH=/usr/lib/aarch64-linux-gnu/pkgconfig
  162. elif [ "${LINUX_TARGET}" = "linux-armhf" ]; then
  163. export PKG_CONFIG_PATH=/usr/lib/arm-linux-gnueabihf/pkgconfig
  164. elif [ "${LINUX_TARGET}" = "linux-i686" ]; then
  165. export PKG_CONFIG_PATH=/usr/lib/i386-linux-gnu/pkgconfig
  166. elif [ "${LINUX_TARGET}" = "linux-riscv64" ]; then
  167. export PKG_CONFIG_PATH=/usr/lib/riscv64-linux-gnu/pkgconfig
  168. elif [ "${LINUX_TARGET}" = "linux-x86_64" ]; then
  169. export PKG_CONFIG_PATH=/usr/lib/x86_64-linux-gnu/pkgconfig
  170. fi
  171. if ! pkg-config --print-errors --exists alsa dbus-1 gl glib-2.0 libpcre libpcre2-8 pthread-stubs uuid x11 xcb xcursor xext xfixes xproto xrandr xrender; then
  172. echo "some system libs are not available, cannot continue"
  173. exit 2
  174. fi
  175. if [ ! -e "${TARGET_PKG_CONFIG_PATH}/alsa.pc" ]; then
  176. cp $(pkg-config --variable=pcfiledir alsa)/alsa.pc ${TARGET_PKG_CONFIG_PATH}/
  177. sed -i '/Libs.private/d' ${TARGET_PKG_CONFIG_PATH}/alsa.pc
  178. fi
  179. if [ ! -e "${TARGET_PKG_CONFIG_PATH}/dbus-1.pc" ]; then
  180. cp $(pkg-config --variable=pcfiledir dbus-1)/dbus-1.pc ${TARGET_PKG_CONFIG_PATH}/
  181. sed -i '/Libs.private/d' ${TARGET_PKG_CONFIG_PATH}/dbus-1.pc
  182. fi
  183. if [ ! -e "${TARGET_PKG_CONFIG_PATH}/gl.pc" ]; then
  184. cp $(pkg-config --variable=pcfiledir gl)/gl.pc ${TARGET_PKG_CONFIG_PATH}/
  185. sed -i '/Libs.private/d' ${TARGET_PKG_CONFIG_PATH}/gl.pc
  186. fi
  187. if [ ! -e "${TARGET_PKG_CONFIG_PATH}/glib-2.0.pc" ]; then
  188. cp $(pkg-config --variable=pcfiledir glib-2.0)/g{io,lib,module,object,thread}-2.0.pc ${TARGET_PKG_CONFIG_PATH}/
  189. sed -i '/Libs.private/d' ${TARGET_PKG_CONFIG_PATH}/g{io,lib,module,object,thread}-2.0.pc
  190. fi
  191. if [ ! -e "${TARGET_PKG_CONFIG_PATH}/libpcre.pc" ]; then
  192. cp $(pkg-config --variable=pcfiledir libpcre)/libpcre.pc ${TARGET_PKG_CONFIG_PATH}/
  193. sed -i '/Libs.private/d' ${TARGET_PKG_CONFIG_PATH}/libpcre.pc
  194. fi
  195. if [ ! -e "${TARGET_PKG_CONFIG_PATH}/libpcre2-8.pc" ]; then
  196. cp $(pkg-config --variable=pcfiledir libpcre2-8)/libpcre2-8.pc ${TARGET_PKG_CONFIG_PATH}/
  197. sed -i '/Libs.private/d' ${TARGET_PKG_CONFIG_PATH}/libpcre2-8.pc
  198. fi
  199. if [ ! -e "${TARGET_PKG_CONFIG_PATH}/pthread-stubs.pc" ]; then
  200. cp $(pkg-config --variable=pcfiledir pthread-stubs)/pthread-stubs.pc ${TARGET_PKG_CONFIG_PATH}/
  201. sed -i '/Libs.private/d' ${TARGET_PKG_CONFIG_PATH}/pthread-stubs.pc
  202. fi
  203. if [ ! -e "${TARGET_PKG_CONFIG_PATH}/uuid.pc" ]; then
  204. cp $(pkg-config --variable=pcfiledir uuid)/uuid.pc ${TARGET_PKG_CONFIG_PATH}/
  205. sed -i '/Libs.private/d' ${TARGET_PKG_CONFIG_PATH}/uuid.pc
  206. fi
  207. if [ ! -e "${TARGET_PKG_CONFIG_PATH}/x11.pc" ]; then
  208. cp $(pkg-config --variable=pcfiledir x11)/x11.pc ${TARGET_PKG_CONFIG_PATH}/
  209. sed -i '/Libs.private/d' ${TARGET_PKG_CONFIG_PATH}/x11.pc
  210. fi
  211. if [ ! -e "${TARGET_PKG_CONFIG_PATH}/xcb.pc" ]; then
  212. cp $(pkg-config --variable=pcfiledir xcb)/{xau,xcb,xdmcp}.pc ${TARGET_PKG_CONFIG_PATH}/
  213. sed -i '/Libs.private/d' ${TARGET_PKG_CONFIG_PATH}/{xau,xcb,xdmcp}.pc
  214. fi
  215. if [ ! -e "${TARGET_PKG_CONFIG_PATH}/xcursor.pc" ]; then
  216. cp $(pkg-config --variable=pcfiledir xcursor)/xcursor.pc ${TARGET_PKG_CONFIG_PATH}/
  217. sed -i '/Libs.private/d' ${TARGET_PKG_CONFIG_PATH}/xcursor.pc
  218. fi
  219. if [ ! -e "${TARGET_PKG_CONFIG_PATH}/xext.pc" ]; then
  220. cp $(pkg-config --variable=pcfiledir xext)/xext.pc ${TARGET_PKG_CONFIG_PATH}/
  221. sed -i '/Libs.private/d' ${TARGET_PKG_CONFIG_PATH}/xext.pc
  222. fi
  223. if [ ! -e "${TARGET_PKG_CONFIG_PATH}/xfixes.pc" ]; then
  224. cp $(pkg-config --variable=pcfiledir xfixes)/xfixes.pc ${TARGET_PKG_CONFIG_PATH}/
  225. sed -i '/Libs.private/d' ${TARGET_PKG_CONFIG_PATH}/xfixes.pc
  226. fi
  227. if [ ! -e "${TARGET_PKG_CONFIG_PATH}/xproto.pc" ]; then
  228. cp $(pkg-config --variable=pcfiledir xproto)/{fixesproto,kbproto,randrproto,renderproto,xextproto,xproto}.pc ${TARGET_PKG_CONFIG_PATH}/
  229. sed -i '/Libs.private/d' ${TARGET_PKG_CONFIG_PATH}/{fixesproto,kbproto,randrproto,renderproto,xextproto,xproto}.pc
  230. fi
  231. if [ ! -e "${TARGET_PKG_CONFIG_PATH}/xrandr.pc" ]; then
  232. cp $(pkg-config --variable=pcfiledir xrandr)/xrandr.pc ${TARGET_PKG_CONFIG_PATH}/
  233. sed -i '/Libs.private/d' ${TARGET_PKG_CONFIG_PATH}/xrandr.pc
  234. fi
  235. if [ ! -e "${TARGET_PKG_CONFIG_PATH}/xrender.pc" ]; then
  236. cp $(pkg-config --variable=pcfiledir xrender)/xrender.pc ${TARGET_PKG_CONFIG_PATH}/
  237. sed -i '/Libs.private/d' ${TARGET_PKG_CONFIG_PATH}/xrender.pc
  238. fi
  239. fi
  240. # ---------------------------------------------------------------------------------------------------------------------
  241. # pkgconfig
  242. download pkg-config "${PKG_CONFIG_VERSION}" "${PKG_CONFIG_URL}"
  243. build_host_autoconf pkg-config "${PKG_CONFIG_VERSION}" "--enable-indirect-deps --with-internal-glib --with-pc-path=${TARGET_PKG_CONFIG_PATH}"
  244. if [ -n "${TOOLCHAIN_PREFIX_}" ] && [ ! -e "${PAWPAW_PREFIX}/bin/${TOOLCHAIN_PREFIX_}pkg-config" ]; then
  245. ln -s pkg-config "${PAWPAW_PREFIX}/bin/${TOOLCHAIN_PREFIX_}pkg-config"
  246. fi
  247. # ---------------------------------------------------------------------------------------------------------------------
  248. # libogg
  249. download libogg "${LIBOGG_VERSION}" "${LIBOGG_URL}"
  250. build_autoconf libogg "${LIBOGG_VERSION}"
  251. if [ -z "${PAWPAW_SKIP_TESTS}" ] || [ "${PAWPAW_SKIP_TESTS}" -eq 0 ]; then
  252. run_make libogg "${LIBOGG_VERSION}" "check -j 1"
  253. fi
  254. # ---------------------------------------------------------------------------------------------------------------------
  255. # libvorbis
  256. LIBVORBIS_EXTRAFLAGS="--disable-examples"
  257. download libvorbis "${LIBVORBIS_VERSION}" "${LIBVORBIS_URL}"
  258. build_autoconf libvorbis "${LIBVORBIS_VERSION}" "${LIBVORBIS_EXTRAFLAGS}"
  259. if [ -z "${PAWPAW_SKIP_TESTS}" ] || [ "${PAWPAW_SKIP_TESTS}" -eq 0 ]; then
  260. run_make libvorbis "${LIBVORBIS_VERSION}" "check -j 1"
  261. fi
  262. # ---------------------------------------------------------------------------------------------------------------------
  263. # flac
  264. FLAC_EXTRAFLAGS=""
  265. FLAC_EXTRAFLAGS+=" --disable-doxygen-docs"
  266. FLAC_EXTRAFLAGS+=" --disable-examples"
  267. FLAC_EXTRAFLAGS+=" --disable-stack-smash-protection"
  268. FLAC_EXTRAFLAGS+=" --disable-thorough-tests"
  269. FLAC_EXTRAFLAGS+=" --disable-xmms-plugin"
  270. if [ -n "${PAWPAW_NOSIMD}" ] && [ "${PAWPAW_NOSIMD}" -eq 1 ]; then
  271. FLAC_EXTRAFLAGS+=" ac_cv_header_x86intrin_h=no ac_cv_header_arm_neon_h=no asm_opt=no"
  272. elif [ "${MACOS_UNIVERSAL}" -eq 1 ] || [ "${WASM}" -eq 1 ]; then
  273. # FIXME
  274. FLAC_EXTRAFLAGS+=" ac_cv_header_x86intrin_h=no ac_cv_header_arm_neon_h=no asm_opt=no"
  275. else
  276. # force intrinsic optimizations on targets where auto-detection fails
  277. if [ "${MACOS_UNIVERSAL}" -eq 1 ]; then
  278. FLAC_EXTRAFLAGS+=" ac_cv_header_x86intrin_h=yes ac_cv_header_arm_neon_h=yes asm_opt=yes"
  279. elif [ "${WASM}" -eq 1 ]; then
  280. FLAC_EXTRAFLAGS+=" ac_cv_header_x86intrin_h=yes asm_opt=yes"
  281. fi
  282. fi
  283. download flac "${FLAC_VERSION}" "${FLAC_URL}" "tar.xz"
  284. build_autoconf flac "${FLAC_VERSION}" "${FLAC_EXTRAFLAGS}"
  285. if [ -z "${PAWPAW_SKIP_TESTS}" ] || [ "${PAWPAW_SKIP_TESTS}" -eq 0 ]; then
  286. run_make flac "${FLAC_VERSION}" "check -j 1"
  287. fi
  288. # ---------------------------------------------------------------------------------------------------------------------
  289. # opus
  290. OPUS_EXTRAFLAGS="--enable-custom-modes --enable-float-approx"
  291. OPUS_EXTRAFLAGS+=" --disable-stack-protector"
  292. if [ "${CROSS_COMPILING}" -eq 1 ]; then
  293. OPUS_EXTRAFLAGS+=" --disable-extra-programs"
  294. fi
  295. if [ -n "${PAWPAW_NOSIMD}" ] && [ "${PAWPAW_NOSIMD}" -eq 1 ]; then
  296. OPUS_EXTRAFLAGS+=" --disable-intrinsics"
  297. # FIXME macos-universal proper optimizations https://github.com/DISTRHO/PawPaw/issues/4
  298. elif [ "${MACOS_UNIVERSAL}" -eq 1 ] || [ "${WASM}" -eq 1 ]; then
  299. OPUS_EXTRAFLAGS+=" --disable-intrinsics"
  300. fi
  301. download opus "${OPUS_VERSION}" "${OPUS_URL}"
  302. build_autoconf opus "${OPUS_VERSION}" "${OPUS_EXTRAFLAGS}"
  303. if [ -z "${PAWPAW_SKIP_TESTS}" ] || [ "${PAWPAW_SKIP_TESTS}" -eq 0 ]; then
  304. run_make opus "${OPUS_VERSION}" check
  305. fi
  306. # ---------------------------------------------------------------------------------------------------------------------
  307. # libsndfile
  308. LIBSNDFILE_EXTRAFLAGS="--disable-alsa --disable-full-suite --disable-sqlite"
  309. # force disable mp3 support for now, until we handle those libs
  310. LIBSNDFILE_EXTRAFLAGS+=" --disable-mpeg"
  311. # force intrinsic optimizations on some targets
  312. if [ -z "${PAWPAW_NOSIMD}" ] || [ "${PAWPAW_NOSIMD}" -eq 0 ]; then
  313. if [ "${MACOS_UNIVERSAL}" -eq 1 ] || [ "${WASM}" -eq 1 ]; then
  314. LIBSNDFILE_EXTRAFLAGS+=" ac_cv_header_immintrin_h=yes"
  315. fi
  316. fi
  317. # fix build, regex matching fails
  318. if [ "${WASM}" -eq 1 ]; then
  319. LIBSNDFILE_EXTRAFLAGS+=" ax_cv_c_compiler_version=15.0.0"
  320. LIBSNDFILE_EXTRAFLAGS+=" ax_cv_cxx_compiler_version=15.0.0"
  321. fi
  322. # otherwise tests fail
  323. export EXTRA_CFLAGS="-fno-associative-math -frounding-math"
  324. if [ "${CLANG}" -eq 1 ]; then
  325. export EXTRA_CFLAGS+=" -fno-reciprocal-math"
  326. else
  327. export EXTRA_CFLAGS+=" -fsignaling-nans"
  328. fi
  329. download libsndfile "${LIBSNDFILE_VERSION}" "${LIBSNDFILE_URL}" "tar.xz"
  330. build_autoconf libsndfile "${LIBSNDFILE_VERSION}" "${LIBSNDFILE_EXTRAFLAGS}"
  331. if [ -z "${PAWPAW_SKIP_TESTS}" ] || [ "${PAWPAW_SKIP_TESTS}" -eq 0 ]; then
  332. run_make libsndfile "${LIBSNDFILE_VERSION}" check
  333. fi
  334. # ---------------------------------------------------------------------------------------------------------------------
  335. # libsamplerate
  336. if [ -n "${PAWPAW_SKIP_SAMPLERATE}" ] && [ "${PAWPAW_SKIP_SAMPLERATE}" -eq 1 ]; then
  337. LIBSAMPLERATE_EXTRAFLAGS="--disable-fftw"
  338. # NOTE: sndfile tests use Carbon, which is not always available on macOS
  339. if [ "${CROSS_COMPILING}" -eq 1 ] || [ "${MACOS}" -eq 1 ]; then
  340. LIBSAMPLERATE_EXTRAFLAGS+=" --disable-sndfile"
  341. fi
  342. download libsamplerate "${LIBSAMPLERATE_VERSION}" "${LIBSAMPLERATE_URL}"
  343. build_autoconf libsamplerate "${LIBSAMPLERATE_VERSION}" "${LIBSAMPLERATE_EXTRAFLAGS}"
  344. if ([ -z "${PAWPAW_SKIP_TESTS}" ] || [ "${PAWPAW_SKIP_TESTS}" -eq 0 ]) && [ "${MACOS}" -eq 0 ]; then
  345. run_make libsamplerate "${LIBSAMPLERATE_VERSION}" check
  346. fi
  347. fi # PAWPAW_SKIP_SAMPLERATE
  348. # ---------------------------------------------------------------------------------------------------------------------
  349. # zlib (skipped on macOS)
  350. if [ "${MACOS}" -eq 0 ]; then
  351. git_clone zlib "${ZLIB_VERSION}" "${ZLIB_URL}"
  352. build_conf zlib "${ZLIB_VERSION}" "--static --prefix=${PAWPAW_PREFIX} --zprefix"
  353. if [ "${CROSS_COMPILING}" -eq 0 ]; then
  354. run_make zlib "${ZLIB_VERSION}" check
  355. fi
  356. fi
  357. # ---------------------------------------------------------------------------------------------------------------------
  358. # mingw-std-threads (download, win32 only)
  359. if [ "${WIN32}" -eq 1 ]; then
  360. git_clone mingw-std-threads "${MINGW_STD_THREADS_VERSION}" "${MINGW_STD_THREADS_URL}"
  361. if [ ! -e "${PAWPAW_BUILDDIR}/mingw-std-threads-${MINGW_STD_THREADS_VERSION}/.stamp-installed" ]; then
  362. install -m 644 "${PAWPAW_BUILDDIR}/mingw-std-threads-${MINGW_STD_THREADS_VERSION}"/mingw.*.h "${PAWPAW_PREFIX}/include/"
  363. install -m 644 "${PAWPAW_ROOT}/mingw-compat"/* "${PAWPAW_PREFIX}/include/"
  364. touch "${PAWPAW_BUILDDIR}/mingw-std-threads-${MINGW_STD_THREADS_VERSION}/.stamp-installed"
  365. fi
  366. fi
  367. # ---------------------------------------------------------------------------------------------------------------------