2
0

ar-lib5a.sh 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. #! /bin/sh
  2. # Copyright (C) 2011-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 if AM_PROG_AR triggers the use of the ar-lib script.
  17. # This test requires Microsoft lib.
  18. # Keep this test in sync with sister test 'ar-lib5b.sh'.
  19. required=lib
  20. . test-init.sh
  21. cat > configure.ac << END
  22. AC_INIT([$me], [1.0])
  23. AC_CONFIG_AUX_DIR([auxdir])
  24. AM_INIT_AUTOMAKE
  25. AC_CONFIG_FILES([Makefile])
  26. AC_PROG_CC
  27. AM_PROG_AR
  28. AC_PROG_RANLIB
  29. # We want to test the content of am_cv_ar_interface in the Makefile.
  30. AC_SUBST([am_cv_ar_interface])
  31. AC_OUTPUT
  32. END
  33. cat > Makefile.am << 'END'
  34. lib_LIBRARIES = libwish.a
  35. libwish_a_SOURCES = wish.c
  36. check-local:
  37. test x'$(am_cv_ar_interface)' = x'lib'
  38. test -f ar-lib-worked
  39. test -f libwish.a
  40. MOSTLYCLEANFILES = ar-lib-worked
  41. END
  42. cat > wish.c << 'END'
  43. int wish(void) { return 0; }
  44. END
  45. mkdir auxdir
  46. cat - "$am_scriptdir/ar-lib" > auxdir/ar-lib << 'END'
  47. #! /bin/sh
  48. :> ar-lib-worked
  49. END
  50. chmod +x auxdir/ar-lib
  51. $ACLOCAL
  52. $AUTOCONF
  53. $AUTOMAKE --add-missing
  54. # Sanity check: test that it is ok to use 'am_cv_ar_interface' as we do.
  55. $FGREP 'am_cv_ar_interface=' configure
  56. ./configure AR=lib RANLIB=:
  57. $MAKE check
  58. $MAKE distcheck DISTCHECK_CONFIGURE_FLAGS='AR=lib RANLIB=:'
  59. :