libobj2.sh 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. #! /bin/sh
  2. # Copyright (C) 1996-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 LIBOBJS works in subdirs.
  17. # Bug from Josh MacDonald.
  18. required=cc
  19. . test-init.sh
  20. cat >> configure.ac << 'END'
  21. AC_CONFIG_FILES([subdir/Makefile])
  22. AC_PROG_CC
  23. AM_PROG_AR
  24. AC_PROG_RANLIB
  25. AC_CHECK_TOOLS([AR], [ar])
  26. AC_LIBOBJ([fsusage])
  27. AC_OUTPUT
  28. END
  29. cat > Makefile.am << 'END'
  30. SUBDIRS = subdir
  31. check-local: distdir
  32. ls -l $(srcdir) $(srcdir)/subdir
  33. ls -l $(distdir) $(distdir)/subdir
  34. ls -l $(builddir) $(builddir)/subdir
  35. test -f $(srcdir)/subdir/fsusage.c
  36. test -f $(distdir)/subdir/fsusage.c
  37. $(AR) tv $(builddir)/subdir/libtu.a
  38. END
  39. mkdir subdir
  40. cat > subdir/Makefile.am << 'END'
  41. noinst_LIBRARIES = libtu.a
  42. libtu_a_SOURCES =
  43. libtu_a_LIBADD = @LIBOBJS@
  44. END
  45. cat > subdir/fsusage.c << 'END'
  46. extern int dummy;
  47. END
  48. $ACLOCAL
  49. $AUTOCONF
  50. $AUTOMAKE -a
  51. # Older grepping check, kept "just to be sure".
  52. $FGREP 'fsusage.c' subdir/Makefile.in
  53. ./configure
  54. $MAKE check
  55. $MAKE distcheck
  56. :