mirror of
git://git.sv.gnu.org/autoconf
synced 2025-02-17 14:01:27 +08:00
* tests/atgeneral.m4 (AT_CHECK): Make exit status report more
visible. * tests/atspecific.m4 (AT_CHECK_AUTOCONF): Support FLAGS, STDOUT and STDERR. (AT_CHECK_CONFIGURE): Support plenty, cleanup defs when needed. Spread their use in the whole suite. Simplify a few AT_CLEANUPs.
This commit is contained in:
parent
7fd0f6597d
commit
6804b0e12a
10
ChangeLog
10
ChangeLog
@ -1,3 +1,13 @@
|
||||
2000-12-19 Akim Demaille <akim@epita.fr>
|
||||
|
||||
* tests/atgeneral.m4 (AT_CHECK): Make exit status report more
|
||||
visible.
|
||||
* tests/atspecific.m4 (AT_CHECK_AUTOCONF): Support FLAGS, STDOUT
|
||||
and STDERR.
|
||||
(AT_CHECK_CONFIGURE): Support plenty, cleanup defs when needed.
|
||||
Spread their use in the whole suite.
|
||||
Simplify a few AT_CLEANUPs.
|
||||
|
||||
2000-12-19 Akim Demaille <akim@epita.fr>
|
||||
|
||||
* tests/atgeneral.m4 (AT_CHECK): Accept if-failed and
|
||||
|
@ -455,7 +455,7 @@ m4_case([$2],
|
||||
[ignore],
|
||||
[ *);;],
|
||||
[ m4_default([$2], [0])) ;;
|
||||
*) $at_verbose "Exit code was $at_status, expected $2" >&2
|
||||
*) $at_verbose "$srcdir/AT_LINE: exit code was $at_status, expected $2" >&2
|
||||
at_failed=:;;])
|
||||
esac
|
||||
AS_IFELSE($at_failed, [$5], [$6])
|
||||
|
@ -455,7 +455,7 @@ m4_case([$2],
|
||||
[ignore],
|
||||
[ *);;],
|
||||
[ m4_default([$2], [0])) ;;
|
||||
*) $at_verbose "Exit code was $at_status, expected $2" >&2
|
||||
*) $at_verbose "$srcdir/AT_LINE: exit code was $at_status, expected $2" >&2
|
||||
at_failed=:;;])
|
||||
esac
|
||||
AS_IFELSE($at_failed, [$5], [$6])
|
||||
|
@ -22,11 +22,11 @@ include(atgeneral.m4) -*- Autoconf -*-
|
||||
## ---------------------------------------- ##
|
||||
|
||||
|
||||
# AT_CHECK_AUTOCONF
|
||||
# -----------------
|
||||
# AT_CHECK_AUTOCONF(FLAGS, STDOUT, STDERR)
|
||||
# ----------------------------------------
|
||||
m4_define([AT_CHECK_AUTOCONF],
|
||||
[AT_CLEANUP_FILES(configure)dnl
|
||||
AT_CHECK([autoconf --autoconf-dir .. -l $at_srcdir], 0, [], [])])
|
||||
AT_CHECK([autoconf --autoconf-dir .. -l $at_srcdir $1], 0, [$2], [$3])])
|
||||
|
||||
|
||||
# AT_CHECK_AUTOHEADER
|
||||
@ -36,16 +36,20 @@ m4_define([AT_CHECK_AUTOHEADER],
|
||||
AT_CHECK([autoheader --autoconf-dir .. -l $at_srcdir], 0, [], [])])
|
||||
|
||||
|
||||
# AT_CHECK_CONFIGURE
|
||||
# ------------------
|
||||
# AT_CHECK_CONFIGURE(END-COMMAND,
|
||||
# [EXIT-STATUS = 0],
|
||||
# [SDOUT = IGNORE], STDERR)
|
||||
# --------------------------------------------
|
||||
# `top_srcdir' is needed so that `./configure' finds install-sh.
|
||||
# Using --srcdir is more expensive.
|
||||
m4_define([AT_CHECK_CONFIGURE],
|
||||
[AT_CLEANUP_FILE_IFELSE([config.hin],
|
||||
[AT_CLEANUP_FILE(config.h)])dnl
|
||||
[AT_CLEANUP_FILE_IFELSE([config.hin], [AT_CLEANUP_FILE(config.h)])dnl
|
||||
AT_CLEANUP_FILE_IFELSE([defs.in], [AT_CLEANUP_FILE(defs)])dnl
|
||||
AT_CLEANUP_FILES(config.log config.status config.cache)dnl
|
||||
AT_CHECK([top_srcdir=$top_srcdir ./configure], 0, ignore, [],
|
||||
[test $at_verbose = echo && echo "--- config.log" && cat config.log])])
|
||||
AT_CHECK([top_srcdir=$top_srcdir ./configure $1],
|
||||
[$2],
|
||||
m4_default([$3], [ignore]), [$4],
|
||||
[test $at_verbose = echo && echo "$srcdir/AT_LINE: config.log" && cat config.log])])
|
||||
|
||||
|
||||
# _AT_CHECK_AC_MACRO(AC-BODY, PRE-TESTS)
|
||||
|
@ -40,9 +40,9 @@ AS_EXIT(0)
|
||||
]])
|
||||
|
||||
AT_CHECK_AUTOCONF
|
||||
AT_CHECK([./configure], 0)
|
||||
AT_CHECK_CONFIGURE
|
||||
|
||||
AT_CLEANUP(configure)
|
||||
AT_CLEANUP
|
||||
|
||||
|
||||
|
||||
@ -78,14 +78,14 @@ case $multi_test:$single_test in
|
||||
esac
|
||||
]])
|
||||
|
||||
AT_CHECK([autoconf --autoconf-dir .. -l $at_srcdir], 0, [],
|
||||
AT_CHECK_AUTOCONF([], [],
|
||||
[configure.in:16: warning: SINGLE_TEST invoked multiple times
|
||||
configure.in:17: warning: SINGLE_TEST invoked multiple times
|
||||
])
|
||||
|
||||
AT_CHECK([./configure], 0)
|
||||
AT_CHECK_CONFIGURE
|
||||
|
||||
AT_CLEANUP(configure)
|
||||
AT_CLEANUP
|
||||
|
||||
|
||||
|
||||
@ -122,13 +122,12 @@ case $multi_test:$single_test in
|
||||
esac
|
||||
]])
|
||||
|
||||
AT_CHECK([autoconf --autoconf-dir .. -l $at_srcdir], 0, [],
|
||||
AT_CHECK_AUTOCONF([], [],
|
||||
[configure.in:15: warning: SINGLE_TEST invoked multiple times
|
||||
])
|
||||
AT_CHECK([./configure], 0)
|
||||
AT_CHECK_CONFIGURE
|
||||
|
||||
|
||||
AT_CLEANUP(configure)
|
||||
AT_CLEANUP
|
||||
|
||||
|
||||
|
||||
@ -155,8 +154,7 @@ case $inner_test in
|
||||
esac
|
||||
]])
|
||||
|
||||
AT_CHECK([autoconf --autoconf-dir .. -l $at_srcdir], 0)
|
||||
AT_CHECK([./configure], 0)
|
||||
|
||||
AT_CHECK_AUTOCONF
|
||||
AT_CHECK_CONFIGURE
|
||||
|
||||
AT_CLEANUP(configure)
|
||||
|
@ -67,7 +67,7 @@ AT_CHECK_DEFINES(
|
||||
#define HAVE_STDIO_H 1
|
||||
])
|
||||
|
||||
AT_CLEANUP(configure config.status config.log config.cache config.hin config.h env-after)dnl
|
||||
AT_CLEANUP
|
||||
|
||||
|
||||
## ------------------------------ ##
|
||||
@ -99,7 +99,7 @@ AT_CHECK_DEFINES(
|
||||
#define HAVE_STDIO_H 1
|
||||
])
|
||||
|
||||
AT_CLEANUP(configure config.status config.log config.cache config.hin config.h env-after)dnl
|
||||
AT_CLEANUP
|
||||
|
||||
|
||||
|
||||
|
@ -48,7 +48,7 @@ AS_EXIT(0)
|
||||
]])
|
||||
|
||||
AT_CHECK_AUTOCONF
|
||||
AT_CHECK([./configure], 0)
|
||||
AT_CHECK_CONFIGURE
|
||||
|
||||
AT_CLEANUP(configure)
|
||||
|
||||
@ -78,7 +78,7 @@ AS_EXIT(0)
|
||||
]])
|
||||
|
||||
AT_CHECK_AUTOCONF
|
||||
AT_CHECK([./configure], 0)
|
||||
AT_CHECK_CONFIGURE
|
||||
|
||||
AT_CLEANUP(configure 1 a)
|
||||
|
||||
@ -107,6 +107,6 @@ esac
|
||||
]])
|
||||
|
||||
AT_CHECK_AUTOCONF
|
||||
AT_CHECK([./configure], 0)
|
||||
AT_CHECK_CONFIGURE
|
||||
|
||||
AT_CLEANUP(configure)
|
||||
|
@ -12,7 +12,7 @@ AT_SETUP([[m4_text_wrap]])
|
||||
# commas are not swallowed. This can easily happen because of
|
||||
# m4-listification.
|
||||
|
||||
AT_DATA(configure.in,
|
||||
AT_DATA([configure.in],
|
||||
[[AC_PLAIN_SCRIPT()dnl
|
||||
m4_text_wrap([Short string */], [ ], [/* ], 20)
|
||||
|
||||
@ -45,9 +45,9 @@ AT_DATA(expout,
|
||||
First, second , third, [,quoted]
|
||||
]])
|
||||
|
||||
AT_CHECK([autoconf --autoconf-dir .. -l $at_srcdir -o-], 0, expout)
|
||||
AT_CHECK_AUTOCONF([-o-], [expout])
|
||||
|
||||
AT_CLEANUP()
|
||||
AT_CLEANUP
|
||||
|
||||
|
||||
|
||||
@ -90,4 +90,4 @@ AT_CHECK([autoconf --autoconf-dir .. -l $at_srcdir -o- -Wnone,bar,error],
|
||||
configure.in:2: the top level
|
||||
])
|
||||
|
||||
AT_CLEANUP()
|
||||
AT_CLEANUP
|
||||
|
@ -151,7 +151,7 @@ AC_CHECK_TYPE(a,b,c,d)
|
||||
AC_OUTPUT
|
||||
]])
|
||||
|
||||
AT_CHECK([../autoconf --autoconf-dir .. -l $at_srcdir], 0,,
|
||||
AT_CHECK_AUTOCONF([], [],
|
||||
[configure.in:10: warning: AC_CHECK_TYPE: assuming `uint65536_t' is not a type
|
||||
])
|
||||
AT_CHECK([[sed -e '/^#(cut-from-here/,/^#to-here)/!d' -e '/^#/d' configure]],
|
||||
@ -164,7 +164,7 @@ NEW
|
||||
NEW
|
||||
])
|
||||
|
||||
AT_CLEANUP(autoconf.err)
|
||||
AT_CLEANUP
|
||||
|
||||
|
||||
|
||||
@ -310,7 +310,7 @@ AT_SETUP([AC_PATH_XTRA])
|
||||
_AT_CHECK_AC_MACRO([AC_PATH_XTRA])
|
||||
|
||||
# Check X_DISPLAY_MISSING.
|
||||
AT_CHECK([top_srcdir=$top_srcdir ./configure --without-x], 0, ignore)
|
||||
AT_CHECK_CONFIGURE([--without-x])
|
||||
AT_CHECK_DEFINES(
|
||||
[#define X_DISPLAY_MISSING 1
|
||||
])
|
||||
|
@ -305,7 +305,7 @@ VAL3 iftest1.c
|
||||
VAL4 iftest1.c
|
||||
], [])
|
||||
|
||||
AT_CLEANUP(configure)
|
||||
AT_CLEANUP
|
||||
|
||||
|
||||
|
||||
@ -456,7 +456,7 @@ AT_DATA(dst2, dst2
|
||||
AT_CHECK([autoupdate --autoconf-dir $top_srcdir], 0, [],
|
||||
[autoupdate: `configure.in' is updated
|
||||
])
|
||||
AT_CHECK([autoconf --autoconf-dir .. -l $at_srcdir], 0)
|
||||
AT_CHECK_AUTOCONF
|
||||
AT_CHECK_CONFIGURE
|
||||
AT_CHECK([cat src1], 0, [dst1
|
||||
])
|
||||
|
@ -32,26 +32,26 @@ AC_OUTPUT
|
||||
AT_CHECK_AUTOCONF
|
||||
|
||||
# Create a header
|
||||
AT_CHECK([./configure what_to_test=header], 0, ignore)
|
||||
AT_CHECK_CONFIGURE([what_to_test=header])
|
||||
AT_CHECK([ls header file command link 2>/dev/null], [ignore], [header
|
||||
])
|
||||
|
||||
# Create a file
|
||||
AT_CHECK([./configure what_to_test=file], 0, ignore)
|
||||
AT_CHECK_CONFIGURE([what_to_test=file])
|
||||
AT_CHECK([ls header file command link 2>/dev/null], [ignore], [file
|
||||
])
|
||||
|
||||
# Execute a command
|
||||
AT_CHECK([./configure what_to_test=command], 0, ignore)
|
||||
AT_CHECK_CONFIGURE([what_to_test=command])
|
||||
AT_CHECK([ls header file command link 2>/dev/null], [ignore], [command
|
||||
])
|
||||
|
||||
# Create a link
|
||||
AT_CHECK([./configure what_to_test=link], 0, ignore)
|
||||
AT_CHECK_CONFIGURE([what_to_test=link])
|
||||
AT_CHECK([ls header file command link 2>/dev/null], [ignore], [link
|
||||
])
|
||||
|
||||
AT_CLEANUP(header file link command header.in file.in link.in command.in configure config.status)
|
||||
AT_CLEANUP(header file link command header.in file.in link.in command.in)
|
||||
|
||||
|
||||
|
||||
@ -69,13 +69,13 @@ AC_OUTPUT
|
||||
]])
|
||||
|
||||
AT_CHECK_AUTOCONF
|
||||
AT_CHECK([./configure], 1, ignore,
|
||||
AT_CHECK_CONFIGURE([], [1], [],
|
||||
[[config.status: error: cannot find input file: nonexistent.in
|
||||
]])
|
||||
# Make sure that the output file doesn't exist
|
||||
AT_CHECK([test -f nonexistent], 1)
|
||||
|
||||
AT_CLEANUP(configure config.status config.log config.cache config.h defs)
|
||||
AT_CLEANUP
|
||||
|
||||
|
||||
|
||||
@ -101,21 +101,21 @@ AC_OUTPUT
|
||||
|
||||
AT_CHECK_AUTOCONF
|
||||
|
||||
AT_CHECK([./configure one=one --enable-two=two --with-three=three |
|
||||
sed -n -e 's/^result=//p'], 0,
|
||||
AT_CHECK_CONFIGURE([one=one --enable-two=two --with-three=three |
|
||||
sed -n -e 's/^result=//p'], 0,
|
||||
[onetwothree
|
||||
])
|
||||
AT_CHECK([./config.status --recheck | sed -n 's/^result=//p'], 0,
|
||||
[onetwothree
|
||||
], ignore)
|
||||
AT_CHECK([./config.status --recheck | sed -n -e 's/^result=//p'], 0,
|
||||
[onetwothree
|
||||
], ignore)
|
||||
])
|
||||
|
||||
AT_CHECK([./configure one="\"'$ " --enable-two="\" ' $" --with-three=" \"'$"|
|
||||
sed -n -e 's/^result=//p'], 0,
|
||||
AT_CHECK_CONFIGURE([one="\"'$ " --enable-two="\" ' $" --with-three=" \"'$"|
|
||||
sed -n -e 's/^result=//p'], 0,
|
||||
["'$ " ' $ "'$
|
||||
])
|
||||
AT_CHECK([./config.status --recheck | sed -n 's/^result=//p'], 0,
|
||||
["'$ " ' $ "'$
|
||||
], ignore)
|
||||
AT_CHECK([./config.status --recheck | sed -n -e 's/^result=//p'], 0,
|
||||
["'$ " ' $ "'$
|
||||
], ignore)
|
||||
])
|
||||
|
||||
AT_CLEANUP(configure config.status config.log config.cache)
|
||||
|
||||
@ -130,7 +130,7 @@ AT_CLEANUP(configure config.status config.log config.cache)
|
||||
|
||||
AT_SETUP([#define header templates])
|
||||
|
||||
AT_DATA(configure.in,
|
||||
AT_DATA([configure.in],
|
||||
[[AC_INIT
|
||||
AC_CONFIG_HEADERS(config.h:config.hin)
|
||||
# I18n of dummy variables: their French translations.
|
||||
@ -150,11 +150,11 @@ AC_SUBST(DEFS_SAVED)
|
||||
AC_OUTPUT
|
||||
]])
|
||||
|
||||
AT_DATA(defs.in,
|
||||
AT_DATA([defs.in],
|
||||
[[@DEFS_SAVED@
|
||||
]])
|
||||
|
||||
AT_DATA(config.hin,
|
||||
AT_DATA([config.hin],
|
||||
[[#define foo 0
|
||||
# define bar bar
|
||||
# define baz "Archimedes was sinking in his baz"
|
||||
@ -167,10 +167,10 @@ AT_DATA(config.hin,
|
||||
#undef aaa
|
||||
]])
|
||||
|
||||
AT_CHECK([../autoconf --autoconf-dir .. -l $at_srcdir], 0)
|
||||
AT_CHECK_AUTOCONF
|
||||
AT_CHECK_CONFIGURE
|
||||
|
||||
AT_DATA(expout,
|
||||
AT_DATA([expout],
|
||||
[[/* config.h. Generated automatically by configure. */
|
||||
#define foo toto
|
||||
# define bar tata
|
||||
@ -186,7 +186,7 @@ AT_DATA(expout,
|
||||
AT_CHECK([cat config.h], 0, expout)
|
||||
|
||||
# Check the value of DEFS. Note the leading space.
|
||||
AT_DATA(expout,
|
||||
AT_DATA([expout],
|
||||
[[ -Dfoo=toto -Dbar=tata -Dbaz=titi -Dfubar=tutu -Da=A -Daaa=AAA -Daa=AA]
|
||||
])
|
||||
|
||||
@ -194,7 +194,7 @@ AT_DATA(expout,
|
||||
# expout, hence nuke the one left by AC_OUTPUT_MAKE_DEFS.
|
||||
AT_CHECK([sed -e 's/ $//' defs], 0, expout)
|
||||
|
||||
AT_CLEANUP(configure config.status config.log config.cache config.h defs)
|
||||
AT_CLEANUP
|
||||
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user