common.sh.in 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. # FLAC - Free Lossless Audio Codec
  2. # Copyright (C) 2001-2009 Josh Coalson
  3. # Copyright (C) 2011-2023 Xiph.Org Foundation
  4. #
  5. # This file is part the FLAC project. FLAC is comprised of several
  6. # components distributed under different licenses. The codec libraries
  7. # are distributed under Xiph.Org's BSD-like license (see the file
  8. # COPYING.Xiph in this distribution). All other programs, libraries, and
  9. # plugins are distributed under the GPL (see COPYING.GPL). The documentation
  10. # is distributed under the Gnu FDL (see COPYING.FDL). Each file in the
  11. # FLAC distribution contains at the top the terms under which it may be
  12. # distributed.
  13. #
  14. # Since this particular file is relevant to all components of FLAC,
  15. # it may be distributed under the Xiph.Org license, which is the least
  16. # restrictive of those mentioned above. See the file COPYING.Xiph in this
  17. # distribution.
  18. export MALLOC_CHECK_=3
  19. export MALLOC_PERTURB_=$((RANDOM % 255 + 1))
  20. if [ -z "$1" ] ; then
  21. BUILD=debug
  22. else
  23. BUILD="$1"
  24. fi
  25. LD_LIBRARY_PATH=../objs/$BUILD/lib:$LD_LIBRARY_PATH
  26. LD_LIBRARY_PATH="$(pwd)/../objs/$BUILD/lib:$LD_LIBRARY_PATH"
  27. LD_LIBRARY_PATH="$(pwd)/../src/libFLAC/.libs:$LD_LIBRARY_PATH"
  28. LD_LIBRARY_PATH="$(pwd)/../src/share/getopt/.libs:$LD_LIBRARY_PATH"
  29. LD_LIBRARY_PATH="$(pwd)/../src/share/grabbag/.libs:$LD_LIBRARY_PATH"
  30. LD_LIBRARY_PATH="$(pwd)/../src/share/replaygain_analysis/.libs:$LD_LIBRARY_PATH"
  31. LD_LIBRARY_PATH="$(pwd)/../src/share/replaygain_synthesis/.libs:$LD_LIBRARY_PATH"
  32. LD_LIBRARY_PATH="$(pwd)/../src/share/utf8/.libs:$LD_LIBRARY_PATH"
  33. LD_LIBRARY_PATH=../src/libFLAC/.libs:$LD_LIBRARY_PATH
  34. LD_LIBRARY_PATH=../src/libFLAC++/.libs:$LD_LIBRARY_PATH
  35. LD_LIBRARY_PATH=../src/share/getopt/.libs:$LD_LIBRARY_PATH
  36. LD_LIBRARY_PATH=../src/share/grabbag/.libs:$LD_LIBRARY_PATH
  37. LD_LIBRARY_PATH=../src/share/replaygain_analysis/.libs:$LD_LIBRARY_PATH
  38. LD_LIBRARY_PATH=../src/share/replaygain_synthesis/.libs:$LD_LIBRARY_PATH
  39. LD_LIBRARY_PATH=../src/share/utf8/.libs:$LD_LIBRARY_PATH
  40. export LD_LIBRARY_PATH
  41. PATH="$(pwd)/../objs/$CMAKE_CONFIG_TYPE:$PATH"
  42. PATH="$(pwd)/../objs:$PATH"
  43. EXE=@EXEEXT@
  44. # Needed for building out-of-tree where source files are in the $top_srcdir tree
  45. # and build products in the $top_builddir tree.
  46. top_srcdir=@top_srcdir@
  47. top_builddir=@top_builddir@
  48. git_commit_version_hash=@GIT_COMMIT_VERSION_HASH@
  49. # Set `is_win` variable which is used in other scripts that source this one.
  50. if test $(env | grep -ic '^comspec=') != 0 ; then
  51. is_win=yes
  52. else
  53. is_win=no
  54. fi
  55. # change to 'false' to show all flac/metaflac output (useful for debugging)
  56. if true ; then
  57. SILENT='--silent'
  58. TOTALLY_SILENT='--totally-silent'
  59. else
  60. SILENT=''
  61. TOTALLY_SILENT=''
  62. fi
  63. # Functions
  64. die ()
  65. {
  66. echo $* 1>&2
  67. exit 1
  68. }
  69. make_streams ()
  70. {
  71. echo "Generating streams..."
  72. if [ ! -f wacky1.wav ] ; then
  73. test_streams${EXE} || die "ERROR during test_streams"
  74. fi
  75. }