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.

166 lines
6.7KB

  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. # run bootstrap dependencies
  14. ./bootstrap-common.sh "${target}"
  15. # ---------------------------------------------------------------------------------------------------------------------
  16. # source setup code
  17. source setup/check_target.sh
  18. source setup/env.sh
  19. source setup/functions.sh
  20. source setup/versions.sh
  21. # ---------------------------------------------------------------------------------------------------------------------
  22. # aften (macos only)
  23. if [ "${MACOS}" -eq 1 ]; then
  24. download aften "${AFTEN_VERSION}" "http://downloads.sourceforge.net/aften" "tar.bz2"
  25. if [ ! -f "${PAWPAW_BUILDDIR}/aften-${AFTEN_VERSION}/.stamp_installed" ]; then
  26. rm -f "${PAWPAW_BUILDDIR}/aften-${AFTEN_VERSION}/.stamp_installed_libs"
  27. fi
  28. build_cmake aften "${AFTEN_VERSION}" "-DHAVE_MMX=ON -DHAVE_SSE=ON -DHAVE_SSE2=ON"
  29. if [ ! -f "${PAWPAW_BUILDDIR}/aften-${AFTEN_VERSION}/.stamp_installed_libs" ]; then
  30. cp -v "${PAWPAW_BUILDDIR}/aften-${AFTEN_VERSION}/build/libaften_pcm.a" "${PAWPAW_PREFIX}/lib/libaften_pcm.a"
  31. cp -v "${PAWPAW_BUILDDIR}/aften-${AFTEN_VERSION}/build/libaften_static.a" "${PAWPAW_PREFIX}/lib/libaften.a"
  32. touch "${PAWPAW_BUILDDIR}/aften-${AFTEN_VERSION}/.stamp_installed_libs"
  33. fi
  34. fi
  35. # ---------------------------------------------------------------------------------------------------------------------
  36. # db
  37. download db "${DB_VERSION}" "https://download.oracle.com/berkeley-db"
  38. # based on build_autoconf
  39. function build_custom_db() {
  40. local name="${1}"
  41. local version="${2}"
  42. local extraconfrules="${3}"
  43. local pkgdir="${PAWPAW_BUILDDIR}/${name}-${version}"
  44. if [ "${CROSS_COMPILING}" -eq 1 ]; then
  45. extraconfrules+=" --host=${TOOLCHAIN_PREFIX}"
  46. fi
  47. if [ "${MACOS}" -eq 1 ]; then
  48. extraconfrules+=" --with-mutex=x86_64/gcc-assembly db_cv_atomic=x86/gcc-assembly"
  49. fi
  50. if [ "${WIN32}" -eq 1 ]; then
  51. extraconfrules+=" --enable-mingw"
  52. fi
  53. _prebuild "${name}" "${pkgdir}"
  54. if [ ! -f "${pkgdir}/.stamp_configured" ]; then
  55. pushd "${pkgdir}/build_unix"
  56. ../dist/configure --enable-static --disable-shared --disable-debug --disable-doc --disable-maintainer-mode --prefix="${PAWPAW_PREFIX}" ${extraconfrules}
  57. touch ../.stamp_configured
  58. popd
  59. fi
  60. if [ ! -f "${pkgdir}/.stamp_built" ]; then
  61. pushd "${pkgdir}/build_unix"
  62. make ${MAKE_ARGS}
  63. touch ../.stamp_built
  64. popd
  65. fi
  66. if [ ! -f "${pkgdir}/.stamp_installed" ]; then
  67. pushd "${pkgdir}/build_unix"
  68. make ${MAKE_ARGS} install
  69. touch ../.stamp_installed
  70. popd
  71. fi
  72. _postbuild
  73. }
  74. build_custom_db db "${DB_VERSION}" "--disable-java --disable-replication --disable-sql --disable-tcl"
  75. # ---------------------------------------------------------------------------------------------------------------------
  76. # rtaudio (download, win32 only)
  77. if [ "${WIN32}" -eq 1 ]; then
  78. download rtaudio "${RTAUDIO_VERSION}" "https://github.com/falkTX/rtaudio.git" "" "git"
  79. # fixes for portaudio
  80. ASIO_DIR="${PAWPAW_BUILDDIR}/rtaudio-${RTAUDIO_VERSION}/include"
  81. if [ -d "${ASIO_DIR}" ]; then
  82. link_file rtaudio "${RTAUDIO_VERSION}" "." "include/common"
  83. link_file rtaudio "${RTAUDIO_VERSION}" "." "include/host"
  84. link_file rtaudio "${RTAUDIO_VERSION}" "." "include/pc"
  85. fi
  86. fi
  87. # ---------------------------------------------------------------------------------------------------------------------
  88. # portaudio (win32 only)
  89. if [ "${WIN32}" -eq 1 ]; then
  90. export EXTRA_CFLAGS="-I${ASIO_DIR}"
  91. export EXTRA_CXXFLAGS="-I${ASIO_DIR}"
  92. export EXTRA_MAKE_ARGS="-j 1"
  93. download portaudio19 "${PORTAUDIO_VERSION}" "http://deb.debian.org/debian/pool/main/p/portaudio19" "orig.tar.gz"
  94. remove_file portaudio19 "${PORTAUDIO_VERSION}" "src/hostapi/wasapi/mingw-include/audioclient.h"
  95. remove_file portaudio19 "${PORTAUDIO_VERSION}" "src/hostapi/wasapi/mingw-include/devicetopology.h"
  96. remove_file portaudio19 "${PORTAUDIO_VERSION}" "src/hostapi/wasapi/mingw-include/endpointvolume.h"
  97. remove_file portaudio19 "${PORTAUDIO_VERSION}" "src/hostapi/wasapi/mingw-include/functiondiscoverykeys.h"
  98. remove_file portaudio19 "${PORTAUDIO_VERSION}" "src/hostapi/wasapi/mingw-include/ksguid.h"
  99. remove_file portaudio19 "${PORTAUDIO_VERSION}" "src/hostapi/wasapi/mingw-include/ksproxy.h"
  100. remove_file portaudio19 "${PORTAUDIO_VERSION}" "src/hostapi/wasapi/mingw-include/ksuuids.h"
  101. remove_file portaudio19 "${PORTAUDIO_VERSION}" "src/hostapi/wasapi/mingw-include/mmdeviceapi.h"
  102. remove_file portaudio19 "${PORTAUDIO_VERSION}" "src/hostapi/wasapi/mingw-include/propkeydef.h"
  103. remove_file portaudio19 "${PORTAUDIO_VERSION}" "src/hostapi/wasapi/mingw-include/propsys.h"
  104. remove_file portaudio19 "${PORTAUDIO_VERSION}" "src/hostapi/wasapi/mingw-include/rpcsal.h"
  105. remove_file portaudio19 "${PORTAUDIO_VERSION}" "src/hostapi/wasapi/mingw-include/sal.h"
  106. remove_file portaudio19 "${PORTAUDIO_VERSION}" "src/hostapi/wasapi/mingw-include/structuredquery.h"
  107. build_autoconf portaudio19 "${PORTAUDIO_VERSION}" "--enable-cxx --with-asiodir=${ASIO_DIR} --with-winapi=asio,directx,wasapi,wdmks,wmme"
  108. install_file portaudio19 "${PORTAUDIO_VERSION}" "include/pa_asio.h" "include"
  109. fi
  110. # ---------------------------------------------------------------------------------------------------------------------
  111. # tre (win32 only)
  112. if [ "${WIN32}" -eq 1 ]; then
  113. download tre "${TRE_VERSION}" "https://github.com/laurikari/tre.git" "" "git"
  114. build_autoconfgen tre "${TRE_VERSION}" "--disable-nls"
  115. fi
  116. # ---------------------------------------------------------------------------------------------------------------------
  117. # tre (win64 32bit build)
  118. # NOTE: this must be the last item to build
  119. if [ "${WIN64}" -eq 1 ]; then
  120. target="win32"
  121. source setup/check_target.sh
  122. source setup/env.sh
  123. PAWPAW_BUILDDIR="${PAWPAW_DIR}/builds/win64"
  124. PAWPAW_PREFIX="${PAWPAW_DIR}/targets/win64"
  125. source setup/functions.sh
  126. copy_download tre tre-x32 "${TRE_VERSION}"
  127. build_autoconfgen tre-x32 "${TRE_VERSION}" "--disable-nls --libdir=${PAWPAW_PREFIX}/lib32"
  128. if [ ! -e "${PAWPAW_PREFIX}/lib/libtre32.a" ]; then
  129. ln -s "${PAWPAW_PREFIX}/lib32/libtre.a" "${PAWPAW_PREFIX}/lib/libtre32.a"
  130. fi
  131. fi
  132. # ---------------------------------------------------------------------------------------------------------------------