autogen.sh 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. #! /bin/sh
  2. # Run this to generate all the initial makefiles, etc.
  3. # Make it possible to specify path in the environment
  4. : ${AUTOCONF=autoconf}
  5. : ${AUTOHEADER=autoheader}
  6. : ${AUTOMAKE=automake}
  7. : ${ACLOCAL=aclocal}
  8. : ${GETTEXTIZE=gettextize}
  9. srcdir=`dirname $0`
  10. test -z "$srcdir" && srcdir=.
  11. (
  12. cd $srcdir
  13. # The autoconf cache (version after 2.52) is not reliable yet.
  14. rm -rf autom4te.cache vfs/samba/autom4te.cache
  15. # Ensure that gettext is reasonably new.
  16. gettext_ver=`$GETTEXTIZE --version | sed -n '1s/^.* //p'`
  17. case $gettext_ver in
  18. 0.10.3[89]) ;;
  19. *) echo "Don't use gettext other than versions 0.10.38 and 0.10.39"
  20. exit 1;;
  21. esac
  22. rm -rf intl
  23. $GETTEXTIZE --copy --force >tmpout || exit 1
  24. rm -f po/ChangeLog
  25. mv po/ChangeLog~ po/ChangeLog
  26. if test ! -d config; then
  27. mkdir config || exit 1
  28. fi
  29. rm -f aclocal.m4
  30. if test -f `aclocal --print-ac-dir`/gettext.m4; then
  31. : # gettext macro files are available to aclocal.
  32. else
  33. # gettext macro files are not available.
  34. # Find them and copy to a local directory.
  35. # Ugly way to parse the instructions gettexize gives us.
  36. m4files="`cat tmpout | sed -n -e '/^Please/,/^from/s/^ *//p'`"
  37. fromdir=`cat tmpout | sed -n -e '/^Please/,/^from/s/^from the \([^ ]*\) .*$/\1/p'`
  38. rm tmpout
  39. rm -rf gettext.m4
  40. mkdir gettext.m4
  41. for i in $m4files; do
  42. cp -f $fromdir/$i gettext.m4
  43. done
  44. ACLOCAL_INCLUDES="-I gettext.m4"
  45. fi
  46. # Some old version of GNU build tools fail to set error codes.
  47. # Check that they generate some of the files they should.
  48. $ACLOCAL $ACLOCAL_INCLUDES $ACLOCAL_FLAGS || exit 1
  49. test -f aclocal.m4 || \
  50. { echo "aclocal failed to generate aclocal.m4" 2>&1; exit 1; }
  51. $AUTOHEADER || exit 1
  52. test -f config.h.in || \
  53. { echo "autoheader failed to generate config.h.in" 2>&1; exit 1; }
  54. $AUTOCONF || exit 1
  55. test -f configure || \
  56. { echo "autoconf failed to generate configure" 2>&1; exit 1; }
  57. # Workaround for Automake 1.5 to ensure that depcomp is distributed.
  58. $AUTOMAKE -a src/Makefile || exit 1
  59. $AUTOMAKE -a || exit 1
  60. test -f Makefile.in || \
  61. { echo "automake failed to generate Makefile.in" 2>&1; exit 1; }
  62. cd vfs/samba || exit 1
  63. date -u >include/stamp-h.in
  64. $AUTOHEADER || exit 1
  65. test -f include/config.h.in || \
  66. { echo "autoheader failed to generate vfs/samba/include/config.h.in" 2>&1; exit 1; }
  67. $AUTOCONF || exit 1
  68. test -f configure || \
  69. { echo "autoconf failed to generate vfs/samba/configure" 2>&1; exit 1; }
  70. ) || exit 1
  71. $srcdir/configure --cache-file=config.cache --enable-maintainer-mode "$@"