asm.sh 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. #! /bin/sh
  2. # Copyright (C) 2001-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. # Test of basic assembly functionality.
  17. # Keep this in sync with sister tests 'asm2.sh' and 'asm3.sh'.
  18. . test-init.sh
  19. mv configure.ac configure.stub
  20. cat > Makefile.am << 'END'
  21. noinst_PROGRAMS = maude
  22. maude_SOURCES = maude.s
  23. END
  24. echo '*** Try 1 -- should fail because we need CC and CCAS ***'
  25. cat configure.stub - > configure.ac << 'END'
  26. AC_SUBST([CCASFLAGS])
  27. AC_OUTPUT
  28. END
  29. $ACLOCAL
  30. AUTOMAKE_fails
  31. grep '[Aa]ssembler source.*CCAS.* undefined' stderr
  32. grep 'define .*CCAS.* add .*AM_PROG_AS' stderr
  33. # On fast machines the autom4te.cache created during the above run of
  34. # $AUTOMAKE is likely to have the same time stamp as the configure.ac
  35. # created below; thus causing traces for the old configure.ac to be
  36. # used. We could do '$sleep', but it's faster to erase the
  37. # directory. (Erase autom4te*.cache, not autom4te.cache, because some
  38. # bogus installations of Autoconf use a versioned cache.)
  39. rm -rf autom4te*.cache
  40. echo '*** Try 2 -- we still need CCAS ***'
  41. cat configure.stub - > configure.ac << 'END'
  42. AC_PROG_CC
  43. AC_SUBST([CCASFLAGS])
  44. AC_OUTPUT
  45. END
  46. $ACLOCAL
  47. AUTOMAKE_fails
  48. grep '[Aa]ssembler source.*CCAS.* undefined' stderr
  49. grep 'define .*CCAS.* add .*AM_PROG_AS' stderr
  50. rm -rf autom4te*.cache
  51. echo '*** Try 3 -- we need CCASFLAGS ***'
  52. cat configure.stub - > configure.ac << 'END'
  53. CCAS='$(CC)'
  54. AC_SUBST([CCAS])
  55. AC_PROG_CC
  56. AC_OUTPUT
  57. END
  58. $ACLOCAL
  59. AUTOMAKE_fails
  60. grep '[Aa]ssembler source.*CCASFLAGS.* undefined' stderr
  61. grep 'define .*CCASFLAGS.* add .*AM_PROG_AS' stderr
  62. rm -rf autom4te*.cache
  63. echo '*** Try 4 -- we have everything needed, expect success ***'
  64. cat configure.stub - > configure.ac << 'END'
  65. CCAS='$(CC)'
  66. AC_SUBST([CCAS])
  67. AC_PROG_CC
  68. AC_SUBST([CCASFLAGS])
  69. AC_OUTPUT
  70. END
  71. $ACLOCAL
  72. $AUTOMAKE
  73. rm -rf autom4te*.cache
  74. echo '*** Try 5 -- we have everything needed, expect success ***'
  75. cat configure.stub - > configure.ac << 'END'
  76. AM_PROG_AS
  77. AC_OUTPUT
  78. END
  79. $ACLOCAL
  80. $AUTOMAKE
  81. :