Assists music production by grouping standalone programs into sessions. Community version of "Non Session Manager".
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.

120 lines
2.5KB

  1. #!/bin/sh
  2. #
  3. # Copyright (C) 2008 Jonathan Moore Liles
  4. #
  5. . scripts/colors
  6. fatal ()
  7. {
  8. echo "$BOLD$RED$*$SGR0"
  9. exit 255
  10. }
  11. ask ()
  12. {
  13. echo -n "$1 [$BOLD$3$SGR0] "
  14. read R
  15. echo "${2}=${R:-$3}" >> make.conf
  16. }
  17. ok ()
  18. {
  19. echo "$BOLD${GREEN}ok${SGR0}."
  20. }
  21. failed ()
  22. {
  23. echo "$BOLD${RED}failed!${SGR0}"
  24. rm -f make.conf
  25. }
  26. [ $# -gt 0 ] && fatal "This is not an autoconf script. Run it without any options and you will be prompted."
  27. echo "-- Configuration:"
  28. # get the old values
  29. if [ -f make.conf ]
  30. then
  31. OIFS="$IFS"
  32. IFS=''
  33. eval "`sed -n '/^## options/{ : i; /^## libs/{ q }; p; n; b i }' make.conf`"
  34. IFS="$OIFS"
  35. fi
  36. echo "# This is a generated file. Any changes may be lost!" > make.conf
  37. echo "## options" >> make.conf
  38. ask "Install prefix?" prefix ${prefix:-/usr/local}
  39. ask "Use LASH?" USE_LASH ${USE_LASH:-yes}
  40. ask "Build for debugging?" MAINTAINER_MODE ${MAINTAINER_MODE:-no}
  41. echo "## libs/flags" >> make.conf
  42. # tests
  43. echo -n "Checking for ${BOLD}FLTK${SGR0}..."
  44. FLTK_VERSION=`fltk-config --version`
  45. FLTK_VERSION_MAJOR=`echo $FLTK_VERSION | cut -d'.' -f1`
  46. FLTK_VERSION_MINOR=`echo $FLTK_VERSION | cut -d'.' -f2`
  47. FLTK_VERSION_PATCH=`echo $FLTK_VERSION | cut -d'.' -f3`
  48. if ! ( [ $FLTK_VERSION_MAJOR -ge 1 ] && [ $FLTK_VERSION_MINOR -ge 1 ] && [ $FLTK_VERSION_PATCH -ge 7 ] )
  49. then
  50. failed
  51. fatal "The installed FLTK version ($FLTK_VERSION) is too old."
  52. else
  53. ok
  54. fi
  55. echo "FLTK_LIBS=`fltk-config --use-images --ldflags`" >> make.conf
  56. echo "FLTK_CFLAGS=`fltk-config --cflags`" >> make.conf
  57. check_command ()
  58. {
  59. echo -n "Checking for ${BOLD}$1${SGR0}..."
  60. if ! [ -x "`which $2`" ]
  61. then
  62. failed
  63. fatal "Command $1 not found."
  64. else
  65. ok
  66. fi
  67. }
  68. check_command FLUID fluid
  69. #
  70. check ()
  71. {
  72. echo -n "Checking for $BOLD$1$SGR0..."
  73. if ! pkg-config --exists $3
  74. then
  75. failed
  76. fatal "Required package $1 doesn't appear to be installed."
  77. elif ! pkg-config --atleast-version $2 $3
  78. then
  79. failed
  80. fatal "The installed version of $1 (`pkg-config --mod-version $3`) is too old."
  81. fi
  82. ok
  83. return 0
  84. }
  85. check JACK 0.103.0 jack && echo "JACK_LIBS=`pkg-config --libs jack`" >> make.conf
  86. check libSNDFILE 1.0.17 sndfile && echo "SNDFILE_LIBS=`pkg-config --libs sndfile`" >> make.conf
  87. grep -q 'USE_LASH=yes' make.conf &&
  88. check LASH 0.5.4 lash-1.0 &&
  89. ( echo "LASH_LIBS=`pkg-config --libs lash-1.0`" >> make.conf
  90. echo "LASH_CFLAGS=-DUSE_LASH `pkg-config --cflags lash-1.0`" >> make.conf )
  91. echo "-- Configuration complete."