130f8ce46Smrg# =========================================================================== 230f8ce46Smrg# http://www.gnu.org/software/autoconf-archive/ax_define_dir.html 330f8ce46Smrg# =========================================================================== 430f8ce46Smrg# 530f8ce46Smrg# SYNOPSIS 630f8ce46Smrg# 730f8ce46Smrg# AX_DEFINE_DIR(VARNAME, DIR [, DESCRIPTION]) 830f8ce46Smrg# 930f8ce46Smrg# DESCRIPTION 1030f8ce46Smrg# 1130f8ce46Smrg# This macro sets VARNAME to the expansion of the DIR variable, taking 1230f8ce46Smrg# care of fixing up ${prefix} and such. 1330f8ce46Smrg# 1430f8ce46Smrg# VARNAME is then offered as both an output variable and a C preprocessor 1530f8ce46Smrg# symbol. 1630f8ce46Smrg# 1730f8ce46Smrg# Example: 1830f8ce46Smrg# 1930f8ce46Smrg# AX_DEFINE_DIR([DATADIR], [datadir], [Where data are placed to.]) 2030f8ce46Smrg# 2130f8ce46Smrg# LICENSE 2230f8ce46Smrg# 2330f8ce46Smrg# Copyright (c) 2008 Stepan Kasal <kasal@ucw.cz> 2430f8ce46Smrg# Copyright (c) 2008 Andreas Schwab <schwab@suse.de> 2530f8ce46Smrg# Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de> 2630f8ce46Smrg# Copyright (c) 2008 Alexandre Oliva 2730f8ce46Smrg# 2830f8ce46Smrg# Copying and distribution of this file, with or without modification, are 2930f8ce46Smrg# permitted in any medium without royalty provided the copyright notice 3030f8ce46Smrg# and this notice are preserved. This file is offered as-is, without any 3130f8ce46Smrg# warranty. 3230f8ce46Smrg 3330f8ce46Smrg#serial 6 3430f8ce46Smrg 3530f8ce46SmrgAU_ALIAS([AC_DEFINE_DIR], [AX_DEFINE_DIR]) 3630f8ce46SmrgAC_DEFUN([AX_DEFINE_DIR], [ 3730f8ce46Smrg prefix_NONE= 3830f8ce46Smrg exec_prefix_NONE= 3930f8ce46Smrg test "x$prefix" = xNONE && prefix_NONE=yes && prefix=$ac_default_prefix 4030f8ce46Smrg test "x$exec_prefix" = xNONE && exec_prefix_NONE=yes && exec_prefix=$prefix 4130f8ce46Smrgdnl In Autoconf 2.60, ${datadir} refers to ${datarootdir}, which in turn 4230f8ce46Smrgdnl refers to ${prefix}. Thus we have to use `eval' twice. 4330f8ce46Smrg eval ax_define_dir="\"[$]$2\"" 4430f8ce46Smrg eval ax_define_dir="\"$ax_define_dir\"" 4530f8ce46Smrg AC_SUBST($1, "$ax_define_dir") 4630f8ce46Smrg AC_DEFINE_UNQUOTED($1, "$ax_define_dir", [$3]) 4730f8ce46Smrg test "$prefix_NONE" && prefix=NONE 4830f8ce46Smrg test "$exec_prefix_NONE" && exec_prefix=NONE 4930f8ce46Smrg]) 50