ccnoco-lib.sh 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  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. # Test to make sure we can compile when the compiler doesn't
  17. # understand '-c -o'.
  18. required=gcc # For cc-no-c-o.
  19. . test-init.sh
  20. cat >> configure.ac << 'END'
  21. AC_PROG_CC
  22. $CC --version || exit 1
  23. $CC -v || exit 1
  24. AC_PROG_RANLIB
  25. AM_PROG_AR
  26. AC_OUTPUT
  27. END
  28. cat > Makefile.am << 'END'
  29. mylibsdir = $(libdir)/my-libs
  30. mylibs_LIBRARIES = libwish.a
  31. libwish_a_SOURCES = a.c
  32. # Make sure we need something strange.
  33. libwish_CFLAGS = -O0
  34. END
  35. cat > a.c << 'END'
  36. int wish_granted (void)
  37. {
  38. return 0;
  39. }
  40. END
  41. # Make sure the compiler doesn't understand '-c -o'.
  42. CC=$am_testaux_builddir/cc-no-c-o; export CC
  43. $ACLOCAL
  44. $AUTOCONF -Wall -Werror
  45. $AUTOMAKE --copy --add-missing
  46. for vpath in : false; do
  47. if $vpath; then
  48. srcdir=..
  49. mkdir build
  50. cd build
  51. else
  52. srcdir=.
  53. fi
  54. $srcdir/configure >stdout || { cat stdout; exit 1; }
  55. cat stdout
  56. $EGREP 'understands? -c and -o together.* no$' stdout
  57. # No repeated checks please.
  58. test $(grep -c ".*-c['\" ].*-o['\" ]" stdout) -eq 1
  59. $MAKE
  60. cd $srcdir
  61. done
  62. $MAKE distcheck
  63. :