3 # Copyright (c) 2008 Nicira Networks.
5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License.
7 # You may obtain a copy of the License at:
9 # http://www.apache.org/licenses/LICENSE-2.0
11 # Unless required by applicable law or agreed to in writing, software
12 # distributed under the License is distributed on an "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
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.])])