[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
#define
Installation Directories?
My program needs library files, installed in
I get
|
As already explained, this behavior is on purpose, mandated by the GNU Coding Standards, see 4.7.2 Installation Directory Variables. There are several means to achieve a similar goal:
AC_DEFINE
but use your `Makefile' to pass the
actual value of datadir
via compilation flags, see
4.7.2 Installation Directory Variables, for the details.
CPPFLAGS
:
CPPFLAGS = -DDATADIR=\"$(datadir)\" @CPPFLAGS@ |
or create a dedicated header file:
DISTCLEANFILES = datadir.h datadir.h: Makefile echo '#define DATADIR "$(datadir)"' >$@ |
AC_DEFINE
but have configure
compute the literal
value of datadir
and others. Many people have wrapped macros to
automate this task. For instance, the macro AC_DEFINE_DIR
from
the Autoconf Macro Archive.
This solution does not conform to the GNU Coding Standards.
prefix
, and try to
find prefix
at runtime, this way your package is relocatable.
Some macros are already available to address this issue: see
adl_COMPUTE_RELATIVE_PATHS
and
adl_COMPUTE_STANDARD_RELATIVE_PATHS
on the
Autoconf Macro Archive.