autogen.sh 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  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. : ${XGETTEXT=xgettext}
  12. srcdir=`dirname $0`
  13. test -z "$srcdir" && srcdir=.
  14. (
  15. # Some shells don't propagate "set -e" to subshells.
  16. set -e
  17. cd "$srcdir"
  18. # The autoconf cache (version after 2.52) is not reliable yet.
  19. rm -rf autom4te.cache vfs/samba/autom4te.cache
  20. if test ! -d config; then
  21. mkdir config
  22. fi
  23. # Recreate intl directory.
  24. rm -rf intl
  25. $AUTOPOINT --force || exit 1
  26. # Generate po/POTFILES.in
  27. $XGETTEXT --keyword=_ --keyword=N_ --keyword=Q_ --output=- \
  28. `find . -name '*.[ch]'` | sed -ne '/^#:/{s/#://;s/:[0-9]*/\
  29. /g;s/ //g;p;}' | \
  30. grep -v '^$' | sort | uniq | grep -v 'regex.c' >po/POTFILES.in
  31. ACLOCAL_INCLUDES="-I m4"
  32. # Some old version of GNU build tools fail to set error codes.
  33. # Check that they generate some of the files they should.
  34. $ACLOCAL $ACLOCAL_INCLUDES $ACLOCAL_FLAGS
  35. test -f aclocal.m4 || \
  36. { echo "aclocal failed to generate aclocal.m4" >&2; exit 1; }
  37. $AUTOHEADER || exit 1
  38. test -f config.h.in || \
  39. { echo "autoheader failed to generate config.h.in" >&2; exit 1; }
  40. $AUTOCONF || exit 1
  41. test -f configure || \
  42. { echo "autoconf failed to generate configure" >&2; exit 1; }
  43. # Workaround for Automake 1.5 to ensure that depcomp is distributed.
  44. if test "`$AUTOMAKE --version|awk '{print $NF;exit}'`" = '1.5' ; then
  45. $AUTOMAKE -a src/Makefile
  46. fi
  47. $AUTOMAKE -a
  48. test -f Makefile.in || \
  49. { echo "automake failed to generate Makefile.in" >&2; exit 1; }
  50. cd vfs/samba
  51. date -u >include/stamp-h.in
  52. $AUTOHEADER
  53. test -f include/config.h.in || \
  54. { echo "autoheader failed to generate vfs/samba/include/config.h.in" >&2; exit 1; }
  55. $AUTOCONF
  56. test -f configure || \
  57. { echo "autoconf failed to generate vfs/samba/configure" >&2; exit 1; }
  58. ) || exit 1
  59. if test -x $srcdir/configure.mc; then
  60. $srcdir/configure.mc "$@"
  61. else
  62. $srcdir/configure --cache-file=config.cache --enable-maintainer-mode "$@"
  63. fi