From 66c12e8e732c59f07acc2aebbbed3a25a67cbb9e Mon Sep 17 00:00:00 2001 From: Felicity Tarnell Date: Wed, 5 Mar 2014 15:28:24 +0000 Subject: [PATCH] Calculate version string from configure.ac at compile time. Also bump version from T.1.0-80 to T.81.0, as the leading 1.0 was useless. --- Makefile.in | 7 +++++-- configure | 18 +++++++++--------- configure.ac | 2 +- tts.c | 9 ++++++++- vers.c.sh | 6 ++++++ 5 files changed, 29 insertions(+), 13 deletions(-) create mode 100644 vers.c.sh diff --git a/Makefile.in b/Makefile.in index 9c39ff6..8ee1584 100644 --- a/Makefile.in +++ b/Makefile.in @@ -13,8 +13,8 @@ prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = @bindir@ -tts: ${OBJS} - ${CC} ${CFLAGS} ${LDFLAGS} ${OBJS} -o tts ${LIBS} @CURSES_LIB@ +tts: ${OBJS} vers.o + ${CC} ${CFLAGS} ${LDFLAGS} ${OBJS} vers.o -o tts ${LIBS} @CURSES_LIB@ install: ${INSTALL} -d -m 0755 ${bindir} @@ -23,5 +23,8 @@ install: .c.o: ${CC} ${CPPFLAGS} ${CFLAGS} -c $< +vers.c: vers.c.sh configure.ac + sh @top_srcdir@/vers.c.sh @top_srcdir@/configure.ac + clean: rm -f tts *.o diff --git a/configure b/configure index 01963a4..bdcb839 100755 --- a/configure +++ b/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for RT/TTS T.1.0-80. +# Generated by GNU Autoconf 2.69 for RT/TTS T.81.0. # # Report bugs to . # @@ -580,8 +580,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='RT/TTS' PACKAGE_TARNAME='rt-tts' -PACKAGE_VERSION='T.1.0-80' -PACKAGE_STRING='RT/TTS T.1.0-80' +PACKAGE_VERSION='T.81.0' +PACKAGE_STRING='RT/TTS T.81.0' PACKAGE_BUGREPORT='felicity@loreley.flyingparchment.org.uk' PACKAGE_URL='' @@ -1232,7 +1232,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures RT/TTS T.1.0-80 to adapt to many kinds of systems. +\`configure' configures RT/TTS T.81.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1293,7 +1293,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of RT/TTS T.1.0-80:";; + short | recursive ) echo "Configuration of RT/TTS T.81.0:";; esac cat <<\_ACEOF @@ -1380,7 +1380,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -RT/TTS configure T.1.0-80 +RT/TTS configure T.81.0 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -1749,7 +1749,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by RT/TTS $as_me T.1.0-80, which was +It was created by RT/TTS $as_me T.81.0, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -4720,7 +4720,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by RT/TTS $as_me T.1.0-80, which was +This file was extended by RT/TTS $as_me T.81.0, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -4782,7 +4782,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -RT/TTS config.status T.1.0-80 +RT/TTS config.status T.81.0 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff --git a/configure.ac b/configure.ac index 5d94e76..0f9c0c2 100644 --- a/configure.ac +++ b/configure.ac @@ -1,5 +1,5 @@ AC_PREREQ([2.69]) -AC_INIT([RT/TTS], [T.1.0-80], [felicity@loreley.flyingparchment.org.uk]) +AC_INIT([RT/TTS], [T.81.0], [felicity@loreley.flyingparchment.org.uk]) AC_CONFIG_SRCDIR([tts.c]) AC_CONFIG_HEADERS([config.h]) diff --git a/tts.c b/tts.c index ba6b37a..ae88ed9 100644 --- a/tts.c +++ b/tts.c @@ -136,6 +136,8 @@ int c; #define WSIZEOF(s) (sizeof(s) / sizeof(WCHAR)) +extern char const *tts_version; + static volatile sig_atomic_t doexit; static WINDOW *titwin, *statwin, *listwin; @@ -1555,8 +1557,13 @@ size_t nargs; void drawheader() { +WCHAR title[64]; + + SNPRINTF(title, WSIZEOF(title), "TTS %s - Type '?' for help", + tts_version); wmove(titwin, 0, 0); - waddstr(titwin, "TTS " PACKAGE_VERSION " - Type '?' for help"); + waddstr(titwin, title); + if (itime > 0) { WCHAR str[128]; int h, m, s; diff --git a/vers.c.sh b/vers.c.sh new file mode 100644 index 0000000..71b4fb4 --- /dev/null +++ b/vers.c.sh @@ -0,0 +1,6 @@ +#! /bin/sh + +vers=`sed -n '/^AC_INIT/ { s/^AC_INIT(\[\(.*\)\], \[\(.*\)\], \[\(.*\)\])/\2/; p; }' $1` +cat >vers.c <