After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 342326 - .pc contains unprocessed templates
.pc contains unprocessed templates
Status: RESOLVED NOTABUG
Product: bonobo
Classification: Deprecated
Component: libbonobo
2.14.x
Other Mac OS
: Normal normal
: ---
Assigned To: Stepan Kasal
bonobo qa
Depends on:
Blocks:
 
 
Reported: 2006-05-19 07:43 UTC by Daniel Macks
Modified: 2006-05-20 12:52 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Daniel Macks 2006-05-19 07:43:04 UTC
bonobo-2.14.0 gave me some pkg-config files that are incompletely constructed vs their templates. Both bonobo-activation-2.0.pc and libbonobo-2.0.pc contain an entry:

datarootdir=@datarootdir@

instead of having @datarootdir@ replaced by the correct configuration value for the local build. The other @*@ values from the respective .pc.in are substituted correctly in the .pc files.

This all appears to have begun with:

2005-08-16  Stepan Kasal  <kasal@ucw.cz>

	* bonobo/libbonobo-2.0.pc.in, bonobo/libbonobo-2.0-uninstalled.pc.in:
	* bonobo-activation/bonobo-activation-2.0-uninstalled.pc.in:
	* bonobo-activation/bonobo-activation-2.0.pc.in: Add datarootdir
	variable, for compatibility with future Autoconf releases.

That means autoconf2.60, right? Better require its use (and use it when constructing the tardist) if you're going to use features of it that aren't present in lower versions.
Comment 1 Stepan Kasal 2006-05-19 09:02:22 UTC
Autoconf 2.60 is not released yet, though we are very close. Thus we cannot require it.

Let me explain the original problem:
With Autoconf 2.60 generated configure, @datadir@ will be replaced by ${datarootdir}
This means that the `datarootdir' variable will have to be in *.pc.in templates, for the same reason for which current *.pc.in contains `prefix', `exec_prefix', etc.

In Autoconf 2.59, `datarootdir' does not exist, so the string @datarootdir@ remains intact.

Even though it would be easy to make provisions for removing the line, or for setting detarootdir to ``this variable is not used by this version'', I don't think it is worth it, unless a real problem appears.

My current understanding is that this is only a cosmetic issue, which will fade out soon, as Autoconf 2.60 will take the world.  ;-)
Comment 2 Daniel Macks 2006-05-19 15:05:52 UTC
I understand what's going on, but not why it's implemented in bonobo *now*. That is, when 2.60 is used, will *.pc really "have to" have a datarootdir variable?

I don't mind having it left as @datarootdir@ if it doesn't break anything presently. It was something flagged while validating my *.pc collection...had over a dozen unsubstituted @*@ strings, this (same as in Bug #342327) is the only case where it wasn't due to a clear typo in .pc.in or brokenness in configure.in.
Comment 3 Stepan Kasal 2006-05-20 12:52:28 UTC
(In reply to comment #2)
> I understand what's going on, but not why it's implemented in bonobo *now*.
> That is, when 2.60 is used, will *.pc really "have to" have a datarootdir
> variable?

Well, the answer has evolved in time, so I'll give you two answers instead of one:

As of 2005-08-16, when I committed the patch:
If the (then) current CVS version of Autoconf was used, the resulting *.pc contained line
  idldir=${datarootdir}/idl/bonobo-2.0
(supposing that the --datadir option was not used).
Had the *.pc line lacked the datarootdir variable, this above line would imply creating the /idl directory under the root.[*]

So back then, the answer was clearly: "yes, the *.pc absolutely have to contain the datarootdir variable."  And I was not aware of any plans to change the situation in further development.

The situation, as of now, is different:
If the template file contains the string "@datadir@", but not the string "datarootdir", configure issues a warning and changes the value of datadir do that it doesn't contain the reference to datarootdir.

This hack means that the datarootdir is not so strictly required, yet I think that the cosmetic problem of a "WARNING" from Autoconf-2.60-generated configure is bigger than the cosmetic problem of having "@datarootdir@" in the *.pc file. Consequently, I think that this change should be done rather sooner than later. And I beleive that Autoconf 2.60 will be out before summer 2006.

> I don't mind having it left as @datarootdir@ if it doesn't break anything
> presently.

I do not think it causes any problems.  I have made this change to several Gnome projects back then, and this is the first complaint I have encountered.

> It was something flagged while validating my *.pc collection...had
> over a dozen unsubstituted @*@ strings, this (same as in Bug #342327) is the
> only case where it wasn't due to a clear typo in .pc.in or brokenness in
> configure.in.

This is a very useful work, thank you very much for that. I apologize for the complications caused by my changes.

I have two ideas for your validator, probably obvious:

1) if the *.pc file contains ${foo}, but does not define the variable `foo', this is a bug. (Does pkg-config complain in such a situation?  I think it should.)

2) if the definition of `foo' comes after the ${foo} occurence, how does pkg-config cope with it?  (Or other programs which parse *.pc.)