1629baa8cSmrg# =========================================================================== 2629baa8cSmrg# http://www.gnu.org/software/autoconf-archive/ax_define_dir.html 3629baa8cSmrg# =========================================================================== 4629baa8cSmrg# 5629baa8cSmrg# SYNOPSIS 6629baa8cSmrg# 7629baa8cSmrg# AX_DEFINE_DIR(VARNAME, DIR [, DESCRIPTION]) 8629baa8cSmrg# 9629baa8cSmrg# DESCRIPTION 10629baa8cSmrg# 11629baa8cSmrg# This macro sets VARNAME to the expansion of the DIR variable, taking 12629baa8cSmrg# care of fixing up ${prefix} and such. 13629baa8cSmrg# 14629baa8cSmrg# VARNAME is then offered as both an output variable and a C preprocessor 15629baa8cSmrg# symbol. 16629baa8cSmrg# 17629baa8cSmrg# Example: 18629baa8cSmrg# 19629baa8cSmrg# AX_DEFINE_DIR([DATADIR], [datadir], [Where data are placed to.]) 20629baa8cSmrg# 21629baa8cSmrg# LICENSE 22629baa8cSmrg# 23629baa8cSmrg# Copyright (c) 2008 Stepan Kasal <kasal@ucw.cz> 24629baa8cSmrg# Copyright (c) 2008 Andreas Schwab <schwab@suse.de> 25629baa8cSmrg# Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de> 26629baa8cSmrg# Copyright (c) 2008 Alexandre Oliva 27629baa8cSmrg# 28629baa8cSmrg# Copying and distribution of this file, with or without modification, are 29629baa8cSmrg# permitted in any medium without royalty provided the copyright notice 30629baa8cSmrg# and this notice are preserved. This file is offered as-is, without any 31629baa8cSmrg# warranty. 32629baa8cSmrg 33629baa8cSmrg#serial 6 34629baa8cSmrg 35629baa8cSmrgAU_ALIAS([AC_DEFINE_DIR], [AX_DEFINE_DIR]) 36629baa8cSmrgAC_DEFUN([AX_DEFINE_DIR], [ 37629baa8cSmrg prefix_NONE= 38629baa8cSmrg exec_prefix_NONE= 39629baa8cSmrg test "x$prefix" = xNONE && prefix_NONE=yes && prefix=$ac_default_prefix 40629baa8cSmrg test "x$exec_prefix" = xNONE && exec_prefix_NONE=yes && exec_prefix=$prefix 41629baa8cSmrgdnl In Autoconf 2.60, ${datadir} refers to ${datarootdir}, which in turn 42629baa8cSmrgdnl refers to ${prefix}. Thus we have to use `eval' twice. 43629baa8cSmrg eval ax_define_dir="\"[$]$2\"" 44629baa8cSmrg eval ax_define_dir="\"$ax_define_dir\"" 45629baa8cSmrg AC_SUBST($1, "$ax_define_dir") 46629baa8cSmrg AC_DEFINE_UNQUOTED($1, "$ax_define_dir", [$3]) 47629baa8cSmrg test "$prefix_NONE" && prefix=NONE 48629baa8cSmrg test "$exec_prefix_NONE" && exec_prefix=NONE 49629baa8cSmrg]) 50