188de56ccSmrg# ===========================================================================
288de56ccSmrg#       http://www.gnu.org/software/autoconf-archive/ax_define_dir.html
388de56ccSmrg# ===========================================================================
488de56ccSmrg#
588de56ccSmrg# SYNOPSIS
688de56ccSmrg#
788de56ccSmrg#   AX_DEFINE_DIR(VARNAME, DIR [, DESCRIPTION])
888de56ccSmrg#
988de56ccSmrg# DESCRIPTION
1088de56ccSmrg#
1188de56ccSmrg#   This macro sets VARNAME to the expansion of the DIR variable, taking
1288de56ccSmrg#   care of fixing up ${prefix} and such.
1388de56ccSmrg#
1488de56ccSmrg#   VARNAME is then offered as both an output variable and a C preprocessor
1588de56ccSmrg#   symbol.
1688de56ccSmrg#
1788de56ccSmrg#   Example:
1888de56ccSmrg#
1988de56ccSmrg#     AX_DEFINE_DIR([DATADIR], [datadir], [Where data are placed to.])
2088de56ccSmrg#
2188de56ccSmrg# LICENSE
2288de56ccSmrg#
2388de56ccSmrg#   Copyright (c) 2008 Stepan Kasal <kasal@ucw.cz>
2488de56ccSmrg#   Copyright (c) 2008 Andreas Schwab <schwab@suse.de>
2588de56ccSmrg#   Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de>
2688de56ccSmrg#   Copyright (c) 2008 Alexandre Oliva
2788de56ccSmrg#
2888de56ccSmrg#   Copying and distribution of this file, with or without modification, are
2988de56ccSmrg#   permitted in any medium without royalty provided the copyright notice
3088de56ccSmrg#   and this notice are preserved. This file is offered as-is, without any
3188de56ccSmrg#   warranty.
3288de56ccSmrg
3388de56ccSmrg#serial 6
3488de56ccSmrg
3588de56ccSmrgAU_ALIAS([AC_DEFINE_DIR], [AX_DEFINE_DIR])
3688de56ccSmrgAC_DEFUN([AX_DEFINE_DIR], [
3788de56ccSmrg  prefix_NONE=
3888de56ccSmrg  exec_prefix_NONE=
3988de56ccSmrg  test "x$prefix" = xNONE && prefix_NONE=yes && prefix=$ac_default_prefix
4088de56ccSmrg  test "x$exec_prefix" = xNONE && exec_prefix_NONE=yes && exec_prefix=$prefix
4188de56ccSmrgdnl In Autoconf 2.60, ${datadir} refers to ${datarootdir}, which in turn
4288de56ccSmrgdnl refers to ${prefix}.  Thus we have to use `eval' twice.
4388de56ccSmrg  eval ax_define_dir="\"[$]$2\""
4488de56ccSmrg  eval ax_define_dir="\"$ax_define_dir\""
4588de56ccSmrg  AC_SUBST($1, "$ax_define_dir")
4688de56ccSmrg  AC_DEFINE_UNQUOTED($1, "$ax_define_dir", [$3])
4788de56ccSmrg  test "$prefix_NONE" && prefix=NONE
4888de56ccSmrg  test "$exec_prefix_NONE" && exec_prefix=NONE
4988de56ccSmrg])
50