remake-maintainer-mode.sh 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. #! /bin/sh
  2. # Copyright (C) 2003-2017 Free Software Foundation, Inc.
  3. #
  4. # This program is free software; you can redistribute it and/or modify
  5. # it under the terms of the GNU General Public License as published by
  6. # the Free Software Foundation; either version 2, or (at your option)
  7. # any later version.
  8. #
  9. # This program is distributed in the hope that it will be useful,
  10. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. # GNU General Public License for more details.
  13. #
  14. # You should have received a copy of the GNU General Public License
  15. # along with this program. If not, see <http://www.gnu.org/licenses/>.
  16. # Check that AM_MAINTAINER_MODE disable some rebuild rules,
  17. # but not all.
  18. # Report from Ralf Corsepius.
  19. . test-init.sh
  20. if using_gmake; then
  21. remake="$MAKE"
  22. else
  23. remake="$MAKE Makefile"
  24. fi
  25. cat >>configure.ac <<'EOF'
  26. AM_MAINTAINER_MODE
  27. m4_include([foo.m4])
  28. if test ! -f rebuild_ok; then
  29. ACLOCAL=false
  30. AUTOMAKE=false
  31. AUTOCONF=false
  32. fi
  33. AC_OUTPUT
  34. EOF
  35. : > foo.m4
  36. : > Makefile.am
  37. $ACLOCAL
  38. $AUTOCONF
  39. $AUTOMAKE --add-missing
  40. ./configure
  41. $MAKE
  42. # Make sure the rules to rebuild configure/Makefile.in are not
  43. # triggered by default. ($MAKE will fail if they are, because the
  44. # tools are set to false.)
  45. $sleep
  46. touch aclocal.m4 Makefile.am configure.ac foo.m4
  47. $remake
  48. # Make sure the rebuild rule for Makefile is triggered.
  49. $sleep
  50. echo '# GrEpMe' >>Makefile.in
  51. $remake
  52. grep GrEpMe Makefile
  53. # Make sure the rebuild rule for config.status is triggered.
  54. $sleep
  55. grep 'AUTOCONF.*=.*false' Makefile
  56. : > rebuild_ok
  57. ./configure --no-create
  58. $remake
  59. grep 'AUTOCONF.*=.*false' Makefile && exit 1
  60. # Make sure rebuild rules do work if --enable-maintainer-mode is given.
  61. ./configure --enable-maintainer-mode
  62. $sleep
  63. echo 'AC_SUBST([YIPPY_YIPPY_YEAH])' >foo.m4
  64. $remake
  65. grep YIPPY_YIPPY_YEAH Makefile
  66. # Try the distribution, for completeness.
  67. $MAKE distcheck
  68. :