source: trunk/m4/yat_check_headers.m4

Last change on this file was 3885, checked in by Peter, 15 months ago

Lift out macro YAT_CHECK_HEADERS to its own file, yat_check_header.m4.

Move htslib-related macros to yat_check_htslib.m4

Deprecate all remaining macros in yat_check_libbam.m4

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id Date
File size: 1.7 KB
Line 
1## $Id: yat_check_headers.m4 3885 2020-03-25 03:06:46Z peter $
2#
3# serial 11 (yat 0.18)
4#
5#
6#   Copyright (C) 2012, 2013, 2014, 2015, 2018, 2020 Peter Johansson
7#
8#   This file is part of the yat library, http://dev.thep.lu.se/yat
9#
10#   The yat library is free software; you can redistribute it and/or
11#   modify it under the terms of the GNU General Public License as
12#   published by the Free Software Foundation; either version 3 of the
13#   License, or (at your option) any later version.
14#
15#   The yat library is distributed in the hope that it will be useful,
16#   but WITHOUT ANY WARRANTY; without even the implied warranty of
17#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
18#   General Public License for more details.
19#
20#   You should have received a copy of the GNU General Public License
21#   along with yat. If not, see <http://www.gnu.org/licenses/>.
22
23
24# YAT_CHECK_HEADERS(headers, [action-if-found], [action-if-not-found])
25# ====================================================================
26# Loop over headers (space-separated), check if header exist. If
27# header exists, AC_DEFINE(YAT_HAVE_header) and execute shell command
28# action-if-found. If none of headers is available, execute
29# action-if-not-found.
30AC_DEFUN([YAT_CHECK_HEADERS],
31[
32yat_check_headers_result=no
33m4_foreach_w([myheader], [$1], [_YAT_CHECK_HEADERS(myheader)])
34AS_IF([test x$yat_check_headers_result = xyes], [$2], [$3])
35]) # YAT_CHECK_HEADERS
36
37
38# _YAT_CHECK_HEADERS
39# =====================
40# Private macro used in YAT_CHECK_HEADERS
41AC_DEFUN([_YAT_CHECK_HEADERS],
42[
43AS_IF([test x$yat_check_headers_result = xno], [dnl
44  AC_CHECK_HEADER([$1], [
45    AC_DEFINE_UNQUOTED(AS_TR_CPP([YAT_HAVE_$1]), [1],
46                       [Define to 1 if you have <$1> header file])
47    yat_check_headers_result=yes;
48  ])
49])
50]) # _YAT_CHECK_HEADERS
Note: See TracBrowser for help on using the repository browser.