autogen.sh 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. #! /bin/sh
  2. # Run this to generate all the initial makefiles, etc.
  3. # Don't ignore errors.
  4. set -e
  5. # Make it possible to specify path in the environment
  6. : ${AUTOCONF=autoconf}
  7. : ${AUTOHEADER=autoheader}
  8. : ${AUTOMAKE=automake}
  9. : ${ACLOCAL=aclocal}
  10. : ${AUTOPOINT=autopoint}
  11. : ${LIBTOOLIZE=libtoolize}
  12. : ${XGETTEXT=xgettext}
  13. srcdir=`dirname $0`
  14. test -z "$srcdir" && srcdir=.
  15. (
  16. # Some shells don't propagate "set -e" to subshells.
  17. set -e
  18. $AUTOPOINT --version >/dev/null 2>&1
  19. if test $? -ne 0; then
  20. AUTOPOINT=maint/utils/autopoint
  21. fi
  22. cd "$srcdir"
  23. # The autoconf cache (version after 2.52) is not reliable yet.
  24. rm -rf autom4te.cache src/vfs/smbfs/helpers/autom4te.cache
  25. if test ! -d config; then
  26. mkdir config
  27. fi
  28. # Recreate intl directory.
  29. rm -rf intl
  30. $AUTOPOINT --force || exit 1
  31. # Generate po/POTFILES.in
  32. $XGETTEXT --keyword=_ --keyword=N_ --keyword=Q_ --output=- \
  33. `find . -name '*.[ch]'` | sed -ne '/^#:/{s/#://;s/:[0-9]*/\
  34. /g;s/ //g;p;}' | \
  35. grep -v '^$' | sort | uniq >po/POTFILES.in
  36. $LIBTOOLIZE
  37. ACLOCAL_INCLUDES="-I m4"
  38. # Some old version of GNU build tools fail to set error codes.
  39. # Check that they generate some of the files they should.
  40. $ACLOCAL $ACLOCAL_INCLUDES $ACLOCAL_FLAGS
  41. test -f aclocal.m4 || \
  42. { echo "aclocal failed to generate aclocal.m4" >&2; exit 1; }
  43. $AUTOHEADER || exit 1
  44. test -f config.h.in || \
  45. { echo "autoheader failed to generate config.h.in" >&2; exit 1; }
  46. $AUTOCONF || exit 1
  47. test -f configure || \
  48. { echo "autoconf failed to generate configure" >&2; exit 1; }
  49. # Workaround for Automake 1.5 to ensure that depcomp is distributed.
  50. if test "`$AUTOMAKE --version|awk '{print $NF;exit}'`" = '1.5' ; then
  51. $AUTOMAKE -a src/Makefile
  52. fi
  53. $AUTOMAKE -a
  54. test -f Makefile.in || \
  55. { echo "automake failed to generate Makefile.in" >&2; exit 1; }
  56. cd src/vfs/smbfs/helpers
  57. date -u >include/stamp-h.in
  58. $AUTOHEADER
  59. test -f include/config.h.in || \
  60. { echo "autoheader failed to generate src/vfs/smbfs/helpers/include/config.h.in" >&2; exit 1; }
  61. $AUTOCONF
  62. test -f configure || \
  63. { echo "autoconf failed to generate src/vfs/smbfs/helpers/configure" >&2; exit 1; }
  64. ) || exit 1
  65. $srcdir/maint/utils/version.sh "$srcdir"
  66. if test -x $srcdir/configure.mc; then
  67. $srcdir/configure.mc "$@"
  68. fi