[Pkg-voip-commits] [dahdi-tools] 225/285: build: generate version.c during configure
tzafrir at debian.org
tzafrir at debian.org
Thu Jul 7 19:19:02 UTC 2016
This is an automated email from the git hooks/post-receive script.
tzafrir pushed a commit to branch master
in repository dahdi-tools.
commit 41532ca8a192e88a9fbaa20c86cafb7ad9d7e98e
Author: Oron Peled <oron.peled at xorcom.com>
Date: Sun Dec 14 17:37:33 2014 -0500
build: generate version.c during configure
The TOOLSVERSION was inconsistent in configure.ac and Makefile:
* Rename the second parameter to AC_INIT() into short_version
* Calculate TOOLSVERSION during configure and use it to
generate version.c from version.c.in
* For now, leave duplicate TOOLSVERSION in Makefile (for make dist)
Signed-off-by: Tzafrir Cohen <tzafrir.cohen at xorcom.com>
---
Makefile | 7 -------
build_tools/make_version_c | 10 ----------
configure.ac | 11 ++++++++---
version.c.in | 6 ++++++
4 files changed, 14 insertions(+), 20 deletions(-)
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@";
+
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-voip/dahdi-tools.git
More information about the Pkg-voip-commits
mailing list