| 1 | dnl Driver and redefinitions of some Autoconf macros for autoheader. | 
|---|
| 2 | dnl This file is part of Autoconf. | 
|---|
| 3 | dnl Copyright (C) 1994, 1995 Free Software Foundation, Inc. | 
|---|
| 4 | dnl | 
|---|
| 5 | dnl This program is free software; you can redistribute it and/or modify | 
|---|
| 6 | dnl it under the terms of the GNU General Public License as published by | 
|---|
| 7 | dnl the Free Software Foundation; either version 2, or (at your option) | 
|---|
| 8 | dnl any later version. | 
|---|
| 9 | dnl | 
|---|
| 10 | dnl This program is distributed in the hope that it will be useful, | 
|---|
| 11 | dnl but WITHOUT ANY WARRANTY; without even the implied warranty of | 
|---|
| 12 | dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | 
|---|
| 13 | dnl GNU General Public License for more details. | 
|---|
| 14 | dnl | 
|---|
| 15 | dnl You should have received a copy of the GNU General Public License | 
|---|
| 16 | dnl along with this program; if not, write to the Free Software | 
|---|
| 17 | dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA | 
|---|
| 18 | dnl 02111-1307, USA. | 
|---|
| 19 | dnl | 
|---|
| 20 | dnl Written by Roland McGrath. | 
|---|
| 21 | dnl | 
|---|
| 22 | include(acgeneral.m4)dnl | 
|---|
| 23 | builtin(include, acspecific.m4)dnl | 
|---|
| 24 | builtin(include, acoldnames.m4)dnl | 
|---|
| 25 |  | 
|---|
| 26 | dnl These are alternate definitions of some macros, which produce | 
|---|
| 27 | dnl strings in the output marked with "@@@" so we can easily extract | 
|---|
| 28 | dnl the information we want.  The `#' at the end of the first line of | 
|---|
| 29 | dnl each definition seems to be necessary to prevent m4 from eating | 
|---|
| 30 | dnl the newline, which makes the @@@ not always be at the beginning of | 
|---|
| 31 | dnl a line. | 
|---|
| 32 |  | 
|---|
| 33 | define([AC_CHECK_FUNCS], [# | 
|---|
| 34 | @@@funcs="$funcs $1"@@@ | 
|---|
| 35 | ifelse([$2], , , [ | 
|---|
| 36 | # If it was found, we do: | 
|---|
| 37 | $2 | 
|---|
| 38 | # If it was not found, we do: | 
|---|
| 39 | $3 | 
|---|
| 40 | ]) | 
|---|
| 41 | ]) | 
|---|
| 42 |  | 
|---|
| 43 | define([AC_CHECK_HEADERS], [# | 
|---|
| 44 | @@@headers="$headers $1"@@@ | 
|---|
| 45 | ifelse([$2], , , [ | 
|---|
| 46 | # If it was found, we do: | 
|---|
| 47 | $2 | 
|---|
| 48 | # If it was not found, we do: | 
|---|
| 49 | $3 | 
|---|
| 50 | ]) | 
|---|
| 51 | ]) | 
|---|
| 52 |  | 
|---|
| 53 | define([AC_CHECK_HEADERS_DIRENT], [# | 
|---|
| 54 | @@@headers="$headers $1"@@@ | 
|---|
| 55 | ]) | 
|---|
| 56 |  | 
|---|
| 57 | define([AC_CHECK_LIB], [# | 
|---|
| 58 | ifelse([$3], , [ | 
|---|
| 59 | @@@libs="$libs $1"@@@ | 
|---|
| 60 | ], [ | 
|---|
| 61 | # If it was found, we do: | 
|---|
| 62 | $3 | 
|---|
| 63 | # If it was not found, we do: | 
|---|
| 64 | $4 | 
|---|
| 65 | ]) | 
|---|
| 66 | ]) | 
|---|
| 67 |  | 
|---|
| 68 | define([AC_HAVE_LIBRARY], [# | 
|---|
| 69 | changequote(<<, >>)dnl | 
|---|
| 70 | define(<<AC_LIB_NAME>>, dnl | 
|---|
| 71 | patsubst(patsubst($1, <<lib\([^\.]*\)\.a>>, <<\1>>), <<-l>>, <<>>))dnl | 
|---|
| 72 | changequote([, ])dnl | 
|---|
| 73 | ifelse([$2], , [ | 
|---|
| 74 | @@@libs="$libs AC_LIB_NAME"@@@ | 
|---|
| 75 | ], [ | 
|---|
| 76 | # If it was found, we do: | 
|---|
| 77 | $2 | 
|---|
| 78 | # If it was not found, we do: | 
|---|
| 79 | $3 | 
|---|
| 80 | ]) | 
|---|
| 81 | ]) | 
|---|
| 82 |  | 
|---|
| 83 | define([AC_CHECK_SIZEOF], [# | 
|---|
| 84 | @@@types="$types,$1"@@@ | 
|---|
| 85 | ]) | 
|---|
| 86 |  | 
|---|
| 87 | define([AC_CONFIG_HEADER], [# | 
|---|
| 88 | define([AC_CONFIG_H], patsubst($1, [ .*$], []))dnl | 
|---|
| 89 | @@@config_h=AC_CONFIG_H@@@ | 
|---|
| 90 | ]) | 
|---|
| 91 |  | 
|---|
| 92 | define([AC_DEFINE], [# | 
|---|
| 93 | ifelse([$3],,[# | 
|---|
| 94 | @@@syms="$syms $1"@@@ | 
|---|
| 95 | ], [# | 
|---|
| 96 | @@@verbatim="$verbatim | 
|---|
| 97 | /* $3 */ | 
|---|
| 98 | #undef $1 | 
|---|
| 99 | "@@@ | 
|---|
| 100 | ])]) | 
|---|
| 101 |  | 
|---|
| 102 | define([AC_DEFINE_UNQUOTED], [# | 
|---|
| 103 | ifelse([$3],,[# | 
|---|
| 104 | @@@syms="$syms $1"@@@ | 
|---|
| 105 | ], [# | 
|---|
| 106 | @@@verbatim="$verbatim | 
|---|
| 107 | /* $3 */ | 
|---|
| 108 | #undef $1 | 
|---|
| 109 | "@@@ | 
|---|
| 110 | ])]) | 
|---|