public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* bfdlibdir and bfdincludedir change
@ 2009-08-24 17:51 Rainer Emrich
  2009-08-25  1:50 ` Alan Modra
  0 siblings, 1 reply; 7+ messages in thread
From: Rainer Emrich @ 2009-08-24 17:51 UTC (permalink / raw)
  To: binutils

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Is this change intentional?

In bdf/acinclude.m4

  if test "${host}" != "${target}"; then
    bfdlibdir='$(exec_prefix)/$(host_noncanonical)/$(target_noncanonical)/lib'

bfdincludedir='$(exec_prefix)/$(host_noncanonical)/$(target_noncanonical)/include'
  fi
  AC_SUBST(bfdlibdir)
  AC_SUBST(bfdincludedir)


used to be:

    bfdlibdir='$(exec_prefix)/$(target_noncanonical)/lib'
bfdincludedir='$(exec_prefix)/$(target_noncanonical)/include'


and even if

install_libbfd_p=no

the directories are created.

Cheers,
Rainer
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkqSzmEACgkQoUhjsh59BL5dvQCeN+n+felwu0ao8kHeCDHRu77r
9nIAmQFlKnum69lB1/WX3pBRX3OnsyTD
=oXKb
-----END PGP SIGNATURE-----

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: bfdlibdir and bfdincludedir change
  2009-08-24 17:51 bfdlibdir and bfdincludedir change Rainer Emrich
@ 2009-08-25  1:50 ` Alan Modra
  2009-08-25 12:23   ` Rainer Emrich
  0 siblings, 1 reply; 7+ messages in thread
From: Alan Modra @ 2009-08-25  1:50 UTC (permalink / raw)
  To: Rainer Emrich; +Cc: binutils

On Mon, Aug 24, 2009 at 07:31:13PM +0200, Rainer Emrich wrote:
> Is this change intentional?

Yes.  libbfd contains code to run on the host to support the target.
Consider what happens if you are building binutils for multiple hosts
and targets, and installing to a shared file system.

-- 
Alan Modra
Australia Development Lab, IBM

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: bfdlibdir and bfdincludedir change
  2009-08-25  1:50 ` Alan Modra
@ 2009-08-25 12:23   ` Rainer Emrich
  2009-08-26  7:25     ` Alan Modra
  0 siblings, 1 reply; 7+ messages in thread
From: Rainer Emrich @ 2009-08-25 12:23 UTC (permalink / raw)
  To: Rainer Emrich, binutils

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Alan Modra schrieb:
> On Mon, Aug 24, 2009 at 07:31:13PM +0200, Rainer Emrich wrote:
>> Is this change intentional?
> 
> Yes.  libbfd contains code to run on the host to support the target.
> Consider what happens if you are building binutils for multiple hosts
> and targets, and installing to a shared file system.
> 

That sounds reasonable. But why are the directories created even if libbfd is
not install at all?

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkqT1QsACgkQoUhjsh59BL67fwCfWwX/Ieocq/Y0F0i7p/5+CYcV
5fgAn3zijtETjFLbkSX4IP7k4VHKtz+c
=8RiU
-----END PGP SIGNATURE-----

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: bfdlibdir and bfdincludedir change
  2009-08-25 12:23   ` Rainer Emrich
@ 2009-08-26  7:25     ` Alan Modra
  2009-08-26 19:58       ` Ralf Wildenhues
  0 siblings, 1 reply; 7+ messages in thread
From: Alan Modra @ 2009-08-26  7:25 UTC (permalink / raw)
  To: Rainer Emrich; +Cc: binutils

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.

-- 
Alan Modra
Australia Development Lab, IBM

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: bfdlibdir and bfdincludedir change
  2009-08-26  7:25     ` Alan Modra
@ 2009-08-26 19:58       ` Ralf Wildenhues
  2009-08-27  6:42         ` Alan Modra
  2009-10-11 11:36         ` Allow variable override of, rather than by, silent variables. (was: bfdlibdir and bfdincludedir change) Ralf Wildenhues
  0 siblings, 2 replies; 7+ messages in thread
From: Ralf Wildenhues @ 2009-08-26 19:58 UTC (permalink / raw)
  To: Rainer Emrich, binutils

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.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: bfdlibdir and bfdincludedir change
  2009-08-26 19:58       ` Ralf Wildenhues
@ 2009-08-27  6:42         ` Alan Modra
  2009-10-11 11:36         ` Allow variable override of, rather than by, silent variables. (was: bfdlibdir and bfdincludedir change) Ralf Wildenhues
  1 sibling, 0 replies; 7+ messages in thread
From: Alan Modra @ 2009-08-27  6:42 UTC (permalink / raw)
  To: Ralf Wildenhues; +Cc: Rainer Emrich, binutils

On Wed, Aug 26, 2009 at 09:04:42PM +0200, Ralf Wildenhues wrote:
> Do not create $(bfdlibdir) and $(bfdincludedir) if !INSTALL_LIBBFD.

OK, thanks!

-- 
Alan Modra
Australia Development Lab, IBM

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Allow variable override of, rather than by, silent variables. (was:  bfdlibdir and bfdincludedir change)
  2009-08-26 19:58       ` Ralf Wildenhues
  2009-08-27  6:42         ` Alan Modra
@ 2009-10-11 11:36         ` Ralf Wildenhues
  1 sibling, 0 replies; 7+ messages in thread
From: Ralf Wildenhues @ 2009-10-11 11:36 UTC (permalink / raw)
  To: automake-patches; +Cc: binutils

<http://thread.gmane.org/gmane.comp.gnu.binutils/43160/focus=43207>

* Ralf Wildenhues wrote on Wed, Aug 26, 2009 at 09:04:42PM CEST:
>
[ binutils/bfd/Makefile.am ]
> 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.)

Fixing this bug in Automake branch-1.11 and master as follows.

Cheers,
Ralf

    Allow variable override of, rather than by, silent variables.
    
    When overriding variables, check the VAR_SILENT status of the
    old condition, not the new one: we allow non-silent overrides
    of silent variables (these do not hit ordering bugs in the
    automake output), but there is no use case for doing so the
    other way round.  Fixes conditional overrides of variables
    annotated AM_SUBST_NOTMAKE in configure.ac.
    
    * lib/Automake/Variable.pm (_check_ambiguous_condition): Check
    for VAR_SILENT in $ambig_cond not $cond.
    * tests/cond44.test, tests/cond45.test: New tests, analogous to
    cond23.test and cond24.test.
    * tests/Makefile.am: Update.
    Spotted originally in binutils/bfd.

diff --git a/lib/Automake/Variable.pm b/lib/Automake/Variable.pm
index 94c0880..e7fa6bb 100644
--- a/lib/Automake/Variable.pm
+++ b/lib/Automake/Variable.pm
@@ -472,8 +472,9 @@ sub _check_ambiguous_condition ($$$)
   my $var = $self->name;
   my ($message, $ambig_cond) = $self->conditions->ambiguous_p ($var, $cond);
 
-  # We allow silent variables to be overridden silently.
-  my $def = $self->def ($cond);
+  # We allow silent variables to be overridden silently,
+  # by either silent or non-silent variables.
+  my $def = $self->def ($ambig_cond);
   if ($message && !($def && $def->pretty == VAR_SILENT))
     {
       msg 'syntax', $where, "$message ...", partial => 1;
diff --git a/tests/Makefile.am b/tests/Makefile.am
index bc8dbb2..15325e4 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -185,6 +185,8 @@ cond40.test \
 cond41.test \
 cond42.test \
 cond43.test \
+cond44.test \
+cond45.test \
 condd.test \
 condhook.test \
 condinc.test \
diff --git a/tests/cond44.test b/tests/cond44.test
new file mode 100755
index 0000000..ac907f1
--- /dev/null
+++ b/tests/cond44.test
@@ -0,0 +1,40 @@
+#!/bin/sh
+# Copyright (C) 2002, 2003, 2009 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# Check that redefinitions of AC_SUBST'ed AM_SUBST_NOTMAKE'd variables
+# are not diagnosed.  See cond23.test.
+
+. ./defs
+
+set -e
+
+cat >>configure.in <<EOF
+AM_CONDITIONAL([COND], [true])
+AM_SUBST_NOTMAKE([libdir])
+AC_OUTPUT
+EOF
+
+cat >Makefile.am <<EOF
+if COND
+libdir = mumble
+endif
+EOF
+
+$ACLOCAL
+AUTOMAKE_run 0
+grep 'libdir was already defined' stderr && Exit 1
+grep '^libdir = ' Makefile.in && Exit 1
+Exit 0
diff --git a/tests/cond45.test b/tests/cond45.test
new file mode 100755
index 0000000..57dd339
--- /dev/null
+++ b/tests/cond45.test
@@ -0,0 +1,41 @@
+#!/bin/sh
+# Copyright (C) 2002, 2003, 2009 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# Check that redefinitions of AC_SUBST'ed AM_SUBST_NOTMAKE'd variables
+# are not diagnosed.  See cond24.test.
+
+. ./defs
+
+set -e
+
+cat >>configure.in <<EOF
+AC_SUBST([foo], [bar])
+AM_SUBST_NOTMAKE([foo])
+AM_CONDITIONAL([COND], [true])
+AC_OUTPUT
+EOF
+
+cat >Makefile.am <<EOF
+if COND
+foo = baz
+endif
+EOF
+
+$ACLOCAL
+AUTOMAKE_run 0
+grep 'foo was already defined' stderr && Exit 1
+grep '^foo =' Makefile.in && Exit 1
+Exit 0

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2009-10-11 11:36 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-08-24 17:51 bfdlibdir and bfdincludedir change Rainer Emrich
2009-08-25  1:50 ` Alan Modra
2009-08-25 12:23   ` Rainer Emrich
2009-08-26  7:25     ` Alan Modra
2009-08-26 19:58       ` Ralf Wildenhues
2009-08-27  6:42         ` Alan Modra
2009-10-11 11:36         ` Allow variable override of, rather than by, silent variables. (was: bfdlibdir and bfdincludedir change) Ralf Wildenhues

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).