]>
Commit | Line | Data |
---|---|---|
064af421 BP |
1 | # -*- autoconf -*- |
2 | ||
3 | # Copyright (c) 2008 Nicira Networks. | |
4 | # | |
a14bc59f BP |
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: | |
064af421 | 8 | # |
a14bc59f BP |
9 | # http://www.apache.org/licenses/LICENSE-2.0 |
10 | # | |
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. | |
064af421 BP |
16 | |
17 | dnl NX_BUILDNR | |
18 | dnl | |
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". | |
22 | dnl | |
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], | |
26 | [AC_ARG_WITH( | |
27 | [build-number], | |
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 # ( | |
32 | [[0-9]] | \ | |
33 | [[0-9]][[0-9]] | \ | |
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]) | |
40 | ;; # ( | |
41 | ''|no) | |
42 | BUILDNR=0 | |
43 | buildnr='""' | |
44 | AC_MSG_RESULT([none]) | |
45 | ;; # ( | |
46 | *) | |
47 | AC_MSG_ERROR([invalid build number $with_build_number]) | |
48 | ;; | |
49 | esac | |
50 | AC_SUBST([BUILDNR]) | |
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.])]) |