Next: Changed Directory Variables, Previous: Preset Output Variables, Up: Makefile Substitutions
The following variables specify the directories for package installation, see Variables for Installation Directories, for more information. See the end of this section for details on when and how to use these variables.
The directory for installing idiosyncratic read-only architecture-independent data.
The root of the directory tree for read-only architecture-independent data files.
The installation prefix for architecture-dependent files. By default it's the same as prefix. You should avoid installing anything directly to exec_prefix. However, the default value for directories containing architecture-dependent files should be relative to exec_prefix.
The directory for installing locale-dependent but architecture-independent data, such as message catalogs. This directory usually has a subdirectory per locale.
The common installation prefix for all files. If exec_prefix is defined to a different value, prefix is used only for architecture-independent files.
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 `@datarootdir@' is
replaced by `${prefix}/share', not `/usr/local/share', and
`@datadir@' is replaced by `${datarootdir}'.
This behavior is mandated by the GNU coding standards, so that when the user runs:
In order to support these features, it is essential that
datarootdir
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"], [Data directory.])',
you should add
-DDATADIR='$(datadir)' to your makefile's definition of
CPPFLAGS
(AM_CPPFLAGS
if you are also using Automake).
Similarly, you should not rely on AC_CONFIG_FILES
to replace
datadir
and friends in your shell scripts and other files; instead,
let make manage their replacement. For instance Autoconf
ships templates of its shell scripts ending with `.in', and uses a
makefile snippet similar to the following to build scripts like
autoheader and autom4te:
edit = sed \ -e 's|@datadir[@]|$(pkgdatadir)|g' \ -e 's|@prefix[@]|$(prefix)|g' autoheader autom4te: Makefile rm -f $@ $@.tmp $(edit) '$(srcdir)/$@.in' >$@.tmp chmod +x $@.tmp chmod a-w $@.tmp mv $@.tmp $@ autoheader: $(srcdir)/autoheader.in autom4te: $(srcdir)/autom4te.in
Some details are noteworthy:
VPATH
should
not contain shell metacharacters or white
space. See Special Chars in Variables.
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 $@ $@.tmp $(edit) $< >$@.tmp chmod +x $@.tmp mv $@.tmp $@
See Single Suffix Rules, for details.
For the more specific installation of Erlang libraries, the following variables are defined:
The common parent directory of Erlang library installation directories. This variable is set by calling the
AC_ERLANG_SUBST_INSTALL_LIB_DIR
macro in configure.ac.
The installation directory for Erlang library library. This variable is set by calling the `AC_ERLANG_SUBST_INSTALL_LIB_SUBDIR(library, version' macro in configure.ac.
See Erlang Libraries, for details.