1999-10-31 Akim Demaille <akim@epita.fr>

* acspecific.m4 (AC_CHECK_MEMBER, AC_CHECK_MEMBERS): New macros.
	* autoheader.m4 (AH_CHECK_MEMBERS): New macro.
	(epilogue): Hook AH_CHECK_MEMBERS on AC_CHECK_MEMBERS.
This commit is contained in:
Akim Demaille 1999-12-20 12:01:55 +00:00
parent dc08b45c63
commit 71c0040e3b
4 changed files with 122 additions and 6 deletions

View File

@ -1,10 +1,16 @@
1999-10-31 Akim Demaille <akim@epita.fr>
* acspecific.m4 (AC_CHECK_MEMBER, AC_CHECK_MEMBERS): New macros.
* autoheader.m4 (AH_CHECK_MEMBERS): New macro.
(epilogue): Hook AH_CHECK_MEMBERS on AC_CHECK_MEMBERS.
1999-10-31 Akim Demaille <akim@epita.fr>
* autoheader.m4 (AC_FUNC_ALLOCA): Rename from this ...
(AH_FUNC_ALLOCA): ... to this. Includes all the needed templates.
(AC_C_CHAR_UNSIGNED): Rename from this ...
(AH_C_CHAR_UNSIGNED): ... to this.
1999-10-31 Ben Elliston <bje@cygnus.com>
* Makefile.am (CLEANFILES): New explicit variable.
@ -630,7 +636,7 @@
* config.guess: Eliminate the trailing dot if ${UNAME_RELEASE} is
1.4-<SOMETHING>. Fix for PR autoconf/22.
1999-09-17 Akim Demaille <akim@epita.fr>
1999-09-17 Akim Demaille <akim@epita.fr>
* acgeneral.m4 (AC_INIT_PARSE_ARGS): Improve configure's --help.

View File

@ -2034,6 +2034,52 @@ define(AC_HASBEEN,
dnl ### Generic structure checks
dnl AC_CHECK_MEMBER(AGGREGATE.MEMBER
dnl [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND
dnl [, INCLUDES ]]])
dnl ---------------------------------------------------------
dnl AGGREGATE.MEMBER is for instance `struct passwd.pw_gecos', shell
dnl variables are not a valid argument.
AC_DEFUN(AC_CHECK_MEMBER,
[AC_REQUIRE([AC_HEADER_STDC])dnl
AC_VAR_PUSHDEF([ac_Member], [ac_cv_member_$1])dnl
dnl Extract the aggregate name, and the member name
AC_VAR_IF_INDIR([$1],
[AC_FATAL([$0: requires manifest arguments])],
[pushdef(AC_Member_Aggregate, [patsubst([$1], [\.[^.]*])])dnl
pushdef(AC_Member_Member, [patsubst([$1], [.*\.])])])dnl
AC_CACHE_CHECK([for $1], ac_Member,
[AC_TRY_COMPILE(m4_default([$4
], [#include <stdio.h>
#include <sys/types.h>
#if STDC_HEADERS
# include <stdlib.h>
# include <stddef.h>
#endif
]),
ac_Member_Aggregate foo;
foo.ac_Member_Member;,
AC_VAR_SET(ac_Member, yes), AC_VAR_SET(ac_Member, no))])
AC_SHELL_IFELSE(test AC_VAR_GET(ac_Member) = yes,
[$2], [$3])dnl
popdef([AC_Member_Member])dnl
popdef([AC_Member_Aggregate])dnl
AC_VAR_POPDEF([ac_Member])dnl
])dnl AC_CHECK_MEMBER
dnl AC_CHECK_MEMBER(AGGREGATE.MEMBER...
dnl [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND
dnl [, INCLUDES ]]])
dnl ---------------------------------------------------------
AC_DEFUN(AC_CHECK_MEMBERS,
[m4_foreach([AC_Member], [$1],
[AC_SPECIALIZE([AC_CHECK_MEMBER], AC_Member,
[AC_DEFINE_UNQUOTED(AC_TR_CPP(HAVE_[]AC_Member))
$2],
[$3],
[$4])])])
dnl Check if a particular structure member exists.
dnl AC_C_STRUCT_MEMBER(VARIABLE, INCLUDES, TYPE, MEMBER)
AC_DEFUN(AC_C_STRUCT_MEMBER,

View File

@ -103,10 +103,11 @@ define([AH_CHECK_FUNCS],
[AC_FOREACH([AC_Func], [$1],
[AH_TEMPLATE(AC_TR_CPP(HAVE_[]AC_Func),
[Define if you have the `]AC_Func[' function.])
# Success
$2
# Failure
$3])])
# Success
$2
# Failure
$3])
])
define([AH_CHECK_SIZEOF],
[AH_TEMPLATE(AC_TR_CPP(SIZEOF_$1),
@ -116,6 +117,22 @@ define([AH_PROG_LEX],
[AH_CHECK_LIB(fl)
AH_CHECK_LIB(l)])
define([AH_CHECK_MEMBERS],
[m4_foreach([AC_Member], [$1],
[pushdef(AC_Member_Aggregate, [patsubst(AC_Member, [\.[^.]*])])
pushdef(AC_Member_Member, [patsubst(AC_Member, [.*\.])])
AH_TEMPLATE(AC_TR_CPP(HAVE_[]AC_Member),
[Define if `]AC_Member_Member[' is member of]
[`]AC_Member_Aggregate['.])
popdef([AC_Member_Member])
popdef([AC_Member_Aggregate])
# Success
$2
# Failure
$3])
])
define([AH_FUNC_ALLOCA],
[AH_TEMPLATE(HAVE_ALLOCA_H,
[Define if you have <alloca.h> and it should be used
@ -188,6 +205,7 @@ define([AC_CHECK_SIZEOF], [AH_CHECK_SIZEOF($@)])
define([AC_CHECK_FUNCS], [AH_CHECK_FUNCS($@)])
define([AC_CHECK_HEADERS], [AH_CHECK_HEADERS($@)])
define([AC_CHECK_HEADERS_DIRENT], [AH_CHECK_HEADERS($@)])
define([AC_CHECK_MEMBERS], [AH_CHECK_MEMBERS($@)])
define([AC_CHECK_LIB], [AH_CHECK_LIB($@)])
define([AC_PROG_LEX], [AH_PROG_LEX($@)])
define([AC_FUNC_ALLOCA], [AH_FUNC_ALLOCA($@)])

View File

@ -2034,6 +2034,52 @@ define(AC_HASBEEN,
dnl ### Generic structure checks
dnl AC_CHECK_MEMBER(AGGREGATE.MEMBER
dnl [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND
dnl [, INCLUDES ]]])
dnl ---------------------------------------------------------
dnl AGGREGATE.MEMBER is for instance `struct passwd.pw_gecos', shell
dnl variables are not a valid argument.
AC_DEFUN(AC_CHECK_MEMBER,
[AC_REQUIRE([AC_HEADER_STDC])dnl
AC_VAR_PUSHDEF([ac_Member], [ac_cv_member_$1])dnl
dnl Extract the aggregate name, and the member name
AC_VAR_IF_INDIR([$1],
[AC_FATAL([$0: requires manifest arguments])],
[pushdef(AC_Member_Aggregate, [patsubst([$1], [\.[^.]*])])dnl
pushdef(AC_Member_Member, [patsubst([$1], [.*\.])])])dnl
AC_CACHE_CHECK([for $1], ac_Member,
[AC_TRY_COMPILE(m4_default([$4
], [#include <stdio.h>
#include <sys/types.h>
#if STDC_HEADERS
# include <stdlib.h>
# include <stddef.h>
#endif
]),
ac_Member_Aggregate foo;
foo.ac_Member_Member;,
AC_VAR_SET(ac_Member, yes), AC_VAR_SET(ac_Member, no))])
AC_SHELL_IFELSE(test AC_VAR_GET(ac_Member) = yes,
[$2], [$3])dnl
popdef([AC_Member_Member])dnl
popdef([AC_Member_Aggregate])dnl
AC_VAR_POPDEF([ac_Member])dnl
])dnl AC_CHECK_MEMBER
dnl AC_CHECK_MEMBER(AGGREGATE.MEMBER...
dnl [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND
dnl [, INCLUDES ]]])
dnl ---------------------------------------------------------
AC_DEFUN(AC_CHECK_MEMBERS,
[m4_foreach([AC_Member], [$1],
[AC_SPECIALIZE([AC_CHECK_MEMBER], AC_Member,
[AC_DEFINE_UNQUOTED(AC_TR_CPP(HAVE_[]AC_Member))
$2],
[$3],
[$4])])])
dnl Check if a particular structure member exists.
dnl AC_C_STRUCT_MEMBER(VARIABLE, INCLUDES, TYPE, MEMBER)
AC_DEFUN(AC_C_STRUCT_MEMBER,