Bug 15815

Summary: can't install libiberty
Product: binutils Reporter: Neil <knrstaj>
Component: binutilsAssignee: Not yet assigned to anyone <unassigned>
Status: RESOLVED FIXED    
Severity: normal CC: moo.sourceware.z.edmcman
Priority: P2    
Version: 2.24   
Target Milestone: ---   
Host: Target:
Build: Last reconfirmed:

Description Neil 2013-08-05 02:50:46 UTC
--enable-install-libiberty option fail

libiberty won't install in ${prefix}/lib

I found this commit.

commit 9c9b87adf7434822a6b71941b37015a2b0d1727c
Author: DJ Delorie <dj@delorie.com>
Date:   Sat Jun 1 01:01:43 2013 +0000

    merge from gcc

diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog
index a30a363..96bc317 100644
--- a/libiberty/ChangeLog
+++ b/libiberty/ChangeLog
@@ -1,3 +1,15 @@
+2013-05-31  Matt Burgess <matthew@linuxfromscratch.org>
+
+       PR other/56780
+       * libiberty/configure.ac: Move test for --enable-install-libiberty
+       outside of the 'with_target_subdir' test so that it actually gets
+       run.  Add output messages to show the test result.
+       * libiberty/configure: Regenerate.
+       * libiberty/Makefile.in (install_to_libdir): Place the
+       installation of the libiberty library in the same guard as that
+       used for the headers to prevent it being installed unless
+       requested via --enable-install-libiberty.
+


There is some code should be move together.

-----------------
# For each of these functions, if the host does not provide the
# function we want to put FN.o in LIBOBJS, and if the host does
# provide the function, we want to define HAVE_FN in config.h.

setobjs=
CHECK=
target_header_dir=                    <======  this is root cause
if test -n "${with_target_subdir}"; then
-----------------

Because ${target_header_dir} is empty, libiberty.a will never be install.
Comment 1 Edward J. Schwartz 2014-02-28 00:14:55 UTC
commit 369be6981b26787b2685e3b8c6da779dae8ce35f
Author: Mike Frysinger <vapier@gentoo.org>
Date:   Mon Jan 6 13:15:31 2014

    libiberty: fix --enable-install-libiberty flag [PR 56780]

    Commit 199570 fixed the --disable-install-libiberty behavior, but it also
    added a bug where the enable path never works because the initial clear
    of target_header_dir wasn't deleted.  So we end up initializing properly
    at the top only to reset it at the end all the time.

    git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@206367 138bc75d-0d04-0410-961f-82ee72b054a4
Comment 2 Edward J. Schwartz 2014-02-28 00:16:51 UTC
This is fixed in 369be6981b26787b2685e3b8c6da779dae8ce35f