autogen.sh 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. #! /bin/sh
  2. # Run this to generate the configure script etc.
  3. set -eu
  4. PQXXVERSION=$(./tools/extract_version)
  5. PQXX_ABI=$(./tools/extract_version --abi)
  6. PQXX_MAJOR=$(./tools/extract_version --major)
  7. PQXX_MINOR=$(./tools/extract_version --minor)
  8. echo "libpqxx version $PQXXVERSION"
  9. echo "libpqxx ABI version $PQXX_ABI"
  10. substitute() {
  11. sed -e "s/@PQXXVERSION@/$PQXXVERSION/g" \
  12. -e "s/@PQXX_MAJOR@/$PQXX_MAJOR/g" \
  13. -e "s/@PQXX_MINOR@/$PQXX_MINOR/g" \
  14. -e "s/@PQXX_ABI@/$PQXX_ABI/g" \
  15. "$1"
  16. }
  17. # Use templating system to generate various Makefiles.
  18. expand_templates() {
  19. for template in "$@"
  20. do
  21. ./tools/template2mak.py "$template" "${template%.template}"
  22. done
  23. }
  24. # We have two kinds of templates. One uses our custom templating tool. And
  25. # a few others simply have some substitutions done.
  26. expand_templates $(find -name \*.template)
  27. substitute include/pqxx/version.hxx.template >include/pqxx/version.hxx
  28. substitute include/pqxx/doc/mainpage.md.template >include/pqxx/doc/mainpage.md
  29. autoheader
  30. libtoolize --force --automake --copy
  31. aclocal -I . -I config/m4
  32. automake --add-missing --copy
  33. autoconf
  34. echo "Done."