16e7d3316Smrg# =========================================================================== 26e7d3316Smrg# http://www.gnu.org/software/autoconf-archive/ax_define_dir.html 36e7d3316Smrg# =========================================================================== 46e7d3316Smrg# 56e7d3316Smrg# SYNOPSIS 66e7d3316Smrg# 76e7d3316Smrg# AX_DEFINE_DIR(VARNAME, DIR [, DESCRIPTION]) 86e7d3316Smrg# 96e7d3316Smrg# DESCRIPTION 106e7d3316Smrg# 116e7d3316Smrg# This macro sets VARNAME to the expansion of the DIR variable, taking 126e7d3316Smrg# care of fixing up ${prefix} and such. 136e7d3316Smrg# 146e7d3316Smrg# VARNAME is then offered as both an output variable and a C preprocessor 156e7d3316Smrg# symbol. 166e7d3316Smrg# 176e7d3316Smrg# Example: 186e7d3316Smrg# 196e7d3316Smrg# AX_DEFINE_DIR([DATADIR], [datadir], [Where data are placed to.]) 206e7d3316Smrg# 216e7d3316Smrg# LICENSE 226e7d3316Smrg# 236e7d3316Smrg# Copyright (c) 2008 Stepan Kasal <kasal@ucw.cz> 246e7d3316Smrg# Copyright (c) 2008 Andreas Schwab <schwab@suse.de> 256e7d3316Smrg# Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de> 266e7d3316Smrg# Copyright (c) 2008 Alexandre Oliva 276e7d3316Smrg# 286e7d3316Smrg# Copying and distribution of this file, with or without modification, are 296e7d3316Smrg# permitted in any medium without royalty provided the copyright notice 306e7d3316Smrg# and this notice are preserved. This file is offered as-is, without any 316e7d3316Smrg# warranty. 326e7d3316Smrg 336e7d3316Smrg#serial 6 346e7d3316Smrg 356e7d3316SmrgAU_ALIAS([AC_DEFINE_DIR], [AX_DEFINE_DIR]) 366e7d3316SmrgAC_DEFUN([AX_DEFINE_DIR], [ 376e7d3316Smrg prefix_NONE= 386e7d3316Smrg exec_prefix_NONE= 396e7d3316Smrg test "x$prefix" = xNONE && prefix_NONE=yes && prefix=$ac_default_prefix 406e7d3316Smrg test "x$exec_prefix" = xNONE && exec_prefix_NONE=yes && exec_prefix=$prefix 416e7d3316Smrgdnl In Autoconf 2.60, ${datadir} refers to ${datarootdir}, which in turn 426e7d3316Smrgdnl refers to ${prefix}. Thus we have to use `eval' twice. 436e7d3316Smrg eval ax_define_dir="\"[$]$2\"" 446e7d3316Smrg eval ax_define_dir="\"$ax_define_dir\"" 456e7d3316Smrg AC_SUBST($1, "$ax_define_dir") 466e7d3316Smrg AC_DEFINE_UNQUOTED($1, "$ax_define_dir", [$3]) 476e7d3316Smrg test "$prefix_NONE" && prefix=NONE 486e7d3316Smrg test "$exec_prefix_NONE" && exec_prefix=NONE 496e7d3316Smrg]) 50