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.

62 lines
1.3KB

  1. #!/bin/sh
  2. #
  3. # Execute this script to generate a configure script
  4. #
  5. # This file is free software: you are free to change and redistribute it.
  6. # There is NO WARRANTY, to the extent permitted by law.
  7. #
  8. # check for needed tools
  9. for i in git autoreconf make m4 fmt; do
  10. if test -z "$(which ${i})"; then
  11. echo "error: ${i} is not installed"
  12. exit 1
  13. fi
  14. done
  15. ./autoclean.sh
  16. if test -d ".git"; then
  17. vcs=git
  18. else
  19. echo "this tree is not a repository (did you download instead of clone?)"
  20. exit 1
  21. fi
  22. if test ${vcs} = "git"; then
  23. # major version is equal to the latest tag
  24. version=$(git describe --tags | sed 's/-/./')
  25. branch=$(git symbolic-ref HEAD | sed -e 's,.*/\(.*\),\1,')
  26. commitdate=$(git log -1 --pretty=format:"%ad")
  27. cat << EOF > src/version-vcs.h
  28. #define LIBREBLACKJACK_VCS_BRANCH "${branch}"
  29. #define LIBREBLACKJACK_VCS_VERSION "${version}"
  30. #define LIBREBLACKJACK_VCS_DATE "${commitdate}"
  31. #define LIBREBLACKJACK_VCS_CLEAN $(git status --porcelain | wc -l)
  32. EOF
  33. else
  34. version=0.1.0
  35. fi
  36. echo "define(libreblackjackversion, [${version}])dnl" > version.m4
  37. if [ ! -z "$(which pandoc)" ]; then
  38. pandoc README.md -t plain -o README
  39. # cd doc
  40. # ./md2texi.sh
  41. # cd ..
  42. else
  43. fmt README.md > README
  44. touch doc/libreblackjack.texi
  45. fi
  46. # touch ChangeLog
  47. git log --oneline --decorate > ChangeLog
  48. autoreconf --install
  49. automake --add-missing