1dnl
2dnl Automated Testing Framework (atf)
3dnl
4dnl Copyright 2011 Google Inc.
5dnl All rights reserved.
6dnl
7dnl Redistribution and use in source and binary forms, with or without
8dnl modification, are permitted provided that the following conditions are
9dnl met:
10dnl
11dnl * Redistributions of source code must retain the above copyright
12dnl   notice, this list of conditions and the following disclaimer.
13dnl * Redistributions in binary form must reproduce the above copyright
14dnl   notice, this list of conditions and the following disclaimer in the
15dnl   documentation and/or other materials provided with the distribution.
16dnl * Neither the name of Google Inc. nor the names of its contributors
17dnl   may be used to endorse or promote products derived from this software
18dnl   without specific prior written permission.
19dnl
20dnl THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21dnl "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22dnl LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23dnl A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
24dnl OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25dnl SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
26dnl LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27dnl DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28dnl THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29dnl (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30dnl OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31dnl
32
33dnl ATF_CHECK_CXX([version-spec])
34dnl
35dnl Checks if atf-c++ is present.  If version-spec is provided, ensures that
36dnl the installed version of atf-sh matches the required version.  This
37dnl argument must be something like '>= 0.14' and accepts any version
38dnl specification supported by pkg-config.
39dnl
40dnl Defines and substitutes ATF_CXX_CFLAGS and ATF_CXX_LIBS with the compiler
41dnl and linker flags need to build against atf-c++.
42AC_DEFUN([ATF_CHECK_CXX], [
43    spec="atf-c++[]m4_default_nblank([ $1], [])"
44    _ATF_CHECK_ARG_WITH(
45        [PKG_CHECK_MODULES([ATF_CXX], [${spec}],
46                           [found=yes found_atf_cxx=yes], [found=no])],
47        [required ${spec} not found])
48])
49