doc: update copyright line for 2021
[adg.git] / build / ntd.m4
blob9af1b50ec5925a0afea2f4d544e00b1b2cef9fe8
1 # ntd.m4 - Collection of autoconf snippets.
3 # Copyright (C) 2012  Nicola Fontana <ntd@entidi.it>
5 # This library is free software; you can redistribute it and/or
6 # modify it under the terms of the GNU Lesser General Public
7 # License as published by the Free Software Foundation; either
8 # version 2 of the License, or (at your option) any later version.
10 # This library is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13 # Lesser General Public License for more details.
15 # You should have received a copy of the GNU Lesser General Public
16 # License along with this library; if not, write to the
17 # Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 # Boston, MA  02110-1301, USA.
20 dnl NTD_UNEXPAND(PACKAGE,VARIABLE,[ACTION-IF-FOUND],[ACTION-IF-NOT-FOUND])
21 dnl Get the unexpanded value VARIABLE in PACKAGE by using pkg-config.
22 dnl The result is returned in the NTD_UNEXPANDED shell variable.
23 AC_DEFUN([NTD_UNEXPAND],[
24 NTD_UNEXPANDED="$(${PKG_CONFIG} \
25  --define-variable=prefix='${prefix}' \
26  --define-variable=exec_prefix='${exec_prefix}' \
27  --define-variable=libdir='${libdir}' \
28  --define-variable=bindir='${bindir}' \
29  --define-variable=datarootdir='${datarootdir}' \
30  --define-variable=datadir='${datadir}' \
31  --define-variable=includedir='${includedir}' \
32  --variable=[$2] [$1])"
34 if test "x$NTD_UNEXPANDED" != "x"; then
35         m4_default([$3], [:])
36 m4_ifvaln([$4], [else
37         $4])dnl
38 fi])