This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: bfd.h installation location
On Thu, May 16, 2002 at 06:45:02PM -0300, Alexandre Oliva wrote:
> *If* libbfd.so is installed. If it wasn't, as I had thought was a
> good idea t first, it can't possibly help.
Certainly libbfd.so needs to be installed when --enable-shared. HJ's
comment alerted me to that wrinkle before I posted my first fix.
Here's a revision of my fix incorporating Maciej's suggestion regarding
install paths.
bfd/ChangeLog
* acinclude.m4 (AM_INSTALL_LIBBFD): New.
* configure.in: Invoke AM_INSTALL_LIBBFD.
* Makefile.am (install-data-local): Revert 2002-05-13. Move to..
(install_libbfd): .. New target.
(uninstall_libbfd): Likewise.
(install-libLTLIBRARIES): Likewise.
(uninstall-libLTLIBRARIES): Likewise.
* aclocal.m4: Regenerate.
* configure: Regenerate.
* Makefile.in: Regenerate.
Index: bfd/acinclude.m4
===================================================================
RCS file: /cvs/src/src/bfd/acinclude.m4,v
retrieving revision 1.5
diff -u -p -r1.5 acinclude.m4
--- bfd/acinclude.m4 31 Aug 2000 09:35:50 -0000 1.5
+++ bfd/acinclude.m4 17 May 2002 02:17:05 -0000
@@ -123,3 +123,27 @@ ifelse(yes,no,[
AC_DEFUN([CY_WITH_NLS],)
AC_SUBST(INTLLIBS)
])
+
+AC_DEFUN([AM_INSTALL_LIBBFD],
+[AC_MSG_CHECKING([whether to install libbfd])
+ AC_ARG_ENABLE(install-libbfd,
+[ --install-libbfd controls installation of libbfd and related headers],
+ INSTALL_LIBBFD_P=$enableval,
+ if test "${host}" = "${target}" -o "$enable_shared" = "yes"; then
+ INSTALL_LIBBFD_P=yes
+ else
+ INSTALL_LIBBFD_P=no
+ fi)
+ AC_MSG_RESULT($INSTALL_LIBBFD_P)
+ AM_CONDITIONAL(INSTALL_LIBBFD, test $INSTALL_LIBBFD_P = yes)
+ # libbfd.a is a host library containing target dependent code
+ if test "${host}" != "${target}"; then
+ if test x"${libdir}" = x'${exec_prefix}/lib'; then
+ libdir='${exec_prefix}/${target_alias}/${host_alias}/lib'
+ fi
+ if test x"${includedir}" = x'${prefix}/include'; then
+ includedir='${exec_prefix}/${target_alias}/${host_alias}/include'
+ fi
+ fi
+]
+)
Index: bfd/configure.in
===================================================================
RCS file: /cvs/src/src/bfd/configure.in,v
retrieving revision 1.94
diff -u -p -r1.94 configure.in
--- bfd/configure.in 13 May 2002 13:33:29 -0000 1.94
+++ bfd/configure.in 17 May 2002 02:17:10 -0000
@@ -98,6 +98,7 @@ if test -z "$target" ; then
fi
AM_MAINTAINER_MODE
+AM_INSTALL_LIBBFD
AC_EXEEXT
host64=false
Index: bfd/Makefile.am
===================================================================
RCS file: /cvs/src/src/bfd/Makefile.am,v
retrieving revision 1.82
diff -u -p -r1.82 Makefile.am
--- bfd/Makefile.am 13 May 2002 00:58:40 -0000 1.82
+++ bfd/Makefile.am 17 May 2002 02:17:04 -0000
@@ -672,14 +672,35 @@ $(BFD32_LIBS) \
$(BFD64_BACKENDS) \
$(OPTIONAL_BACKENDS): $(BFD_H) $(BFD_H_DEPS) $(LOCAL_H_DEPS)
-# Install BFD include file, and others that it needs.
-install-data-local: $(BFD_H)
+install-libLTLIBRARIES: @INSTALL_LIBBFD_TRUE@ install_libbfd
@$(NORMAL_INSTALL)
- $(mkinstalldirs) $(DESTDIR)$(exec_prefix)/include
- $(INSTALL_DATA) $(BFD_H) $(DESTDIR)$(exec_prefix)/include/bfd.h
- $(INSTALL_DATA) $(INCDIR)/ansidecl.h $(DESTDIR)$(exec_prefix)/include/ansidecl.h
- $(INSTALL_DATA) $(INCDIR)/symcat.h $(DESTDIR)$(exec_prefix)/include/symcat.h
- $(INSTALL_DATA) $(INCDIR)/bfdlink.h $(DESTDIR)$(exec_prefix)/include/bfdlink.h
+
+uninstall-libLTLIBRARIES: @INSTALL_LIBBFD_TRUE@ uninstall_libbfd
+ @$(NORMAL_UNINSTALL)
+
+.PHONY: install_libbfd uninstall_libbfd
+install_libbfd: $(lib_LTLIBRARIES) $(BFD_H)
+ $(mkinstalldirs) $(DESTDIR)$(libdir)
+ $(mkinstalldirs) $(DESTDIR)$(includedir)
+ @list='$(lib_LTLIBRARIES)'; for p in $$list; do \
+ if test -f $$p; then \
+ echo "$(LIBTOOL) --mode=install $(INSTALL) $$p $(DESTDIR)$(libdir)/$$p"; \
+ $(LIBTOOL) --mode=install $(INSTALL) $$p $(DESTDIR)$(libdir)/$$p; \
+ else :; fi; \
+ done
+ $(INSTALL_DATA) $(BFD_H) $(DESTDIR)$(includedir)/bfd.h
+ $(INSTALL_DATA) $(INCDIR)/ansidecl.h $(DESTDIR)$(includedir)/ansidecl.h
+ $(INSTALL_DATA) $(INCDIR)/symcat.h $(DESTDIR)$(includedir)/symcat.h
+ $(INSTALL_DATA) $(INCDIR)/bfdlink.h $(DESTDIR)$(includedir)/bfdlink.h
+
+uninstall_libbfd:
+ list='$(lib_LTLIBRARIES)'; for p in $$list; do \
+ $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(libdir)/$$p; \
+ done
+ rm -f $(DESTDIR)$(includedir)/bfd.h
+ rm -f $(DESTDIR)$(includedir)/ansidecl.h
+ rm -f $(DESTDIR)$(includedir)/symcat.h
+ rm -f $(DESTDIR)$(includedir)/bfdlink.h
Makefile: $(srcdir)/configure.in
--
Alan Modra
IBM OzLabs - Linux Technology Centre