no-extra-c-stuff.sh 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. #! /bin/sh
  2. # Copyright (C) 2013-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 Automake doesn't generated rules or definitions related
  17. # to compilation of C sources for a project that doesn't use nor need
  18. # a C Compiler. Inspired by the issues reported in automake bug#14560.
  19. am_create_testdir=empty
  20. . test-init.sh
  21. cat > configure.ac <<END
  22. AC_INIT([$me], [1.0])
  23. AC_CONFIG_AUX_DIR([.])
  24. AM_INIT_AUTOMAKE
  25. AC_CONFIG_FILES([
  26. Makefile
  27. sub/Makefile
  28. sub2/Makefile
  29. ])
  30. AC_PROG_CXX
  31. AC_PROG_F77
  32. AC_OUTPUT
  33. END
  34. cat > Makefile.am <<END
  35. SUBDIRS = sub sub2
  36. bin_PROGRAMS = bar
  37. bar_SOURCES = bar.cc
  38. END
  39. mkdir sub sub2
  40. cat > sub/Makefile.am <<END
  41. bin_PROGRAMS = foo
  42. foo_SOURCES = foo.f
  43. END
  44. cat > sub2/Makefile.am <<END
  45. bin_PROGRAMS = baz
  46. baz_SOURCES = baz.cxx
  47. END
  48. $ACLOCAL
  49. $AUTOCONF
  50. $AUTOMAKE --add-missing
  51. test -f install-sh
  52. test ! -e compile
  53. # Sanity checks.
  54. $FGREP '$(CXX)' Makefile.in
  55. $FGREP '$(CXX)' sub2/Makefile.in
  56. $FGREP '$(F77)' Makefile.in sub2/Makefile.in && exit 1
  57. $FGREP '$(F77)' sub/Makefile.in
  58. $FGREP '$(CXX)' sub/Makefile.in && exit 1
  59. $EGREP '(^COMPILE|$\(CC\)|AM_V_CC)' \
  60. Makefile.in sub/Makefile.in sub2/Makefile.in && exit 1
  61. :