bootstrap 975 B

12345678910111213141516171819202122232425262728293031323334353637
  1. #!/bin/sh
  2. # This script bootstraps autotools: it copies any necessary files,
  3. # and generates the configure script, when checked out from git
  4. # Copyright (C) Oliver Galvin 2018
  5. # See COPYING for license information
  6. #Check for dependencies
  7. deps="automake autoconf autopoint pkgconf"
  8. for dep in $deps; do
  9. $dep --version >/dev/null 2>&1 || (
  10. echo "Error: $dep is missing. Aborting."
  11. exit 1
  12. )
  13. done
  14. #Make sure we are in the same directory as the script
  15. srcdir=$(dirname "$0")
  16. cd "$srcdir" || exit 1
  17. #Check the directory has the necessary template files
  18. if ! test -f configure.ac || ! test -f makefile.am; then
  19. echo "Directory $srcdir does not look like a project root. Aborting."
  20. exit 1
  21. fi
  22. #shellcheck disable=SC2016
  23. prog=$(autoconf -t 'AC_INIT:$1')
  24. echo "$0: Bootstrapping $prog source directory..."
  25. autopoint || exit 1
  26. aclocal || exit 1
  27. autoreconf -fi || exit 1
  28. echo "...done. $prog can now be built and installed."
  29. test -f INSTALL && echo "See the INSTALL file."