cond37.sh 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. #!/bin/sh
  2. # Copyright (C) 2004-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 conditional local rules.
  17. # Report from Simon Josefsson.
  18. . test-init.sh
  19. cat >>configure.ac <<'EOF'
  20. AM_CONDITIONAL([CASE_A], [test -n "$case_A"])
  21. AC_OUTPUT
  22. EOF
  23. cat > Makefile.am <<'EOF'
  24. if CASE_A
  25. check-local:
  26. @echo GrepMe1
  27. else
  28. install-data-local:
  29. @echo GrepMe2
  30. endif
  31. EOF
  32. $ACLOCAL
  33. $AUTOCONF
  34. $AUTOMAKE
  35. ./configure
  36. run_make -O check
  37. grep GrepMe1 stdout && exit 1
  38. run_make -O install
  39. grep GrepMe2 stdout
  40. ./configure case_A=1
  41. run_make -O check
  42. grep GrepMe1 stdout
  43. run_make -O install
  44. grep GrepMe2 stdout && exit 1
  45. :