3 # Copyright (c) 2008 Nicira Networks.
5 # Permission to use, copy, modify, and/or distribute this software for any
6 # purpose with or without fee is hereby granted, provided that the above
7 # copyright notice and this permission notice appear in all copies.
9 # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10 # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11 # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12 # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13 # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14 # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15 # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
19 dnl If --with-build-number=NUMBER is used, substitutes a Makefile
20 dnl variable BUILDNR with NUMBER, and sets a C preprocessor variable
21 dnl BUILDNR to "+buildNUMBER".
23 dnl Otherwise, if --with-build-number is not used, substitutes BUILDNR
24 dnl with 0 and sets C preprocessor variable BUILDNR to "".
25 AC_DEFUN([NX_BUILDNR],
28 [AS_HELP_STRING([--with-build-number=NUMBER],
29 [Official build number (default is none)])])
30 AC_MSG_CHECKING([build number])
31 case $with_build_number in # (
34 [[0-9]][[0-9]][[0-9]] | \
35 [[0-9]][[0-9]][[0-9]][[0-9]] | \
36 [[0-9]][[0-9]][[0-9]][[0-9]][[0-9]])
37 BUILDNR=$with_build_number
38 buildnr='"+build'$BUILDNR'"'
39 AC_MSG_RESULT([$with_build_number])
47 AC_MSG_ERROR([invalid build number $with_build_number])
51 AC_DEFINE_UNQUOTED([BUILDNR], [$buildnr],
52 [Official build number as a VERSION suffix string, e.g. "+build123",
53 or "" if this is not an official build.])])