AC_PREREQ(2.59)
AC_INIT(openflow, 0.9.0~b1, info@openflowswitch.org)
+NX_BUILDNR
AC_CONFIG_SRCDIR([README.hwtables])
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_AUX_DIR([build-aux])
* is queriable through the switch description stats message. */
static char mfr_desc[DESC_STR_LEN] = "Nicira Networks, Inc.";
static char hw_desc[DESC_STR_LEN] = "Reference Linux Kernel Module";
-static char sw_desc[DESC_STR_LEN] = VERSION;
+static char sw_desc[DESC_STR_LEN] = VERSION BUILDNR;
static char serial_num[SERIAL_NUM_LEN] = "None";
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
{
int err;
- printk("OpenFlow "VERSION", built "__DATE__" "__TIME__", "
- "protocol 0x%02x\n", OFP_VERSION);
+ printk("OpenFlow %s, built "__DATE__" "__TIME__", "
+ "protocol 0x%02x\n", VERSION BUILDNR, OFP_VERSION);
err = flow_init();
if (err)
top_srcdir = @abs_top_srcdir@
KSRC = @KSRC24@
VERSION = @VERSION@
+BUILDNR = @BUILDNR@
# File Lists
include $(srcdir)/../Modules.mk
# mechanism the kernel provides to add cflags is the EXTRA_CFLAGS variable,
# which gets inserted into the build command after the internal kernel CFLAGS.
# Since our stuff needs to come first, we override the variable.
-OF_CFLAGS = -I$(srcdir)/compat-2.4/include -I$(srcdir)/compat-2.4/include-$(ARCH) \
- -I$(srcdir)/compat-2.4 -I$(srcdir)/.. -I$(srcdir)/../../include \
- -I$(builddir)/.. $(CFLAGS) -DVERSION=\"$(VERSION)\"
+OF_CFLAGS = -I$(srcdir)/compat-2.4/include \
+ -I$(srcdir)/compat-2.4/include-$(ARCH) \
+ -I$(srcdir)/compat-2.4 -I$(srcdir)/.. \
+ -I$(srcdir)/../../include \
+ -I$(builddir)/.. $(CFLAGS) \
+ -DVERSION=\"$(VERSION)\"
+ifeq '$(BUILDNR)' '0'
+OF_CFLAGS += -DBUILDNR=\"\"
+else
+OF_CFLAGS += -DBUILDNR=\"+build$(BUILDNR)\"
+endif
override CFLAGS := $(OF_CFLAGS)
# Multipart objects
export srcdir = @abs_srcdir@
export top_srcdir = @abs_top_srcdir@
export VERSION = @VERSION@
+export BUILDNR = @BUILDNR@
include $(srcdir)/../Modules.mk
include $(srcdir)/Modules.mk
EXTRA_CFLAGS += -I$(builddir)/..
EXTRA_CFLAGS += -I$(top_srcdir)/include
EXTRA_CFLAGS += @SUPPORT_SNAT@
+ifeq '$(BUILDNR)' '0'
+EXTRA_CFLAGS += -DBUILDNR=\"\"
+else
+EXTRA_CFLAGS += -DBUILDNR=\"+build$(BUILDNR)\"
+endif
# These include directories have to go before -I$(KSRC)/include.
# NOSTDINC_FLAGS just happens to be a variable that goes in the
dh_compress
dh_fixperms
dh_installdeb
- dh_gencontrol -- -v$(VERSION)
+ dh_gencontrol
dh_md5sums
dh_builddeb --destdir=$(DEB_DESTDIR)
--- /dev/null
+# -*- autoconf -*-
+
+# Copyright (c) 2008 The Board of Trustees of The Leland Stanford
+# Junior University
+#
+# We are making the OpenFlow specification and associated documentation
+# (Software) available for public use and benefit with the expectation
+# that others will use, modify and enhance the Software and contribute
+# those enhancements back to the community. However, since we would
+# like to make the Software available for broadest use, with as few
+# restrictions as possible permission is hereby granted, free of
+# charge, to any person obtaining a copy of this Software to deal in
+# the Software under the copyrights without restriction, including
+# without limitation the rights to use, copy, modify, merge, publish,
+# distribute, sublicense, and/or sell copies of the Software, and to
+# permit persons to whom the Software is furnished to do so, subject to
+# the following conditions:
+#
+# The above copyright notice and this permission notice shall be
+# included in all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+# BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+# ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+#
+# The name and trademarks of copyright holder(s) may NOT be used in
+# advertising or publicity pertaining to the Software or any
+# derivatives without specific, written prior permission.
+
+dnl NX_BUILDNR([NUMBER])
+dnl
+dnl If NUMBER is empty, substitutes BUILDNR with 0 and sets C
+dnl preprocessor variable BUILDNR to "".
+dnl
+dnl If NUMBER is nonempty, substitutes a Makefile variable BUILDNR
+dnl with NUMBER, and sets a C preprocessor variable BUILDNR to
+dnl "+buildNUMBER".
+AC_DEFUN([NX_BUILDNR],
+ [AC_SUBST([BUILDNR],
+ [m4_if([$1], [], [0], [$1])])
+ AC_DEFINE([BUILDNR],
+ [m4_if([$1], [], [""], ["+build$1"])],
+ [Official build number.])])
die_if_already_running();
daemonize();
- VLOG_WARN("OpenFlow reference implementation version %s", VERSION);
+ VLOG_WARN("OpenFlow reference implementation version %s", VERSION BUILDNR);
VLOG_WARN("OpenFlow protocol version 0x%02x", OFP_VERSION);
/* Connect to datapath. */
usage();
case 'V':
- printf("%s "VERSION" compiled "__DATE__" "__TIME__"\n", argv[0]);
+ printf("%s %s compiled "__DATE__" "__TIME__"\n",
+ program_name, VERSION BUILDNR);
exit(EXIT_SUCCESS);
DAEMON_OPTION_HANDLERS
usage();
case 'V':
- printf("%s "VERSION" compiled "__DATE__" "__TIME__"\n", argv[0]);
+ printf("%s %s compiled "__DATE__" "__TIME__"\n",
+ program_name, VERSION BUILDNR);
exit(EXIT_SUCCESS);
case 'v':
usage();
case 'V':
- printf("%s "VERSION" compiled "__DATE__" "__TIME__"\n", argv[0]);
+ printf("%s %s compiled "__DATE__" "__TIME__"\n",
+ program_name, VERSION BUILDNR);
exit(EXIT_SUCCESS);
case 'v':
usage();
case 'V':
- printf("%s "VERSION" compiled "__DATE__" "__TIME__"\n", argv[0]);
+ printf("%s %s compiled "__DATE__" "__TIME__"\n",
+ program_name, VERSION BUILDNR);
exit(EXIT_SUCCESS);
case 'v':
usage();
case 'V':
- printf("%s "VERSION" compiled "__DATE__" "__TIME__"\n", argv[0]);
+ printf("%s %s compiled "__DATE__" "__TIME__"\n",
+ program_name, VERSION BUILDNR);
exit(EXIT_SUCCESS);
case 'v':
usage();
case 'V':
- printf("%s "VERSION" compiled "__DATE__" "__TIME__"\n", argv[0]);
+ printf("%s %s compiled "__DATE__" "__TIME__"\n",
+ program_name, VERSION BUILDNR);
exit(EXIT_SUCCESS);
case '?':