autogen.sh 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  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; # strip leading 0 from long tokens
  30. s/$/.00.00/; # add .00.00 for short version strings
  31. s/\.//g; # remove dots
  32. s/\(......\).*/\1/; # leave only 6 leading digits
  33. '`
  34. if test $gettext_ver -lt 01038; then
  35. echo "Don't use gettext older than 0.10.38" 2>&1
  36. exit 1
  37. fi
  38. rm -rf intl
  39. if test $gettext_ver -ge 01100; then
  40. if test $gettext_ver -lt 01105; then
  41. echo "Upgrade gettext to at least 0.11.5 or downgrade to 0.10.40" 2>&1
  42. exit 1
  43. fi
  44. $AUTOPOINT --force || exit 1
  45. else
  46. $GETTEXTIZE --copy --force || exit 1
  47. if test -e po/ChangeLog~; then
  48. rm -f po/ChangeLog
  49. mv po/ChangeLog~ po/ChangeLog
  50. fi
  51. fi
  52. ACLOCAL_INCLUDES="-I m4"
  53. # Some old version of GNU build tools fail to set error codes.
  54. # Check that they generate some of the files they should.
  55. $ACLOCAL $ACLOCAL_INCLUDES $ACLOCAL_FLAGS
  56. test -f aclocal.m4 || \
  57. { echo "aclocal failed to generate aclocal.m4" 2>&1; exit 1; }
  58. $AUTOHEADER || exit 1
  59. test -f config.h.in || \
  60. { echo "autoheader failed to generate config.h.in" 2>&1; exit 1; }
  61. $AUTOCONF || exit 1
  62. test -f configure || \
  63. { echo "autoconf failed to generate configure" 2>&1; exit 1; }
  64. # Workaround for Automake 1.5 to ensure that depcomp is distributed.
  65. $AUTOMAKE -a src/Makefile
  66. $AUTOMAKE -a
  67. test -f Makefile.in || \
  68. { echo "automake failed to generate Makefile.in" 2>&1; exit 1; }
  69. cd vfs/samba
  70. date -u >include/stamp-h.in
  71. $AUTOHEADER
  72. test -f include/config.h.in || \
  73. { echo "autoheader failed to generate vfs/samba/include/config.h.in" 2>&1; exit 1; }
  74. $AUTOCONF
  75. test -f configure || \
  76. { echo "autoconf failed to generate vfs/samba/configure" 2>&1; exit 1; }
  77. ) || exit 1
  78. if test -x $srcdir/configure.mc; then
  79. $srcdir/configure.mc "$@"
  80. else
  81. $srcdir/configure --cache-file=config.cache --enable-maintainer-mode "$@"
  82. fi