2000-02-09 16:36:01 +08:00
|
|
|
# -*- autoconf -*-
|
|
|
|
|
2000-11-29 18:12:05 +08:00
|
|
|
AT_BANNER([Autoconf base layer.])
|
2000-02-09 16:36:01 +08:00
|
|
|
|
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
|
|
|
|
|
|
|
AT_DATA(configure.in,
|
|
|
|
[[define([REQUIRE_AND_CHECK],
|
|
|
|
[AC_REQUIRE([$1])dnl
|
2000-11-23 17:45:48 +08:00
|
|
|
test -z "$m4_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])
|
|
|
|
|
2000-07-10 16:56:19 +08:00
|
|
|
AC_PLAIN_SCRIPT
|
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-06-26 17:06:02 +08:00
|
|
|
AT_CHECK([./configure], 0)
|
|
|
|
|
|
|
|
AT_CLEANUP(configure)
|
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
|
|
|
|
|
|
|
AT_DATA([configure.in],
|
|
|
|
[[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"])
|
|
|
|
|
|
|
|
AC_PLAIN_SCRIPT
|
|
|
|
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
|
|
|
|
]])
|
|
|
|
|
|
|
|
AT_CHECK([autoconf --autoconf-dir .. -l $at_srcdir], 0, [],
|
|
|
|
[configure.in:16: warning: SINGLE_TEST invoked multiple times
|
|
|
|
configure.in:17: warning: SINGLE_TEST invoked multiple times
|
|
|
|
])
|
|
|
|
|
|
|
|
AT_CHECK([./configure], 0)
|
|
|
|
|
|
|
|
AT_CLEANUP(configure)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## ----------------------------------------------- ##
|
|
|
|
## 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
|
|
|
|
|
|
|
AT_DATA([configure.in],
|
|
|
|
[[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"])
|
|
|
|
|
|
|
|
AC_PLAIN_SCRIPT
|
|
|
|
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
|
|
|
|
]])
|
|
|
|
|
|
|
|
AT_CHECK([autoconf --autoconf-dir .. -l $at_srcdir], 0, [],
|
|
|
|
[configure.in:15: warning: SINGLE_TEST invoked multiple times
|
|
|
|
])
|
|
|
|
AT_CHECK([./configure], 0)
|
|
|
|
|
|
|
|
|
|
|
|
AT_CLEANUP(configure)
|
2000-11-04 00:02:54 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## ------------------------- ##
|
|
|
|
## AC_REQUIRE & AC_PROVIDE. ##
|
|
|
|
## ------------------------- ##
|
|
|
|
|
|
|
|
AT_SETUP([AC_REQUIRE & AC_PROVIDE])
|
|
|
|
|
|
|
|
AT_DATA([configure.in],
|
|
|
|
[[AC_DEFUN([TEST],
|
|
|
|
[AC_REQUIRE([INNER_TEST])])
|
|
|
|
|
|
|
|
AC_DEFUN([INNER_TEST],
|
|
|
|
[inner_test=".$inner_test"])
|
|
|
|
|
|
|
|
AC_PLAIN_SCRIPT
|
|
|
|
AC_PROVIDE([INNER_TEST])
|
|
|
|
TEST
|
|
|
|
|
|
|
|
case $inner_test in
|
|
|
|
"" ) AS_EXIT(0);;
|
|
|
|
* ) AC_MSG_ERROR([received `$inner_test']);;
|
|
|
|
esac
|
|
|
|
]])
|
|
|
|
|
|
|
|
AT_CHECK([autoconf --autoconf-dir .. -l $at_srcdir], 0)
|
|
|
|
AT_CHECK([./configure], 0)
|
|
|
|
|
|
|
|
|
|
|
|
AT_CLEANUP(configure)
|