summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile.am6
-rw-r--r--configure.ac7
-rwxr-xr-xgit-version-gen15
3 files changed, 26 insertions, 2 deletions
diff --git a/Makefile.am b/Makefile.am
index 4d21b65..84b196d 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -11,7 +11,11 @@ SUBDIRS += fuzz
11endif 11endif
12 12
13EXTRA_DIST = \ 13EXTRA_DIST = \
14 README.md 14 README.md \
15 git-version-gen
16
17dist-hook:
18 echo $(VERSION) > $(distdir)/.tarball-version
15 19
16docs/html: $(top_builddir)/doxygen.cfg $(top_srcdir)/include/plist/*.h 20docs/html: $(top_builddir)/doxygen.cfg $(top_srcdir)/include/plist/*.h
17 rm -rf docs/html 21 rm -rf docs/html
diff --git a/configure.ac b/configure.ac
index 0d13e04..d1b1f62 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2,7 +2,7 @@
2# Process this file with autoconf to produce a configure script. 2# Process this file with autoconf to produce a configure script.
3 3
4AC_PREREQ(2.68) 4AC_PREREQ(2.68)
5AC_INIT([libplist], [2.2.1], [https://github.com/libimobiledevice/libplist/issues],, [https://libimobiledevice.org]) 5AC_INIT([libplist], [m4_esyscmd(./git-version-gen $RELEASE_VERSION)], [https://github.com/libimobiledevice/libplist/issues],, [https://libimobiledevice.org])
6AM_INIT_AUTOMAKE([dist-bzip2 no-dist-gzip check-news]) 6AM_INIT_AUTOMAKE([dist-bzip2 no-dist-gzip check-news])
7m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES]) 7m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES])
8AC_CONFIG_SRCDIR([src/]) 8AC_CONFIG_SRCDIR([src/])
@@ -19,6 +19,11 @@ LIBPLIST_SO_VERSION=6:0:3
19 19
20AC_SUBST(LIBPLIST_SO_VERSION) 20AC_SUBST(LIBPLIST_SO_VERSION)
21 21
22# Check if we have a version defined
23if test -z $PACKAGE_VERSION; then
24 AC_MSG_ERROR([PACKAGE_VERSION is not defined. Make sure to configure a source tree checked out from git or that .tarball-version is present.])
25fi
26
22# Checks for programs. 27# Checks for programs.
23AC_PROG_CC 28AC_PROG_CC
24AC_PROG_CXX 29AC_PROG_CXX
diff --git a/git-version-gen b/git-version-gen
new file mode 100755
index 0000000..6feac34
--- /dev/null
+++ b/git-version-gen
@@ -0,0 +1,15 @@
1#!/bin/sh
2SRCDIR=`dirname $0`
3if test -n "$1"; then
4 VER=$1
5else
6 if test -d "${SRCDIR}/.git" && test -x "`which git`" ; then
7 git update-index -q --refresh
8 VER=`git describe --tags --always --dirty=-dirty`
9 else
10 if test -f "${SRCDIR}/.tarball-version"; then
11 VER=`cat "${SRCDIR}/.tarball-version"`
12 fi
13 fi
14fi
15printf %s "$VER"