2
0

gettext-external-pr338.sh 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. #! /bin/sh
  2. # Copyright (C) 2002-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 gettext 'external' support.
  17. # PR/338, reported by Charles Wilson.
  18. required='gettext'
  19. . test-init.sh
  20. cat >>configure.ac <<END
  21. AM_GNU_GETTEXT([external])
  22. AC_OUTPUT
  23. END
  24. : >Makefile.am
  25. mkdir foo po
  26. $ACLOCAL
  27. $AUTOCONF
  28. # config.rpath is required.
  29. : >config.rpath
  30. # po/ is required, but intl/ isn't.
  31. AUTOMAKE_fails --add-missing
  32. grep 'AM_GNU_GETTEXT.*SUBDIRS' stderr
  33. echo 'SUBDIRS = foo' >Makefile.am
  34. AUTOMAKE_fails --add-missing
  35. grep 'AM_GNU_GETTEXT.*po' stderr
  36. # Ok.
  37. echo 'SUBDIRS = po' >Makefile.am
  38. $AUTOMAKE --add-missing
  39. # Don't try running ./configure --with-included-gettext if the
  40. # user is using AM_GNU_GETTEXT([external]).
  41. grep 'with-included-gettext' Makefile.in && exit 1
  42. ./configure
  43. $MAKE -n distcheck | grep 'with-included-gettext' && exit 1
  44. # intl/ isn't wanted with AM_GNU_GETTEXT([external]).
  45. mkdir intl
  46. echo 'SUBDIRS = po intl' >Makefile.am
  47. AUTOMAKE_fails --add-missing
  48. grep 'intl.*AM_GNU_GETTEXT' stderr
  49. :