1249c3046Smrg# =========================================================================== 2249c3046Smrg# http://www.gnu.org/software/autoconf-archive/ax_define_dir.html 3249c3046Smrg# =========================================================================== 4249c3046Smrg# 5249c3046Smrg# SYNOPSIS 6249c3046Smrg# 7249c3046Smrg# AX_DEFINE_DIR(VARNAME, DIR [, DESCRIPTION]) 8249c3046Smrg# 9249c3046Smrg# DESCRIPTION 10249c3046Smrg# 11249c3046Smrg# This macro sets VARNAME to the expansion of the DIR variable, taking 12249c3046Smrg# care of fixing up ${prefix} and such. 13249c3046Smrg# 14249c3046Smrg# VARNAME is then offered as both an output variable and a C preprocessor 15249c3046Smrg# symbol. 16249c3046Smrg# 17249c3046Smrg# Example: 18249c3046Smrg# 19249c3046Smrg# AX_DEFINE_DIR([DATADIR], [datadir], [Where data are placed to.]) 20249c3046Smrg# 21249c3046Smrg# LICENSE 22249c3046Smrg# 23249c3046Smrg# Copyright (c) 2008 Stepan Kasal <kasal@ucw.cz> 24249c3046Smrg# Copyright (c) 2008 Andreas Schwab <schwab@suse.de> 25249c3046Smrg# Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de> 26249c3046Smrg# Copyright (c) 2008 Alexandre Oliva 27249c3046Smrg# 28249c3046Smrg# Copying and distribution of this file, with or without modification, are 29249c3046Smrg# permitted in any medium without royalty provided the copyright notice 30249c3046Smrg# and this notice are preserved. This file is offered as-is, without any 31249c3046Smrg# warranty. 32249c3046Smrg 33249c3046Smrg#serial 6 34249c3046Smrg 35249c3046SmrgAU_ALIAS([AC_DEFINE_DIR], [AX_DEFINE_DIR]) 36249c3046SmrgAC_DEFUN([AX_DEFINE_DIR], [ 37249c3046Smrg prefix_NONE= 38249c3046Smrg exec_prefix_NONE= 39249c3046Smrg test "x$prefix" = xNONE && prefix_NONE=yes && prefix=$ac_default_prefix 40249c3046Smrg test "x$exec_prefix" = xNONE && exec_prefix_NONE=yes && exec_prefix=$prefix 41249c3046Smrgdnl In Autoconf 2.60, ${datadir} refers to ${datarootdir}, which in turn 42249c3046Smrgdnl refers to ${prefix}. Thus we have to use `eval' twice. 43249c3046Smrg eval ax_define_dir="\"[$]$2\"" 44249c3046Smrg eval ax_define_dir="\"$ax_define_dir\"" 45249c3046Smrg AC_SUBST($1, "$ax_define_dir") 46249c3046Smrg AC_DEFINE_UNQUOTED($1, "$ax_define_dir", [$3]) 47249c3046Smrg test "$prefix_NONE" && prefix=NONE 48249c3046Smrg test "$exec_prefix_NONE" && exec_prefix=NONE 49249c3046Smrg]) 50