]> git.proxmox.com Git - mirror_frr.git/commitdiff
build: carry --with-pkg-extra-version into tarballs
authorDavid Lamparter <equinox@diac24.net>
Tue, 23 Oct 2018 12:06:25 +0000 (14:06 +0200)
committerDavid Lamparter <equinox@diac24.net>
Thu, 25 Oct 2018 15:30:21 +0000 (17:30 +0200)
If we use "./configure --with-pkg-extra-version=... && make dist", we
probably want the dist tarball to remember the extra version it was
configured with.

Use --without-pkg-extra-version to kill the tag.

Signed-off-by: David Lamparter <equinox@diac24.net>
.gitignore
Makefile.am
config.version.in [new file with mode: 0644]
configure.ac

index 8c62f05539e483d457055b83567920e575f12843..ad3e3c80e02ec70399195eba172b1b7c312ba9fa 100644 (file)
@@ -7,6 +7,7 @@
 /config.status
 /config.guess
 /config.sub
+/config.version
 /ltmain.sh
 /stamp-h
 /stamp-h[0-9]*
index 2d3c6fa638706916d1f43e7b92b6f87a8f218945..0b1c5463d4b5d50da4d756dde18e6d8e1277a5b5 100644 (file)
@@ -158,6 +158,7 @@ EXTRA_DIST += \
        aclocal.m4 \
        README.md \
        m4/README.txt \
+       config.version \
        \
        python/clidef.py \
        python/clippy/__init__.py \
diff --git a/config.version.in b/config.version.in
new file mode 100644 (file)
index 0000000..e2e739c
--- /dev/null
@@ -0,0 +1,4 @@
+# this file is used to carry --with-pkg-extra-version into tarballs
+EXTRAVERSION="@EXTRAVERSION@"
+# for easy access by scripts before ./configure is run
+DIST_PACKAGE_VERSION="@PACKAGE_VERSION@"
index 28cb5cb8f64c9fb994117f8b686835627381a35e..54fc121430f6f2d61e52fee360ef4e06b2293c6b 100755 (executable)
@@ -330,9 +330,19 @@ test -f conftest.a && rm conftest.a
 dnl ----------------------
 dnl Packages configuration
 dnl ----------------------
+if test -f config.version; then
+  . ./config.version
+elif test -f "${srcdir}/config.version"; then
+  . "${srcdir}/config.version"
+fi
 AC_ARG_WITH(pkg-extra-version,
-       AS_HELP_STRING([--with-pkg-extra-version=VER], [add extra version field, for packagers/distributions]),
-       [EXTRAVERSION=$withval],)
+  AS_HELP_STRING([--with-pkg-extra-version=VER], [add extra version field, for packagers/distributions]), [
+  if test "$withval" = "no"; then
+    EXTRAVERSION=
+  else
+    EXTRAVERSION=$withval
+  fi
+], [])
 AC_ARG_WITH(pkg-git-version,
        AS_HELP_STRING([--with-pkg-git-version], [add git information to MOTD and build version string]),
        [ test "x$withval" != "xno" && with_pkg_git_version="yes" ])
@@ -741,6 +751,7 @@ if test "x${EXTRAVERSION}" != "x" ; then
   AC_SUBST(PACKAGE_EXTRAVERSION, ["${EXTRAVERSION}"])
   PACKAGE_STRING="${PACKAGE_STRING}${EXTRAVERSION}"
 fi
+AC_SUBST(EXTRAVERSION)
 
 if test "x$with_pkg_git_version" = "xyes"; then
        if test -d "${srcdir}/.git"; then
@@ -1996,6 +2007,7 @@ AC_MSG_RESULT($ac_cv_htonl_works)
 AC_CONFIG_FILES([Makefile],[sed -e 's/^#AUTODERP# //' -i Makefile])
 
 AC_CONFIG_FILES([
+         config.version
          redhat/frr.spec
          solaris/Makefile
          debianpkg/changelog