[Macro Index Page] [Download M4 Source]

ac_define_dir

Synopsis

AC_DEFINE_DIR(VARNAME, DIR [, DESCRIPTION])

Description

This macro _AC_DEFINEs VARNAME to the expansion of the DIR variable, taking care of fixing up ${prefix} and such.

VARNAME is offered as both a C preprocessor symbol, and an output variable.

Note that the 3 argument form is only supported with autoconf 2.13 and later (i.e. only where _AC_DEFINE supports 3 arguments).

Examples:

   AC_DEFINE_DIR(DATADIR, datadir)
   AC_DEFINE_DIR(PROG_PATH, bindir, [Location of installed binaries])

Version

1.4 (last modified: 2003-10-28)

Author

Guido Draheim <guidod@gmx.de>, original by Alexandre Oliva

M4 Source Code

AC_DEFUN([AC_DEFINE_DIR], [
  test "x$prefix" = xNONE && prefix="$ac_default_prefix"
  test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
  ac_define_dir=`eval echo [$]$2`
  ac_define_dir=`eval echo [$]ac_define_dir`
  $1="$ac_define_dir"
  AC_SUBST($1)
  ifelse($3, ,
    AC_DEFINE_UNQUOTED($1, "$ac_define_dir"),
    AC_DEFINE_UNQUOTED($1, "$ac_define_dir", $3))
])

Copyright

GNU General Public License with this special exception.