configure 653 B

123456789101112131415161718192021222324252627282930313233343536
  1. #!/bin/bash
  2. # install location
  3. install_loc=/usr
  4. # parse arguments
  5. while [ $1 ]; do
  6. # install location
  7. if [ $1 == "--install-loc" ]; then
  8. if [ $# -gt 1 ]; then
  9. install_loc=$2
  10. shift
  11. else
  12. echo "--install-loc command expects an argument"
  13. fi
  14. # help text
  15. elif [ $1 == "--help" ]; then
  16. echo "arguments:"
  17. echo "--install-loc <loc>"
  18. echo " where to install the project"
  19. fi
  20. # parse next argument
  21. shift
  22. done
  23. # copy makefile
  24. # replace install location - make sure to escape slashes
  25. cp makefile.in makefile
  26. sed -i "s/@INSTALL_LOCATION@/${install_loc//\//\\\/}/g" makefile
  27. # prepare docs
  28. makeinfo doc/ddlang.texi
  29. gzip -f ddlang.info