summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorDavid Lamparter <equinox@opensourcerouting.org>2012-11-27 01:34:56 +0000
committerDavid Lamparter <equinox@opensourcerouting.org>2012-12-12 15:34:37 +0100
commit0be793e674c8b076f0e8bf327257f15803480f49 (patch)
tree28c42a679265d25ea41f4265232e2bcc167b1f49 /configure.ac
parent324ed1f87aedf30a45aea951edb2e717c5f9b7fb (diff)
build: include git info
If enabled with --with-pkg-gitversion on ./configure, this will append git version strings and branch information at the following places: - overall version number: 0.99.21-g0123456 - login motd and show version: tag information + git id + branches Sample output: Hello, this is Quagga (version 0.99.21-g14b49ad-dirty). Copyright 1996-2005 Kunihiro Ishiguro, et al. This is a git build of quagga_0_99_21_release-106-g14b49ad-dirty Associated branch(es): local:master [v2]: fix build without gitinfo (add "else" branch) [v2]: fix for repos without any tags (different git describe output) Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Diffstat (limited to 'configure.ac')
-rwxr-xr-xconfigure.ac16
1 files changed, 12 insertions, 4 deletions
diff --git a/configure.ac b/configure.ac
index 9bbe89f3..fb6efd7e 100755
--- a/configure.ac
+++ b/configure.ac
@@ -21,6 +21,7 @@ AC_CANONICAL_TARGET()
AM_INIT_AUTOMAKE(1.6)
AM_CONFIG_HEADER(config.h)
+AC_PATH_PROG(PERL, perl)
AC_CHECK_PROG([GAWK],[gawk],[gawk],[not-in-PATH])
if test "x$GAWK" = "xnot-in-PATH" ; then
AC_MSG_ERROR([GNU awk is required for lib/memtype.h made by memtypes.awk.
@@ -192,6 +193,12 @@ dnl ----------------------
AC_ARG_WITH(pkg-extra-version,
AS_HELP_STRING([--with-pkg-extra-version=VER], [add extra version field, for packagers/distributions]),
[EXTRAVERSION=$withval],)
+AC_ARG_WITH(pkg-git-version,
+ AS_HELP_STRING([--with-pkg-git-version], [add git information to MOTD and build version string]),
+ [ if test "x$withval" != "xno"; then
+ with_pkg_git_version="1"
+ AC_DEFINE(GIT_VERSION, [1], [include git version info])
+ fi ],)
AC_ARG_ENABLE(vtysh,
[ --enable-vtysh include integrated vty shell for Quagga])
AC_ARG_ENABLE(ipv6,
@@ -398,11 +405,13 @@ dnl Add extra version string to package
dnl name, string and version fields.
dnl -----------------------------------
if test "x${EXTRAVERSION}" != "x" ; then
- VERSION=${VERSION}${EXTRAVERSION}
- PACKAGE_VERSION=${PACKAGE_VERSION}${EXTRAVERSION}
- PACKAGE_STRING=${PACKAGE_STRING}${EXTRAVERSION}
+ VERSION="${VERSION}${EXTRAVERSION}"
+ PACKAGE_VERSION="${PACKAGE_VERSION}${EXTRAVERSION}"
+ PACKAGE_STRING="${PACKAGE_STRING}${EXTRAVERSION}"
fi
+AM_CONDITIONAL([GIT_VERSION], [test "x$with_pkg_git_version" != "x"])
+
dnl ------------------------------------
dnl Check C keywords and standard types
dnl ------------------------------------
@@ -611,7 +620,6 @@ dnl ---------------------
case "${enable_vtysh}" in
"yes") VTYSH="vtysh";
AC_DEFINE(VTYSH,,VTY shell)
- AC_PATH_PROG(PERL, perl)
dnl Vtysh uses libreadline, which looks for termcap functions at
dnl configure time. We follow readlines search order.
dnl The required procedures are in libtermcap on NetBSD, in