ccnoco-lt.sh 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  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 libtool libraries when the compiler
  17. # doesn't understand '-c -o'.
  18. required='gcc libtoolize' # For cc-no-c-o.
  19. . test-init.sh
  20. cat >> configure.ac << 'END'
  21. AC_PROG_CC
  22. AM_PROG_AR
  23. LT_INIT
  24. $CC --version
  25. $CC -v
  26. AC_OUTPUT
  27. END
  28. cat > Makefile.am << 'END'
  29. lib_LTLIBRARIES = libwish.la
  30. END
  31. cat > libwish.c << 'END'
  32. int wish_granted (void)
  33. {
  34. return 0;
  35. }
  36. END
  37. # Make sure the compiler doesn't understand '-c -o'.
  38. CC=$am_testaux_builddir/cc-no-c-o; export CC
  39. libtoolize --verbose --install
  40. $ACLOCAL
  41. $AUTOCONF
  42. $AUTOMAKE --copy --add-missing
  43. for vpath in : false; do
  44. if $vpath; then
  45. srcdir=..
  46. mkdir build
  47. cd build
  48. else
  49. srcdir=.
  50. fi
  51. $srcdir/configure >stdout || { cat stdout; exit 1; }
  52. cat stdout
  53. $EGREP 'understands? -c and -o together.* no$' stdout
  54. # No repeated checks please.
  55. test $(grep ".*-c['\" ].*-o['\" ]" stdout \
  56. | $FGREP -v ' -c -o file.o' | wc -l) -eq 1
  57. # Once we have rewritten $CC to use our 'compile' wrapper script,
  58. # libtool should pick it up correctly, and not mess with the
  59. # redefinition.
  60. grep '^checking if .*/compile .*supports -c -o file\.o\.\.\. yes' stdout
  61. # And of course, we should be able to build our package.
  62. $MAKE
  63. cd $srcdir
  64. done
  65. $MAKE distcheck
  66. :