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.

102 lines
2.1KB

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