configure 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. #!/bin/sh
  2. help()
  3. {
  4. echo ""
  5. echo "Usage is: configure [--prefix=PREFIX] [--profile=PROFILE]"
  6. echo ""
  7. echo "Profiles available: "
  8. (cd build/profiles; ls *.make | sed -e 's/.make//' -e 's/^/ /')
  9. }
  10. prefix=/usr/local
  11. profile=default
  12. while [ $# -ne 0 ]; do
  13. case $1 in
  14. --help)
  15. help
  16. exit 0
  17. ;;
  18. --prefix=*)
  19. prefix=`echo $1 | sed 's/--prefix=//'`;
  20. shift
  21. ;;
  22. --prefix)
  23. shift
  24. prefix="$1"
  25. shift
  26. ;;
  27. --profile=*)
  28. profile=`echo $1 | sed 's/--profile=//'`
  29. shift
  30. if test ! -f build/profiles/$profile.make; then
  31. echo ""
  32. echo Error, profile $profile does not exist
  33. help
  34. exit 1;
  35. fi
  36. ;;
  37. --profile)
  38. shift
  39. profile="$1"
  40. shift
  41. if test ! -f build/profiles/$profile.make; then
  42. echo ""
  43. echo Error, profile $profile does not exist
  44. help
  45. exit 1;
  46. fi
  47. ;;
  48. *)
  49. echo Unknown option: $1
  50. help
  51. shift
  52. esac
  53. done
  54. echo "prefix=$prefix" > build/config.make
  55. echo "MCS_FLAGS = \$(PLATFORM_DEBUG_FLAGS)" >> build/config.make
  56. echo "PROFILE=$profile" > build/pre-config.make
  57. echo ""
  58. echo "MCS module configured"
  59. echo ""
  60. echo " Profile selected: $profile"
  61. echo " Prefix: $prefix"
  62. echo ""
  63. exit 0;