This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: bfdlibdir and bfdincludedir change


Hello Rainer, Alan,

* Alan Modra wrote on Wed, Aug 26, 2009 at 09:19:47AM CEST:
> On Tue, Aug 25, 2009 at 02:11:56PM +0200, Rainer Emrich wrote:
> > That sounds reasonable. But why are the directories created even if
> > libbfd is not install at all?
> 
> We used to not create the directories, but Ralf deleted our custom
> install rules when converting to the latest autotools.  Seems like the
> standard automake rules always create the dirs.

Thanks for the report and the notification.  Indeed the removal of the
custom rules changed that.  If you'd like the old behavior back, then we
can either go back to your old rules, or use the following patch.  It
uses defined semantics from Automake 1.11 to not create the installation
directory if the files aren't installed.  However, the Makefile.am files
as they are now will currently cause automake to warn unconditionally:

$ automake
Makefile.am:18: bfdlibdir was already defined in condition TRUE, which includes condition INSTALL_LIBBFD ...
configure.in:137: ... `bfdlibdir' previously defined here
Makefile.am:19: bfdincludedir was already defined in condition TRUE, which includes condition INSTALL_LIBBFD ...
configure.in:137: ... `bfdincludedir' previously defined here
Makefile.am:24: bfdlibdir was already defined in condition TRUE, which includes condition !INSTALL_LIBBFD ...
Makefile.am:18: ... `bfdlibdir' previously defined here
Makefile.am:25: bfdincludedir was already defined in condition TRUE, which includes condition !INSTALL_LIBBFD ...
Makefile.am:19: ... `bfdincludedir' previously defined here

(-Wno-override won't help here).  I can look into fixing the warning in
a future automake sometime, but for the moment, you'd have to live with
such warnings in opcodes/ and bfd/.  (The warning is wrong when
AM_SUBST_NOTMAKE is used on these variables, as that prevents the
'foo = @foo@' line in Makefile.in from being produced by automake.)

OK to apply?  Alternatively, I could also just revert the respective
chunks from <http://thread.gmane.org/gmane.comp.gnu.binutils/42975>.

Thanks,
Ralf

Do not create $(bfdlibdir) and $(bfdincludedir) if !INSTALL_LIBBFD.

opcodes/ChangeLog:
2009-08-26  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>

	* Makefile.am (bfdlibdir, bfdincludedir): Move definition ...
	[INSTALL_LIBBFD]: ... here, ...
	[INSTALL_LIBBFD]: ... and empty overrides here.
	[!INSTALL_LIBBFD]: (rpath_bfdlibdir): New variable.
	[!INSTALL_LIBBFD] (libbfd_la_LDFLAGS): Use it.
	* Makefile.in: Regenerate.
	* configure: Regenerate.

bfd/ChangeLog:
2009-08-26  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>

	* acinclude.m4 (AM_INSTALL_LIBBFD): Call AM_SUBST_NOTMAKE for
	bfdlibdir and bfdincludedir.
	* Makefile.am (bfdlibdir, bfdincludedir): Move definition ...
	[INSTALL_LIBBFD]: ... here, ...
	[INSTALL_LIBBFD]: ... and empty overrides here.
	[!INSTALL_LIBBFD]: (rpath_bfdlibdir): New variable.
	[!INSTALL_LIBBFD] (libbfd_la_LDFLAGS): Use it.
	* Makefile.in: Regenerate.
	* configure: Regenerate.

bfd/doc/ChangeLog:
2009-08-26  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>

	* Makefile.in: Regenerate.

diff --git a/bfd/Makefile.am b/bfd/Makefile.am
index 8381492..f6142dc 100644
--- a/bfd/Makefile.am
+++ b/bfd/Makefile.am
@@ -12,16 +12,20 @@ CSEARCH = -I. -I$(srcdir) -I$(INCDIR)
 SUBDIRS = doc po
 
 bfddocdir = doc
-bfdlibdir = @bfdlibdir@
-bfdincludedir = @bfdincludedir@
 
 libbfd_la_LDFLAGS =
 if INSTALL_LIBBFD
+bfdlibdir = @bfdlibdir@
+bfdincludedir = @bfdincludedir@
 bfdlib_LTLIBRARIES = libbfd.la
 bfdinclude_HEADERS = $(BFD_H) $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h $(INCDIR)/bfdlink.h
 else !INSTALL_LIBBFD
+# Empty these so that the respective installation directories will not be created.
+bfdlibdir =
+bfdincludedir =
+rpath_bfdlibdir = @bfdlibdir@
 noinst_LTLIBRARIES = libbfd.la
-libbfd_la_LDFLAGS += -rpath $(bfdlibdir)
+libbfd_la_LDFLAGS += -rpath $(rpath_bfdlibdir)
 endif
 
 WARN_CFLAGS = @WARN_CFLAGS@
diff --git a/bfd/acinclude.m4 b/bfd/acinclude.m4
index cd4fd55..aaa147e 100644
--- a/bfd/acinclude.m4
+++ b/bfd/acinclude.m4
@@ -64,6 +64,8 @@ AC_DEFUN([AM_INSTALL_LIBBFD],
     bfdincludedir='$(exec_prefix)/$(host_noncanonical)/$(target_noncanonical)/include'
   fi
   AC_SUBST(bfdlibdir)
+  AM_SUBST_NOTMAKE(bfdlibdir)
   AC_SUBST(bfdincludedir)
+  AM_SUBST_NOTMAKE(bfdincludedir)
 ]
 )
diff --git a/opcodes/Makefile.am b/opcodes/Makefile.am
index 465ea05..4f9a390 100644
--- a/opcodes/Makefile.am
+++ b/opcodes/Makefile.am
@@ -17,16 +17,19 @@ COMPILE_FOR_BUILD = $(CC_FOR_BUILD) $(INCLUDES) $(AM_CPPFLAGS) \
 	$(BUILD_CPPFLAGS) $(BUILD_CFLAGS)
 LINK_FOR_BUILD = $(CC_FOR_BUILD) $(BUILD_CFLAGS) $(BUILD_LDFLAGS) -o $@
 
-bfdlibdir = @bfdlibdir@
-bfdincludedir = @bfdincludedir@
-
 libopcodes_la_LDFLAGS =
 if INSTALL_LIBBFD
+bfdlibdir = @bfdlibdir@
+bfdincludedir = @bfdincludedir@
 bfdlib_LTLIBRARIES = libopcodes.la
 bfdinclude_DATA = $(INCDIR)/dis-asm.h
 else
+# Empty these so that the respective installation directories will not be created.
+bfdlibdir =
+bfdincludedir =
+rpath_bfdlibdir = @bfdlibdir@
 noinst_LTLIBRARIES = libopcodes.la
-libopcodes_la_LDFLAGS += -rpath $(bfdlibdir)
+libopcodes_la_LDFLAGS += -rpath $(rpath_bfdlibdir)
 endif
 
 # This is where bfd.h lives.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]