2
0

exeext.sh 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  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 to make sure '.' in an exe name doesn't fool us.
  17. # Report from Robert Collins.
  18. # Also make sure we rewrite conditionals variables.
  19. # Also check for PR/352.
  20. # Also make sure the old definitions of bin_PROGRAMS and friend
  21. # aren't left around. Report from Jim Meyering.
  22. required=cc
  23. . test-init.sh
  24. cat >> configure.ac << 'END'
  25. AC_PROG_CC
  26. AM_CONDITIONAL([WANT_MT], [test -z "$revert"])
  27. AM_CONDITIONAL([WANT_RMT], [test -z "$revert"])
  28. AC_OUTPUT
  29. END
  30. cat > Makefile.am << 'END'
  31. bin_PROGRAMS = maude
  32. sbin_PROGRAMS = maude.static
  33. ## We don't define this one for now. Probably it is an error.
  34. ## noinst_PROGRAMS = maude2.exe
  35. check_PROGRAMS = maude3$(EXEEXT)
  36. if WANT_MT
  37. bin_PROGRAMS += mt
  38. endif
  39. if WANT_RMT
  40. libexec_PROGRAMS = rmt
  41. endif
  42. test-default:
  43. is $(bin_PROGRAMS) == maude$(EXEEXT) mt$(EXEEXT)
  44. is $(sbin_PROGRAMS) == maude.static$(EXEEXT)
  45. is $(check_PROGRAMS) == maude3$(EXEEXT)
  46. is $(libexec_PROGRAMS) == rmt$(EXEEXT)
  47. test-revert:
  48. is $(bin_PROGRAMS) == maude$(EXEEXT)
  49. is $(sbin_PROGRAMS) == maude.static$(EXEEXT)
  50. is $(check_PROGRAMS) == maude3$(EXEEXT)
  51. is $(libexec_PROGRAMS) ==
  52. END
  53. $ACLOCAL
  54. $AUTOCONF
  55. $AUTOMAKE
  56. grep '^maude$(EXEEXT):' Makefile.in
  57. grep '^maude\.static$(EXEEXT):' Makefile.in
  58. grep '^maude3$(EXEEXT):' Makefile.in
  59. grep '^mt$(EXEEXT):' Makefile.in
  60. grep '^rmt$(EXEEXT):' Makefile.in
  61. test $(grep -c '^bin_PROGRAMS =' Makefile.in) -eq 1
  62. # Make sure $(EXEEXT) gets stripped before canonicalization.
  63. grep 'maude3__EXEEXT__OBJECTS' Makefile.in && exit 1
  64. ./configure
  65. run_make test-default
  66. run_make test-default EXEEXT=.foo
  67. ./configure revert=yes
  68. run_make test-revert
  69. run_make test-revert EXEEXT=.foo
  70. :