libobj7.sh 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. #! /bin/sh
  2. # Copyright (C) 1997-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 for multiple replacement functions.
  17. required=cc
  18. . test-init.sh
  19. cat >> configure.ac << 'END'
  20. AC_PROG_CC
  21. AM_PROG_AR
  22. AC_PROG_RANLIB
  23. # 'am__dummy_function' is there to ensure that at least one function is
  24. # replaced, to avoid creating an empty archive which can cause problems
  25. # with e.g. Solaris ar.
  26. AC_REPLACE_FUNCS([basename dirname am__dummy_function])
  27. AC_OUTPUT
  28. END
  29. cat > Makefile.am << 'END'
  30. noinst_LIBRARIES = libtu.a
  31. libtu_a_SOURCES =
  32. libtu_a_LIBADD = @LIBOBJS@
  33. check-local: test1 test2 test3
  34. .PHONY: test1 test2 test3
  35. test1: all
  36. $(AR) tv libtu.a
  37. test2:
  38. @echo DIST_COMMON = $(DIST_COMMON)
  39. echo ' ' $(DIST_COMMON) ' ' | grep '[ /]basename\.c '
  40. echo ' ' $(DIST_COMMON) ' ' | grep '[ /]dirname\.c '
  41. echo ' ' $(DIST_COMMON) ' ' | grep '[ /]am__dummy_function\.c '
  42. test3: distdir
  43. test -f $(distdir)/basename.c
  44. test -f $(distdir)/dirname.c
  45. test -f $(distdir)/am__dummy_function.c
  46. END
  47. cat > basename.c <<'END'
  48. extern int dummy1;
  49. END
  50. cat > dirname.c <<'END'
  51. extern int dummy2;
  52. END
  53. cat > am__dummy_function.c <<'END'
  54. extern int dummy3;
  55. END
  56. $ACLOCAL
  57. $AUTOCONF
  58. $AUTOMAKE --add-missing
  59. ./configure
  60. $MAKE
  61. $MAKE check
  62. $MAKE distcheck
  63. :