diff --git a/Makefile b/Makefile index 69741e6..e7e8612 100644 --- a/Makefile +++ b/Makefile @@ -143,13 +143,6 @@ programs: libs utils utils: $(BINS) utils-subdirs -version.c: FORCE - @TOOLSVERSION="${TOOLSVERSION}" build_tools/make_version_c > $@.tmp - @if cmp -s $@.tmp $@ ; then :; else \ - mv $@.tmp $@ ; \ - fi - @rm -f $@.tmp - tests: $(TEST_BINS) $(UTILS): %: %.o diff --git a/build_tools/make_version_c b/build_tools/make_version_c deleted file mode 100755 index 7382f3f..0000000 --- a/build_tools/make_version_c +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh -cat << END -/* - * version.c - * Automatically generated - */ - -const char dahdi_tools_version[] = "DAHDI Tools Version - ${TOOLSVERSION}"; - -END diff --git a/configure.ac b/configure.ac index 4fa396b..9e75f09 100644 --- a/configure.ac +++ b/configure.ac @@ -2,11 +2,11 @@ AC_PREREQ(2.59) -m4_define([TOOLSVERSION], +m4_define([short_version], m4_bpatsubst(m4_esyscmd([build_tools/make_version . dahdi/tools]), [\([0-9.]*\)\(\w\|\W\)*], [\1])) -AC_INIT(dahdi, TOOLSVERSION, www.asterisk.org) +AC_INIT(dahdi, short_version, www.asterisk.org) # check existence of the package AC_CONFIG_SRCDIR([dahdi_cfg.c]) @@ -211,7 +211,12 @@ fi AC_SUBST(PPPD_VERSION) -AC_CONFIG_FILES([makeopts]) +AC_SUBST([TOOLSVERSION], m4_esyscmd([build_tools/make_version . dahdi/tools])) + +AC_CONFIG_FILES([ + makeopts + version.c + ]) AC_OUTPUT AC_MSG_NOTICE(*** dahdi-tools build successfully configured ***) diff --git a/version.c.in b/version.c.in new file mode 100644 index 0000000..8a65a84 --- /dev/null +++ b/version.c.in @@ -0,0 +1,6 @@ +/* + * version.c.in + */ + +const char dahdi_tools_version[] = "DAHDI Tools Version - @TOOLSVERSION@"; +