aboutsummaryrefslogtreecommitdiff
path: root/build-aux/version.sh
blob: 40d04936288d1748faedf1f52058df609215b528 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/bin/sh
#
#############################################################################
#
# Get the version string from version.h and print it out without
# trailing newline. This makes it suitable for use in configure.ac.
#
#############################################################################
#
# Author: Lasse Collin
#
# This file has been put into the public domain.
# You can do whatever you want with this file.
#
#############################################################################

sed -n 's/LZMA_VERSION_STABILITY_ALPHA/alpha/
	s/LZMA_VERSION_STABILITY_BETA/beta/
	s/LZMA_VERSION_STABILITY_STABLE//
	s/^#define LZMA_VERSION_[MPS][AIT][AJNT][A-Z]* //p' \
	src/liblzma/api/lzma/version.h \
	| tr '\n' '|' \
	| sed 's/|/./; s/|/./; s/|//g' \
	| tr -d '\n'