libtoo10.sh 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. #! /bin/sh
  2. # Copyright (C) 2007-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. # Make sure .libs directories are removed for _PROGRAMS.
  17. # Report from Guillermo Ontañón.
  18. required='cc libtoolize'
  19. . test-init.sh
  20. cat >> configure.ac << 'END'
  21. AM_PROG_AR
  22. AC_PROG_LIBTOOL
  23. AC_OUTPUT
  24. END
  25. cat > Makefile.am << 'END'
  26. lib_LTLIBRARIES = lib/libfoo.la
  27. lib_libfoo_la_SOURCES = foo.c
  28. bin_PROGRAMS = src/main
  29. check_PROGRAMS = check/test
  30. src_main_SOURCES = main.c
  31. check_test_SOURCES = main.c
  32. LDADD = lib/libfoo.la
  33. END
  34. mkdir lib src check
  35. cat > foo.c << 'END'
  36. int foo () { return 0; }
  37. END
  38. cat > main.c << 'END'
  39. extern int foo ();
  40. int main () { return foo (); }
  41. END
  42. libtoolize
  43. $ACLOCAL
  44. $AUTOMAKE --add-missing
  45. $AUTOCONF
  46. ./configure
  47. $MAKE all check
  48. $MAKE clean
  49. test ! -e src/.libs
  50. test ! -e src/_libs
  51. test ! -e check/.libs
  52. test ! -e check/_libs
  53. $MAKE distcheck
  54. :