A gotcha.
On 2005 Feb 9 , at 08.58, Norman Gray wrote:
> On 2005 Feb 9 , at 02.12, Tim Jenness wrote:
>
>> Wow. This is bad! rv can't find sla despite sla being a dependency.
>> ems
>> fails because of sae missing. I think SAE has broken.
>
> No, it was me who broke starconf. I changed starconf to set AM_CFLAGS
> (and co.) rather than CFLAGS (strictly verboten; reserved for the
> user), but it seems that the symmetry between the two is not as
> complete as the automake documentation and inspection of the
> Makefile.in seemed to suggest, so -I/stardev/include was getting missed
> out from various compile lines.
Fixed, I think, though it's rather hard to be sure until I see the full
automatic build working.
As I mentioned, the change above was to use the variables AM_*, which
are sort-of private to automake and, I suppose, autoconf, in the sense
that the eventual user/builder shouldn't have to know about them, and
is free to specify CFLAGS, LDFLAGS and so on, with gay abadon.
When you're writing a configure.ac or Makefile.am you shouldn't have to
know much about them either, EXCEPT THAT, rather unexpectedly, when you
specify a per-target variable like libxxx_la_LDFLAGS this _replaces_
AM_LDFLAGS in the link line for that target. This makes sense, in
retrospect, since if it didn't do this then there would be no way of
removing any troublesome options in AM_*FLAGS, but it does mean that if
you don't want to remove the AM_*FLAGS in a per-target variable, you
should specify it as
libxxx_la_CFLAGS = $(AM_CFLAGS) -my-magic-flags...
(and no, += doesn't help). Thus it was actually all of the
libxxx_la_CFLAGS=-prefer-pic lines which precipitated this chaos. What
I've done is change starconf so that it adds its -I option to
AM_CPPFLAGS, and ensured that this variable is respected in the FC
compile lines, as well as the C ones. That means that I haven't felt
it necessary to work through all the -prefer-pic lines adding
$(AM_CFLAGS) to them (though be assured that I feel wicked about it).
AM_CPPFLAGS isn't often overridden (I don't think it's overridden
anywhere in our sources).
By the way, even though AM_* are `private' to automake, you can't say
AM_CFLAGS=-my-magic-flags within a Makefile.am unless you know that you
are thereby stomping on whatever value that variable was given by
configure.
I await the nightly build on tenterhooks....
See you,
Norman
--
----------------------------------------------------------------------
Norman Gray : Physics & Astronomy, Glasgow University, UK
http://www.astro.gla.ac.uk/users/norman/ : www.starlink.ac.uk
|