On 09/19/12 11:03, Russ Allbery wrote:
> ... I believe the method using sed is
> correct, and generating the file at Autoconf time is not as correct...
For my perspective, there really ought to be a simple macro that just
exports all the configured values to whatever external command anyone
wants to use. e.g. always have all Makefile-s define this:
CONFIGURABLES = \
prefix="$(prefix)" \
....
so that you can, for example, use this in any directory:
$(CONFIGURABLES) $(SHELL) some-script
and have the right thing happen. "some-script" can construct
a pc file or do any of many things much more easily than
using the embedded-in-a-makefile scripting syntax.
Constructing CONFIGURABLES yourself isn't rocket science, but
it is a nuisance. The ax_create_pkgconfig_info.m4 file
is very complicated. The "some-script" could be as simple as:
cat > ${package}.pc <<- _EOF_
# pkg-config information for AutoOpts ${version}
#
prefix="${prefix}"
datarootdir="${datarootdir}"
datadir="${datadir}"
package="${package}"
includedir="${includedir}"
exec_prefix="${exec_prefix}"
bindir="${bindir}"
libdir="${libdir}"
version="${version}"
pkgdatadir="${pkgdatadir}"
libs="${libs}"
Name: AutoOpts
Description: A semi-automated generated/library option parser
URL: http://www.gnu.org/software/autogen
Version: ${version}
Libs: ${ldflags}
Cflags: ${cflags}
_EOF_
and all the variables are substituted properly before this "here-doc"
gets evaluated.
_______________________________________________
Autoconf mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/autoconf