* tests/base.at, tests/compile.at, tests/foreign.at,
* tests/m4sh.at, tests/m4sugar.at, tests/mktests.sh,
* tests/semantics.at, tests/suite.at, tests/tools.at,
* tests/torture.at: Ask Autotest mode, not Autoconf mode.
2001-08-20 14:44:38 +00:00
|
|
|
# -*- Autotest -*-
|
2000-02-07 11:54:29 +00:00
|
|
|
|
2000-12-07 15:21:54 +00:00
|
|
|
AT_BANNER([Semantics.])
|
2000-02-07 11:54:29 +00:00
|
|
|
|
2017-01-01 05:17:07 -08:00
|
|
|
# Copyright (C) 2000-2002, 2004-2007, 2009-2017 Free Software
|
2011-01-04 16:13:09 -07:00
|
|
|
# Foundation, Inc.
|
* AUTHORS, BUGS, ChangeLog, ChangeLog.0, ChangeLog.1,
ChangeLog.2, GNUmakefile, Makefile.maint, NEWS, README,
README-alpha, TODO, configure.ac, lib/autoconf/Makefile.am,
m4/atconfig.m4, m4/init.m4, m4/m4.m4, m4/missing.m4,
m4/sanity.m4, tests/README, tests/aclocal.m4,
tests/atspecific.m4, tests/base.at, tests/compile.at,
tests/foreign.at, tests/m4sh.at, tests/m4sugar.at,
tests/semantics.at, tests/suite.at, tests/tools.at,
tests/torture.at: Add copyright notice.
* tests/mktests.sh: Update year in copyright notice.
2001-08-12 13:05:11 +00:00
|
|
|
#
|
2007-07-20 23:11:49 +00:00
|
|
|
# This program is free software: you can redistribute it and/or modify
|
* AUTHORS, BUGS, ChangeLog, ChangeLog.0, ChangeLog.1,
ChangeLog.2, GNUmakefile, Makefile.maint, NEWS, README,
README-alpha, TODO, configure.ac, lib/autoconf/Makefile.am,
m4/atconfig.m4, m4/init.m4, m4/m4.m4, m4/missing.m4,
m4/sanity.m4, tests/README, tests/aclocal.m4,
tests/atspecific.m4, tests/base.at, tests/compile.at,
tests/foreign.at, tests/m4sh.at, tests/m4sugar.at,
tests/semantics.at, tests/suite.at, tests/tools.at,
tests/torture.at: Add copyright notice.
* tests/mktests.sh: Update year in copyright notice.
2001-08-12 13:05:11 +00:00
|
|
|
# it under the terms of the GNU General Public License as published by
|
Update License to GPLv3+ including new Autoconf Exception.
* NEWS, README: Update licensing information.
* COPYING.EXCEPTION: New file.
* Makefile.am (EXTRA_DIST): Distribute it.
* cfg.mk (autom4te-update): Remove copyright change warning.
* lib/autoconf/autoconf.m4, lib/autoconf/autoheader.m4,
lib/autoconf/autoscan.m4, lib/autoconf/autotest.m4,
lib/autoconf/autoupdate.m4, lib/autoconf/c.m4,
lib/autoconf/erlang.m4, lib/autoconf/fortran.m4,
lib/autoconf/functions.m4, lib/autoconf/general.m4,
lib/autoconf/headers.m4, lib/autoconf/lang.m4,
lib/autoconf/libs.m4, lib/autoconf/oldnames.m4,
lib/autoconf/programs.m4, lib/autoconf/specific.m4,
lib/autoconf/status.m4, lib/autoconf/types.m4,
lib/autotest/autotest.m4, lib/autotest/general.m4,
lib/autotest/specific.m4, lib/m4sugar/foreach.m4,
lib/m4sugar/m4sh.m4, lib/m4sugar/m4sugar.m4: Update exception
statement, bump to GPLv3.
* bin/autoconf.as, bin/autoheader.in, bin/autom4te.in,
bin/autoreconf.in, bin/autoscan.in, bin/autoupdate.in,
bin/ifnames.in: Bump to GPLv3+, adjust --version output
to reflect the GPLv3+ and the Autoconf Exception.
* lib/Autom4te/C4che.pm, lib/Autom4te/ChannelDefs.pm,
lib/Autom4te/General.pm, lib/Autom4te/Request.pm,
lib/autom4te.in, lib/autoscan/autoscan.pre,
lib/emacs/autoconf-mode.el, lib/emacs/autotest-mode.el,
lib/freeze.mk, tests/atlocal.in, tests/autoscan.at,
tests/autotest.at, tests/base.at, tests/c.at,
tests/compile.at, tests/erlang.at, tests/foreign.at,
tests/fortran.at, tests/local.at, tests/m4sh.at,
tests/m4sugar.at, tests/mktests.sh, tests/semantics.at,
tests/statesave.m4, tests/suite.at, tests/tools.at,
tests/torture.at, tests/wrapper.as: Bump to GPLv3+.
2009-09-09 19:53:31 +02:00
|
|
|
# the Free Software Foundation, either version 3 of the License, or
|
|
|
|
# (at your option) any later version.
|
* AUTHORS, BUGS, ChangeLog, ChangeLog.0, ChangeLog.1,
ChangeLog.2, GNUmakefile, Makefile.maint, NEWS, README,
README-alpha, TODO, configure.ac, lib/autoconf/Makefile.am,
m4/atconfig.m4, m4/init.m4, m4/m4.m4, m4/missing.m4,
m4/sanity.m4, tests/README, tests/aclocal.m4,
tests/atspecific.m4, tests/base.at, tests/compile.at,
tests/foreign.at, tests/m4sh.at, tests/m4sugar.at,
tests/semantics.at, tests/suite.at, tests/tools.at,
tests/torture.at: Add copyright notice.
* tests/mktests.sh: Update year in copyright notice.
2001-08-12 13:05:11 +00:00
|
|
|
#
|
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU General Public License
|
2017-09-16 17:48:19 -07:00
|
|
|
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
2000-03-25 09:06:24 +00:00
|
|
|
|
Eradicate AC_TRY_COMPILE.
* aclang.m4 (AC_PROG_CC_STDC, AC_C_BIGENDIAN, AC_C_INLINE,
AC_C_CONST, AC_C_VOLATILE, AC_F77_NAME_MANGLING): Use
`AC_COMPILE_IFELSE'.
* acspecific.m4 (AC_DECL_SYS_SIGLIST, _AC_CHECK_HEADER_DIRENT,
AC_HEADER_SYS_WAIT, AC_HEADER_TIME, AC_TYPE_SIGNAL,
AC_FUNC_GETLOADAVG, AC_FUNC_SELECT_ARGTYPES, AC_STRUCT_TM,
AC_CYGWIN, AC_MINGW32, AC_EMXOS2): Likewise.
* tests/semantics.m4 (C keywords): Check that AC_C_CONST,
AC_C_VOLATILE, and AC_C_INLINE function properly with GCC.
2000-05-11 13:09:05 +00:00
|
|
|
|
|
|
|
## -------------------------------- ##
|
|
|
|
## Members of the AC_CHECK family. ##
|
|
|
|
## -------------------------------- ##
|
|
|
|
|
|
|
|
|
2000-03-25 09:06:24 +00:00
|
|
|
# AC_CHECK_LIB
|
|
|
|
# ------------
|
|
|
|
# Well, I can't imagine a system where `cos' is neither in libc, nor
|
|
|
|
# in libm. Nor can I imagine a lib more likely to exists than libm.
|
2000-04-11 12:07:45 +00:00
|
|
|
# But there are systems without libm, on which we don't want to have
|
2000-03-25 09:06:24 +00:00
|
|
|
# this test fail, so exit successfully if `cos' is in libc.
|
2000-11-29 10:11:38 +00:00
|
|
|
AT_CHECK_MACRO([AC_CHECK_LIB],
|
2001-06-06 08:25:00 +00:00
|
|
|
[AC_TRY_LINK_FUNC(cos,
|
* aclocal.m4, bin/autoconf.as, lib/autoconf/autoconf.m4,
* lib/autoconf/autoheader.m4, lib/autoconf/autoupdate.m4,
* lib/autoconf/c.m4, lib/autoconf/fortran.m4,
* lib/autoconf/general.m4, lib/autoconf/headers.m4,
* lib/autoconf/lang.m4, lib/autoconf/libs.m4,
* lib/autoconf/programs.m4, lib/autoconf/specific.m4,
* lib/autoconf/status.m4, lib/autoconf/types.m4,
* lib/autotest/general.m4, lib/m4sugar/m4sugar.m4,
* tests/atspecific.m4, tests/base.at, tests/compile.at,
* tests/foreign.at, tests/m4sh.at, tests/semantics.at,
* tests/tools.at, tests/torture.at:
Whitespace clean up.
Suggested by Jim Meyering.
2003-05-22 13:24:04 +00:00
|
|
|
[AC_MSG_ERROR([`cos' is in `libc'], 77)])
|
2001-06-06 08:25:00 +00:00
|
|
|
|
2000-10-27 14:15:28 +00:00
|
|
|
AC_CHECK_LIB(m, cos,,
|
* aclocal.m4, bin/autoconf.as, lib/autoconf/autoconf.m4,
* lib/autoconf/autoheader.m4, lib/autoconf/autoupdate.m4,
* lib/autoconf/c.m4, lib/autoconf/fortran.m4,
* lib/autoconf/general.m4, lib/autoconf/headers.m4,
* lib/autoconf/lang.m4, lib/autoconf/libs.m4,
* lib/autoconf/programs.m4, lib/autoconf/specific.m4,
* lib/autoconf/status.m4, lib/autoconf/types.m4,
* lib/autotest/general.m4, lib/m4sugar/m4sugar.m4,
* tests/atspecific.m4, tests/base.at, tests/compile.at,
* tests/foreign.at, tests/m4sh.at, tests/semantics.at,
* tests/tools.at, tests/torture.at:
Whitespace clean up.
Suggested by Jim Meyering.
2003-05-22 13:24:04 +00:00
|
|
|
[AC_MSG_ERROR([cannot find `cos' in `libm'])])
|
2001-06-06 08:25:00 +00:00
|
|
|
|
|
|
|
# No kidding, using variables was broken in 2.50 :(
|
|
|
|
ac_sin=sin
|
|
|
|
AC_CHECK_LIB(m, $ac_sin,,
|
|
|
|
[AC_MSG_ERROR([cannot find `\$ac_sin' (= `$ac_sin') in `libm'])])
|
|
|
|
|
|
|
|
ac_m=m
|
|
|
|
AC_CHECK_LIB($ac_m, acos,,
|
|
|
|
[AC_MSG_ERROR([cannot find `acos' in `\$ac_m' (= `$ac_m')])])
|
|
|
|
|
|
|
|
ac_asin=asin
|
|
|
|
AC_CHECK_LIB($ac_m, $ac_asin,,
|
2007-11-12 09:46:16 +01:00
|
|
|
[AC_MSG_ERROR([cannot find `\$ac_asin' (= `$ac_asin') in `\$ac_m' (= `$ac_m')])])
|
2001-06-06 08:25:00 +00:00
|
|
|
|
|
|
|
# But if the bug is in the caching mechanism, then be sure we
|
|
|
|
# correctly detect failures.
|
|
|
|
|
|
|
|
AC_CHECK_LIB(m, cossack,
|
* aclocal.m4, bin/autoconf.as, lib/autoconf/autoconf.m4,
* lib/autoconf/autoheader.m4, lib/autoconf/autoupdate.m4,
* lib/autoconf/c.m4, lib/autoconf/fortran.m4,
* lib/autoconf/general.m4, lib/autoconf/headers.m4,
* lib/autoconf/lang.m4, lib/autoconf/libs.m4,
* lib/autoconf/programs.m4, lib/autoconf/specific.m4,
* lib/autoconf/status.m4, lib/autoconf/types.m4,
* lib/autotest/general.m4, lib/m4sugar/m4sugar.m4,
* tests/atspecific.m4, tests/base.at, tests/compile.at,
* tests/foreign.at, tests/m4sh.at, tests/semantics.at,
* tests/tools.at, tests/torture.at:
Whitespace clean up.
Suggested by Jim Meyering.
2003-05-22 13:24:04 +00:00
|
|
|
[AC_MSG_ERROR([found `cossack' in `libm'])])
|
2001-06-06 08:25:00 +00:00
|
|
|
|
|
|
|
# No kidding, using variables was broken in 2.50 :(
|
|
|
|
ac_sinner=sinner
|
|
|
|
AC_CHECK_LIB(m, $ac_sinner,
|
|
|
|
[AC_MSG_ERROR([found `\$ac_sinner' (= `$ac_sinner') in `libm'])])
|
|
|
|
|
|
|
|
ac_m=m
|
|
|
|
AC_CHECK_LIB($ac_m, acossack,
|
|
|
|
[AC_MSG_ERROR([found `acossack' in `\$ac_m' (= `$ac_m')])])
|
|
|
|
|
|
|
|
ac_asinner=asinner
|
|
|
|
AC_CHECK_LIB($ac_m, $ac_asinner,
|
2007-11-12 09:46:16 +01:00
|
|
|
[AC_MSG_ERROR([found `\$ac_asinner' (= `$ac_asinner') in `\$ac_m' (= `$ac_m')])])
|
2001-06-06 08:25:00 +00:00
|
|
|
|
|
|
|
])
|
2000-03-25 09:06:24 +00:00
|
|
|
|
|
|
|
|
2003-05-18 14:48:02 +00:00
|
|
|
# AC_SEARCH_LIBS
|
|
|
|
# --------------
|
|
|
|
AT_CHECK_MACRO([AC_SEARCH_LIBS],
|
|
|
|
[
|
|
|
|
AC_SEARCH_LIBS(cos, oser m ust,,
|
* aclocal.m4, bin/autoconf.as, lib/autoconf/autoconf.m4,
* lib/autoconf/autoheader.m4, lib/autoconf/autoupdate.m4,
* lib/autoconf/c.m4, lib/autoconf/fortran.m4,
* lib/autoconf/general.m4, lib/autoconf/headers.m4,
* lib/autoconf/lang.m4, lib/autoconf/libs.m4,
* lib/autoconf/programs.m4, lib/autoconf/specific.m4,
* lib/autoconf/status.m4, lib/autoconf/types.m4,
* lib/autotest/general.m4, lib/m4sugar/m4sugar.m4,
* tests/atspecific.m4, tests/base.at, tests/compile.at,
* tests/foreign.at, tests/m4sh.at, tests/semantics.at,
* tests/tools.at, tests/torture.at:
Whitespace clean up.
Suggested by Jim Meyering.
2003-05-22 13:24:04 +00:00
|
|
|
[AC_MSG_ERROR([cannot find `cos'])])
|
2003-05-18 14:48:02 +00:00
|
|
|
|
|
|
|
case "$ac_cv_search_cos" in
|
|
|
|
-loser|-lust) AC_MSG_ERROR([jeez, $ac_cv_search_cos must be a cool library!]) ;;
|
|
|
|
esac
|
2005-09-06 15:34:06 +00:00
|
|
|
])
|
|
|
|
|
2003-05-18 14:48:02 +00:00
|
|
|
|
2005-09-06 15:34:06 +00:00
|
|
|
# AC_SEARCH_LIBS (none needed)
|
|
|
|
# ----------------------------
|
|
|
|
AT_CHECK_MACRO([AC_SEARCH_LIBS (none needed)],
|
|
|
|
[
|
2003-05-18 14:48:02 +00:00
|
|
|
AC_SEARCH_LIBS(printf, oser c ust,,
|
* aclocal.m4, bin/autoconf.as, lib/autoconf/autoconf.m4,
* lib/autoconf/autoheader.m4, lib/autoconf/autoupdate.m4,
* lib/autoconf/c.m4, lib/autoconf/fortran.m4,
* lib/autoconf/general.m4, lib/autoconf/headers.m4,
* lib/autoconf/lang.m4, lib/autoconf/libs.m4,
* lib/autoconf/programs.m4, lib/autoconf/specific.m4,
* lib/autoconf/status.m4, lib/autoconf/types.m4,
* lib/autotest/general.m4, lib/m4sugar/m4sugar.m4,
* tests/atspecific.m4, tests/base.at, tests/compile.at,
* tests/foreign.at, tests/m4sh.at, tests/semantics.at,
* tests/tools.at, tests/torture.at:
Whitespace clean up.
Suggested by Jim Meyering.
2003-05-22 13:24:04 +00:00
|
|
|
[AC_MSG_ERROR([cannot find `printf'])])
|
2003-05-18 14:48:02 +00:00
|
|
|
|
|
|
|
case "$ac_cv_search_printf" in
|
|
|
|
-loser|-lust) AC_MSG_ERROR([jeez, $ac_cv_search_printf must be a cool library!]) ;;
|
|
|
|
-lc) AC_MSG_ERROR([huh, you need to give -lc?])
|
|
|
|
esac
|
|
|
|
])
|
|
|
|
|
|
|
|
|
2000-03-25 09:06:24 +00:00
|
|
|
# AC_CHECK_DECLS
|
|
|
|
# --------------
|
2015-05-13 21:11:47 -04:00
|
|
|
# For the benefit of _AC_UNDECLARED_WARNING compilers, these INCLUDES sections
|
|
|
|
# should not elicit warnings.
|
2000-11-29 10:11:38 +00:00
|
|
|
AT_CHECK_MACRO([AC_CHECK_DECLS],
|
2006-09-26 20:42:43 +00:00
|
|
|
[[AC_CHECK_DECLS([yes, no, myenum, mystruct, myfunc, mymacro1, mymacro2],,,
|
2015-05-13 21:11:47 -04:00
|
|
|
[[extern int yes;
|
2006-09-26 20:42:43 +00:00
|
|
|
enum { myenum };
|
2015-05-13 21:11:47 -04:00
|
|
|
extern struct { int x[20]; } mystruct;
|
2006-09-26 20:42:43 +00:00
|
|
|
extern int myfunc();
|
|
|
|
#define mymacro1(arg) arg
|
2010-06-01 21:54:39 +02:00
|
|
|
#define mymacro2]])
|
2015-05-13 21:11:47 -04:00
|
|
|
# Clang reports a warning for an undeclared builtin.
|
|
|
|
AC_CHECK_DECLS([strerror],,, [[]])
|
2010-06-01 21:54:39 +02:00
|
|
|
# The difference in space-before-open-paren is intentional.
|
|
|
|
AC_CHECK_DECLS([basenam (char *), dirnam(char *),
|
|
|
|
[moreargs (char, short, int, long, void *, char [], float, double)]],,,
|
|
|
|
[[#ifdef __cplusplus
|
|
|
|
extern "C++" char *basenam (char *);
|
|
|
|
extern "C++" const char *basenam (const char *);
|
|
|
|
#else
|
|
|
|
extern char *basenam (const char *);
|
|
|
|
#endif
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
extern int moreargs (char, short, int, long, void *,
|
|
|
|
char [], float, double);
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
]])
|
|
|
|
AC_CHECK_DECL([declared (char *)],, [AS_EXIT([1])],
|
|
|
|
[[#ifdef __cplusplus
|
|
|
|
extern "C++" char *declared (char *);
|
|
|
|
extern "C++" const char *declared (const char *);
|
|
|
|
#else
|
|
|
|
extern char *declared (const char *);
|
|
|
|
#endif
|
|
|
|
]])
|
2018-11-24 20:57:43 -08:00
|
|
|
AC_LANG_WERROR
|
2010-06-01 21:54:39 +02:00
|
|
|
AC_CHECK_DECL([undeclared (char *)], [AS_EXIT([1])],, [[]])
|
2018-11-24 20:57:43 -08:00
|
|
|
if test -z "$ac_c_werror_flag"; then
|
|
|
|
AC_MSG_ERROR([ac_c_werror_flag overwritten])
|
|
|
|
fi
|
2010-06-01 21:54:39 +02:00
|
|
|
]],
|
2000-02-07 17:28:43 +00:00
|
|
|
[AT_CHECK_DEFINES(
|
2010-06-01 21:54:39 +02:00
|
|
|
[#define HAVE_DECL_BASENAM 1
|
|
|
|
#define HAVE_DECL_DIRNAM 0
|
|
|
|
#define HAVE_DECL_MOREARGS 1
|
|
|
|
#define HAVE_DECL_MYENUM 1
|
2006-09-26 20:42:43 +00:00
|
|
|
#define HAVE_DECL_MYFUNC 1
|
|
|
|
#define HAVE_DECL_MYMACRO1 1
|
|
|
|
#define HAVE_DECL_MYMACRO2 1
|
|
|
|
#define HAVE_DECL_MYSTRUCT 1
|
|
|
|
#define HAVE_DECL_NO 0
|
2015-05-13 21:11:47 -04:00
|
|
|
#define HAVE_DECL_STRERROR 0
|
2000-02-15 09:33:59 +00:00
|
|
|
#define HAVE_DECL_YES 1
|
2000-02-07 17:28:43 +00:00
|
|
|
])])
|
|
|
|
|
|
|
|
|
2000-03-25 09:06:24 +00:00
|
|
|
# AC_CHECK_FUNCS
|
|
|
|
# --------------
|
|
|
|
# Check that it performs the correct actions:
|
2001-01-11 15:17:13 +00:00
|
|
|
# Must define HAVE_PRINTF, but not HAVE_AUTOCONF_FTNIRP
|
2000-11-03 11:59:39 +00:00
|
|
|
AT_CHECK_MACRO([AC_CHECK_FUNCS],
|
2001-01-11 15:17:13 +00:00
|
|
|
[AC_CHECK_FUNCS(printf autoconf_ftnirp)],
|
2000-11-03 11:59:39 +00:00
|
|
|
[AT_CHECK_DEFINES(
|
2001-01-11 15:17:13 +00:00
|
|
|
[/* #undef HAVE_AUTOCONF_FTNIRP */
|
|
|
|
#define HAVE_PRINTF 1
|
2000-11-03 11:59:39 +00:00
|
|
|
])])
|
|
|
|
|
|
|
|
|
2001-02-05 10:16:32 +00:00
|
|
|
# AC_REPLACE_FUNCS
|
|
|
|
# ----------------
|
|
|
|
# Check that it performs the correct actions: autoconf_ftnirp.c must
|
|
|
|
# be compiled, and must define HAVE_PRINTF, but not HAVE_AUTOCONF_FTNIRP
|
|
|
|
# FIXME: Maybe check the traces?
|
|
|
|
AT_SETUP([AC_REPLACE_FUNCS])
|
|
|
|
|
|
|
|
AT_DATA([config.in],
|
|
|
|
[@LIBOBJS@
|
|
|
|
])
|
|
|
|
|
|
|
|
AT_CONFIGURE_AC(
|
2010-09-21 17:00:09 -06:00
|
|
|
[AC_CONFIG_FILES([config.libobjs:config.in])
|
2010-09-22 15:55:26 -06:00
|
|
|
AC_REPLACE_FUNCS([printf \
|
|
|
|
autoconf_ftnirp])
|
2011-06-30 09:13:41 -07:00
|
|
|
funcs='fprintf fopen autoconf_ftnirpf'
|
|
|
|
AH_TEMPLATE([HAVE_FOPEN], [])
|
2010-09-21 17:00:09 -06:00
|
|
|
AH_TEMPLATE([HAVE_FPRINTF], [])
|
|
|
|
AH_TEMPLATE([HAVE_AUTOCONF_FTNIRPF], [])
|
2010-09-22 15:55:26 -06:00
|
|
|
AC_REPLACE_FUNCS([\
|
|
|
|
$funcs])
|
2010-09-21 17:00:09 -06:00
|
|
|
AS_UNSET([funcs])])
|
2001-02-05 10:16:32 +00:00
|
|
|
|
|
|
|
AT_CHECK_AUTOCONF([-W obsolete])
|
|
|
|
AT_CHECK_AUTOHEADER
|
|
|
|
AT_CHECK_CONFIGURE
|
|
|
|
AT_CHECK_ENV
|
|
|
|
AT_CHECK_DEFINES(
|
|
|
|
[/* #undef HAVE_AUTOCONF_FTNIRP */
|
2010-09-21 17:00:09 -06:00
|
|
|
/* #undef HAVE_AUTOCONF_FTNIRPF */
|
2011-06-30 09:13:41 -07:00
|
|
|
#define HAVE_FOPEN 1
|
2010-09-21 17:00:09 -06:00
|
|
|
#define HAVE_FPRINTF 1
|
2001-02-05 10:16:32 +00:00
|
|
|
#define HAVE_PRINTF 1
|
|
|
|
])
|
|
|
|
|
|
|
|
AT_CHECK([sed 's/ */ /g;s/^ //;s/ $//' config.libobjs], [],
|
2010-09-21 17:00:09 -06:00
|
|
|
[${LIBOBJDIR}autoconf_ftnirp$U.o ${LIBOBJDIR}autoconf_ftnirpf$U.o
|
2001-02-05 10:16:32 +00:00
|
|
|
])
|
|
|
|
|
2007-05-16 09:42:25 +00:00
|
|
|
AT_CLEANUP
|
2001-02-05 10:16:32 +00:00
|
|
|
|
|
|
|
|
2000-03-25 09:06:24 +00:00
|
|
|
# AC_CHECK_HEADERS
|
|
|
|
# ----------------
|
|
|
|
# Check that it performs the correct actions:
|
|
|
|
# Must define HAVE_STDIO_H, but not HAVE_AUTOCONF_IO_H.
|
2008-11-06 10:54:51 +01:00
|
|
|
AT_SETUP([AC_CHECK_HEADERS])
|
|
|
|
|
|
|
|
AT_DATA([autoconf_io.h],
|
|
|
|
[blah blah
|
|
|
|
])
|
|
|
|
|
|
|
|
AT_CONFIGURE_AC([AC_CHECK_HEADERS(stdio.h autoconf_io.h)])
|
|
|
|
AT_CHECK_AUTOCONF([-W obsolete])
|
|
|
|
AT_CHECK_AUTOHEADER
|
2013-09-13 20:42:04 -04:00
|
|
|
AT_CHECK_CONFIGURE([CPPFLAGS=-I.])
|
2008-11-06 10:54:51 +01:00
|
|
|
AT_CHECK_ENV
|
|
|
|
AT_CHECK_DEFINES(
|
2000-02-07 17:28:43 +00:00
|
|
|
[/* #undef HAVE_AUTOCONF_IO_H */
|
|
|
|
#define HAVE_STDIO_H 1
|
2008-11-06 10:54:51 +01:00
|
|
|
])
|
|
|
|
|
|
|
|
AT_CLEANUP
|
2000-02-07 17:28:43 +00:00
|
|
|
|
|
|
|
|
2003-05-18 14:48:02 +00:00
|
|
|
# AC_CHECK_HEADERS_OLD
|
|
|
|
# --------------------
|
|
|
|
# Check that it performs the correct actions:
|
|
|
|
# Must not check prerequisites, hence define header2.h
|
2008-10-31 16:53:17 +01:00
|
|
|
AT_SETUP([AC_CHECK_HEADERS (preprocessor test)])
|
2003-05-18 14:48:02 +00:00
|
|
|
|
|
|
|
AT_DATA([header1.h],
|
|
|
|
[typedef int foo;
|
|
|
|
])
|
|
|
|
|
|
|
|
AT_DATA([header2.h],
|
|
|
|
[typedef foo bar;
|
|
|
|
])
|
|
|
|
|
2005-02-05 04:55:08 +00:00
|
|
|
AT_CONFIGURE_AC([AC_CHECK_HEADERS(header2.h, [], [], -)])
|
2003-05-18 14:48:02 +00:00
|
|
|
|
2013-09-13 20:42:04 -04:00
|
|
|
AT_CHECK_AUTOCONF([-W obsolete], [], [], [stderr])
|
|
|
|
AT_CHECK([[grep '^configure\.ac' stderr]], [0],
|
|
|
|
[configure.ac:4: warning: Checking for headers with the preprocessor is
|
|
|
|
configure.ac:4: deprecated. Specify prerequisite code to AC_CHECK_HEADER
|
|
|
|
configure.ac:4: instead of using fourth argument `-'. (Many headers need
|
|
|
|
configure.ac:4: no prerequisites. If you truly need to test whether
|
|
|
|
configure.ac:4: something passes the preprocessor but not the compiler,
|
|
|
|
configure.ac:4: use AC_PREPROC_IFELSE.)
|
|
|
|
configure.ac:4: the top level
|
|
|
|
])
|
2003-05-18 14:48:02 +00:00
|
|
|
AT_CHECK_AUTOHEADER
|
2005-02-05 04:55:08 +00:00
|
|
|
AT_CHECK_CONFIGURE([CPPFLAGS=-I.])
|
2003-05-18 14:48:02 +00:00
|
|
|
AT_CHECK_ENV
|
|
|
|
AT_CHECK_DEFINES(
|
|
|
|
[#define HAVE_HEADER2_H 1
|
|
|
|
])
|
|
|
|
|
2007-05-16 09:42:25 +00:00
|
|
|
AT_CLEANUP
|
2003-05-18 14:48:02 +00:00
|
|
|
|
|
|
|
|
|
|
|
# AC_CHECK_HEADERS_NEW
|
|
|
|
# --------------------
|
|
|
|
# Check that it performs the correct actions:
|
|
|
|
# Must check prerequisites, hence define header2.h but not header3.h
|
2008-10-31 16:53:17 +01:00
|
|
|
AT_SETUP([AC_CHECK_HEADERS (compiler test)])
|
2003-05-18 14:48:02 +00:00
|
|
|
|
|
|
|
AT_DATA([header1.h],
|
|
|
|
[typedef int foo;
|
|
|
|
])
|
|
|
|
|
|
|
|
AT_DATA([header2.h],
|
|
|
|
[typedef foo bar;
|
|
|
|
])
|
|
|
|
|
|
|
|
AT_DATA([header3.h],
|
|
|
|
[typedef bar wow;
|
|
|
|
])
|
|
|
|
|
|
|
|
AT_CONFIGURE_AC(
|
2005-02-05 04:55:08 +00:00
|
|
|
[AC_CHECK_HEADERS(header2.h header3.h, [], [], [[@%:@include "header1.h"]])])
|
2003-05-18 14:48:02 +00:00
|
|
|
|
|
|
|
AT_CHECK_AUTOCONF([-W obsolete])
|
|
|
|
AT_CHECK_AUTOHEADER
|
2005-02-05 04:55:08 +00:00
|
|
|
AT_CHECK_CONFIGURE([CPPFLAGS=-I.])
|
2003-05-18 14:48:02 +00:00
|
|
|
AT_CHECK_ENV
|
|
|
|
AT_CHECK_DEFINES(
|
|
|
|
[#define HAVE_HEADER2_H 1
|
|
|
|
/* #undef HAVE_HEADER3_H */
|
|
|
|
])
|
|
|
|
|
2007-05-16 09:42:25 +00:00
|
|
|
AT_CLEANUP
|
2003-05-18 14:48:02 +00:00
|
|
|
|
|
|
|
|
2009-08-10 20:35:12 +02:00
|
|
|
# AC_CHECK_MEMBER
|
Formatting cleanups in macro comments.
For a list of candidate unaligned underlines, use this script:
for f in `git ls-files`; do
awk '{ len[NR] = length($0) }
/----*/ && len[NR-1] != 0 {
if (len[NR-1] != len[NR])
print FILENAME ":" NR ":" $0
}' $f
done
* lib/autoconf/c.m4, lib/autoconf/erlang.m4,
lib/autoconf/fortran.m4, lib/autoconf/functions.m4,
lib/autoconf/general.m4, lib/autoconf/lang.m4,
lib/autoconf/programs.m4, lib/autoconf/specific.m4,
lib/autoconf/status.m4, lib/autoconf/types.m4,
lib/autotest/general.m4, lib/autotest/specific.m4,
lib/m4sugar/m4sh.m4, lib/m4sugar/m4sugar.m4,
tests/autotest.at, tests/local.at, tests/m4sh.at,
tests/semantics.at, tests/tools.at, tests/torture.at: Fix macro
comment format.
Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2010-03-12 06:58:46 +01:00
|
|
|
# ---------------
|
2009-08-10 20:35:12 +02:00
|
|
|
# Check that it performs the correct actions.
|
|
|
|
# Must define HAVE_STRUCT_YES_S_YES, but not HAVE_STRUCT_YES_S_NO.
|
|
|
|
AT_CHECK_MACRO([AC_CHECK_MEMBER],
|
|
|
|
[[AC_CHECK_MEMBER([struct yes_s.yes],
|
|
|
|
[AC_DEFINE([HAVE_STRUCT_YES_S_YES], [1],
|
|
|
|
[Define to 1 if `yes' is a member of `struct yes_s'.])],,
|
|
|
|
[struct sub { int x; };
|
|
|
|
struct yes_s { int yes; struct sub substruct; };])
|
|
|
|
AC_CHECK_MEMBER([struct yes_s.no],
|
|
|
|
[AC_DEFINE([HAVE_STRUCT_YES_S_NO], [1],
|
|
|
|
[Define to 1 if `no' is a member of `struct yes_s'.])],,
|
|
|
|
[struct sub { int x; };
|
|
|
|
struct yes_s { int yes; struct sub substruct; };])
|
|
|
|
AC_CHECK_MEMBER([struct yes_s.substruct],
|
|
|
|
[AC_DEFINE([HAVE_STRUCT_YES_S_SUBSTRUCT], [1],
|
|
|
|
[Define to 1 if `substruct' is a member of `struct yes_s'.])],,
|
|
|
|
[struct sub { int x; };
|
|
|
|
struct yes_s { int yes; struct sub substruct; };])]],
|
|
|
|
[AT_CHECK_DEFINES(
|
|
|
|
[/* #undef HAVE_STRUCT_YES_S_NO */
|
|
|
|
#define HAVE_STRUCT_YES_S_SUBSTRUCT 1
|
|
|
|
#define HAVE_STRUCT_YES_S_YES 1
|
|
|
|
])])
|
|
|
|
|
2000-03-25 09:06:24 +00:00
|
|
|
# AC_CHECK_MEMBERS
|
|
|
|
# ----------------
|
|
|
|
# Check that it performs the correct actions.
|
2000-04-11 12:07:45 +00:00
|
|
|
# Must define HAVE_STRUCT_YES_S_YES, but not HAVE_STRUCT_YES_S_NO.
|
2000-11-29 10:11:38 +00:00
|
|
|
AT_CHECK_MACRO([AC_CHECK_MEMBERS],
|
2006-09-26 18:07:16 +00:00
|
|
|
[[AC_CHECK_MEMBERS([struct yes_s.yes, struct yes_s.no, struct yes_s.substruct],,,
|
|
|
|
[struct sub { int x; };
|
|
|
|
struct yes_s { int yes; struct sub substruct; };])]],
|
2000-02-07 17:28:43 +00:00
|
|
|
[AT_CHECK_DEFINES(
|
2000-04-11 12:07:45 +00:00
|
|
|
[/* #undef HAVE_STRUCT_YES_S_NO */
|
2006-09-26 18:07:16 +00:00
|
|
|
#define HAVE_STRUCT_YES_S_SUBSTRUCT 1
|
2000-04-11 12:07:45 +00:00
|
|
|
#define HAVE_STRUCT_YES_S_YES 1
|
2009-08-10 20:35:12 +02:00
|
|
|
])
|
|
|
|
AT_CHECK([grep 'yes.*member of.*yes_s' config.h], [], [ignore])
|
|
|
|
])
|
2000-02-07 11:54:29 +00:00
|
|
|
|
|
|
|
|
2004-03-15 22:00:05 +00:00
|
|
|
# AC_CHECK_ALIGNOF
|
|
|
|
# ----------------
|
2006-03-17 18:03:01 +00:00
|
|
|
AT_CHECK_MACRO_CROSS([AC_CHECK_ALIGNOF],
|
2004-03-15 22:00:05 +00:00
|
|
|
[[AC_CHECK_ALIGNOF(char)
|
|
|
|
AC_CHECK_ALIGNOF(charchar,
|
|
|
|
[[#include <stddef.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
typedef char charchar[2];]])
|
|
|
|
AC_CHECK_ALIGNOF(charcharchar)
|
|
|
|
]],
|
|
|
|
[AT_CHECK_DEFINES(
|
|
|
|
[#define ALIGNOF_CHAR 1
|
|
|
|
#define ALIGNOF_CHARCHAR 1
|
|
|
|
#define ALIGNOF_CHARCHARCHAR 0
|
|
|
|
])])
|
|
|
|
|
|
|
|
|
2006-03-11 13:22:42 +00:00
|
|
|
# AC_CHECK_ALIGNOF struct
|
|
|
|
# -----------------------
|
2006-03-17 18:03:01 +00:00
|
|
|
AT_CHECK_MACRO_CROSS([AC_CHECK_ALIGNOF struct],
|
2006-03-11 13:22:42 +00:00
|
|
|
[[AC_CHECK_ALIGNOF([struct { char c; }])
|
|
|
|
AC_CHECK_ALIGNOF([struct nosuchstruct])
|
|
|
|
]],
|
2010-07-06 22:00:44 +02:00
|
|
|
[AT_CHECK([[grep "#define ALIGNOF_STRUCT___CHAR_C___ [1-9]" config.h]],
|
2006-03-11 13:22:42 +00:00
|
|
|
0, ignore)
|
|
|
|
AT_CHECK([[grep "#define ALIGNOF_STRUCT_NOSUCHSTRUCT 0" config.h]],
|
|
|
|
0, ignore)
|
|
|
|
])
|
|
|
|
|
2000-03-25 09:06:24 +00:00
|
|
|
# AC_CHECK_SIZEOF
|
2000-04-11 12:07:45 +00:00
|
|
|
# ---------------
|
2006-03-17 18:03:01 +00:00
|
|
|
AT_CHECK_MACRO_CROSS([AC_CHECK_SIZEOF],
|
2000-11-29 14:14:10 +00:00
|
|
|
[[AC_CHECK_SIZEOF(char)
|
2000-02-07 17:28:43 +00:00
|
|
|
AC_CHECK_SIZEOF(charchar,,
|
2000-11-29 14:14:10 +00:00
|
|
|
[[#include <stdio.h>
|
|
|
|
typedef char charchar[2];]])
|
2000-05-26 11:33:54 +00:00
|
|
|
AC_CHECK_SIZEOF(charcharchar)
|
2002-01-30 15:11:49 +00:00
|
|
|
]],
|
|
|
|
[AT_CHECK_DEFINES(
|
|
|
|
[#define SIZEOF_CHAR 1
|
|
|
|
#define SIZEOF_CHARCHAR 2
|
|
|
|
#define SIZEOF_CHARCHARCHAR 0
|
|
|
|
])])
|
|
|
|
|
2000-05-26 11:33:54 +00:00
|
|
|
|
2006-03-17 18:03:01 +00:00
|
|
|
# AC_CHECK_SIZEOF struct
|
|
|
|
# ----------------------
|
|
|
|
AT_CHECK_MACRO_CROSS([AC_CHECK_SIZEOF struct],
|
2006-03-11 13:22:42 +00:00
|
|
|
[[AC_C_CONST
|
2007-04-13 07:52:57 +00:00
|
|
|
AC_CHECK_SIZEOF([struct x], [], [struct x { char c; int x; };])
|
|
|
|
AC_CHECK_SIZEOF([const struct x], [], [struct x { const char *p; int x; };])
|
2006-03-11 13:22:42 +00:00
|
|
|
AC_CHECK_SIZEOF([struct nosuchstruct])
|
2010-07-06 22:00:44 +02:00
|
|
|
# Taken from autoconf.texi:Generic Compiler Characteristics.
|
|
|
|
AC_CHECK_SIZEOF([int *])
|
2006-03-11 13:22:42 +00:00
|
|
|
]],
|
2010-07-06 22:00:44 +02:00
|
|
|
[AT_CHECK([[grep "#define SIZEOF_STRUCT_X [1-9]" config.h]],
|
2006-03-11 13:22:42 +00:00
|
|
|
0, ignore)
|
2010-07-06 22:00:44 +02:00
|
|
|
AT_CHECK([[grep "#define SIZEOF_CONST_STRUCT_X [1-9]" config.h]],
|
2006-03-11 13:22:42 +00:00
|
|
|
0, ignore)
|
|
|
|
AT_CHECK([[grep "#define SIZEOF_STRUCT_NOSUCHSTRUCT 0" config.h]],
|
|
|
|
0, ignore)
|
2010-07-06 22:00:44 +02:00
|
|
|
AT_CHECK([[grep "#define SIZEOF_INT_P [1-9]" config.h]],
|
|
|
|
0, ignore)
|
2006-03-11 13:22:42 +00:00
|
|
|
])
|
|
|
|
|
|
|
|
|
2000-03-25 09:06:24 +00:00
|
|
|
# AC_CHECK_TYPES
|
|
|
|
# --------------
|
|
|
|
# Check that it performs the correct actions.
|
2000-04-11 12:07:45 +00:00
|
|
|
# Must define HAVE_STRUCT_YES_S, HAVE_INT, but not HAVE_STRUCT_NO_S.
|
|
|
|
# `int' and `struct yes_s' are both checked to test both the compiler
|
2000-03-25 09:06:24 +00:00
|
|
|
# builtin types, and defined types.
|
2000-11-29 10:11:38 +00:00
|
|
|
AT_CHECK_MACRO([AC_CHECK_TYPES],
|
2000-05-10 16:16:31 +00:00
|
|
|
[[AC_CHECK_TYPES([int, struct yes_s, struct no_s],,,
|
* aclocal.m4, bin/autoconf.as, lib/autoconf/autoconf.m4,
* lib/autoconf/autoheader.m4, lib/autoconf/autoupdate.m4,
* lib/autoconf/c.m4, lib/autoconf/fortran.m4,
* lib/autoconf/general.m4, lib/autoconf/headers.m4,
* lib/autoconf/lang.m4, lib/autoconf/libs.m4,
* lib/autoconf/programs.m4, lib/autoconf/specific.m4,
* lib/autoconf/status.m4, lib/autoconf/types.m4,
* lib/autotest/general.m4, lib/m4sugar/m4sugar.m4,
* tests/atspecific.m4, tests/base.at, tests/compile.at,
* tests/foreign.at, tests/m4sh.at, tests/semantics.at,
* tests/tools.at, tests/torture.at:
Whitespace clean up.
Suggested by Jim Meyering.
2003-05-22 13:24:04 +00:00
|
|
|
[struct yes_s { int yes ;} ;])]],
|
2000-02-07 17:28:43 +00:00
|
|
|
[AT_CHECK_DEFINES(
|
|
|
|
[#define HAVE_INT 1
|
2000-04-11 12:07:45 +00:00
|
|
|
/* #undef HAVE_STRUCT_NO_S */
|
|
|
|
#define HAVE_STRUCT_YES_S 1
|
2000-02-07 11:54:29 +00:00
|
|
|
])])
|
2000-02-10 09:40:55 +00:00
|
|
|
|
|
|
|
|
2000-03-25 09:06:24 +00:00
|
|
|
# AC_CHECK_TYPES
|
|
|
|
# --------------
|
|
|
|
# Check that we properly dispatch properly to the old implementation
|
|
|
|
# or to the new one.
|
2000-12-14 15:36:47 +00:00
|
|
|
AT_SETUP([AC_CHECK_TYPES: backward compatibility])
|
2000-02-10 10:24:10 +00:00
|
|
|
|
2001-08-20 14:45:09 +00:00
|
|
|
AT_DATA([configure.ac],
|
2000-02-10 10:24:10 +00:00
|
|
|
[[AC_INIT
|
Get rid of the m4 name spaces.
* libm4.m4 (m4_changequote, m4_define, m4_defn, m4_dnl, m4_indir,
m4_popdef, m4_pushdef, m4_undefine, m4_namespace_push,
m4_namespace_pop, m4_namespace_register, m4_namespace_define,
m4_disable, m4_enable): Removed.
All dependencies adjusted.
* libm4.m4: Remove all the name space initialization.
* acgeneral.m4: Adjust.
(AU_DEFINE): Redefine as `AC_DEFUN'.
* autoupdate.m4: Adjust.
* tests/tools.m4: Temporarily disable the `autoupdate' test.
2000-05-11 13:28:47 +00:00
|
|
|
define([_AC_CHECK_TYPE_NEW], [NEW])
|
|
|
|
define([_AC_CHECK_TYPE_OLD], [OLD])
|
2000-02-10 10:24:10 +00:00
|
|
|
#(cut-from-here
|
|
|
|
AC_CHECK_TYPE(ptrdiff_t)
|
|
|
|
AC_CHECK_TYPE(ptrdiff_t, int)
|
2004-03-30 07:55:25 +00:00
|
|
|
AC_CHECK_TYPE(quad, long long int)
|
2000-02-10 10:24:10 +00:00
|
|
|
AC_CHECK_TYPE(table_42, [int[42]])
|
2000-03-25 09:06:24 +00:00
|
|
|
# Nice machine!
|
2000-02-10 10:24:10 +00:00
|
|
|
AC_CHECK_TYPE(uint8_t, uint65536_t)
|
|
|
|
AC_CHECK_TYPE(a,b,c,d)
|
|
|
|
#to-here)
|
|
|
|
AC_OUTPUT
|
|
|
|
]])
|
|
|
|
|
2001-07-17 10:01:09 +00:00
|
|
|
AT_CHECK_AUTOCONF
|
2000-02-17 09:38:08 +00:00
|
|
|
AT_CHECK([[sed -e '/^#(cut-from-here/,/^#to-here)/!d' -e '/^#/d' configure]],
|
* aclocal.m4, bin/autoconf.as, lib/autoconf/autoconf.m4,
* lib/autoconf/autoheader.m4, lib/autoconf/autoupdate.m4,
* lib/autoconf/c.m4, lib/autoconf/fortran.m4,
* lib/autoconf/general.m4, lib/autoconf/headers.m4,
* lib/autoconf/lang.m4, lib/autoconf/libs.m4,
* lib/autoconf/programs.m4, lib/autoconf/specific.m4,
* lib/autoconf/status.m4, lib/autoconf/types.m4,
* lib/autotest/general.m4, lib/m4sugar/m4sugar.m4,
* tests/atspecific.m4, tests/base.at, tests/compile.at,
* tests/foreign.at, tests/m4sh.at, tests/semantics.at,
* tests/tools.at, tests/torture.at:
Whitespace clean up.
Suggested by Jim Meyering.
2003-05-22 13:24:04 +00:00
|
|
|
0,
|
|
|
|
[NEW
|
2000-02-10 10:24:10 +00:00
|
|
|
OLD
|
|
|
|
OLD
|
|
|
|
OLD
|
2001-07-17 10:01:09 +00:00
|
|
|
OLD
|
2000-02-10 10:24:10 +00:00
|
|
|
NEW
|
|
|
|
])
|
|
|
|
|
2000-12-19 08:15:48 +00:00
|
|
|
AT_CLEANUP
|
2000-02-10 10:24:10 +00:00
|
|
|
|
|
|
|
|
2000-03-25 09:06:24 +00:00
|
|
|
# AC_CHECK_FILES
|
|
|
|
# --------------
|
|
|
|
# FIXME: To really test HAVE_AC_EXISTS2 and HAVE_AC_MISSING2 we need to
|
2000-12-23 10:11:57 +00:00
|
|
|
# open AH_TEMPLATE to `configure.ac', which is not yet the case.
|
2000-11-29 10:11:38 +00:00
|
|
|
AT_CHECK_MACRO([AC_CHECK_FILES],
|
2001-01-18 09:30:10 +00:00
|
|
|
[touch at-exists1 at-exists2
|
|
|
|
ac_exists2=at-exists2
|
|
|
|
ac_missing2=at-missing2
|
|
|
|
AC_CHECK_FILES(at-exists1 at-missing1 $ac_exists2 $ac_missing2)
|
|
|
|
rm at-exists1 at-exists2],
|
2000-02-10 09:40:55 +00:00
|
|
|
[AT_CHECK_DEFINES(
|
2001-01-18 09:30:10 +00:00
|
|
|
[#define HAVE_AT_EXISTS1 1
|
|
|
|
/* #undef HAVE_AT_MISSING1 */
|
2000-02-10 09:40:55 +00:00
|
|
|
])])
|
2000-03-03 14:15:41 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
2000-03-21 12:22:27 +00:00
|
|
|
## ------------------------------ ##
|
|
|
|
## AC_CHECK_PROG & AC_PATH_PROG. ##
|
|
|
|
## ------------------------------ ##
|
2000-03-03 14:15:41 +00:00
|
|
|
|
|
|
|
|
2000-10-27 14:15:28 +00:00
|
|
|
# AT_CHECK_PROGS_PREPARE
|
|
|
|
# ----------------------
|
2000-03-03 14:15:41 +00:00
|
|
|
# Create a sub directory `path' with 6 subdirs which all 7 contain
|
|
|
|
# an executable `tool'. `6' contains a `better' tool.
|
2000-11-29 10:11:38 +00:00
|
|
|
m4_define([AT_CHECK_PROGS_PREPARE],
|
2000-10-27 14:15:28 +00:00
|
|
|
[mkdir path
|
2000-03-03 14:15:41 +00:00
|
|
|
|
|
|
|
cat >path/tool <<\EOF
|
|
|
|
#! /bin/sh
|
|
|
|
exit 0
|
|
|
|
EOF
|
|
|
|
chmod +x path/tool
|
|
|
|
|
|
|
|
for i in 1 2 3 4 5 6
|
|
|
|
do
|
|
|
|
mkdir path/$i
|
|
|
|
cp path/tool path/$i
|
|
|
|
done
|
2000-10-27 14:15:28 +00:00
|
|
|
cp path/tool path/6/better])
|
2000-03-03 14:15:41 +00:00
|
|
|
|
2000-03-21 12:22:27 +00:00
|
|
|
|
|
|
|
# -------------------------------- #
|
|
|
|
# AC_CHECK_PROG & AC_CHECK_PROGS. #
|
|
|
|
# -------------------------------- #
|
|
|
|
|
2000-11-29 10:11:38 +00:00
|
|
|
AT_SETUP([AC_CHECK_PROG & AC_CHECK_PROGS])
|
2000-10-27 14:15:28 +00:00
|
|
|
|
|
|
|
AT_CHECK_PROGS_PREPARE
|
|
|
|
|
2001-08-20 14:45:09 +00:00
|
|
|
AT_DATA([configure.ac],
|
2000-03-03 14:15:41 +00:00
|
|
|
[[AC_INIT
|
2000-03-21 12:22:27 +00:00
|
|
|
pwd=`pwd`
|
2001-09-10 07:17:41 +00:00
|
|
|
p="1${PATH_SEPARATOR}2${PATH_SEPARATOR}3${PATH_SEPARATOR}4${PATH_SEPARATOR}5${PATH_SEPARATOR}6"
|
Fix Posix-conformance bugs re use of { command in sed scripts,
and improve the sed-related documentation a bit.
* doc/autoconf.texi (Installation Directory Variables): Use
our own style advice re 's,a,b,' versus 's|a|b|'. Use "Sed"
rather than "sed" when talking about Sed in general.
(Particular Programs): Likewise.
(Coding Style): y is like s with respect to / and ,.
(Limitations of Usual Tools): Document the weird restrictions
that Posix has about { }. Use better quoting.
* lib/autoconf/status.m4 (_AC_OUTPUT_FILES_PREPARE, _AC_OUTPUT_HEADER):
Rewrite to conform to Posix rules about { } in sed scripts.
* lib/m4sugar/m4sh.m4 (AS_DIRNAME_SED, AS_BASENAME_SED): Likewise.
* tests/foreign.at (Libtool): Likewise.
* tests/semantics.at (AC_CHECK_PROG & AC_CHECK_PROGS):
Use our own style advice re 's,a,b,' versus 's|a|b|'.
2006-01-05 21:43:44 +00:00
|
|
|
path=`echo $p | sed -e 's,\([[0-9]]\),'"$pwd"'/path/\1,g'`
|
2000-10-27 14:15:28 +00:00
|
|
|
fail=false
|
2000-03-03 14:15:41 +00:00
|
|
|
|
|
|
|
AC_CHECK_PROG(TOOL1, tool, found, not-found, $path)
|
2000-10-27 14:15:28 +00:00
|
|
|
test "$TOOL1" = found || fail=:
|
2000-03-03 14:15:41 +00:00
|
|
|
|
|
|
|
# Yes, the semantics of this macro is weird.
|
|
|
|
AC_CHECK_PROG(TOOL2, tool,, not-found, $path)
|
2000-10-27 14:15:28 +00:00
|
|
|
test "$TOOL2" = not-found || fail=:
|
2000-03-03 14:15:41 +00:00
|
|
|
|
2000-03-21 12:22:27 +00:00
|
|
|
AC_CHECK_PROG(TOOL3, tool, tool, not-found, $path, $pwd/path/1/tool)
|
2005-03-23 01:01:58 +00:00
|
|
|
test "$TOOL3" = "$pwd/path/2/tool" || fail=:
|
2000-03-03 14:15:41 +00:00
|
|
|
|
2000-03-21 12:22:27 +00:00
|
|
|
AC_CHECK_PROG(TOOL4, better, better, not-found, $path, $pwd/path/1/tool)
|
2000-10-27 14:15:28 +00:00
|
|
|
test "$TOOL4" = better || fail=:
|
2000-03-03 14:15:41 +00:00
|
|
|
|
|
|
|
# When a tool is not found, and no value is given for not-found,
|
|
|
|
# the variable is left empty.
|
|
|
|
AC_CHECK_PROGS(TOOL5, missing,, $path)
|
2000-10-27 14:15:28 +00:00
|
|
|
test -z "$TOOL5" || fail=:
|
2000-03-03 14:15:41 +00:00
|
|
|
|
|
|
|
AC_CHECK_PROGS(TOOL6, missing tool better,, $path)
|
2000-10-27 14:15:28 +00:00
|
|
|
test "$TOOL6" = tool || fail=:
|
2000-03-03 14:15:41 +00:00
|
|
|
|
2001-01-18 09:30:10 +00:00
|
|
|
# No AC-OUTPUT, we don't need config.status.
|
2000-10-27 14:15:28 +00:00
|
|
|
$fail &&
|
|
|
|
AC_MSG_ERROR([[CHECK_PROG failed]])
|
2000-11-01 19:57:54 +00:00
|
|
|
AS_EXIT(0)
|
2000-03-03 14:15:41 +00:00
|
|
|
]])
|
|
|
|
|
2000-11-23 09:52:35 +00:00
|
|
|
AT_CHECK_AUTOCONF
|
|
|
|
AT_CHECK_CONFIGURE
|
2000-03-03 14:15:41 +00:00
|
|
|
|
2007-05-16 09:42:25 +00:00
|
|
|
AT_CLEANUP
|
2000-10-27 14:15:28 +00:00
|
|
|
|
2001-08-12 12:35:50 +00:00
|
|
|
|
2001-08-31 13:32:54 +00:00
|
|
|
|
|
|
|
## ---------------- ##
|
|
|
|
## AC_C_BIGENDIAN. ##
|
|
|
|
## ---------------- ##
|
|
|
|
|
2005-02-05 08:28:35 +00:00
|
|
|
AT_SETUP([AC_C_BIGENDIAN])
|
2001-09-13 06:53:19 +00:00
|
|
|
AT_KEYWORDS([cross])
|
2001-08-12 12:35:50 +00:00
|
|
|
|
|
|
|
# Make sure that AC_C_BIGENDIAN behave the same whether we are
|
2001-08-12 15:20:29 +00:00
|
|
|
# cross-compiling or not.
|
|
|
|
|
|
|
|
_AT_CHECK_AC_MACRO(
|
2007-03-01 00:18:28 +00:00
|
|
|
[[AC_C_BIGENDIAN(
|
|
|
|
[ac_endian=big],
|
|
|
|
[ac_endian=little],
|
|
|
|
[ac_endian=unknown],
|
|
|
|
[ac_endian=universal])
|
2001-08-12 15:20:29 +00:00
|
|
|
echo $ac_endian > at-endian
|
2005-09-27 16:08:10 +00:00
|
|
|
]])
|
2001-08-12 12:35:50 +00:00
|
|
|
|
|
|
|
rm -f config.hin # So that next run of autoheader is quiet.
|
|
|
|
_AT_CHECK_AC_MACRO(
|
2006-03-17 20:37:26 +00:00
|
|
|
[[# Force cross compiling.
|
|
|
|
cross_compiling=yes
|
|
|
|
ac_tool_warned=yes
|
2007-03-01 00:18:28 +00:00
|
|
|
AC_C_BIGENDIAN(
|
|
|
|
[ac_endian=big],
|
|
|
|
[ac_endian=little],
|
|
|
|
[ac_endian=unknown],
|
|
|
|
[ac_endian=universal])
|
2001-08-12 15:20:29 +00:00
|
|
|
ac_prevendian=`cat at-endian`
|
2002-06-27 07:50:42 +00:00
|
|
|
# Check that we have found the same result as in the previous run
|
2001-08-12 15:20:29 +00:00
|
|
|
# or unknown (because the cross-compiling check is allowed to fail;
|
|
|
|
# although it might be interesting to suppress this comparison, just
|
|
|
|
# to know on which system it fails if it ever does).
|
2002-06-27 07:50:42 +00:00
|
|
|
if test $ac_endian != $ac_prevendian && test $ac_endian != unknown; then
|
2001-08-12 15:20:29 +00:00
|
|
|
AC_MSG_ERROR([unexpected endianness: first run found '$ac_prevendian' but second run found '$ac_endian'])
|
|
|
|
fi
|
2005-09-27 16:08:10 +00:00
|
|
|
]])
|
2001-08-12 12:35:50 +00:00
|
|
|
|
2007-03-01 00:18:28 +00:00
|
|
|
# Make sure AC_C_BIGENDIAN with no argument will create a config.h template
|
|
|
|
# containing "WORDS_BIGENDIAN".
|
2005-09-27 16:08:10 +00:00
|
|
|
AT_CONFIGURE_AC([[AC_C_BIGENDIAN]])
|
|
|
|
# --force is necessary, the computer might be too fast.
|
|
|
|
AT_CHECK_AUTOHEADER([--force])
|
2001-08-12 12:35:50 +00:00
|
|
|
AT_CHECK([grep WORDS_BIGENDIAN config.hin], [], [ignore])
|
|
|
|
|
2007-05-16 09:42:25 +00:00
|
|
|
AT_CLEANUP
|
2000-03-21 12:22:27 +00:00
|
|
|
|
2001-08-31 13:32:54 +00:00
|
|
|
|
2000-03-21 12:22:27 +00:00
|
|
|
# ------------------------------ #
|
|
|
|
# AC_PATH_PROG & AC_PATH_PROGS. #
|
|
|
|
# ------------------------------ #
|
|
|
|
|
2005-02-05 08:28:35 +00:00
|
|
|
AT_SETUP([AC_PATH_PROG & AC_PATH_PROGS])
|
2000-10-27 14:15:28 +00:00
|
|
|
|
|
|
|
AT_CHECK_PROGS_PREPARE
|
|
|
|
|
2001-08-20 14:45:09 +00:00
|
|
|
AT_DATA([configure.ac],
|
2000-03-21 12:22:27 +00:00
|
|
|
[[AC_INIT
|
|
|
|
pwd=`pwd`
|
2001-09-10 07:17:41 +00:00
|
|
|
p="1${PATH_SEPARATOR}2${PATH_SEPARATOR}3${PATH_SEPARATOR}4${PATH_SEPARATOR}5${PATH_SEPARATOR}6"
|
Fix Posix-conformance bugs re use of { command in sed scripts,
and improve the sed-related documentation a bit.
* doc/autoconf.texi (Installation Directory Variables): Use
our own style advice re 's,a,b,' versus 's|a|b|'. Use "Sed"
rather than "sed" when talking about Sed in general.
(Particular Programs): Likewise.
(Coding Style): y is like s with respect to / and ,.
(Limitations of Usual Tools): Document the weird restrictions
that Posix has about { }. Use better quoting.
* lib/autoconf/status.m4 (_AC_OUTPUT_FILES_PREPARE, _AC_OUTPUT_HEADER):
Rewrite to conform to Posix rules about { } in sed scripts.
* lib/m4sugar/m4sh.m4 (AS_DIRNAME_SED, AS_BASENAME_SED): Likewise.
* tests/foreign.at (Libtool): Likewise.
* tests/semantics.at (AC_CHECK_PROG & AC_CHECK_PROGS):
Use our own style advice re 's,a,b,' versus 's|a|b|'.
2006-01-05 21:43:44 +00:00
|
|
|
path=`echo $p | sed -e 's,\([[0-9]]\),'"$pwd"'/path/\1,g'`
|
2000-10-27 14:15:28 +00:00
|
|
|
fail=false
|
2000-03-21 12:22:27 +00:00
|
|
|
|
|
|
|
AC_PATH_PROG(TOOL1, tool, not-found, $path)
|
2005-03-23 01:01:58 +00:00
|
|
|
test "$TOOL1" = "$pwd/path/1/tool" || fail=:
|
2000-03-21 12:22:27 +00:00
|
|
|
|
|
|
|
AC_PATH_PROG(TOOL2, better, not-found, $path)
|
2005-03-23 01:01:58 +00:00
|
|
|
test "$TOOL2" = "$pwd/path/6/better" || fail=:
|
2000-03-21 12:22:27 +00:00
|
|
|
|
|
|
|
# When a tool is not found, and no value is given for not-found,
|
|
|
|
# the variable is left empty.
|
|
|
|
AC_PATH_PROGS(TOOL3, missing,, $path)
|
2000-10-27 14:15:28 +00:00
|
|
|
test -z "$TOOL3" || fail=:
|
2000-03-21 12:22:27 +00:00
|
|
|
|
|
|
|
AC_PATH_PROGS(TOOL4, missing tool better,, $path)
|
2005-03-23 01:01:58 +00:00
|
|
|
test "$TOOL4" = "$pwd/path/1/tool" || fail=:
|
2000-03-21 12:22:27 +00:00
|
|
|
|
2001-01-18 09:30:10 +00:00
|
|
|
# No AC-OUTPUT, we don't need config.status.
|
2000-10-27 14:15:28 +00:00
|
|
|
$fail &&
|
|
|
|
AC_MSG_ERROR([[PATH_PROG failed]])
|
2000-11-01 19:57:54 +00:00
|
|
|
AS_EXIT(0)
|
2000-03-21 12:22:27 +00:00
|
|
|
]])
|
|
|
|
|
2000-11-23 09:52:35 +00:00
|
|
|
AT_CHECK_AUTOCONF
|
|
|
|
AT_CHECK_CONFIGURE
|
2000-03-21 12:22:27 +00:00
|
|
|
|
2007-05-16 09:42:25 +00:00
|
|
|
AT_CLEANUP
|
Eradicate AC_TRY_COMPILE.
* aclang.m4 (AC_PROG_CC_STDC, AC_C_BIGENDIAN, AC_C_INLINE,
AC_C_CONST, AC_C_VOLATILE, AC_F77_NAME_MANGLING): Use
`AC_COMPILE_IFELSE'.
* acspecific.m4 (AC_DECL_SYS_SIGLIST, _AC_CHECK_HEADER_DIRENT,
AC_HEADER_SYS_WAIT, AC_HEADER_TIME, AC_TYPE_SIGNAL,
AC_FUNC_GETLOADAVG, AC_FUNC_SELECT_ARGTYPES, AC_STRUCT_TM,
AC_CYGWIN, AC_MINGW32, AC_EMXOS2): Likewise.
* tests/semantics.m4 (C keywords): Check that AC_C_CONST,
AC_C_VOLATILE, and AC_C_INLINE function properly with GCC.
2000-05-11 13:09:05 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
2007-09-08 14:48:49 +00:00
|
|
|
# ----------------------------- #
|
|
|
|
# AC_PATH_PROGS_FEATURE_CHECK. #
|
|
|
|
# ----------------------------- #
|
|
|
|
|
|
|
|
AT_SETUP([AC_PATH_PROGS_FEATURE_CHECK])
|
|
|
|
|
2007-12-04 22:49:06 +01:00
|
|
|
# This test doesn't work if `pwd` contains white space
|
|
|
|
case `pwd` in
|
|
|
|
*\ * | *\ *) AT_CHECK([exit 77]) ;;
|
|
|
|
esac
|
|
|
|
|
2007-09-08 14:48:49 +00:00
|
|
|
AT_CHECK_PROGS_PREPARE
|
|
|
|
|
|
|
|
AT_DATA([configure.ac],
|
|
|
|
[[AC_INIT
|
|
|
|
pwd=`pwd`
|
|
|
|
p="1${PATH_SEPARATOR}2${PATH_SEPARATOR}3${PATH_SEPARATOR}4${PATH_SEPARATOR}5${PATH_SEPARATOR}6"
|
|
|
|
path=`echo $p | sed -e 's,\([[0-9]]\),'"$pwd"'/path/\1,g'`
|
|
|
|
fail=false
|
|
|
|
|
|
|
|
# Find first candidate and stop search
|
|
|
|
AC_PATH_PROGS_FEATURE_CHECK(TOOL1, [tool better],
|
|
|
|
[$ac_path_TOOL1 && ac_cv_path_TOOL1=$ac_path_TOOL1 ac_path_TOOL1_found=:],
|
|
|
|
fail=:, $path)
|
|
|
|
test -z "$TOOL1" || fail=:
|
|
|
|
test "$ac_cv_path_TOOL1" = "$pwd/path/1/tool" || fail=:
|
|
|
|
|
|
|
|
# Keep searching each candidate
|
|
|
|
AC_PATH_PROGS_FEATURE_CHECK(TOOL2, [tool better],
|
|
|
|
[$ac_path_TOOL2 && ac_cv_path_TOOL2=$ac_path_TOOL2],
|
|
|
|
fail=:, $path)
|
|
|
|
test "$ac_cv_path_TOOL2" = "$pwd/path/6/better" || fail=:
|
|
|
|
|
|
|
|
# Only accept better candidate
|
|
|
|
AC_PATH_PROGS_FEATURE_CHECK(TOOL3, [tool better],
|
|
|
|
[case "$ac_path_TOOL3" in #(
|
|
|
|
*better) ac_cv_path_TOOL3=$ac_path_TOOL3;;
|
|
|
|
esac],
|
|
|
|
fail=:, $path)
|
|
|
|
test "$ac_cv_path_TOOL3" = "$pwd/path/6/better" || fail=:
|
|
|
|
|
|
|
|
# When a tool is not found, and no action is given for not-found,
|
|
|
|
# the variable is left empty.
|
|
|
|
AC_PATH_PROGS_FEATURE_CHECK(TOOL4, missing,
|
|
|
|
[ac_cv_path_TOOL4=$ac_path_TOOL4], [], $path)
|
|
|
|
test -z "$ac_cv_path_TOOL4" || fail=:
|
|
|
|
|
|
|
|
# Test action when tool is not found
|
|
|
|
AC_PATH_PROGS_FEATURE_CHECK(TOOL5, missing, [],
|
|
|
|
[ac_cv_path_TOOL5='not found'], $path)
|
|
|
|
test "$ac_cv_path_TOOL5" = "not found" || fail=:
|
|
|
|
|
|
|
|
# Test that pre-set tool bypasses feature test
|
|
|
|
TOOL6=$pwd/path/6/better
|
|
|
|
AC_PATH_PROGS_FEATURE_CHECK(TOOL6, tool, fail=:, fail=:, $path)
|
|
|
|
test "$ac_cv_path_TOOL6" = "$pwd/path/6/better" || fail=:
|
|
|
|
|
|
|
|
# A blank pre-set does not bypass feature test
|
|
|
|
TOOL7=
|
|
|
|
AC_PATH_PROGS_FEATURE_CHECK(TOOL7, [tool better],
|
|
|
|
[$ac_path_TOOL7 && ac_cv_path_TOOL7=$ac_path_TOOL7 ac_path_TOOL7_found=:],
|
|
|
|
fail=:, $path)
|
|
|
|
test -z "$TOOL7" || fail=:
|
|
|
|
test "$ac_cv_path_TOOL7" = "$pwd/path/1/tool" || fail=:
|
|
|
|
|
|
|
|
# No AC-OUTPUT, we don't need config.status.
|
|
|
|
$fail &&
|
|
|
|
AC_MSG_ERROR([[PATH_PROG failed]])
|
|
|
|
AS_EXIT(0)
|
|
|
|
]])
|
|
|
|
|
|
|
|
AT_CHECK_AUTOCONF
|
|
|
|
AT_CHECK_CONFIGURE
|
|
|
|
|
|
|
|
AT_CLEANUP
|
|
|
|
|
|
|
|
|
|
|
|
|
Eradicate AC_TRY_COMPILE.
* aclang.m4 (AC_PROG_CC_STDC, AC_C_BIGENDIAN, AC_C_INLINE,
AC_C_CONST, AC_C_VOLATILE, AC_F77_NAME_MANGLING): Use
`AC_COMPILE_IFELSE'.
* acspecific.m4 (AC_DECL_SYS_SIGLIST, _AC_CHECK_HEADER_DIRENT,
AC_HEADER_SYS_WAIT, AC_HEADER_TIME, AC_TYPE_SIGNAL,
AC_FUNC_GETLOADAVG, AC_FUNC_SELECT_ARGTYPES, AC_STRUCT_TM,
AC_CYGWIN, AC_MINGW32, AC_EMXOS2): Likewise.
* tests/semantics.m4 (C keywords): Check that AC_C_CONST,
AC_C_VOLATILE, and AC_C_INLINE function properly with GCC.
2000-05-11 13:09:05 +00:00
|
|
|
|
2000-12-07 15:21:54 +00:00
|
|
|
## -------------- ##
|
|
|
|
## AC_PATH_XTRA. ##
|
|
|
|
## -------------- ##
|
|
|
|
|
|
|
|
|
|
|
|
AT_SETUP([AC_PATH_XTRA])
|
|
|
|
|
|
|
|
_AT_CHECK_AC_MACRO([AC_PATH_XTRA])
|
|
|
|
|
|
|
|
# Check X_DISPLAY_MISSING.
|
2000-12-19 08:15:48 +00:00
|
|
|
AT_CHECK_CONFIGURE([--without-x])
|
2000-12-07 15:21:54 +00:00
|
|
|
AT_CHECK_DEFINES(
|
|
|
|
[#define X_DISPLAY_MISSING 1
|
|
|
|
])
|
|
|
|
|
|
|
|
AT_CLEANUP
|
2001-06-25 18:27:51 +00:00
|
|
|
|
|
|
|
|
|
|
|
## ------------------------------- ##
|
|
|
|
## Obsolete non-updatable macros. ##
|
|
|
|
## ------------------------------- ##
|
|
|
|
|
|
|
|
|
|
|
|
AT_CHECK_MACRO([AC_SYS_RESTARTABLE_SYSCALLS], , ,[-W no-obsolete])
|
2006-12-01 19:36:56 +00:00
|
|
|
AT_CHECK_MACRO([AC_FUNC_SETVBUF_REVERSED], , ,[-W no-obsolete])
|
2001-06-25 18:27:51 +00:00
|
|
|
AT_CHECK_MACRO([AC_FUNC_WAIT3], , ,[-W no-obsolete])
|