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.

171 lines
6.8KB

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