autogen.sh 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  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 | \
  25. sed '2,$d; # remove all but the first line
  26. s/.* //; # take text after the last space
  27. s/-.*//; # strip "-pre" or "-rc" at the end
  28. s/\([^.]\+\)/0\1/g; # prepend 0 to every token
  29. s/0\([^.][^.]\)/\1/g; # trim 0 from long lokens
  30. s/\.//g; # remove dots
  31. '`
  32. if test $gettext_ver -lt 01038; then
  33. echo "Don't use gettext older than 0.10.38" 2>&1
  34. exit 1
  35. fi
  36. rm -rf intl
  37. if test $gettext_ver -ge 01100; then
  38. if test $gettext_ver -lt 01105; then
  39. echo "Upgrade gettext to at least 0.11.5 or downgrade to 0.10.40" 2>&1
  40. exit 1
  41. fi
  42. $AUTOPOINT || exit 1
  43. else
  44. $GETTEXTIZE --copy --force || exit 1
  45. if test -e po/ChangeLog~; then
  46. rm -f po/ChangeLog
  47. mv po/ChangeLog~ po/ChangeLog
  48. fi
  49. fi
  50. ACLOCAL_INCLUDES="-I m4"
  51. # Some old version of GNU build tools fail to set error codes.
  52. # Check that they generate some of the files they should.
  53. $ACLOCAL $ACLOCAL_INCLUDES $ACLOCAL_FLAGS
  54. test -f aclocal.m4 || \
  55. { echo "aclocal failed to generate aclocal.m4" 2>&1; exit 1; }
  56. $AUTOHEADER || exit 1
  57. test -f config.h.in || \
  58. { echo "autoheader failed to generate config.h.in" 2>&1; exit 1; }
  59. $AUTOCONF || exit 1
  60. test -f configure || \
  61. { echo "autoconf failed to generate configure" 2>&1; exit 1; }
  62. # Workaround for Automake 1.5 to ensure that depcomp is distributed.
  63. $AUTOMAKE -a src/Makefile
  64. $AUTOMAKE -a
  65. test -f Makefile.in || \
  66. { echo "automake failed to generate Makefile.in" 2>&1; exit 1; }
  67. cd vfs/samba
  68. date -u >include/stamp-h.in
  69. $AUTOHEADER
  70. test -f include/config.h.in || \
  71. { echo "autoheader failed to generate vfs/samba/include/config.h.in" 2>&1; exit 1; }
  72. $AUTOCONF
  73. test -f configure || \
  74. { echo "autoconf failed to generate vfs/samba/configure" 2>&1; exit 1; }
  75. ) || exit 1
  76. $srcdir/configure --cache-file=config.cache --enable-maintainer-mode "$@"