File:  [ELWIX - Embedded LightWeight unIX -] / embedaddon / ntp / m4 / define_dir.m4
Revision 1.1: download - view: text, annotated - select for diffs - revision graph
Tue May 29 12:08:38 2012 UTC (12 years, 7 months ago) by misho
CVS tags: MAIN, HEAD
Initial revision

dnl @synopsis AC_DEFINE_DIR(VARNAME, DIR [, DESCRIPTION])
dnl
dnl This macro defines (with AC_DEFINE) VARNAME to the expansion of the DIR
dnl variable, taking care of fixing up ${prefix} and such.
dnl
dnl Note that the 3 argument form is only supported with autoconf 2.13 and
dnl later (i.e. only where AC_DEFINE supports 3 arguments).
dnl
dnl Examples:
dnl
dnl    AC_DEFINE_DIR(DATADIR, datadir)
dnl    AC_DEFINE_DIR(PROG_PATH, bindir, [Location of installed binaries])
dnl
dnl @version $Id: define_dir.m4,v 1.1 2012/05/29 12:08:38 misho Exp $
dnl @author Alexandre Oliva <oliva@lsd.ic.unicamp.br>

AC_DEFUN([AC_DEFINE_DIR], [
	ac_expanded=`(
	    test "x$prefix" = xNONE && prefix="$ac_default_prefix"
	    test "x$exec_prefix" = xNONE && exec_prefix="${prefix}"
	    eval echo \""[$]$2"\"
	)`
	ifelse([$3], [],
	  AC_DEFINE_UNQUOTED([$1], ["$ac_expanded"]),
	  AC_DEFINE_UNQUOTED([$1], ["$ac_expanded"], [$3]))
])

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>