Discussion:
AX_CREATE_PKGCONFIG_INFO and hardcoded paths
LRN
2013-03-27 12:41:30 UTC
Permalink
I've been cross-compiling cloog, and noticed that cloog creates a .pc
file by simply doing:
PACKAGE_NAME="cloog-isl"
PACKAGE_CFLAGS="-DCLOOG_INT_GMP=1"
AX_CREATE_PKGCONFIG_INFO

which results in:

# generated by configure / remove this line to disable regeneration
prefix=/root
exec_prefix=${prefix}
bindir=${exec_prefix}/bin
libdir=${exec_prefix}/lib
datarootdir=/root/share
datadir=${datarootdir}
sysconfdir=/etc
includedir=${prefix}/include
package=cloog-isl
suffix=

Name: cloog-isl
Description: cloog-isl Library
Version: 0.18.0
Requires:
Libs: -L${libdir} -L/root/lib -lcloog-isl -lgmp
Cflags: -I${includedir} -I/root/include -DCLOOG_INT_GMP=1

Note that -l${libdir} and -I${includedir} depend on ${prefix} value, and
pkg-config knows how to re-define ${prefix} at runtime (can be
disabled, optionally).
However, -L/root/lib and -I/root/include are hardcoded, and thus are
completely wrong (and potentially dangerous, if the system where cloog
is deployed has /root/include and/or /root/lib directories.

Is this an AX_CREATE_PKGCONFIG_INFO feature, or cloog does something
wrong?
Eric Blake
2013-03-27 16:12:41 UTC
Permalink
Post by LRN
I've been cross-compiling cloog, and noticed that cloog creates a .pc
PACKAGE_NAME="cloog-isl"
PACKAGE_CFLAGS="-DCLOOG_INT_GMP=1"
AX_CREATE_PKGCONFIG_INFO
Is this an AX_CREATE_PKGCONFIG_INFO feature, or cloog does something
wrong?
AX_CREATE_PKGCONFIG_INFO is not maintained by autoconf; perhaps you'll
get better answers to your questions by asking on the Autoconf Archive
mailing list: autoconf-archive-***@gnu.org
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
LRN
2013-03-27 17:09:51 UTC
Permalink
Post by Eric Blake
Post by LRN
I've been cross-compiling cloog, and noticed that cloog creates a
.pc file by simply doing: PACKAGE_NAME="cloog-isl"
PACKAGE_CFLAGS="-DCLOOG_INT_GMP=1" AX_CREATE_PKGCONFIG_INFO
Is this an AX_CREATE_PKGCONFIG_INFO feature, or cloog does
something wrong?
AX_CREATE_PKGCONFIG_INFO is not maintained by autoconf; perhaps
you'll get better answers to your questions by asking on the
I've decided to send the message to autoconf list because i found [1],
where people discussed this very macro.

[1] http://lists.gnu.org/archive/html/autoconf/2012-09/msg00048.html
Russ Allbery
2013-03-27 16:35:01 UTC
Permalink
Post by LRN
However, -L/root/lib and -I/root/include are hardcoded, and thus are
completely wrong (and potentially dangerous, if the system where cloog
is deployed has /root/include and/or /root/lib directories.
Is this an AX_CREATE_PKGCONFIG_INFO feature, or cloog does something
wrong?
The various versions of AX_CREATE_PKGCONFIG_INFO that I've seen all do
things that I consider rather dodgy, such as putting the entire contents
of CFLAGS into the pkgconfig file (including any user-supplied CFLAGS at
configure time and including optimization flags). I suspect this is
similar. I'm not sure if there's a newer version of the macro available
that's less aggressive about copying the *entire* build configuration into
the pkgconfig file, but in the meantime I've preferred to construct my
pkgconfig files using sed from Makefile.am so that I have more control
over exactly what goes into them.
--
Russ Allbery (***@stanford.edu) <http://www.eyrie.org/~eagle/>
Loading...