Add support for listing and deleting entries based on an output port.
[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
36 dnl
37 dnl If --with-build-number=NUMBER is used, substitutes a Makefile
38 dnl variable BUILDNR with NUMBER, and sets a C preprocessor variable
39 dnl BUILDNR to "+buildNUMBER".
40 dnl
41 dnl Otherwise, if --with-build-number is not used, substitutes BUILDNR
42 dnl with 0 and sets C preprocessor variable BUILDNR to "".
43 AC_DEFUN([NX_BUILDNR],
44   [AC_ARG_WITH(
45      [build-number],
46      [AS_HELP_STRING([--with-build-number=NUMBER],
47                      [Official build number (default is none)])])
48    AC_MSG_CHECKING([build number])
49    case $with_build_number in # (
50      [[0-9]] | \
51      [[0-9]][[0-9]] | \
52      [[0-9]][[0-9]][[0-9]] | \
53      [[0-9]][[0-9]][[0-9]][[0-9]] | \
54      [[0-9]][[0-9]][[0-9]][[0-9]][[0-9]])
55        BUILDNR=$with_build_number
56        buildnr='"+build'$BUILDNR'"'
57        AC_MSG_RESULT([$with_build_number])
58        ;; # (
59      ''|no)
60        BUILDNR=0
61        buildnr='""'
62        AC_MSG_RESULT([none])
63        ;; # (
64      *)
65        AC_MSG_ERROR([invalid build number $with_build_number])
66        ;;
67    esac
68    AC_SUBST([BUILDNR])
69    AC_DEFINE_UNQUOTED([BUILDNR], [$buildnr],
70      [Official build number as a VERSION suffix string, e.g. "+build123",
71       or "" if this is not an official build.])])