Add build number to datapath version and --version output from programs.
[sliver-openvswitch.git] / m4 / nx-build.m4
1 # -*- autoconf -*-
2
3 # Copyright (c) 2008 The Board of Trustees of The Leland Stanford
4 # Junior University
5 #
6 # We are making the OpenFlow specification and associated documentation
7 # (Software) available for public use and benefit with the expectation
8 # that others will use, modify and enhance the Software and contribute
9 # those enhancements back to the community. However, since we would
10 # like to make the Software available for broadest use, with as few
11 # restrictions as possible permission is hereby granted, free of
12 # charge, to any person obtaining a copy of this Software to deal in
13 # the Software under the copyrights without restriction, including
14 # without limitation the rights to use, copy, modify, merge, publish,
15 # distribute, sublicense, and/or sell copies of the Software, and to
16 # permit persons to whom the Software is furnished to do so, subject to
17 # the following conditions:
18 #
19 # The above copyright notice and this permission notice shall be
20 # included in all copies or substantial portions of the Software.
21 #
22 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
23 # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
24 # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
25 # NONINFRINGEMENT.  IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
26 # BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
27 # ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
28 # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
29 # SOFTWARE.
30 #
31 # The name and trademarks of copyright holder(s) may NOT be used in
32 # advertising or publicity pertaining to the Software or any
33 # derivatives without specific, written prior permission.
34
35 dnl NX_BUILDNR([NUMBER])
36 dnl
37 dnl If NUMBER is empty, substitutes BUILDNR with 0 and sets C
38 dnl preprocessor variable BUILDNR to "".
39 dnl
40 dnl If NUMBER is nonempty, substitutes a Makefile variable BUILDNR
41 dnl with NUMBER, and sets a C preprocessor variable BUILDNR to
42 dnl "+buildNUMBER".
43 AC_DEFUN([NX_BUILDNR],
44   [AC_SUBST([BUILDNR], 
45             [m4_if([$1], [], [0], [$1])])
46    AC_DEFINE([BUILDNR],
47              [m4_if([$1], [], [""], ["+build$1"])], 
48              [Official build number.])])