depdist.sh 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. #! /bin/sh
  2. # Copyright (C) 2001-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 depcomp is found for the distribution.
  17. # From Eric Magnien.
  18. required=cc
  19. . test-init.sh
  20. rm -f configure.ac
  21. mkdir config
  22. for i in *; do
  23. if test "$i" != "config"; then
  24. mv -f "$i" config
  25. fi
  26. done
  27. cat > configure.ac << END
  28. AC_INIT([$me], [1.0])
  29. AC_CONFIG_AUX_DIR([config])
  30. AM_INIT_AUTOMAKE
  31. AC_PROG_CC
  32. AC_CONFIG_FILES([subdir/Makefile Makefile])
  33. AC_OUTPUT
  34. END
  35. cat > Makefile.am << 'END'
  36. SUBDIRS = subdir
  37. check-local: test1 test2
  38. .PHONY: test1 test2
  39. test1:
  40. echo ' ' $(DIST_COMMON) ' ' | grep '[ /]config/depcomp '
  41. test2: distdir
  42. ls -l $(distdir)/*
  43. test -f $(distdir)/config/depcomp
  44. END
  45. mkdir subdir
  46. cat > subdir/foo.c << 'END'
  47. int main(void)
  48. {
  49. return 0;
  50. }
  51. END
  52. cat > subdir/Makefile.am << 'END'
  53. bin_PROGRAMS = foo
  54. foo_SOURCES = foo.c
  55. END
  56. $ACLOCAL
  57. $AUTOCONF
  58. $AUTOMAKE --add-missing
  59. ./configure
  60. $MAKE check
  61. $MAKE distcheck
  62. :