3 AT_BANNER([Autoconf base layer.])
6 ## ------------------------------- ##
7 ## AC_REQUIRE: topological sort.. ##
8 ## ------------------------------- ##
10 # Check that dependencies are always properly honored.
12 AT_SETUP([AC_REQUIRE: topological sort])
15 [[define([REQUIRE_AND_CHECK],
17 test -z "$m4_translit([$1], [A-Z], [a-z])" && AS_EXIT(1)])
20 [REQUIRE_AND_CHECK([TEST2a])
21 REQUIRE_AND_CHECK([TEST2b])
28 [REQUIRE_AND_CHECK([TEST3])
32 [REQUIRE_AND_CHECK([TEST2a])
40 AC_MSG_ERROR([\$test1 is empty])
51 ## ----------------------------------------------- ##
52 ## AC_REQUIRE and AC_DEFUN_ONCE: Require, expand. ##
53 ## ----------------------------------------------- ##
55 AT_SETUP([AC_REQUIRE & AC_DEFUN_ONCE: Require, expand])
57 AT_DATA([configure.ac],
59 [AC_REQUIRE([MULTI_TEST])
60 AC_REQUIRE([SINGLE_TEST])])
62 AC_DEFUN([MULTI_TEST],
63 [multi_test=".$multi_test"])
65 AC_DEFUN_ONCE([SINGLE_TEST],
66 [single_test=".$single_test"])
78 case $multi_test:$single_test in
80 ...:* ) AC_MSG_ERROR([DEFUN_ONCE is broken]);;
81 *:. ) AC_MSG_ERROR([DEFUN is broken (Wow, congrats!)]);;
85 AT_CHECK_AUTOCONF([], 0, [],
86 [configure.ac:18: warning: SINGLE_TEST invoked multiple times
87 configure.ac:19: warning: SINGLE_TEST invoked multiple times
96 ## ----------------------------------------------- ##
97 ## AC_REQUIRE and AC_DEFUN_ONCE: Expand, require. ##
98 ## ----------------------------------------------- ##
100 AT_SETUP([AC_REQUIRE & AC_DEFUN_ONCE: Expand, require])
102 AT_DATA([configure.ac],
104 [AC_REQUIRE([MULTI_TEST])
105 AC_REQUIRE([SINGLE_TEST])])
107 AC_DEFUN([MULTI_TEST],
108 [multi_test=".$multi_test"])
110 AC_DEFUN_ONCE([SINGLE_TEST],
111 [single_test=".$single_test"])
123 case $multi_test:$single_test in
125 ..:* ) AC_MSG_ERROR([DEFUN_ONCE is broken]);;
126 *:. ) AC_MSG_ERROR([DEFUN is broken (Wow, congrats!)]);;
127 * ) AC_MSG_ERROR([received `$multi_test:$single_test']);;
131 AT_CHECK_AUTOCONF([], 0, [],
132 [configure.ac:17: warning: SINGLE_TEST invoked multiple times
140 ## ------------------------- ##
141 ## AC_REQUIRE & AC_PROVIDE. ##
142 ## ------------------------- ##
144 AT_SETUP([AC_REQUIRE & AC_PROVIDE])
146 AT_DATA([configure.ac],
148 [AC_REQUIRE([INNER_TEST])])
150 AC_DEFUN([INNER_TEST],
151 [inner_test=".$inner_test"])
156 AC_PROVIDE([INNER_TEST])
161 * ) AC_MSG_ERROR([received `$inner_test']);;
171 ## ---------------------- ##
172 ## AC_REQUIRE & AC_LANG. ##
173 ## ---------------------- ##
175 AT_SETUP([AC_REQUIRE & AC_LANG])
177 AT_DATA([configure.ac],
178 [[AC_DEFUN([AC_F77_1],
179 [AC_LANG_PUSH([Fortran 77])
180 if test $ac_ext != f; then
181 AC_MSG_ERROR([F77_1: current shell language is $ac_ext, expected Fortran])
188 [AC_LANG_PUSH([Fortran 77])
189 AC_REQUIRE([AC_F77_1])
190 if test $ac_ext != f; then
191 AC_MSG_ERROR([F77_2: current shell language is $ac_ext, expected Fortran])
207 ## ---------------- ##
208 ## AC_CACHE_CHECK. ##
209 ## ---------------- ##
211 # Make sure AC_CACHE_CHECK is silent with -q.
213 AT_SETUP([AC_CACHE_CHECK])
215 AT_DATA([configure.ac],
217 AC_CACHE_CHECK([for nothing],
223 AT_CHECK_CONFIGURE([-q])
234 AT_DATA([configure.ac],
237 if AC_TRY_COMMAND([(echo "The Cat in the Hat";
238 echo "The Hat in the Cat" >&2)
239 | grep \^The\ Cat\ in\ the\ Hat\$ >/dev/null]); then
242 AC_MSG_ERROR([Didn't see the Cat in the Hat!])
245 if AC_TRY_COMMAND([(echo "The Cat in the Hat";
246 echo "The Hat in the Cat" >&2)
247 | grep \^The\ Hat\ in\ the\ Cat\$ >/dev/null]); then
248 AC_MSG_ERROR([Saw the Hat in the Cat!])
253 AT_CHECK_CONFIGURE([-q])