autogen.sh 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  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. : ${GETTEXTIZE=gettextize}
  11. : ${AUTOPOINT=autopoint}
  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. # Ensure that gettext is reasonably new.
  24. gettext_ver=`$GETTEXTIZE --version | sed -n '1s/\.//g;1s/.* //;1s/^\(...\)$/\100/;1s/^\(...\)\(.\)$/\10\2/;1p'`
  25. if test $gettext_ver -lt 01038; then
  26. echo "Don't use gettext older than 0.10.38" 2>&1
  27. exit 1
  28. fi
  29. rm -rf intl
  30. if test $gettext_ver -ge 01100; then
  31. if test $gettext_ver -lt 01105; then
  32. echo "Upgrade gettext to at least 0.11.5 or downgrade to 0.10.40" 2>&1
  33. exit 1
  34. fi
  35. $AUTOPOINT
  36. else
  37. $GETTEXTIZE --copy --force
  38. if test -e po/ChangeLog~; then
  39. rm -f po/ChangeLog
  40. mv po/ChangeLog~ po/ChangeLog
  41. fi
  42. fi
  43. ACLOCAL_INCLUDES="-I m4"
  44. # Some old version of GNU build tools fail to set error codes.
  45. # Check that they generate some of the files they should.
  46. $ACLOCAL $ACLOCAL_INCLUDES $ACLOCAL_FLAGS
  47. test -f aclocal.m4 || \
  48. { echo "aclocal failed to generate aclocal.m4" 2>&1; exit 1; }
  49. $AUTOHEADER || exit 1
  50. test -f config.h.in || \
  51. { echo "autoheader failed to generate config.h.in" 2>&1; exit 1; }
  52. $AUTOCONF || exit 1
  53. test -f configure || \
  54. { echo "autoconf failed to generate configure" 2>&1; exit 1; }
  55. # Workaround for Automake 1.5 to ensure that depcomp is distributed.
  56. $AUTOMAKE -a src/Makefile
  57. $AUTOMAKE -a
  58. test -f Makefile.in || \
  59. { echo "automake failed to generate Makefile.in" 2>&1; exit 1; }
  60. cd vfs/samba
  61. date -u >include/stamp-h.in
  62. $AUTOHEADER
  63. test -f include/config.h.in || \
  64. { echo "autoheader failed to generate vfs/samba/include/config.h.in" 2>&1; exit 1; }
  65. $AUTOCONF
  66. test -f configure || \
  67. { echo "autoconf failed to generate vfs/samba/configure" 2>&1; exit 1; }
  68. ) || exit 1
  69. $srcdir/configure --cache-file=config.cache --enable-maintainer-mode "$@"