Updates from ddm4
[awesomized/libmemcached] / m4 / ax_hex_version.m4
1 # ===========================================================================
2 # https://github.com/BrianAker/ddm4
3 # ===========================================================================
4 #
5 # SYNOPSIS
6 #
7 # AX_HEX_VERSION
8 #
9 # DESCRIPTION
10 #
11 # Generate version information in HEX format.
12 #
13 # LICENSE
14 #
15 # Copyright (c) 2012 Brian Aker <brian@tangent.org>
16 #
17 # Copying and distribution of this file, with or without modification, are
18 # permitted in any medium without royalty provided the copyright notice
19 # and this notice are preserved. This file is offered as-is, without any
20 # warranty.
21
22 #serial 1
23
24 AC_DEFUN([AX_HEX_VERSION],[
25 AC_CACHE_CHECK([generate HEX_VERSION], [ax_cv_hex_version],[
26 ax_cv_hex_version=`echo $VERSION | sed 's|[\-a-z0-9]*$||' | awk -F. '{printf "0x%0.2d%0.3d%0.3d", $[]1, $[]2, $[]3}'`
27 ])
28 AC_SUBST([HEX_VERSION],["$ax_cv_hex_version"])
29 AC_DEFINE([HEX_VERSION],[1],[HEX representation of VERSION])
30 ])
31