[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The following variables specify the directories where the package will be installed, see section `Variables for Installation Directories' in The GNU Coding Standards, for more information. See the end of this section for details on when and how to use these variables.
Most of these variables have values that rely on prefix
or
exec_prefix
. It is deliberate that the directory output
variables keep them unexpanded: typically `@datadir@' will be
replaced by `${prefix}/share', not `/usr/local/share'.
This behavior is mandated by the GNU coding standards, so that when the user runs:
configure
, in which case, if needed, the package shall hard
code dependencies corresponding to the make-specified prefix.
In order to support these features, it is essential that datadir
remains being defined as `${prefix}/share' to depend upon the
current value of prefix
.
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
.
Similarly you should not rely on AC_OUTPUT_FILES
to replace
datadir
and friends in your shell scripts and other files, rather
let make
manage their replacement. For instance Autoconf
ships templates of its shell scripts ending with `.in', and uses a
Makefile snippet similar to:
edit = sed \ -e 's,@datadir\@,$(pkgdatadir),g' \ -e 's,@prefix\@,$(prefix),g' autoconf: Makefile $(srcdir)/autoconf.in rm -f autoconf autoconf.tmp $(edit) $(srcdir)/autoconf.in >autoconf.tmp chmod +x autoconf.tmp mv autoconf.tmp autoconf autoheader: Makefile $(srcdir)/autoheader.in rm -f autoheader autoheader.tmp $(edit) $(srcdir)/autoconf.in >autoheader.tmp chmod +x autoheader.tmp mv autoheader.tmp autoheader |
Some details are noteworthy:
configure
from replacing
`@datadir@' in the sed expression itself.
edit
uses values that depend on the configuration specific
values (prefix
etc.) and not only on VERSION
and so forth,
the output depends on `Makefile', not `configure.ac'.
autoconf autoheader: Makefile .in: rm -f $@ [email protected] $(edit) $< >[email protected] chmod +x [email protected] mv [email protected] $@ |
See section 10.10 Limitations of Make, for details.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |