maintmode-configure-msg.sh 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. #! /bin/sh
  2. # Copyright (C) 2010-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. # Make sure that our macro 'AM_MAINTAINER_MODE' adds proper text to
  17. # the configure help screen. Also make sure the "checking ..." messages
  18. # related to the enabling/disabling of maintainer mode are correct (see
  19. # automake bug#9890).
  20. . test-init.sh
  21. set_maintmode ()
  22. {
  23. rm -rf autom4te*.cache # Just to be sure not to use a stale cache.
  24. echo "AC_INIT([$me], [1.0])" > configure.ac
  25. case $1 in
  26. DEFAULT) echo AM_MAINTAINER_MODE;;
  27. *) echo "AM_MAINTAINER_MODE([$*])";;
  28. esac >> configure.ac
  29. }
  30. check_configure_message_with ()
  31. {
  32. answer=$1; shift
  33. ./configure ${1+"$@"} >stdout || { cat stdout; exit 1; }
  34. cat stdout
  35. grep "^checking whether to enable maintainer-specific.*\\.\\.\\. $answer$" stdout
  36. test $(grep -c 'checking.*maint' stdout) -eq 1
  37. }
  38. set_maintmode "DEFAULT"
  39. $ACLOCAL
  40. $AUTOCONF --force
  41. grep_configure_help --enable-maintainer-mode 'enable make rules'
  42. check_configure_message_with "no"
  43. check_configure_message_with "yes" --enable-maintainer-mode
  44. set_maintmode "disable"
  45. $AUTOCONF --force
  46. grep_configure_help --enable-maintainer-mode 'enable make rules'
  47. check_configure_message_with "no"
  48. check_configure_message_with "yes" --enable-maintainer-mode
  49. set_maintmode "enable"
  50. $AUTOCONF --force
  51. ./configure --help >stdout || { cat stdout; exit 1; }
  52. cat stdout
  53. grep_configure_help --disable-maintainer-mode 'disable make rules'
  54. check_configure_message_with "yes"
  55. check_configure_message_with "no" --disable-maintainer-mode
  56. :