]> git.ipfire.org Git - thirdparty/lldpd.git/commitdiff
configure: automatically compute version from git
authorVincent Bernat <bernat@luffy.cx>
Thu, 1 Mar 2012 07:04:55 +0000 (08:04 +0100)
committerVincent Bernat <bernat@luffy.cx>
Thu, 1 Mar 2012 07:27:30 +0000 (08:27 +0100)
Also, output this version in usage().

configure.ac
src/lldpctl.c
src/lldpd.c

index 51e54a5250428683348e46101dbc49a15126423f..32ca90b4b2efff0d4add255f54a5a9d5be45ebfc 100644 (file)
@@ -6,7 +6,14 @@
 
 # Configure autoconf
 AC_PREREQ([2.64])
-AC_INIT([lldpd], [0.6], [bernat@luffy.cx])
+
+dnl Use something like this if you need to patch autoconf files and
+dnl regenerate configure outside upstream git tree:
+dnl AC_INIT([lldpd], [0.5.7], [bernat@luffy.cx])
+AC_INIT([lldpd],
+        [m4_esyscmd_s([git describe --tags --always 2> /dev/null || date +%F])],
+        [bernat@luffy.cx])
+
 AC_CONFIG_SRCDIR([src/lldpd.c])
 AC_CONFIG_HEADER([config.h])
 AC_CONFIG_FILES([Makefile src/Makefile man/Makefile tests/Makefile])
index 2c35c5a918421aa4aa54899988a2bef1dc5bc506..045e8bfc10083b49ab59852308f03a89ab910243 100644 (file)
@@ -38,7 +38,8 @@ extern const char     *__progname;
 static void
 usage(void)
 {
-       fprintf(stderr, "Usage: %s [OPTIONS ...] [INTERFACES ...]\n", __progname);
+       fprintf(stderr, "Usage:   %s [OPTIONS ...] [INTERFACES ...]\n", __progname);
+       fprintf(stderr, "Version: %s\n", PACKAGE_STRING);
 
        fprintf(stderr, "\n");
 
index ceb93994b92935b1dc1eaa353711091d4ca91340..5f4b1cdfd80f68e19ce2b546f115d2c53b334e0f 100644 (file)
@@ -83,7 +83,8 @@ extern const char     *__progname;
 static void
 usage(void)
 {
-       fprintf(stderr, "Usage: %s [OPTIONS ...]\n", __progname);
+       fprintf(stderr, "Usage:   %s [OPTIONS ...]\n", __progname);
+       fprintf(stderr, "Version: %s\n", PACKAGE_STRING);
 
        fprintf(stderr, "\n");