851-PR-other-56780.patch 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244
  1. From afe990251bd9b3a063f03da31a3b8d139d033bc3 Mon Sep 17 00:00:00 2001
  2. From: ian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>
  3. Date: Sat, 1 Jun 2013 00:20:49 +0000
  4. Subject: [PATCH] PR other/56780
  5. * libiberty/configure.ac: Move test for --enable-install-libiberty
  6. outside of the 'with_target_subdir' test so that it actually gets
  7. run. Add output messages to show the test result.
  8. * libiberty/configure: Regenerate.
  9. * libiberty/Makefile.in (install_to_libdir): Place the
  10. installation of the libiberty library in the same guard as that
  11. used for the headers to prevent it being installed unless
  12. requested via --enable-install-libiberty.
  13. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@199570 138bc75d-0d04-0410-961f-82ee72b054a4
  14. libiberty: fix --enable-install-libiberty flag [PR 56780]
  15. Commit 199570 fixed the --disable-install-libiberty behavior, but it also
  16. added a bug where the enable path never works because the initial clear
  17. of target_header_dir wasn't deleted. So we end up initializing properly
  18. at the top only to reset it at the end all the time.
  19. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@206367 138bc75d-0d04-0410-961f-82ee72b054a4
  20. [Romain
  21. squash the two upstream commits
  22. Remove the ChangeLog]
  23. Signed-off-by: Romain Naour <romain.naour@openwide.fr>
  24. ---
  25. libiberty/Makefile.in | 24 ++++++++++-----------
  26. libiberty/configure | 57 +++++++++++++++++++++++++++-----------------------
  27. libiberty/configure.ac | 47 ++++++++++++++++++++++-------------------
  28. 3 files changed, 68 insertions(+), 60 deletions(-)
  29. diff --git a/libiberty/Makefile.in b/libiberty/Makefile.in
  30. index f6a3ebd..75ff82d 100644
  31. --- a/libiberty/Makefile.in
  32. +++ b/libiberty/Makefile.in
  33. @@ -355,19 +355,19 @@ install-strip: install
  34. # since it will be passed the multilib flags.
  35. MULTIOSDIR = `$(CC) $(CFLAGS) -print-multi-os-directory`
  36. install_to_libdir: all
  37. - ${mkinstalldirs} $(DESTDIR)$(libdir)/$(MULTIOSDIR)
  38. - $(INSTALL_DATA) $(TARGETLIB) $(DESTDIR)$(libdir)/$(MULTIOSDIR)/$(TARGETLIB)n
  39. - ( cd $(DESTDIR)$(libdir)/$(MULTIOSDIR) ; chmod 644 $(TARGETLIB)n ;$(RANLIB) $(TARGETLIB)n )
  40. - mv -f $(DESTDIR)$(libdir)/$(MULTIOSDIR)/$(TARGETLIB)n $(DESTDIR)$(libdir)/$(MULTIOSDIR)/$(TARGETLIB)
  41. if test -n "${target_header_dir}"; then \
  42. - case "${target_header_dir}" in \
  43. - /*) thd=${target_header_dir};; \
  44. - *) thd=${includedir}/${target_header_dir};; \
  45. - esac; \
  46. - ${mkinstalldirs} $(DESTDIR)$${thd}; \
  47. - for h in ${INSTALLED_HEADERS}; do \
  48. - ${INSTALL_DATA} $$h $(DESTDIR)$${thd}; \
  49. - done; \
  50. + ${mkinstalldirs} $(DESTDIR)$(libdir)/$(MULTIOSDIR); \
  51. + $(INSTALL_DATA) $(TARGETLIB) $(DESTDIR)$(libdir)/$(MULTIOSDIR)/$(TARGETLIB)n; \
  52. + ( cd $(DESTDIR)$(libdir)/$(MULTIOSDIR) ; chmod 644 $(TARGETLIB)n ;$(RANLIB) $(TARGETLIB)n ); \
  53. + mv -f $(DESTDIR)$(libdir)/$(MULTIOSDIR)/$(TARGETLIB)n $(DESTDIR)$(libdir)/$(MULTIOSDIR)/$(TARGETLIB); \
  54. + case "${target_header_dir}" in \
  55. + /*) thd=${target_header_dir};; \
  56. + *) thd=${includedir}/${target_header_dir};; \
  57. + esac; \
  58. + ${mkinstalldirs} $(DESTDIR)$${thd}; \
  59. + for h in ${INSTALLED_HEADERS}; do \
  60. + ${INSTALL_DATA} $$h $(DESTDIR)$${thd}; \
  61. + done; \
  62. fi
  63. @$(MULTIDO) $(FLAGS_TO_PASS) multi-do DO=install
  64. diff --git a/libiberty/configure b/libiberty/configure
  65. index 5367027..4feb95a 100755
  66. --- a/libiberty/configure
  67. +++ b/libiberty/configure
  68. @@ -675,8 +675,8 @@ with_cross_host
  69. with_newlib
  70. enable_maintainer_mode
  71. enable_multilib
  72. -enable_largefile
  73. enable_install_libiberty
  74. +enable_largefile
  75. '
  76. ac_precious_vars='build_alias
  77. host_alias
  78. @@ -1303,8 +1303,8 @@ Optional Features:
  79. enable make rules and dependencies not useful
  80. (and sometimes confusing) to the casual installer
  81. --enable-multilib build many library versions (default)
  82. + --enable-install-libiberty Install headers and library for end users
  83. --disable-largefile omit support for large files
  84. - --enable-install-libiberty Install headers for end users
  85. Optional Packages:
  86. --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
  87. @@ -2784,6 +2784,35 @@ if test $cross_compiling = no && test $multilib = yes \
  88. cross_compiling=maybe
  89. fi
  90. +# We may wish to install the target headers somewhere.
  91. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to install libiberty headers and static library" >&5
  92. +$as_echo_n "checking whether to install libiberty headers and static library... " >&6; }
  93. +
  94. +# Check whether --enable-install-libiberty was given.
  95. +if test "${enable_install_libiberty+set}" = set; then :
  96. + enableval=$enable_install_libiberty; enable_install_libiberty=$enableval
  97. +else
  98. + enable_install_libiberty=no
  99. +fi
  100. +
  101. +# Option parsed, now set things appropriately.
  102. +case x"$enable_install_libiberty" in
  103. + xyes|x)
  104. + target_header_dir=libiberty
  105. + ;;
  106. + xno)
  107. + target_header_dir=
  108. + ;;
  109. + *)
  110. + # This could be sanity-checked in various ways...
  111. + target_header_dir="${enable_install_libiberty}"
  112. + ;;
  113. +esac
  114. +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_install_libiberty" >&5
  115. +$as_echo "$enable_install_libiberty" >&6; }
  116. +{ $as_echo "$as_me:${as_lineno-$LINENO}: target_header_dir = $target_header_dir" >&5
  117. +$as_echo "$as_me: target_header_dir = $target_header_dir" >&6;}
  118. +
  119. ac_ext=c
  120. ac_cpp='$CPP $CPPFLAGS'
  121. @@ -5476,7 +5505,6 @@ fi
  122. setobjs=
  123. CHECK=
  124. -target_header_dir=
  125. if test -n "${with_target_subdir}"; then
  126. # We are being configured as a target library. AC_REPLACE_FUNCS
  127. @@ -5759,29 +5787,6 @@ _ACEOF
  128. esac
  129. - # We may wish to install the target headers somewhere.
  130. - # Check whether --enable-install-libiberty was given.
  131. -if test "${enable_install_libiberty+set}" = set; then :
  132. - enableval=$enable_install_libiberty; enable_install_libiberty=$enableval
  133. -else
  134. - enable_install_libiberty=no
  135. -fi
  136. -
  137. - # Option parsed, now set things appropriately.
  138. - case x"$enable_install_libiberty" in
  139. - xyes|x)
  140. - target_header_dir=libiberty
  141. - ;;
  142. - xno)
  143. - target_header_dir=
  144. - ;;
  145. - *)
  146. - # This could be sanity-checked in various ways...
  147. - target_header_dir="${enable_install_libiberty}"
  148. - ;;
  149. - esac
  150. -
  151. -
  152. else
  153. # Not a target library, so we set things up to run the test suite.
  154. diff --git a/libiberty/configure.ac b/libiberty/configure.ac
  155. index c763894..f17e6b6 100644
  156. --- a/libiberty/configure.ac
  157. +++ b/libiberty/configure.ac
  158. @@ -128,6 +128,31 @@ if test $cross_compiling = no && test $multilib = yes \
  159. cross_compiling=maybe
  160. fi
  161. +# We may wish to install the target headers somewhere.
  162. +AC_MSG_CHECKING([whether to install libiberty headers and static library])
  163. +dnl install-libiberty is disabled by default
  164. +
  165. +AC_ARG_ENABLE(install-libiberty,
  166. +[ --enable-install-libiberty Install headers and library for end users],
  167. +enable_install_libiberty=$enableval,
  168. +enable_install_libiberty=no)dnl
  169. +
  170. +# Option parsed, now set things appropriately.
  171. +case x"$enable_install_libiberty" in
  172. + xyes|x)
  173. + target_header_dir=libiberty
  174. + ;;
  175. + xno)
  176. + target_header_dir=
  177. + ;;
  178. + *)
  179. + # This could be sanity-checked in various ways...
  180. + target_header_dir="${enable_install_libiberty}"
  181. + ;;
  182. +esac
  183. +AC_MSG_RESULT($enable_install_libiberty)
  184. +AC_MSG_NOTICE([target_header_dir = $target_header_dir])
  185. +
  186. GCC_NO_EXECUTABLES
  187. AC_PROG_CC
  188. AC_SYS_LARGEFILE
  189. @@ -380,7 +405,6 @@ fi
  190. setobjs=
  191. CHECK=
  192. -target_header_dir=
  193. if test -n "${with_target_subdir}"; then
  194. # We are being configured as a target library. AC_REPLACE_FUNCS
  195. @@ -492,27 +516,6 @@ if test -n "${with_target_subdir}"; then
  196. esac
  197. - # We may wish to install the target headers somewhere.
  198. - AC_ARG_ENABLE(install-libiberty,
  199. - [ --enable-install-libiberty Install headers for end users],
  200. - enable_install_libiberty=$enableval,
  201. - enable_install_libiberty=no)dnl
  202. -
  203. - # Option parsed, now set things appropriately.
  204. - case x"$enable_install_libiberty" in
  205. - xyes|x)
  206. - target_header_dir=libiberty
  207. - ;;
  208. - xno)
  209. - target_header_dir=
  210. - ;;
  211. - *)
  212. - # This could be sanity-checked in various ways...
  213. - target_header_dir="${enable_install_libiberty}"
  214. - ;;
  215. - esac
  216. -
  217. -
  218. else
  219. # Not a target library, so we set things up to run the test suite.
  220. --
  221. 1.9.3