automake
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

${prefix} expansion broken?


From: Pat Suwalski
Subject: ${prefix} expansion broken?
Date: Wed, 30 Aug 2006 00:51:28 -0400
User-agent: Thunderbird 1.5.0.5 (X11/20060812)

Hello,

My configure.in has the following snippet:

-------------------------------------------------------
PKGDATADIR=`eval echo "${datadir}/$PACKAGE"`

AC_SUBST(PKGDATADIR)

AC_DEFINE_UNQUOTED(CONFIG_DATA_DIR, "$PKGDATADIR",
                   [The directory where our data will be installed])
-------------------------------------------------------

With automake-1.7 it properly expanded. With automake-1.9, my config.h
has the following in it:

#define CONFIG_DATA_DIR "${prefix}/share/celestia"

I know the autoconf manual says:

"A corollary is that you should not use these variables except in
Makefiles. For instance, instead of trying to evaluate datadir in
`configure' and hard-coding it in Makefiles using e.g.,
`AC_DEFINE_UNQUOTED(DATADIR, "$datadir")', you should add
`-DDATADIR="$(datadir)"' to your CPPFLAGS."

But is that really the best solution?

Also, is the following still in any way relevant?:

if (test "$prefix" = "NONE"); then
        prefix=$ac_default_prefix
fi

It seems the $prefix is generally set to a sane default value.

Thanks!
--Pat




reply via email to

[Prev in Thread] Current Thread [Next in Thread]