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.

634 lines
18KB

  1. #!/bin/bash
  2. # ---------------------------------------------------------------------------------------------------------------------
  3. function download() {
  4. local name="${1}"
  5. local version="${2}"
  6. local dlbaseurl="${3}"
  7. local dlext="${4}"
  8. local dlmethod="${5}"
  9. if [ -z "${dlext}" ]; then
  10. dlext="tar.gz"
  11. fi
  12. local dlfile="${PAWPAW_DOWNLOADDIR}/${name}-${version}.${dlext}"
  13. local dlfolder="${PAWPAW_BUILDDIR}/${name}-${version}"
  14. if [ ! -f "${dlfile}" ]; then
  15. if [ -n "${dlmethod}" ] && [ "${dlmethod}" = "git" ]; then
  16. local tmprepodir="${PAWPAW_TMPDIR}/${name}-${version}"
  17. rm -rf "${tmprepodir}"
  18. git clone --recursive "${dlbaseurl}" "${tmprepodir}"
  19. git -C "${tmprepodir}" checkout "${version}"
  20. git -C "${tmprepodir}" submodule update
  21. tar --exclude=".git" -czf "${dlfile}" -C "${PAWPAW_TMPDIR}" "${name}-${version}"
  22. rm -rf "${tmprepodir}"
  23. else
  24. local dlurl
  25. if echo ${dlbaseurl} | grep -q github.com; then
  26. if [ x"${dlmethod}" = x"nv" ]; then
  27. dlurl="${dlbaseurl}/${version}.${dlext}"
  28. else
  29. dlurl="${dlbaseurl}/v${version}.${dlext}"
  30. fi
  31. elif [ "${dlext}" = "orig.tar.gz" ]; then
  32. dlurl="${dlbaseurl}/${name}_${version}.${dlext}"
  33. else
  34. dlurl="${dlbaseurl}/${name}-${version}.${dlext}"
  35. fi
  36. curl -L "${dlurl}" -o "${dlfile}" --fail
  37. fi
  38. fi
  39. if [ ! -d "${dlfolder}" ]; then
  40. mkdir "${dlfolder}"
  41. tar -xf "${dlfile}" -C "${dlfolder}" --strip-components=1
  42. fi
  43. }
  44. function copy_download() {
  45. local name1="${1}"
  46. local name2="${2}"
  47. local version="${3}"
  48. local dlext="${4}"
  49. if [ -z "${dlext}" ]; then
  50. dlext="tar.gz"
  51. fi
  52. local dlfile1="${PAWPAW_DOWNLOADDIR}/${name1}-${version}.${dlext}"
  53. local dlfolder2="${PAWPAW_BUILDDIR}/${name2}-${version}"
  54. if [ ! -d "${dlfolder2}" ]; then
  55. mkdir "${dlfolder2}"
  56. tar -xf "${dlfile1}" -C "${dlfolder2}" --strip-components=1
  57. fi
  58. }
  59. # ---------------------------------------------------------------------------------------------------------------------
  60. function _prebuild() {
  61. local name="${1}"
  62. local pkgdir="${2}"
  63. export AR="${TARGET_AR}"
  64. export CC="${TARGET_CC}"
  65. export CXX="${TARGET_CXX}"
  66. export LD="${TARGET_LD}"
  67. export STRIP="${TARGET_STRIP}"
  68. export CFLAGS="${TARGET_CFLAGS} ${EXTRA_CFLAGS}"
  69. export CXXFLAGS="${TARGET_CXXFLAGS} ${EXTRA_CXXFLAGS}"
  70. export LDFLAGS="${TARGET_LDFLAGS} ${EXTRA_LDFLAGS}"
  71. export PKG_CONFIG_PATH="${TARGET_PKG_CONFIG_PATH}"
  72. unset CPPFLAGS
  73. export OLD_PATH="${PATH}"
  74. export PATH="${TARGET_PATH}"
  75. if [ -d "${PAWPAW_ROOT}/patches/${name}" ]; then
  76. for p in $(ls "${PAWPAW_ROOT}/patches/${name}/" | grep "\.patch" | sort); do
  77. if [ ! -f "${pkgdir}/.stamp_applied_${p}" ]; then
  78. patch -p1 -d "${pkgdir}" -i "${PAWPAW_ROOT}/patches/${name}/${p}"
  79. touch "${pkgdir}/.stamp_applied_${p}"
  80. fi
  81. done
  82. fi
  83. if [ -d "${PAWPAW_ROOT}/patches/${name}/${PAWPAW_TARGET}" ]; then
  84. for p in $(ls "${PAWPAW_ROOT}/patches/${name}/${PAWPAW_TARGET}/" | grep "\.patch" | sort); do
  85. if [ ! -f "${pkgdir}/.stamp_applied_${p}" ]; then
  86. patch -p1 -d "${pkgdir}" -i "${PAWPAW_ROOT}/patches/${name}/${PAWPAW_TARGET}/${p}"
  87. touch "${pkgdir}/.stamp_applied_${p}"
  88. fi
  89. done
  90. fi
  91. if [ ! -f "${pkgdir}/.stamp_configured" ]; then
  92. rm -f "${pkgdir}/.stamp_built"
  93. rm -f "${pkgdir}/.stamp_installed"
  94. rm -f "${pkgdir}/.stamp_verified"
  95. rm -f "${pkgdir}/CMakeCache.txt"
  96. elif [ ! -f "${pkgdir}/.stamp_built" ]; then
  97. rm -f "${pkgdir}/.stamp_installed"
  98. rm -f "${pkgdir}/.stamp_verified"
  99. elif [ ! -f "${pkgdir}/.stamp_installed" ]; then
  100. rm -f "${pkgdir}/.stamp_verified"
  101. fi
  102. }
  103. function _postbuild() {
  104. unset AR
  105. unset CC
  106. unset CXX
  107. unset LD
  108. unset STRIP
  109. unset CFLAGS
  110. unset CPPFLAGS
  111. unset CXXFLAGS
  112. unset LDFLAGS
  113. unset PKG_CONFIG_PATH
  114. unset EXTRA_CFLAGS
  115. unset EXTRA_CXXFLAGS
  116. unset EXTRA_LDFLAGS
  117. unset EXTRA_MAKE_ARGS
  118. export PATH="${OLD_PATH}"
  119. }
  120. # ---------------------------------------------------------------------------------------------------------------------
  121. function build_autoconf() {
  122. local name="${1}"
  123. local version="${2}"
  124. local extraconfrules="${3}"
  125. local pkgdir="${PAWPAW_BUILDDIR}/${name}-${version}"
  126. if [ "${CROSS_COMPILING}" -eq 1 ]; then
  127. extraconfrules="--host=${TOOLCHAIN_PREFIX} ${extraconfrules}"
  128. fi
  129. _prebuild "${name}" "${pkgdir}"
  130. if [ ! -f "${pkgdir}/.stamp_configured" ]; then
  131. pushd "${pkgdir}"
  132. ./configure --enable-static --disable-shared --disable-debug --disable-doc --disable-docs --disable-maintainer-mode --prefix="${PAWPAW_PREFIX}" ${extraconfrules}
  133. touch .stamp_configured
  134. popd
  135. fi
  136. if [ ! -f "${pkgdir}/.stamp_built" ]; then
  137. pushd "${pkgdir}"
  138. make ${MAKE_ARGS} ${EXTRA_MAKE_ARGS}
  139. touch .stamp_built
  140. popd
  141. fi
  142. if [ ! -f "${pkgdir}/.stamp_installed" ]; then
  143. pushd "${pkgdir}"
  144. make ${MAKE_ARGS} install -j 1
  145. touch .stamp_installed
  146. popd
  147. fi
  148. _postbuild
  149. }
  150. function build_autoconfgen() {
  151. local name="${1}"
  152. local version="${2}"
  153. local extraconfrules="${3}"
  154. local pkgdir="${PAWPAW_BUILDDIR}/${name}-${version}"
  155. local EXTRA_CFLAGS2="${EXTRA_CFLAGS}"
  156. local EXTRA_CXXFLAGS2="${EXTRA_CXXFLAGS}"
  157. local EXTRA_LDFLAGS2="${EXTRA_LDFLAGS}"
  158. local EXTRA_MAKE_ARGS2="${EXTRA_MAKE_ARGS}"
  159. _prebuild "${name}" "${pkgdir}"
  160. if [ ! -f "${pkgdir}/.stamp_preconfigured" ]; then
  161. pushd "${pkgdir}"
  162. autoconf
  163. touch .stamp_preconfigured
  164. popd
  165. fi
  166. _postbuild
  167. export EXTRA_CFLAGS="${EXTRA_CFLAGS2}"
  168. export EXTRA_CXXFLAGS="${EXTRA_CXXFLAGS2}"
  169. export EXTRA_LDFLAGS="${EXTRA_LDFLAGS2}"
  170. export EXTRA_MAKE_ARGS="${EXTRA_MAKE_ARGS2}"
  171. build_autoconf "${name}" "${version}" "${extraconfrules}"
  172. }
  173. function build_conf() {
  174. local name="${1}"
  175. local version="${2}"
  176. local extraconfrules="${3}"
  177. local pkgdir="${PAWPAW_BUILDDIR}/${name}-${version}"
  178. _prebuild "${name}" "${pkgdir}"
  179. if [ ! -f "${pkgdir}/.stamp_configured" ]; then
  180. pushd "${pkgdir}"
  181. ./configure ${extraconfrules}
  182. touch .stamp_configured
  183. popd
  184. fi
  185. if [ ! -f "${pkgdir}/.stamp_built" ]; then
  186. pushd "${pkgdir}"
  187. make ${MAKE_ARGS} ${EXTRA_MAKE_ARGS}
  188. touch .stamp_built
  189. popd
  190. fi
  191. if [ ! -f "${pkgdir}/.stamp_installed" ]; then
  192. pushd "${pkgdir}"
  193. make ${MAKE_ARGS} -j 1 install
  194. touch .stamp_installed
  195. popd
  196. fi
  197. _postbuild
  198. }
  199. function build_cmake() {
  200. local name="${1}"
  201. local version="${2}"
  202. local extraconfrules="${3}"
  203. local pkgdir="${PAWPAW_BUILDDIR}/${name}-${version}"
  204. if [ "${CROSS_COMPILING}" -eq 1 ]; then
  205. extraconfrules+=" -DCMAKE_SYSTEM_NAME=${CMAKE_SYSTEM_NAME}"
  206. fi
  207. if [ "${MACOS}" -eq 1 ]; then
  208. if [ "${MACOS_OLD}" -eq 1 ]; then
  209. OSX_TARGET="10.5"
  210. elif [ "${MACOS_UNIVERSAL}" -eq 1 ]; then
  211. OSX_TARGET="10.12"
  212. else
  213. OSX_TARGET="10.8"
  214. fi
  215. extraconfrules+=" -DCMAKE_OSX_DEPLOYMENT_TARGET=${OSX_TARGET}"
  216. fi
  217. _prebuild "${name}" "${pkgdir}"
  218. mkdir -p "${pkgdir}/build"
  219. if [ ! -f "${pkgdir}/.stamp_configured" ]; then
  220. pushd "${pkgdir}/build"
  221. cmake -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_LIBDIR=lib -DCMAKE_INSTALL_PREFIX="${PAWPAW_PREFIX}" ${extraconfrules} ..
  222. touch ../.stamp_configured
  223. popd
  224. fi
  225. if [ ! -f "${pkgdir}/.stamp_built" ]; then
  226. pushd "${pkgdir}/build"
  227. make ${MAKE_ARGS} ${EXTRA_MAKE_ARGS}
  228. touch ../.stamp_built
  229. popd
  230. fi
  231. if [ ! -f "${pkgdir}/.stamp_installed" ]; then
  232. pushd "${pkgdir}/build"
  233. make ${MAKE_ARGS} -j 1 install
  234. touch ../.stamp_installed
  235. popd
  236. fi
  237. _postbuild
  238. }
  239. function build_make() {
  240. local name="${1}"
  241. local version="${2}"
  242. local extraconfrules="${3}"
  243. local pkgdir="${PAWPAW_BUILDDIR}/${name}-${version}"
  244. _prebuild "${name}" "${pkgdir}"
  245. touch "${pkgdir}/.stamp_configured"
  246. if [ ! -f "${pkgdir}/.stamp_built" ]; then
  247. pushd "${pkgdir}"
  248. make PREFIX="${PAWPAW_PREFIX}" PKG_CONFIG="${TARGET_PKG_CONFIG}" ${MAKE_ARGS} ${extraconfrules}
  249. touch .stamp_built
  250. popd
  251. fi
  252. if [ ! -f "${pkgdir}/.stamp_installed" ]; then
  253. pushd "${pkgdir}"
  254. make PREFIX="${PAWPAW_PREFIX}" PKG_CONFIG="${TARGET_PKG_CONFIG}" ${MAKE_ARGS} ${extraconfrules} -j 1 install
  255. touch .stamp_installed
  256. popd
  257. fi
  258. _postbuild
  259. }
  260. function build_meson() {
  261. local name="${1}"
  262. local version="${2}"
  263. local extraconfrules="${3}"
  264. local pkgdir="${PAWPAW_BUILDDIR}/${name}-${version}"
  265. if [ "${CROSS_COMPILING}" -eq 1 ]; then
  266. extraconfrules="--cross-file "${PAWPAW_ROOT}/setup/meson/${PAWPAW_TARGET}.ini" ${extraconfrules}"
  267. fi
  268. _prebuild "${name}" "${pkgdir}"
  269. if [ ! -f "${pkgdir}/.stamp_configured" ]; then
  270. pushd "${pkgdir}"
  271. meson build --buildtype release --prefix "${PAWPAW_PREFIX}" ${extraconfrules}
  272. touch .stamp_configured
  273. popd
  274. fi
  275. if [ ! -f "${pkgdir}/.stamp_built" ]; then
  276. pushd "${pkgdir}"
  277. ninja -v -C build
  278. touch .stamp_built
  279. popd
  280. fi
  281. if [ ! -f "${pkgdir}/.stamp_installed" ]; then
  282. pushd "${pkgdir}"
  283. ninja -C build install
  284. touch .stamp_installed
  285. popd
  286. fi
  287. _postbuild
  288. }
  289. function build_python() {
  290. local name="${1}"
  291. local version="${2}"
  292. local extraconfrules="${3}"
  293. local pkgdir="${PAWPAW_BUILDDIR}/${name}-${version}"
  294. local python=python3
  295. if [ ! -e "${PAWPAW_PREFIX}/bin/python3" ] && ! which python3 > /dev/null; then
  296. python=python
  297. fi
  298. _prebuild "${name}" "${pkgdir}"
  299. # fix build of python packages
  300. export CFLAGS="$(echo ${CFLAGS} | sed -e 's/-fvisibility=hidden//')"
  301. export CFLAGS="$(echo ${CFLAGS} | sed -e 's/-ffast-math//')"
  302. export CFLAGS="$(echo ${CFLAGS} | sed -e 's/-fdata-sections -ffunction-sections//')"
  303. export CXXFLAGS="$(echo ${CXXFLAGS} | sed -e 's/-fvisibility=hidden//')"
  304. export CXXFLAGS="$(echo ${CXXFLAGS} | sed -e 's/-ffast-math//')"
  305. export CXXFLAGS="$(echo ${CXXFLAGS} | sed -e 's/-fvisibility-inlines-hidden//')"
  306. export CXXFLAGS="$(echo ${CXXFLAGS} | sed -e 's/-fdata-sections -ffunction-sections//')"
  307. export LDFLAGS="$(echo ${LDFLAGS} | sed -e 's/-Wl,-dead_strip -Wl,-dead_strip_dylibs//')"
  308. export LDFLAGS="$(echo ${LDFLAGS} | sed -e 's/-fdata-sections -ffunction-sections//')"
  309. touch "${pkgdir}/.stamp_configured"
  310. if [ ! -f "${pkgdir}/.stamp_built" ]; then
  311. pushd "${pkgdir}"
  312. ${python} setup.py build ${extraconfrules}
  313. touch .stamp_built
  314. popd
  315. fi
  316. if [ ! -f "${pkgdir}/.stamp_installed" ]; then
  317. pushd "${pkgdir}"
  318. ${python} setup.py install --prefix="${PAWPAW_PREFIX}" ${extraconfrules}
  319. touch .stamp_installed
  320. popd
  321. fi
  322. _postbuild
  323. }
  324. function build_qmake() {
  325. local name="${1}"
  326. local version="${2}"
  327. local extraconfrules="${3}"
  328. local pkgdir="${PAWPAW_BUILDDIR}/${name}-${version}"
  329. _prebuild "${name}" "${pkgdir}"
  330. if [ ! -f "${pkgdir}/.stamp_configured" ]; then
  331. pushd "${pkgdir}"
  332. qmake ${extraconfrules}
  333. touch .stamp_configured
  334. popd
  335. fi
  336. if [ ! -f "${pkgdir}/.stamp_built" ]; then
  337. pushd "${pkgdir}"
  338. make ${MAKE_ARGS} ${EXTRA_MAKE_ARGS}
  339. touch .stamp_built
  340. popd
  341. fi
  342. if [ ! -f "${pkgdir}/.stamp_installed" ]; then
  343. pushd "${pkgdir}"
  344. make ${MAKE_ARGS} -j 1 install
  345. touch .stamp_installed
  346. popd
  347. fi
  348. _postbuild
  349. }
  350. function build_waf() {
  351. local name="${1}"
  352. local version="${2}"
  353. local extraconfrules="${3}"
  354. local pkgdir="${PAWPAW_BUILDDIR}/${name}-${version}"
  355. local python=python3
  356. if ! which python3 > /dev/null; then
  357. python=python
  358. fi
  359. _prebuild "${name}" "${pkgdir}"
  360. if [ ! -f "${pkgdir}/.stamp_configured" ]; then
  361. pushd "${pkgdir}"
  362. ${python} waf configure --prefix="${PAWPAW_PREFIX}" ${extraconfrules}
  363. touch .stamp_configured
  364. popd
  365. fi
  366. if [ ! -f "${pkgdir}/.stamp_built" ]; then
  367. pushd "${pkgdir}"
  368. ${python} waf build ${WAF_ARGS}
  369. touch .stamp_built
  370. popd
  371. fi
  372. if [ ! -f "${pkgdir}/.stamp_installed" ]; then
  373. pushd "${pkgdir}"
  374. ${python} waf install ${WAF_ARGS} --prefix="${PAWPAW_PREFIX}" ${extraconfrules} -j 1
  375. rm -f ${PAWPAW_PREFIX}/lib/lv2/*/*.a
  376. touch .stamp_installed
  377. popd
  378. fi
  379. _postbuild
  380. }
  381. # ---------------------------------------------------------------------------------------------------------------------
  382. function build_host_autoconf() {
  383. local name="${1}"
  384. local version="${2}"
  385. local extraconfrules="${3}"
  386. local pkgdir="${PAWPAW_BUILDDIR}/${name}-${version}"
  387. unset AR
  388. unset CC
  389. unset CXX
  390. unset LD
  391. unset STRIP
  392. unset CFLAGS
  393. unset CPPFLAGS
  394. unset CXXFLAGS
  395. unset LDFLAGS
  396. if [ ! -f "${pkgdir}/.stamp_configured" ]; then
  397. pushd "${pkgdir}"
  398. ./configure --enable-static --disable-shared --disable-maintainer-mode --prefix="${PAWPAW_PREFIX}" ${extraconfrules}
  399. touch .stamp_configured
  400. popd
  401. fi
  402. if [ ! -f "${pkgdir}/.stamp_built" ]; then
  403. pushd "${pkgdir}"
  404. make ${MAKE_ARGS}
  405. touch .stamp_built
  406. popd
  407. fi
  408. if [ ! -f "${pkgdir}/.stamp_installed" ]; then
  409. pushd "${pkgdir}"
  410. make ${MAKE_ARGS} install -j 1
  411. touch .stamp_installed
  412. popd
  413. fi
  414. }
  415. # ---------------------------------------------------------------------------------------------------------------------
  416. function patch_file() {
  417. local name="${1}"
  418. local version="${2}"
  419. local file="${3}"
  420. local rule="${4}"
  421. local pkgdir="${PAWPAW_BUILDDIR}/${name}-${version}"
  422. if [ -e "${pkgdir}/${file}" ]; then
  423. sed -i -e "${rule}" "${pkgdir}/${file}"
  424. fi
  425. }
  426. function copy_file() {
  427. local name="${1}"
  428. local version="${2}"
  429. local source="${3}"
  430. local target="${4}"
  431. local pkgdir="${PAWPAW_BUILDDIR}/${name}-${version}"
  432. if [ ! -e "${pkgdir}/${target}" ] || [ "${source}" -nt "${target}" ]; then
  433. pushd "${pkgdir}"
  434. cp -v "${source}" "${target}"
  435. popd
  436. fi
  437. }
  438. function install_file() {
  439. local name="${1}"
  440. local version="${2}"
  441. local source="${3}"
  442. local targetdir="${4}"
  443. local pkgdir="${PAWPAW_BUILDDIR}/${name}-${version}"
  444. if [ ! -e "${PAWPAW_PREFIX}/${targetdir}/$(basename ${source})" ]; then
  445. pushd "${pkgdir}"
  446. cp -v "${source}" "${PAWPAW_PREFIX}/${targetdir}/"
  447. popd
  448. fi
  449. }
  450. function link_file() {
  451. local name="${1}"
  452. local version="${2}"
  453. local source="${3}"
  454. local target="${4}"
  455. local pkgdir="${PAWPAW_BUILDDIR}/${name}-${version}"
  456. if [ ! -e "${pkgdir}/${target}" ]; then
  457. pushd "${pkgdir}"
  458. ln -sfv "${source}" "${target}"
  459. popd
  460. fi
  461. }
  462. function remove_file() {
  463. local name="${1}"
  464. local version="${2}"
  465. local file="${3}"
  466. local pkgdir="${PAWPAW_BUILDDIR}/${name}-${version}"
  467. if [ -e "${pkgdir}/${file}" ]; then
  468. rm -fv "${pkgdir}/${file}"
  469. fi
  470. }
  471. # ---------------------------------------------------------------------------------------------------------------------
  472. function patch_osx_binary_libs() {
  473. local file="${1}"
  474. if [ -L "${file}" ]; then
  475. return 0
  476. fi
  477. idname=$(otool -D "${file}")
  478. if otool -L "${file}" | grep -v ":" | grep -v "${idname}" | grep -q "${PAWPAW_PREFIX}"; then
  479. #install_name_tool -change "@rpath/QtCore.framework/Versions/5/QtCore" "@executable_path/QtCore" "${file}"
  480. #install_name_tool -change "@rpath/QtGui.framework/Versions/5/QtGui" "@executable_path/QtGui" "${file}"
  481. #install_name_tool -change "@rpath/QtWidgets.framework/Versions/5/QtWidgets" "@executable_path/QtWidgets" "${file}"
  482. #install_name_tool -change "@rpath/QtXml.framework/Versions/5/QtXml" "@executable_path/QtXml" "${file}"
  483. install_name_tool -change "@executable_path/../Frameworks/libjack.0.dylib" "/usr/local/lib/libjack.0.dylib" "${file}"
  484. install_name_tool -change "${PAWPAW_PREFIX}/jack2/lib/libjack.0.dylib" "/usr/local/lib/libjack.0.dylib" "${file}"
  485. install_name_tool -change "${PAWPAW_PREFIX}/jack2/lib/libjacknet.0.dylib" "/usr/local/lib/libjacknet.0.dylib" "${file}"
  486. install_name_tool -change "${PAWPAW_PREFIX}/jack2/lib/libjackserver.0.dylib" "/usr/local/lib/libjackserver.0.dylib" "${file}"
  487. fi
  488. }
  489. function patch_osx_qtapp() {
  490. local name="${1}"
  491. local version="${2}"
  492. local appfile="${3}"
  493. local pkgdir="${PAWPAW_BUILDDIR}/${name}-${version}"
  494. _prebuild "${name}" "${pkgdir}"
  495. mkdir -p "${appfile}/Contents/PlugIns/platforms"
  496. mkdir -p "${appfile}/Contents/PlugIns/printsupport"
  497. cp -v "${PAWPAW_PREFIX}/lib/qt5/plugins/platforms/libqcocoa.dylib" "${appfile}/Contents/PlugIns/platforms/"
  498. cp -v "${PAWPAW_PREFIX}/lib/qt5/plugins/printsupport/libcocoaprintersupport.dylib" "${appfile}/Contents/PlugIns/printsupport/"
  499. macdeployqt "${appfile}"
  500. rm -f "${appfile}/Contents/Frameworks/libjack.0.dylib"
  501. _postbuild
  502. }
  503. # ---------------------------------------------------------------------------------------------------------------------