build-sys: Move some more defines from CFLAGS to config.h
[pulseaudio-mirror.git] / m4 / ax_define_dir.m4
blobb74d155fd76a346dfd90e3a21e8f3227b0a4bd0b
1 # ===========================================================================
2 #       http://www.gnu.org/software/autoconf-archive/ax_define_dir.html
3 # ===========================================================================
5 # SYNOPSIS
7 #   AX_DEFINE_DIR(VARNAME, DIR [, DESCRIPTION])
9 # DESCRIPTION
11 #   This macro sets VARNAME to the expansion of the DIR variable, taking
12 #   care of fixing up ${prefix} and such.
14 #   VARNAME is then offered as both an output variable and a C preprocessor
15 #   symbol.
17 #   Example:
19 #     AX_DEFINE_DIR([DATADIR], [datadir], [Where data are placed to.])
21 # LICENSE
23 #   Copyright (c) 2008 Stepan Kasal <kasal@ucw.cz>
24 #   Copyright (c) 2008 Andreas Schwab <schwab@suse.de>
25 #   Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de>
26 #   Copyright (c) 2008 Alexandre Oliva
28 #   Copying and distribution of this file, with or without modification, are
29 #   permitted in any medium without royalty provided the copyright notice
30 #   and this notice are preserved. This file is offered as-is, without any
31 #   warranty.
33 #serial 6
35 AU_ALIAS([AC_DEFINE_DIR], [AX_DEFINE_DIR])
36 AC_DEFUN([AX_DEFINE_DIR], [
37   prefix_NONE=
38   exec_prefix_NONE=
39   test "x$prefix" = xNONE && prefix_NONE=yes && prefix=$ac_default_prefix
40   test "x$exec_prefix" = xNONE && exec_prefix_NONE=yes && exec_prefix=$prefix
41 dnl In Autoconf 2.60, ${datadir} refers to ${datarootdir}, which in turn
42 dnl refers to ${prefix}.  Thus we have to use `eval' twice.
43   eval ax_define_dir="\"[$]$2\""
44   eval ax_define_dir="\"$ax_define_dir\""
45   AC_SUBST($1, "$ax_define_dir")
46   AC_DEFINE_UNQUOTED($1, "$ax_define_dir", [$3])
47   test "$prefix_NONE" && prefix=NONE
48   test "$exec_prefix_NONE" && exec_prefix=NONE