1##### http://autoconf-archive.cryp.to/ac_define_dir.html 2# 3# SYNOPSIS 4# 5# AC_DEFINE_DIR(VARNAME, DIR [, DESCRIPTION]) 6# 7# DESCRIPTION 8# 9# This macro sets VARNAME to the expansion of the DIR variable, 10# taking care of fixing up ${prefix} and such. 11# 12# VARNAME is then offered as both an output variable and a C 13# preprocessor symbol. 14# 15# Example: 16# 17# AC_DEFINE_DIR([DATADIR], [datadir], [Where data are placed to.]) 18# 19# LAST MODIFICATION 20# 21# 2006-10-13 22# 23# COPYLEFT 24# 25# Copyright (c) 2006 Stepan Kasal <kasal@ucw.cz> 26# Copyright (c) 2006 Andreas Schwab <schwab@suse.de> 27# Copyright (c) 2006 Guido U. Draheim <guidod@gmx.de> 28# Copyright (c) 2006 Alexandre Oliva 29# 30# Copying and distribution of this file, with or without 31# modification, are permitted in any medium without royalty provided 32# the copyright notice and this notice are preserved. 33 34AC_DEFUN([AC_DEFINE_DIR], [ 35 prefix_NONE= 36 exec_prefix_NONE= 37 test "x$prefix" = xNONE && prefix_NONE=yes && prefix=$ac_default_prefix 38 test "x$exec_prefix" = xNONE && exec_prefix_NONE=yes && exec_prefix=$prefix 39dnl In Autoconf 2.60, ${datadir} refers to ${datarootdir}, which in turn 40dnl refers to ${prefix}. Thus we have to use `eval' twice. 41 eval ac_define_dir="\"[$]$2\"" 42 eval ac_define_dir="\"$ac_define_dir\"" 43 AC_SUBST($1, "$ac_define_dir") 44 AC_DEFINE_UNQUOTED($1, "$ac_define_dir", [$3]) 45 test "$prefix_NONE" && prefix=NONE 46 test "$exec_prefix_NONE" && exec_prefix=NONE 47]) 48