aclocal-I-and-install.sh 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  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. # Make sure aclocal define macros in the same order as -I's.
  17. # This is the similar to aclocal-I-order-1.sh, with the macro calls
  18. # reversed (it did make a difference).
  19. #
  20. # Also check for --install.
  21. # TODO: write a sister test that doesn't use a 'dirlist' file, but
  22. # TODO: puts third-party macros directly into 'acdir'.
  23. am_create_testdir=empty
  24. . test-init.sh
  25. cat > configure.ac << 'END'
  26. AC_INIT
  27. MACRO2
  28. MACRO1
  29. MACRO3
  30. END
  31. ACLOCAL="$ACLOCAL --system-acdir acdir"
  32. mkdir m4_1 m4_2 acdir acdir2
  33. echo ./acdir2 > acdir/dirlist
  34. cat >m4_1/somedefs.m4 <<EOF
  35. AC_DEFUN([MACRO1], [:macro11:])
  36. AC_DEFUN([MACRO2], [:macro21:])
  37. EOF
  38. cat >m4_2/somedefs.m4 <<EOF
  39. AC_DEFUN([MACRO1], [:macro12:])
  40. EOF
  41. cat >acdir2/macro.m4 <<EOF
  42. AC_DEFUN([MACRO3], [:macro33:])
  43. EOF
  44. $ACLOCAL -I m4_1 -I m4_2
  45. $AUTOCONF
  46. $FGREP ':macro11:' configure
  47. $FGREP ':macro21:' configure
  48. $FGREP ':macro33:' configure
  49. grep MACRO3 aclocal.m4
  50. test ! -e m4_1/macro.m4
  51. test ! -e m4_2/macro.m4
  52. $sleep
  53. $ACLOCAL -I m4_2 -I m4_1
  54. $AUTOCONF
  55. $FGREP ':macro12:' configure
  56. $FGREP ':macro21:' configure
  57. $FGREP ':macro33:' configure
  58. grep MACRO3 aclocal.m4
  59. test ! -e m4_1/macro.m4
  60. test ! -e m4_2/macro.m4
  61. $sleep
  62. $ACLOCAL -I m4_1 -I m4_2 --install
  63. $AUTOCONF
  64. $FGREP ':macro11:' configure
  65. $FGREP ':macro21:' configure
  66. $FGREP ':macro33:' configure
  67. grep MACRO3 aclocal.m4 && exit 1
  68. test -f m4_1/macro.m4
  69. test ! -e m4_2/macro.m4
  70. cp aclocal.m4 copy.m4
  71. $sleep
  72. echo '#GREPME' >>acdir2/macro.m4
  73. $ACLOCAL -I m4_1 -I m4_2 --install
  74. $AUTOCONF
  75. $FGREP ':macro11:' configure
  76. $FGREP ':macro21:' configure
  77. $FGREP ':macro33:' configure
  78. grep MACRO3 aclocal.m4 && exit 1
  79. grep GREPME m4_1/macro.m4 && exit 1
  80. test -f m4_1/macro.m4
  81. test ! -e m4_2/macro.m4
  82. diff aclocal.m4 copy.m4
  83. :