stdlib2.sh 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. #! /bin/sh
  2. # Copyright (C) 2003-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. # Check for AM_LDFLAGS = -module
  17. # Report from Kevin P. Fleming.
  18. required=libtool
  19. . test-init.sh
  20. : > README
  21. : > NEWS
  22. : > AUTHORS
  23. : > ChangeLog
  24. : > ltconfig
  25. : > ltmain.sh
  26. : > config.guess
  27. : > config.sub
  28. cat >> configure.ac << 'END'
  29. AC_PROG_CC
  30. AM_PROG_AR
  31. AC_PROG_LIBTOOL
  32. AC_OUTPUT
  33. END
  34. : > Makefile.inc
  35. cat > Makefile.am << 'END'
  36. include Makefile.inc
  37. lib_LTLIBRARIES = nonstandard.la
  38. nonstandard_la_SOURCES = foo.c
  39. FOO = -module
  40. END
  41. $ACLOCAL
  42. AUTOMAKE_fails --add-missing --gnu
  43. grep 'Makefile.am:2:.*nonstandard.la.*standard libtool library name' stderr
  44. grep 'Makefile.am:2:.*libnonstandard.la' stderr
  45. # We will use -Wno-gnu to disable the warning about setting LDFLAGS (below)
  46. # Make sure nonstandard names are diagnosed anyway.
  47. AUTOMAKE_fails --add-missing --gnu -Wno-gnu
  48. grep 'Makefile.am:2:.*nonstandard.la.*standard libtool library name' stderr
  49. grep 'Makefile.am:2:.*libnonstandard.la' stderr
  50. # Make sure nonstandard_la_LDFLAGS is read even if LDFLAGS is used.
  51. cat >Makefile.inc <<'EOF'
  52. LDFLAGS = -lfoo
  53. nonstandard_la_LDFLAGS = $(FOO)
  54. EOF
  55. $AUTOMAKE -Wno-gnu
  56. # Make sure LDFLAGS is read even if nonstandard_la_LDFLAGS is used.
  57. cat >Makefile.inc <<'EOF'
  58. LDFLAGS = $(FOO)
  59. nonstandard_la_LDFLAGS = -lfoo
  60. EOF
  61. $AUTOMAKE -Wno-gnu
  62. # Make sure AM_LDFLAGS is not read if foo_LDFLAGS is used.
  63. cat >Makefile.inc <<'EOF'
  64. nonstandard_la_LDFLAGS = -lfoo
  65. AM_LDFLAGS = -module
  66. EOF
  67. AUTOMAKE_fails
  68. grep 'Makefile.am:2:.*nonstandard.la.*standard libtool library name' stderr
  69. grep 'Makefile.am:2:.*libnonstandard.la' stderr
  70. echo 'AM_LDFLAGS = -module' > Makefile.inc
  71. $AUTOMAKE
  72. # For module, Automake should not suggest the lib prefix.
  73. cat > Makefile.am << 'END'
  74. include Makefile.inc
  75. lib_LTLIBRARIES = nonstandard
  76. nonstandard_SOURCES = foo.c
  77. FOO = -module
  78. END
  79. AUTOMAKE_fails
  80. grep "Makefile.am:2:.*'nonstandard'.*standard libtool module name" stderr
  81. grep 'Makefile.am:2:.*nonstandard.la' stderr