summaryrefslogtreecommitdiff
path: root/autoheader.m4
blob: cb411b0fb7312493a15872e9e30ce2b1cd7e64b4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
dnl Driver and redefinitions of some Autoconf macros for autoheader.
dnl This file is part of Autoconf.
dnl Copyright (C) 1994, 1995 Free Software Foundation, Inc.
dnl
dnl This program is free software; you can redistribute it and/or modify
dnl it under the terms of the GNU General Public License as published by
dnl the Free Software Foundation; either version 2, or (at your option)
dnl any later version.
dnl
dnl This program is distributed in the hope that it will be useful,
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
dnl GNU General Public License for more details.
dnl
dnl You should have received a copy of the GNU General Public License
dnl along with this program; if not, write to the Free Software
dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
dnl 02111-1307, USA.
dnl
dnl Written by Roland McGrath.
dnl
include(acgeneral.m4)dnl
builtin(include, acspecific.m4)dnl
builtin(include, acoldnames.m4)dnl

dnl These are alternate definitions of some macros, which produce
dnl strings in the output marked with "@@@" so we can easily extract
dnl the information we want.  The `#' at the end of the first line of
dnl each definition seems to be necessary to prevent m4 from eating
dnl the newline, which makes the @@@ not always be at the beginning of
dnl a line.

define([AC_CHECK_FUNCS], [#
@@@funcs="$funcs $1"@@@
ifelse([$2], , , [
# If it was found, we do:
$2
# If it was not found, we do:
$3
])
])

define([AC_CHECK_HEADERS], [#
@@@headers="$headers $1"@@@
ifelse([$2], , , [
# If it was found, we do:
$2
# If it was not found, we do:
$3
])
])

define([AC_CHECK_HEADERS_DIRENT], [#
@@@headers="$headers $1"@@@
])

define([AC_CHECK_LIB], [#
  ifelse([$3], , [
@@@libs="$libs $1"@@@
], [
# If it was found, we do:
$3
# If it was not found, we do:
$4
])
])

define([AC_HAVE_LIBRARY], [#
changequote(<<, >>)dnl
define(<<AC_LIB_NAME>>, dnl
patsubst(patsubst($1, <<lib\([^\.]*\)\.a>>, <<\1>>), <<-l>>, <<>>))dnl
changequote([, ])dnl
  ifelse([$2], , [
@@@libs="$libs AC_LIB_NAME"@@@
], [
# If it was found, we do:
$2
# If it was not found, we do:
$3
])
])

define([AC_CHECK_SIZEOF], [#
@@@types="$types,$1"@@@
])

define([AC_CONFIG_HEADER], [#
define([AC_CONFIG_H], patsubst($1, [ .*$], []))dnl
@@@config_h=AC_CONFIG_H@@@
])

define([AC_DEFINE], [#
ifelse([$3],,[#
@@@syms="$syms $1"@@@
], [#
@@@verbatim="$verbatim
/* $3 */
#undef $1
"@@@
])])

define([AC_DEFINE_UNQUOTED], [#
ifelse([$3],,[#
@@@syms="$syms $1"@@@
], [#
@@@verbatim="$verbatim
/* $3 */
#undef $1
"@@@
])])