* 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 22:44:38 +08:00
|
|
|
# -*- Autotest -*-
|
2000-02-09 16:36:01 +08:00
|
|
|
|
2000-11-29 18:12:05 +08:00
|
|
|
AT_BANNER([Autoconf base layer.])
|
2000-02-09 16:36:01 +08:00
|
|
|
|
* 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 21:05:11 +08:00
|
|
|
# Copyright 2000, 2001 Free Software Foundation, Inc.
|
|
|
|
#
|
|
|
|
# This program is free software; you can redistribute it and/or modify
|
|
|
|
# it under the terms of the GNU General Public License as published by
|
|
|
|
# the Free Software Foundation; either version 2, or (at your option)
|
|
|
|
# any later version.
|
|
|
|
#
|
|
|
|
# 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
|
|
|
|
# along with this program; if not, write to the Free Software
|
|
|
|
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
|
|
|
# 02111-1307, USA.
|
|
|
|
|
2000-06-26 17:06:02 +08:00
|
|
|
|
2000-11-04 00:02:54 +08:00
|
|
|
## ------------------------------- ##
|
|
|
|
## AC_REQUIRE: topological sort.. ##
|
|
|
|
## ------------------------------- ##
|
2000-06-26 17:06:02 +08:00
|
|
|
|
|
|
|
# Check that dependencies are always properly honored.
|
|
|
|
|
2000-11-04 00:02:54 +08:00
|
|
|
AT_SETUP([AC_REQUIRE: topological sort])
|
2000-06-26 17:06:02 +08:00
|
|
|
|
2001-08-20 22:45:09 +08:00
|
|
|
AT_DATA([configure.ac],
|
2000-06-26 17:06:02 +08:00
|
|
|
[[define([REQUIRE_AND_CHECK],
|
2001-08-20 22:45:00 +08:00
|
|
|
[AC_REQUIRE([$1])
|
2001-08-29 21:11:16 +08:00
|
|
|
test -z "$m4@&t@_translit([$1], [A-Z], [a-z])" && AS_EXIT(1)])
|
2000-06-26 17:06:02 +08:00
|
|
|
|
|
|
|
AC_DEFUN([TEST1],
|
|
|
|
[REQUIRE_AND_CHECK([TEST2a])
|
|
|
|
REQUIRE_AND_CHECK([TEST2b])
|
|
|
|
test1=set])
|
|
|
|
|
|
|
|
AC_DEFUN([TEST2a],
|
|
|
|
[test2a=set])
|
|
|
|
|
|
|
|
AC_DEFUN([TEST2b],
|
|
|
|
[REQUIRE_AND_CHECK([TEST3])
|
|
|
|
test2b=set])
|
|
|
|
|
|
|
|
AC_DEFUN([TEST3],
|
|
|
|
[REQUIRE_AND_CHECK([TEST2a])
|
|
|
|
test3=set])
|
|
|
|
|
2001-09-13 23:47:34 +08:00
|
|
|
AC_PLAIN_SCRIPT()#! /bin/sh
|
2001-05-31 15:02:13 +08:00
|
|
|
|
2000-06-26 17:06:02 +08:00
|
|
|
TEST1
|
2000-10-27 22:15:28 +08:00
|
|
|
test -z "$test1" &&
|
|
|
|
AC_MSG_ERROR([\$test1 is empty])
|
2000-11-02 03:57:54 +08:00
|
|
|
AS_EXIT(0)
|
2000-06-26 17:06:02 +08:00
|
|
|
]])
|
|
|
|
|
2000-11-23 17:52:35 +08:00
|
|
|
AT_CHECK_AUTOCONF
|
2000-12-19 16:15:48 +08:00
|
|
|
AT_CHECK_CONFIGURE
|
2000-06-26 17:06:02 +08:00
|
|
|
|
2000-12-19 16:15:48 +08:00
|
|
|
AT_CLEANUP
|
2000-11-03 18:39:27 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## ----------------------------------------------- ##
|
|
|
|
## AC_REQUIRE and AC_DEFUN_ONCE: Require, expand. ##
|
|
|
|
## ----------------------------------------------- ##
|
|
|
|
|
2000-11-04 00:02:54 +08:00
|
|
|
AT_SETUP([AC_REQUIRE & AC_DEFUN_ONCE: Require, expand])
|
2000-11-03 18:39:27 +08:00
|
|
|
|
2000-12-23 18:11:57 +08:00
|
|
|
AT_DATA([configure.ac],
|
2000-11-03 18:39:27 +08:00
|
|
|
[[AC_DEFUN([TEST],
|
|
|
|
[AC_REQUIRE([MULTI_TEST])
|
|
|
|
AC_REQUIRE([SINGLE_TEST])])
|
|
|
|
|
|
|
|
AC_DEFUN([MULTI_TEST],
|
|
|
|
[multi_test=".$multi_test"])
|
|
|
|
|
|
|
|
AC_DEFUN_ONCE([SINGLE_TEST],
|
|
|
|
[single_test=".$single_test"])
|
|
|
|
|
2001-09-13 23:47:34 +08:00
|
|
|
AC_PLAIN_SCRIPT()#! /bin/sh
|
2001-05-31 15:02:13 +08:00
|
|
|
|
2000-11-03 18:39:27 +08:00
|
|
|
TEST
|
|
|
|
TEST
|
|
|
|
MULTI_TEST
|
|
|
|
MULTI_TEST
|
|
|
|
SINGLE_TEST
|
|
|
|
SINGLE_TEST
|
|
|
|
|
|
|
|
case $multi_test:$single_test in
|
|
|
|
...:. ) AS_EXIT(0);;
|
|
|
|
...:* ) AC_MSG_ERROR([DEFUN_ONCE is broken]);;
|
|
|
|
*:. ) AC_MSG_ERROR([DEFUN is broken (Wow, congrats!)]);;
|
|
|
|
esac
|
|
|
|
]])
|
|
|
|
|
2001-01-17 23:26:42 +08:00
|
|
|
AT_CHECK_AUTOCONF([], 0, [],
|
2001-05-31 15:04:30 +08:00
|
|
|
[configure.ac:18: warning: SINGLE_TEST invoked multiple times
|
|
|
|
configure.ac:19: warning: SINGLE_TEST invoked multiple times
|
2000-11-03 18:39:27 +08:00
|
|
|
])
|
|
|
|
|
2000-12-19 16:15:48 +08:00
|
|
|
AT_CHECK_CONFIGURE
|
2000-11-03 18:39:27 +08:00
|
|
|
|
2000-12-19 16:15:48 +08:00
|
|
|
AT_CLEANUP
|
2000-11-03 18:39:27 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## ----------------------------------------------- ##
|
|
|
|
## AC_REQUIRE and AC_DEFUN_ONCE: Expand, require. ##
|
|
|
|
## ----------------------------------------------- ##
|
|
|
|
|
2000-11-04 00:02:54 +08:00
|
|
|
AT_SETUP([AC_REQUIRE & AC_DEFUN_ONCE: Expand, require])
|
2000-11-03 18:39:27 +08:00
|
|
|
|
2000-12-23 18:11:57 +08:00
|
|
|
AT_DATA([configure.ac],
|
2000-11-03 18:39:27 +08:00
|
|
|
[[AC_DEFUN([TEST],
|
|
|
|
[AC_REQUIRE([MULTI_TEST])
|
|
|
|
AC_REQUIRE([SINGLE_TEST])])
|
|
|
|
|
|
|
|
AC_DEFUN([MULTI_TEST],
|
|
|
|
[multi_test=".$multi_test"])
|
|
|
|
|
|
|
|
AC_DEFUN_ONCE([SINGLE_TEST],
|
|
|
|
[single_test=".$single_test"])
|
|
|
|
|
2001-09-13 23:47:34 +08:00
|
|
|
AC_PLAIN_SCRIPT()#! /bin/sh
|
2001-05-31 15:02:13 +08:00
|
|
|
|
2000-11-03 18:39:27 +08:00
|
|
|
MULTI_TEST
|
|
|
|
MULTI_TEST
|
|
|
|
SINGLE_TEST
|
|
|
|
SINGLE_TEST
|
|
|
|
TEST
|
|
|
|
TEST
|
|
|
|
|
|
|
|
case $multi_test:$single_test in
|
|
|
|
..:. ) AS_EXIT(0);;
|
|
|
|
..:* ) AC_MSG_ERROR([DEFUN_ONCE is broken]);;
|
|
|
|
*:. ) AC_MSG_ERROR([DEFUN is broken (Wow, congrats!)]);;
|
2000-11-04 00:02:54 +08:00
|
|
|
* ) AC_MSG_ERROR([received `$multi_test:$single_test']);;
|
2000-11-03 18:39:27 +08:00
|
|
|
esac
|
|
|
|
]])
|
|
|
|
|
2001-01-17 23:26:42 +08:00
|
|
|
AT_CHECK_AUTOCONF([], 0, [],
|
2001-05-31 15:04:30 +08:00
|
|
|
[configure.ac:17: warning: SINGLE_TEST invoked multiple times
|
2000-11-03 18:39:27 +08:00
|
|
|
])
|
2000-12-19 16:15:48 +08:00
|
|
|
AT_CHECK_CONFIGURE
|
2000-11-03 18:39:27 +08:00
|
|
|
|
2000-12-19 16:15:48 +08:00
|
|
|
AT_CLEANUP
|
2000-11-04 00:02:54 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## ------------------------- ##
|
|
|
|
## AC_REQUIRE & AC_PROVIDE. ##
|
|
|
|
## ------------------------- ##
|
|
|
|
|
|
|
|
AT_SETUP([AC_REQUIRE & AC_PROVIDE])
|
|
|
|
|
2000-12-23 18:11:57 +08:00
|
|
|
AT_DATA([configure.ac],
|
2000-11-04 00:02:54 +08:00
|
|
|
[[AC_DEFUN([TEST],
|
|
|
|
[AC_REQUIRE([INNER_TEST])])
|
|
|
|
|
|
|
|
AC_DEFUN([INNER_TEST],
|
|
|
|
[inner_test=".$inner_test"])
|
|
|
|
|
2001-09-13 23:47:34 +08:00
|
|
|
AC_PLAIN_SCRIPT()#! /bin/sh
|
2001-05-31 15:02:13 +08:00
|
|
|
|
2000-11-04 00:02:54 +08:00
|
|
|
AC_PROVIDE([INNER_TEST])
|
|
|
|
TEST
|
|
|
|
|
|
|
|
case $inner_test in
|
|
|
|
"" ) AS_EXIT(0);;
|
|
|
|
* ) AC_MSG_ERROR([received `$inner_test']);;
|
|
|
|
esac
|
|
|
|
]])
|
|
|
|
|
2000-12-19 16:15:48 +08:00
|
|
|
AT_CHECK_AUTOCONF
|
|
|
|
AT_CHECK_CONFIGURE
|
2000-11-04 00:02:54 +08:00
|
|
|
|
2001-01-17 23:26:42 +08:00
|
|
|
AT_CLEANUP
|
2001-01-23 20:53:52 +08:00
|
|
|
|
|
|
|
|
|
|
|
## ---------------------- ##
|
|
|
|
## AC_REQUIRE & AC_LANG. ##
|
|
|
|
## ---------------------- ##
|
|
|
|
|
|
|
|
AT_SETUP([AC_REQUIRE & AC_LANG])
|
|
|
|
|
|
|
|
AT_DATA([configure.ac],
|
|
|
|
[[AC_DEFUN([AC_F77_1],
|
|
|
|
[AC_LANG_PUSH([Fortran 77])
|
|
|
|
if test $ac_ext != f; then
|
|
|
|
AC_MSG_ERROR([F77_1: current shell language is $ac_ext, expected Fortran])
|
|
|
|
fi
|
|
|
|
AC_LANG_POP
|
|
|
|
])
|
|
|
|
|
|
|
|
|
|
|
|
AC_DEFUN([AC_F77_2],
|
|
|
|
[AC_LANG_PUSH([Fortran 77])
|
|
|
|
AC_REQUIRE([AC_F77_1])
|
|
|
|
if test $ac_ext != f; then
|
|
|
|
AC_MSG_ERROR([F77_2: current shell language is $ac_ext, expected Fortran])
|
|
|
|
fi
|
|
|
|
AC_LANG_POP
|
|
|
|
])
|
|
|
|
|
|
|
|
AC_INIT
|
|
|
|
AC_F77_2
|
|
|
|
AS_EXIT(0)
|
|
|
|
]])
|
|
|
|
|
|
|
|
AT_CHECK_AUTOCONF
|
|
|
|
AT_CHECK_CONFIGURE
|
|
|
|
|
|
|
|
AT_CLEANUP
|
2001-01-24 18:04:47 +08:00
|
|
|
|
|
|
|
|
2001-01-31 00:21:21 +08:00
|
|
|
## ---------------- ##
|
|
|
|
## AC_CACHE_CHECK. ##
|
|
|
|
## ---------------- ##
|
2001-01-24 18:04:47 +08:00
|
|
|
|
2001-01-31 00:21:21 +08:00
|
|
|
# Make sure AC_CACHE_CHECK is silent with -q.
|
2001-01-24 18:04:47 +08:00
|
|
|
|
|
|
|
AT_SETUP([AC_CACHE_CHECK])
|
|
|
|
|
|
|
|
AT_DATA([configure.ac],
|
|
|
|
[[AC_INIT
|
2001-01-31 02:26:31 +08:00
|
|
|
AC_CACHE_CHECK([for nothing],
|
|
|
|
[ac_nothing],
|
|
|
|
[ac_nothing=found])
|
2001-01-24 18:04:47 +08:00
|
|
|
]])
|
|
|
|
|
|
|
|
AT_CHECK_AUTOCONF
|
2001-01-31 00:21:21 +08:00
|
|
|
AT_CHECK_CONFIGURE([-q])
|
2001-01-24 18:04:47 +08:00
|
|
|
|
|
|
|
AT_CLEANUP
|
2001-01-31 23:00:35 +08:00
|
|
|
|
|
|
|
|
|
|
|
## ---------- ##
|
|
|
|
## AC_TRY_*. ##
|
|
|
|
## ---------- ##
|
|
|
|
|
|
|
|
AT_SETUP([AC_TRY_*])
|
|
|
|
|
|
|
|
AT_DATA([configure.ac],
|
|
|
|
[[AC_INIT
|
|
|
|
|
2001-02-04 03:27:14 +08:00
|
|
|
if AC_TRY_COMMAND([(echo "The Cat in the Hat";
|
2001-01-31 23:00:35 +08:00
|
|
|
echo "The Hat in the Cat" >&2)
|
2001-03-07 00:47:38 +08:00
|
|
|
| grep \^The\ Cat\ in\ the\ Hat\$ >/dev/null]); then
|
2001-02-04 03:27:14 +08:00
|
|
|
:
|
2001-01-31 23:00:35 +08:00
|
|
|
else
|
|
|
|
AC_MSG_ERROR([Didn't see the Cat in the Hat!])
|
|
|
|
fi
|
|
|
|
|
2001-02-04 03:27:14 +08:00
|
|
|
if AC_TRY_COMMAND([(echo "The Cat in the Hat";
|
2001-01-31 23:00:35 +08:00
|
|
|
echo "The Hat in the Cat" >&2)
|
2001-03-07 00:47:38 +08:00
|
|
|
| grep \^The\ Hat\ in\ the\ Cat\$ >/dev/null]); then
|
2001-01-31 23:00:35 +08:00
|
|
|
AC_MSG_ERROR([Saw the Hat in the Cat!])
|
|
|
|
fi
|
|
|
|
]])
|
|
|
|
|
|
|
|
AT_CHECK_AUTOCONF
|
|
|
|
AT_CHECK_CONFIGURE([-q])
|
|
|
|
|
|
|
|
AT_CLEANUP
|