From 1ff958d4fcd4d458c433c416fb119cc20e5eeba8 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Thu, 31 Jan 2013 20:32:31 +0200 Subject: Add API to --version output. Use it for shlib tests. --- ChangeLog | 2 ++ main.c | 3 +++ test/ChangeLog | 2 ++ test/Makefile.am | 6 +++--- test/Makefile.in | 6 +++--- 5 files changed, 13 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 233a7949..d00b1fb8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,6 +3,8 @@ * dfa.c: Include "dfa.h" which includes regex.h after limits.h so that RE_DUP_MAX gets the correct value. Especially needed on OpenVMS. Thanks to Anders Wallin. + * main.c (version): Print out API version numbers if DYNAMIC. + Helpful also for knowing if to run the shlib tests. 2013-01-31 Arnold D. Robbins diff --git a/main.c b/main.c index 7d4458ba..c3adc9f5 100644 --- a/main.c +++ b/main.c @@ -1426,6 +1426,9 @@ static void version() { printf("%s", version_string); +#ifdef DYNAMIC + printf(", API: %d.%d", GAWK_API_MAJOR_VERSION, GAWK_API_MINOR_VERSION); +#endif #ifdef HAVE_MPFR printf(" (GNU MPFR %s, GNU MP %s)", mpfr_get_version(), gmp_version); #endif diff --git a/test/ChangeLog b/test/ChangeLog index 9d612dcd..ba491f3e 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -2,6 +2,8 @@ * Makefile.am: Move functab4 into shlib tests, since it uses @load. Thanks to Anders Wallin for the report. + (shlib-tests): Check --version output for "API" and run tests + if there. 2013-01-31 Andrew J. Schorr diff --git a/test/Makefile.am b/test/Makefile.am index 5edb499f..c45be575 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -1059,9 +1059,9 @@ mpfr-tests: fi shlib-tests: - @if grep 'DYNAMIC 1' $(top_builddir)/config.h > /dev/null ; then \ - $(MAKE) shlib-real-tests ; \ - else echo shlib tests not supported on this system ; \ + @if $(AWK) --version | $(AWK) '/API/ { exit 1 }' ; then \ + echo shlib tests not supported on this system ; \ + else $(MAKE) shlib-real-tests ; \ fi shlib-real-tests: $(SHLIB_TESTS) diff --git a/test/Makefile.in b/test/Makefile.in index c182952a..e1a44a5a 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -1442,9 +1442,9 @@ mpfr-tests: fi shlib-tests: - @if grep 'DYNAMIC 1' $(top_builddir)/config.h > /dev/null ; then \ - $(MAKE) shlib-real-tests ; \ - else echo shlib tests not supported on this system ; \ + @if $(AWK) --version | $(AWK) '/API/ { exit 1 }' ; then \ + echo shlib tests not supported on this system ; \ + else $(MAKE) shlib-real-tests ; \ fi shlib-real-tests: $(SHLIB_TESTS) -- cgit v1.2.3