ccnoco.sh 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  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_OUTPUT
  25. END
  26. cat > Makefile.am << 'END'
  27. bin_PROGRAMS = wish
  28. wish_SOURCES = a.c
  29. # Make sure we need something strange.
  30. wish_CFLAGS = -g
  31. END
  32. cat > a.c << 'END'
  33. #include <stdio.h>
  34. int main ()
  35. {
  36. printf ("hi\n");
  37. }
  38. END
  39. # Make sure the compiler doesn't understand '-c -o'.
  40. CC=$am_testaux_builddir/cc-no-c-o; export CC
  41. $ACLOCAL
  42. $AUTOCONF -Wall -Werror
  43. $AUTOMAKE --copy --add-missing
  44. for vpath in : false; do
  45. if $vpath; then
  46. srcdir=..
  47. mkdir build
  48. cd build
  49. else
  50. srcdir=.
  51. fi
  52. $srcdir/configure >stdout || { cat stdout; exit 1; }
  53. cat stdout
  54. $EGREP 'understands? -c and -o together.* no$' stdout
  55. # No repeated checks please.
  56. test $(grep -c ".*-c['\" ].*-o['\" ]" stdout) -eq 1
  57. $MAKE
  58. cd $srcdir
  59. done
  60. $MAKE distcheck
  61. :