silent-f77.sh 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  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. # Check silent-rules mode for Fortran 77.
  17. # Keep this ins sync with the sister test 'silent-f90.sh'.
  18. required=fortran77
  19. . test-init.sh
  20. mkdir sub
  21. cat >>configure.ac <<'EOF'
  22. AC_PROG_F77
  23. AC_CONFIG_FILES([sub/Makefile])
  24. AC_OUTPUT
  25. EOF
  26. cat > Makefile.am <<'EOF'
  27. # Need generic and non-generic rules.
  28. bin_PROGRAMS = foo1 foo2
  29. foo1_SOURCES = foo.f
  30. foo2_SOURCES = $(foo1_SOURCES)
  31. foo2_FFLAGS = $(AM_FFLAGS)
  32. SUBDIRS = sub
  33. EOF
  34. cat > sub/Makefile.am <<'EOF'
  35. AUTOMAKE_OPTIONS = subdir-objects
  36. # Need generic and non-generic rules.
  37. bin_PROGRAMS = bar1 bar2
  38. bar1_SOURCES = bar.f
  39. bar2_SOURCES = $(bar1_SOURCES)
  40. bar2_FFLAGS = $(AM_FFLAGS)
  41. EOF
  42. cat > foo.f <<'EOF'
  43. program foo
  44. stop
  45. end
  46. EOF
  47. cp foo.f sub/bar.f
  48. $ACLOCAL
  49. $AUTOMAKE --add-missing
  50. $AUTOCONF
  51. ./configure --enable-silent-rules
  52. run_make -O
  53. # Avoid spurious failures with SunStudio Fortran compilers.
  54. sed '/^NOTICE:/d' stdout > t
  55. mv -f t stdout
  56. cat stdout
  57. $EGREP ' (-c|-o)' stdout && exit 1
  58. grep 'mv ' stdout && exit 1
  59. grep 'F77 .*foo\.' stdout
  60. grep 'F77 .*bar\.' stdout
  61. grep 'F77LD .*foo1' stdout
  62. grep 'F77LD .*bar1' stdout
  63. grep 'F77LD .*foo2' stdout
  64. grep 'F77LD .*bar2' stdout
  65. $EGREP '(FC|FCLD) ' stdout && exit 1
  66. # Ensure a clean rebuild.
  67. $MAKE clean
  68. run_make -O V=1
  69. grep ' -c ' stdout
  70. grep ' -o ' stdout
  71. $EGREP '(F77|FC|LD) ' stdout && exit 1
  72. :