aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2011-05-08 22:27:35 +0300
committerSergey Poznyakoff <gray@gnu.org.ua>2011-05-08 22:42:28 +0300
commite523423777dd75acc59cf7b9e7466527d774a9f9 (patch)
tree6d17e7553373fdfb6f32870902b75874c3f06aae
parent79f6b2c923d1c2366b68a431756bde6e4a04ae86 (diff)
downloadgrecs-e523423777dd75acc59cf7b9e7466527d774a9f9.tar.gz
grecs-e523423777dd75acc59cf7b9e7466527d774a9f9.tar.bz2
Various fixes.
* .gitignore: Add gitid.h * Makefile.am: Build gitid.h. * am/grecs.m4: Remove GRECS_VEROK_AT. * build-aux/getopt.m4 (print_version_hook): New variable. (print_version): Call print_version_hook, if defined. * src/Make.am (INCLUDES): Update. * src/grecs.h (grecs_version_info) <id>: New member. * src/version.c (grecs_version): Initialize id. * tests/Makefile.am: Remove GRECS_VEROK_AT. * tests/testsuite.at: Likewise.
-rw-r--r--.gitignore1
-rw-r--r--Makefile.am37
-rw-r--r--am/grecs.m47
-rw-r--r--build-aux/getopt.m44
-rw-r--r--doc/GRECS_SETUP.34
-rw-r--r--doc/grecs_asprintf.32
-rw-r--r--doc/grecs_config.52
-rw-r--r--doc/grecs_error.32
-rw-r--r--doc/grecs_format_locus.32
-rw-r--r--doc/grecs_format_node.32
-rw-r--r--doc/grecs_format_node_path.32
-rw-r--r--doc/grecs_format_value.32
-rw-r--r--doc/grecs_include_path_setup.32
-rw-r--r--doc/grecs_malloc.32
-rw-r--r--doc/grecs_node_free.32
-rw-r--r--doc/grecs_parse.32
-rw-r--r--doc/grecs_stmt_path.52
-rw-r--r--doc/grecs_strdup.32
-rw-r--r--doc/grecs_tree_free.32
-rw-r--r--doc/tmpl.32
-rw-r--r--src/Make.am2
-rw-r--r--src/grecs.h1
-rw-r--r--src/version.c4
-rw-r--r--tests/Makefile.am4
-rw-r--r--tests/testsuite.at1
-rw-r--r--tests/verok.at63
26 files changed, 47 insertions, 111 deletions
diff --git a/.gitignore b/.gitignore
index 65bf18d..f1a51a5 100644
--- a/.gitignore
+++ b/.gitignore
@@ -26,3 +26,4 @@ core
26libtool 26libtool
27m4 27m4
28stamp-h1 28stamp-h1
29gitid.h
diff --git a/Makefile.am b/Makefile.am
index 72619ec..0eb4b0e 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,6 +1,39 @@
1SUBDIRS=src @GRECS_TESTDIR@ @GRECS_DOCDIR@ 1# This file is part of Grecs
2EXTRA_DIST=@GRECS_BUILD_AUX@ 2# Copyright (C) 2007, 2009-2011 Sergey Poznyakoff
3#
4# Grecs is free software; you can redistribute it and/or modify
5# it under the terms of the GNU General Public License as published by
6# the Free Software Foundation; either version 3, or (at your option)
7# any later version.
8#
9# Grecs is distributed in the hope that it will be useful,
10# but WITHOUT ANY WARRANTY; without even the implied warranty of
11# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12# GNU General Public License for more details.
13#
14# You should have received a copy of the GNU General Public License
15# along with Grecs. If not, see <http://www.gnu.org/licenses/>.
16
3ACLOCAL_AMFLAGS = -I am 17ACLOCAL_AMFLAGS = -I am
18SUBDIRS=. src @GRECS_TESTDIR@ @GRECS_DOCDIR@
19EXTRA_DIST=@GRECS_BUILD_AUX@ gitid.h
20
21noinst_HEADERS = gitid.h
22BUILT_SOURCES = gitid.h
23
24.PHONY: gitid.h
25gitid.h:
26 @if test -d .git; then \
27 url=`git config --get remote.origin.url | sed 's|.*://||'`; \
28 if test "$$url" = "git.gnu.org.ua/gitroot/grecs.git"; then \
29 dirty=`git diff-index --name-only HEAD 2>/dev/null` || dirty=;\
30 test -n "$$dirty" && dirty="-dirty"; \
31 ID=`git log -1 --pretty='%H-%ct-%ae'`$$dirty;\
32 echo "#define GRECS_GIT_ID \"$$ID\"" > gitid.tmp; \
33 cmp gitid.tmp gitid.h >/dev/null 2>&1 || mv gitid.tmp gitid.h; \
34 rm -f gitid.tmp; \
35 fi; \
36 fi;
4 37
5@GRECS_CHANGELOG@.PHONY: ChangeLog 38@GRECS_CHANGELOG@.PHONY: ChangeLog
6@GRECS_CHANGELOG@ChangeLog: 39@GRECS_CHANGELOG@ChangeLog:
diff --git a/am/grecs.m4 b/am/grecs.m4
index e4f8671..8202903 100644
--- a/am/grecs.m4
+++ b/am/grecs.m4
@@ -149,14 +149,7 @@ AC_DEFUN([GRECS_SETUP],[
149 ]) 149 ])
150 _GRECS_IF_OPTION_SET([git2chg],[GRECS_BUILD_AUX="$GRECS_BUILD_AUX build-aux/git2chg.awk"]) 150 _GRECS_IF_OPTION_SET([git2chg],[GRECS_BUILD_AUX="$GRECS_BUILD_AUX build-aux/git2chg.awk"])
151 151
152 # Make sure package versioning is compatible with version.at:
153 s=`echo $PACKAGE_VERSION | [sed 's/[0-9][0-9]*\.[0-9][0-9]*\(\.[0-9][0-9]\)\?\([^a-zA-Z_0-9].*\)\?//'`]
154 if test -z "$s"; then
155 GRECS_VEROK_AT=verok.at
156 fi
157
158 AC_SUBST([GRECS_SRCDIR],$1) 152 AC_SUBST([GRECS_SRCDIR],$1)
159 AC_SUBST([GRECS_VEROK_AT])
160 AC_SUBST([GRECS_BUILD_AUX]) 153 AC_SUBST([GRECS_BUILD_AUX])
161 AC_SUBST([GRECS_INCLUDES]) 154 AC_SUBST([GRECS_INCLUDES])
162 AC_SUBST([GRECS_TESTDIR]) 155 AC_SUBST([GRECS_TESTDIR])
diff --git a/build-aux/getopt.m4 b/build-aux/getopt.m4
index b63baaf..83a1e35 100644
--- a/build-aux/getopt.m4
+++ b/build-aux/getopt.m4
@@ -700,6 +700,8 @@ char *program_author[] = {
700format_authors(_getopt_get_option(authors)) 700format_authors(_getopt_get_option(authors))
701};>]) 701};>])
702 702
703void (*print_version_hook)(FILE *stream);
704
703void 705void
704print_version(const char *program_version, FILE *stream) 706print_version(const char *program_version, FILE *stream)
705{ 707{
@@ -729,6 +731,8 @@ dnl directives between the lines.
729dnl ************************************************************************** 731dnl **************************************************************************
730 fputs (_("License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>\nThis is free software: you are free to change and redistribute it.\nThere is NO WARRANTY, to the extent permitted by law.\n\n"), 732 fputs (_("License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>\nThis is free software: you are free to change and redistribute it.\nThere is NO WARRANTY, to the extent permitted by law.\n\n"),
731 stream); 733 stream);
734 if (print_version_hook)
735 print_version_hook (stream);
732_getopt_if_option_set([<authors>],[< 736_getopt_if_option_set([<authors>],[<
733 width = strlen (written_by); 737 width = strlen (written_by);
734 fputs (written_by, stream); 738 fputs (written_by, stream);
diff --git a/doc/GRECS_SETUP.3 b/doc/GRECS_SETUP.3
index af0f8e0..c24399e 100644
--- a/doc/GRECS_SETUP.3
+++ b/doc/GRECS_SETUP.3
@@ -13,10 +13,8 @@
13.\" 13.\"
14.\" You should have received a copy of the GNU General Public License 14.\" You should have received a copy of the GNU General Public License
15.\" along with Grecs. If not, see <http://www.gnu.org/licenses/>. 15.\" along with Grecs. If not, see <http://www.gnu.org/licenses/>.
16.\" This file is part of SLB.
17.\" Copyright (C) 2011 Sergey Poznyakoff
18.\" 16.\"
19.TH GRECS_SETUP 3 "May 5, 2011" "GRECS" "Grecs User Reference" 17.TH GRECS_SETUP 3 "May 8, 2011" "GRECS" "Grecs User Reference"
20.SH NAME 18.SH NAME
21GRECS_SETUP \- Initialize \fBgrecs\fR submodule. 19GRECS_SETUP \- Initialize \fBgrecs\fR submodule.
22.SH SYNOPSIS 20.SH SYNOPSIS
diff --git a/doc/grecs_asprintf.3 b/doc/grecs_asprintf.3
index 73be7f0..daa7f83 100644
--- a/doc/grecs_asprintf.3
+++ b/doc/grecs_asprintf.3
@@ -13,8 +13,6 @@
13.\" 13.\"
14.\" You should have received a copy of the GNU General Public License 14.\" You should have received a copy of the GNU General Public License
15.\" along with Grecs. If not, see <http://www.gnu.org/licenses/>. 15.\" along with Grecs. If not, see <http://www.gnu.org/licenses/>.
16.\" This file is part of SLB.
17.\" Copyright (C) 2011 Sergey Poznyakoff
18.\" 16.\"
19.TH GRECS_ASPRINTF 3 "May 4, 2011" "GRECS" "Grecs User Reference" 17.TH GRECS_ASPRINTF 3 "May 4, 2011" "GRECS" "Grecs User Reference"
20.SH NAME 18.SH NAME
diff --git a/doc/grecs_config.5 b/doc/grecs_config.5
index 579875b..e4ad4f3 100644
--- a/doc/grecs_config.5
+++ b/doc/grecs_config.5
@@ -13,8 +13,6 @@
13.\" 13.\"
14.\" You should have received a copy of the GNU General Public License 14.\" You should have received a copy of the GNU General Public License
15.\" along with Grecs. If not, see <http://www.gnu.org/licenses/>. 15.\" along with Grecs. If not, see <http://www.gnu.org/licenses/>.
16.\" This file is part of SLB.
17.\" Copyright (C) 2011 Sergey Poznyakoff
18.\" 16.\"
19.TH GRECS_CONFIG 3 "May 4, 2011" "GRECS" "Grecs User Reference" 17.TH GRECS_CONFIG 3 "May 4, 2011" "GRECS" "Grecs User Reference"
20.SH NAME 18.SH NAME
diff --git a/doc/grecs_error.3 b/doc/grecs_error.3
index d747d9a..4f82dc5 100644
--- a/doc/grecs_error.3
+++ b/doc/grecs_error.3
@@ -13,8 +13,6 @@
13.\" 13.\"
14.\" You should have received a copy of the GNU General Public License 14.\" You should have received a copy of the GNU General Public License
15.\" along with Grecs. If not, see <http://www.gnu.org/licenses/>. 15.\" along with Grecs. If not, see <http://www.gnu.org/licenses/>.
16.\" This file is part of SLB.
17.\" Copyright (C) 2011 Sergey Poznyakoff
18.\" 16.\"
19.TH GRECS_ERROR 3 "May 4, 2011" "GRECS" "Grecs User Reference" 17.TH GRECS_ERROR 3 "May 4, 2011" "GRECS" "Grecs User Reference"
20.SH NAME 18.SH NAME
diff --git a/doc/grecs_format_locus.3 b/doc/grecs_format_locus.3
index 90ffa03..a7743f1 100644
--- a/doc/grecs_format_locus.3
+++ b/doc/grecs_format_locus.3
@@ -13,8 +13,6 @@
13.\" 13.\"
14.\" You should have received a copy of the GNU General Public License 14.\" You should have received a copy of the GNU General Public License
15.\" along with Grecs. If not, see <http://www.gnu.org/licenses/>. 15.\" along with Grecs. If not, see <http://www.gnu.org/licenses/>.
16.\" This file is part of SLB.
17.\" Copyright (C) 2011 Sergey Poznyakoff
18.\" 16.\"
19.TH GRECS_FORMAT_LOCUS 3 "May 4, 2011" "GRECS" "Grecs User Reference" 17.TH GRECS_FORMAT_LOCUS 3 "May 4, 2011" "GRECS" "Grecs User Reference"
20.SH NAME 18.SH NAME
diff --git a/doc/grecs_format_node.3 b/doc/grecs_format_node.3
index 76cebec..095a494 100644
--- a/doc/grecs_format_node.3
+++ b/doc/grecs_format_node.3
@@ -13,8 +13,6 @@
13.\" 13.\"
14.\" You should have received a copy of the GNU General Public License 14.\" You should have received a copy of the GNU General Public License
15.\" along with Grecs. If not, see <http://www.gnu.org/licenses/>. 15.\" along with Grecs. If not, see <http://www.gnu.org/licenses/>.
16.\" This file is part of SLB.
17.\" Copyright (C) 2011 Sergey Poznyakoff
18.\" 16.\"
19.TH GRECS_FORMAT_NODE 3 "May 4, 2011" "GRECS" "Grecs User Reference" 17.TH GRECS_FORMAT_NODE 3 "May 4, 2011" "GRECS" "Grecs User Reference"
20.SH NAME 18.SH NAME
diff --git a/doc/grecs_format_node_path.3 b/doc/grecs_format_node_path.3
index 2f8cff6..bf119e7 100644
--- a/doc/grecs_format_node_path.3
+++ b/doc/grecs_format_node_path.3
@@ -13,8 +13,6 @@
13.\" 13.\"
14.\" You should have received a copy of the GNU General Public License 14.\" You should have received a copy of the GNU General Public License
15.\" along with Grecs. If not, see <http://www.gnu.org/licenses/>. 15.\" along with Grecs. If not, see <http://www.gnu.org/licenses/>.
16.\" This file is part of SLB.
17.\" Copyright (C) 2011 Sergey Poznyakoff
18.\" 16.\"
19.TH GRECS_FORMAT_NODE_PATH 3 "May 4, 2011" "GRECS" "Grecs User Reference" 17.TH GRECS_FORMAT_NODE_PATH 3 "May 4, 2011" "GRECS" "Grecs User Reference"
20.SH NAME 18.SH NAME
diff --git a/doc/grecs_format_value.3 b/doc/grecs_format_value.3
index 8a8af9f..e4b45fa 100644
--- a/doc/grecs_format_value.3
+++ b/doc/grecs_format_value.3
@@ -13,8 +13,6 @@
13.\" 13.\"
14.\" You should have received a copy of the GNU General Public License 14.\" You should have received a copy of the GNU General Public License
15.\" along with Grecs. If not, see <http://www.gnu.org/licenses/>. 15.\" along with Grecs. If not, see <http://www.gnu.org/licenses/>.
16.\" This file is part of SLB.
17.\" Copyright (C) 2011 Sergey Poznyakoff
18.\" 16.\"
19.TH GRECS_FORMAT_VALUE 3 "May 4, 2011" "GRECS" "Grecs User Reference" 17.TH GRECS_FORMAT_VALUE 3 "May 4, 2011" "GRECS" "Grecs User Reference"
20.SH NAME 18.SH NAME
diff --git a/doc/grecs_include_path_setup.3 b/doc/grecs_include_path_setup.3
index d179773..a29173a 100644
--- a/doc/grecs_include_path_setup.3
+++ b/doc/grecs_include_path_setup.3
@@ -13,8 +13,6 @@
13.\" 13.\"
14.\" You should have received a copy of the GNU General Public License 14.\" You should have received a copy of the GNU General Public License
15.\" along with Grecs. If not, see <http://www.gnu.org/licenses/>. 15.\" along with Grecs. If not, see <http://www.gnu.org/licenses/>.
16.\" This file is part of SLB.
17.\" Copyright (C) 2011 Sergey Poznyakoff
18.\" 16.\"
19.TH GRECS_INCLUDE_PATH_SETUP 3 "May 4, 2011" "GRECS" "Grecs User Reference" 17.TH GRECS_INCLUDE_PATH_SETUP 3 "May 4, 2011" "GRECS" "Grecs User Reference"
20.SH NAME 18.SH NAME
diff --git a/doc/grecs_malloc.3 b/doc/grecs_malloc.3
index 1d52eca..7f01df8 100644
--- a/doc/grecs_malloc.3
+++ b/doc/grecs_malloc.3
@@ -13,8 +13,6 @@
13.\" 13.\"
14.\" You should have received a copy of the GNU General Public License 14.\" You should have received a copy of the GNU General Public License
15.\" along with Grecs. If not, see <http://www.gnu.org/licenses/>. 15.\" along with Grecs. If not, see <http://www.gnu.org/licenses/>.
16.\" This file is part of SLB.
17.\" Copyright (C) 2011 Sergey Poznyakoff
18.\" 16.\"
19.TH GRECS_MALLOC 3 "May 7, 2011" "GRECS" "Grecs User Reference" 17.TH GRECS_MALLOC 3 "May 7, 2011" "GRECS" "Grecs User Reference"
20.SH NAME 18.SH NAME
diff --git a/doc/grecs_node_free.3 b/doc/grecs_node_free.3
index af453c0..c154300 100644
--- a/doc/grecs_node_free.3
+++ b/doc/grecs_node_free.3
@@ -13,8 +13,6 @@
13.\" 13.\"
14.\" You should have received a copy of the GNU General Public License 14.\" You should have received a copy of the GNU General Public License
15.\" along with Grecs. If not, see <http://www.gnu.org/licenses/>. 15.\" along with Grecs. If not, see <http://www.gnu.org/licenses/>.
16.\" This file is part of SLB.
17.\" Copyright (C) 2011 Sergey Poznyakoff
18.\" 16.\"
19.TH GRECS_NODE_FREE 3 "May 4, 2011" "GRECS" "Grecs User Reference" 17.TH GRECS_NODE_FREE 3 "May 4, 2011" "GRECS" "Grecs User Reference"
20.SH NAME 18.SH NAME
diff --git a/doc/grecs_parse.3 b/doc/grecs_parse.3
index c51ef95..2abc417 100644
--- a/doc/grecs_parse.3
+++ b/doc/grecs_parse.3
@@ -13,8 +13,6 @@
13.\" 13.\"
14.\" You should have received a copy of the GNU General Public License 14.\" You should have received a copy of the GNU General Public License
15.\" along with Grecs. If not, see <http://www.gnu.org/licenses/>. 15.\" along with Grecs. If not, see <http://www.gnu.org/licenses/>.
16.\" This file is part of SLB.
17.\" Copyright (C) 2011 Sergey Poznyakoff
18.\" 16.\"
19.TH GRECS_PARSE 3 "May 7, 2011" "GRECS" "Grecs User Reference" 17.TH GRECS_PARSE 3 "May 7, 2011" "GRECS" "Grecs User Reference"
20.SH NAME 18.SH NAME
diff --git a/doc/grecs_stmt_path.5 b/doc/grecs_stmt_path.5
index 52941d5..ffe146b 100644
--- a/doc/grecs_stmt_path.5
+++ b/doc/grecs_stmt_path.5
@@ -13,8 +13,6 @@
13.\" 13.\"
14.\" You should have received a copy of the GNU General Public License 14.\" You should have received a copy of the GNU General Public License
15.\" along with Grecs. If not, see <http://www.gnu.org/licenses/>. 15.\" along with Grecs. If not, see <http://www.gnu.org/licenses/>.
16.\" This file is part of SLB.
17.\" Copyright (C) 2011 Sergey Poznyakoff
18.\" 16.\"
19.TH GRECS_STMT_PATH 5 "May 4, 2011" "GRECS" "Grecs User Reference" 17.TH GRECS_STMT_PATH 5 "May 4, 2011" "GRECS" "Grecs User Reference"
20.SH NAME 18.SH NAME
diff --git a/doc/grecs_strdup.3 b/doc/grecs_strdup.3
index ae861e4..8bfdd5f 100644
--- a/doc/grecs_strdup.3
+++ b/doc/grecs_strdup.3
@@ -13,8 +13,6 @@
13.\" 13.\"
14.\" You should have received a copy of the GNU General Public License 14.\" You should have received a copy of the GNU General Public License
15.\" along with Grecs. If not, see <http://www.gnu.org/licenses/>. 15.\" along with Grecs. If not, see <http://www.gnu.org/licenses/>.
16.\" This file is part of SLB.
17.\" Copyright (C) 2011 Sergey Poznyakoff
18.\" 16.\"
19.TH GRECS_STRDUP 3 "May 7, 2011" "GRECS" "Grecs User Reference" 17.TH GRECS_STRDUP 3 "May 7, 2011" "GRECS" "Grecs User Reference"
20.SH NAME 18.SH NAME
diff --git a/doc/grecs_tree_free.3 b/doc/grecs_tree_free.3
index 527995a..d8f1fec 100644
--- a/doc/grecs_tree_free.3
+++ b/doc/grecs_tree_free.3
@@ -13,8 +13,6 @@
13.\" 13.\"
14.\" You should have received a copy of the GNU General Public License 14.\" You should have received a copy of the GNU General Public License
15.\" along with Grecs. If not, see <http://www.gnu.org/licenses/>. 15.\" along with Grecs. If not, see <http://www.gnu.org/licenses/>.
16.\" This file is part of SLB.
17.\" Copyright (C) 2011 Sergey Poznyakoff
18.\" 16.\"
19.TH GRECS_XXX 3 "May 4, 2011" "GRECS" "Grecs User Reference" 17.TH GRECS_XXX 3 "May 4, 2011" "GRECS" "Grecs User Reference"
20.SH NAME 18.SH NAME
diff --git a/doc/tmpl.3 b/doc/tmpl.3
index 30c60e7..fa4bb74 100644
--- a/doc/tmpl.3
+++ b/doc/tmpl.3
@@ -13,8 +13,6 @@
13.\" 13.\"
14.\" You should have received a copy of the GNU General Public License 14.\" You should have received a copy of the GNU General Public License
15.\" along with Grecs. If not, see <http://www.gnu.org/licenses/>. 15.\" along with Grecs. If not, see <http://www.gnu.org/licenses/>.
16.\" This file is part of SLB.
17.\" Copyright (C) 2011 Sergey Poznyakoff
18.\" 16.\"
19.TH GRECS_XXX 3 "May 4, 2011" "GRECS" "Grecs User Reference" 17.TH GRECS_XXX 3 "May 4, 2011" "GRECS" "Grecs User Reference"
20.SH NAME 18.SH NAME
diff --git a/src/Make.am b/src/Make.am
index 50f9170..e415ada 100644
--- a/src/Make.am
+++ b/src/Make.am
@@ -35,7 +35,7 @@ noinst_HEADERS = yygrecs.h
35 35
36EXTRA_DIST=grecs-gram.h $(PP_SETUP_FILE) Make.am Make-inst.am Make-shared.am Make-static.am 36EXTRA_DIST=grecs-gram.h $(PP_SETUP_FILE) Make.am Make-inst.am Make-shared.am Make-static.am
37 37
38INCLUDES = -I$(srcdir) @GRECS_INCLUDES@ 38INCLUDES = -I$(srcdir) -I$(top_srcdir)/@GRECS_SUBDIR@ @GRECS_INCLUDES@
39AM_YFLAGS = -dtv 39AM_YFLAGS = -dtv
40AM_LFLAGS = -d 40AM_LFLAGS = -d
41 41
diff --git a/src/grecs.h b/src/grecs.h
index 8f0ddc6..decde1d 100644
--- a/src/grecs.h
+++ b/src/grecs.h
@@ -43,6 +43,7 @@
43struct grecs_version_info { 43struct grecs_version_info {
44 const char *package; 44 const char *package;
45 const char *version; 45 const char *version;
46 const char *id;
46 int major; 47 int major;
47 int minor; 48 int minor;
48 int patch; 49 int patch;
diff --git a/src/version.c b/src/version.c
index 3e251d7..709e63e 100644
--- a/src/version.c
+++ b/src/version.c
@@ -20,8 +20,9 @@
20#include <grecs.h> 20#include <grecs.h>
21#include <string.h> 21#include <string.h>
22#include <ctype.h> 22#include <ctype.h>
23#include "gitid.h"
23 24
24const char *grecs_version_string; 25const char *grecs_vcs_id = "$Id: " GRECS_GIT_ID " $";
25 26
26struct grecs_version_info * 27struct grecs_version_info *
27grecs_version_split(const char *vstr) 28grecs_version_split(const char *vstr)
@@ -114,6 +115,7 @@ grecs_version(void)
114#ifdef GRECS_VERSION_SUFFIX 115#ifdef GRECS_VERSION_SUFFIX
115 pv->suffix = GRECS_VERSION_SUFFIX; 116 pv->suffix = GRECS_VERSION_SUFFIX;
116#endif 117#endif
118 pv->id = GRECS_GIT_ID;
117 return pv; 119 return pv;
118} 120}
119 121
diff --git a/tests/Makefile.am b/tests/Makefile.am
index a8bf8d2..0bf7752 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -31,7 +31,6 @@ $(srcdir)/package.m4: $(top_srcdir)/configure.ac $(top_srcdir)/@GRECS_SUBDIR@/am
31 echo 'm4_define([AT_PACKAGE_VERSION], [@PACKAGE_VERSION@])'; \ 31 echo 'm4_define([AT_PACKAGE_VERSION], [@PACKAGE_VERSION@])'; \
32 echo 'm4_define([AT_PACKAGE_STRING], [@PACKAGE_STRING@])'; \ 32 echo 'm4_define([AT_PACKAGE_STRING], [@PACKAGE_STRING@])'; \
33 echo 'm4_define([AT_PACKAGE_BUGREPORT], [@PACKAGE_BUGREPORT@])'; \ 33 echo 'm4_define([AT_PACKAGE_BUGREPORT], [@PACKAGE_BUGREPORT@])'; \
34 echo 'm4_define([GRECS_VEROK_AT], [@GRECS_VEROK_AT@])'; \
35 echo 'm4_define([GRECS_DISTCK_AT], [@GRECS_DISTCK_AT@])'; \ 34 echo 'm4_define([GRECS_DISTCK_AT], [@GRECS_DISTCK_AT@])'; \
36 } >$(srcdir)/package.m4 35 } >$(srcdir)/package.m4
37 36
@@ -57,8 +56,7 @@ TESTSUITE_AT = \
57 reduce03.at\ 56 reduce03.at\
58 set.at\ 57 set.at\
59 testsuite.at\ 58 testsuite.at\
60 @GRECS_DISTCK_AT@\ 59 @GRECS_DISTCK_AT@
61 @GRECS_VEROK_AT@
62 60
63TESTSUITE = $(srcdir)/testsuite 61TESTSUITE = $(srcdir)/testsuite
64M4=m4 62M4=m4
diff --git a/tests/testsuite.at b/tests/testsuite.at
index 221f536..f307cd8 100644
--- a/tests/testsuite.at
+++ b/tests/testsuite.at
@@ -67,6 +67,5 @@ m4_include([reduce03.at])
67m4_include([join.at]) 67m4_include([join.at])
68 68
69m4_include([vercmp.at]) 69m4_include([vercmp.at])
70m4_if(GRECS_VEROK_AT,,,[m4_include(GRECS_VEROK_AT)])
71 70
72# End of testsuite.at 71# End of testsuite.at
diff --git a/tests/verok.at b/tests/verok.at
deleted file mode 100644
index d6064c7..0000000
--- a/tests/verok.at
+++ /dev/null
@@ -1,63 +0,0 @@
1# This file is part of grecs -*- Autotest -*-
2# Copyright (C) 2007, 2009-2011 Sergey Poznyakoff
3#
4# Grecs is free software; you can redistribute it and/or modify
5# it under the terms of the GNU General Public License as published by
6# the Free Software Foundation; either version 3, or (at your option)
7# any later version.
8#
9# Grecs is distributed in the hope that it will be useful,
10# but WITHOUT ANY WARRANTY; without even the implied warranty of
11# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12# GNU General Public License for more details.
13#
14# You should have received a copy of the GNU General Public License
15# along with Grecs. If not, see <http://www.gnu.org/licenses/>.
16
17AT_SETUP(grecs_version_ok)
18AT_KEYWORDS(verok)
19
20dnl Split Package version into major, minor, patchlevel and suffix
21
22m4_define([V_MAJOR],[m4_bpatsubst(AT_PACKAGE_VERSION,[\..*])])
23m4_define([V_MINOR],[m4_bpatsubst(AT_PACKAGE_VERSION,[[0-9]+\.\([0-9]+\).*],\1)])
24
25m4_define([V_PATCH_TMP],[m4_bpatsubst(AT_PACKAGE_VERSION,[[0-9]+\.[0-9]+\.\([0-9]+\).*],\1)])
26m4_define([V_PATCH],[m4_if(V_PATCH_TMP,AT_PACKAGE_VERSION,[0],V_PATCH_TMP)])
27
28m4_pushdef([V_SUFFIX_TMP],[m4_bpatsubst(AT_PACKAGE_VERSION,[[0-9]+\.[0-9]+\(\.[0-9]+\)?])])
29m4_define([V_SUFFIX],[m4_if(V_SUFFIX_TMP,AT_PACKAGE_VERSION,,[ V_SUFFIX_TMP])])
30
31dnl Join them back and see if the result matches version.
32m4_define([V_OK],
33[m4_if(V_MAJOR.V_MINOR[]m4_if(V_PATCH_TMP,AT_PACKAGE_VERSION,,V_PATCH_TMP)dnl
34m4_if(V_SUFFIX_TMP,AT_PACKAGE_VERSION,,V_SUFFIX_TMP),AT_PACKAGE_VERSION,
35[exit 0],
36AT_SKIP_TEST)])
37
38AT_CHECK([V_OK])
39
40AT_CHECK([gcfver],
41[0],
42[package: AT_PACKAGE_NAME
43version: AT_PACKAGE_VERSION
44major: V_MAJOR
45minor: V_MINOR
46patch: V_PATCH
47suffix:V_SUFFIX
48])
49
50AT_CHECK([gcfver AT_PACKAGE_VERSION], [0])
51AT_CHECK([gcfver "AT_PACKAGE_NAME AT_PACKAGE_VERSION"], [0])
52AT_CHECK([gcfver AT_PACKAGE_VERSION.[foo]], [1])
53AT_CHECK([gcfver "[foo] AT_PACKAGE_VERSION"], [1])
54AT_CHECK([gcfver V_MAJOR], [0])
55AT_CHECK([gcfver V_MAJOR.V_MINOR], [0])
56AT_CHECK([gcfver m4_eval(V_MAJOR+1)], [1])
57AT_CHECK([gcfver V_MAJOR.m4_eval(V_MINOR+1)], [1])
58m4_if(V_MAJOR,0,,
59 [AT_CHECK([gcfver m4_eval(V_MAJOR-1)],[0])
60 AT_CHECK([gcfver m4_eval(V_MAJOR-1).m4_eval(V_MINOR+1)],[0])
61 ])
62
63AT_CLEANUP

Return to:

Send suggestions and report system problems to the System administrator.