Bug 10326 - Quoting bug in configure.in
Summary: Quoting bug in configure.in
Status: RESOLVED FIXED
Alias: None
Product: pkg-config
Classification: Unclassified
Component: src (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: Tollef Fog Heen
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-03-17 09:29 UTC by Andreas Hanke
Modified: 2007-06-19 05:35 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
Use single quotes and remove incorrect code from a comment. (476 bytes, patch)
2007-03-17 09:31 UTC, Andreas Hanke
Details | Splinter Review

Description Andreas Hanke 2007-03-17 09:29:00 UTC
configure.in contains code to calculate PKG_CONFIG_PC_PATH (the default search path for .pc files) which is later on passed to the Makefile where it becomes a -D flag.

The code in question is:

[pc_path="$libdir/pkgconfig:$datadir/pkgconfig"]

As you can see, it has double quotes around it. This is wrong because it will cause $libdir and $datadir to be partially expanded within the configure script itself. This in turn will prevent users from redefining libdir and datadir while running "make", like this:

make libdir=/some/other/libdir datadir=/some/other/datadir

It also causes problems if configure was generated with autoconf >= 2.60 without regenerating Makefile.am at the same time because a one-level expansion of ${datadir} becomes ${datarootdir} which isn't defined in old automake versions.

The attached patch changes the code in question like this:

[pc_path='${libdir}/pkgconfig:${datadir}/pkgconfig']

This way, the variables won't be expanded at all within configure; the expansion is purely in the Makefile, as mandated by GNU coding standards:

http://www.gnu.org/software/autoconf/manual/html_node/Defining-Directories.html#Defining-Directories

There result is no change in behaviour for the default case. All it does is fixing the redefinition of variables while running "make" and better compatibility with mixed autotools versions.

Without the patch, the generated Makefile contains:

pc_path = ${exec_prefix}/lib/pkgconfig:${datarootdir}/pkgconfig

With the patch, it will contain what I expect:

pc_path = ${libdir}/pkgconfig:${datadir}/pkgconfig

I also allowed myself to remove a commented line in the same place. This is not necessary because it's just a comment, but the comment suggests something which never works (it will fail in a similar, but even more harmful way).
Comment 1 Andreas Hanke 2007-03-17 09:31:32 UTC
Created attachment 9205 [details] [review]
Use single quotes and remove incorrect code from a comment.
Comment 2 Tollef Fog Heen 2007-06-19 05:35:15 UTC
2007-06-18  Tollef Fog Heen  <tfheen@err.no>

        * configure.in: Fix expansion of default pc_path as per GNU coding
        standards.  Thanks to Andreas Hanke for the fix.
        Freedesktop #10326


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.