#!/usr/bin/python
-# Copyright (c) 2013 Nicira, Inc.
+# Copyright (c) 2013, 2014 Nicira, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
BUILD_CLANG = OVS_SRC + "/_build-clang"
PATH = "%(ovs)s/utilities:%(ovs)s/ovsdb:%(ovs)s/vswitchd" % {"ovs": BUILD_GCC}
-ENV["CFLAGS"] = "-g -fno-omit-frame-pointer -O0"
+ENV["CFLAGS"] = "-g -fno-omit-frame-pointer"
ENV["PATH"] = PATH + ":" + ENV["PATH"]
options = None
configure = ["../configure", "--prefix=" + ROOT, "--localstatedir=" + ROOT,
"--with-logdir=%s/log" % ROOT, "--with-rundir=%s/run" % ROOT,
- "--with-linux=/lib/modules/%s/build" % uname(),
- "--with-dbdir=" + ROOT]
+ "--enable-silent-rules", "--with-dbdir=" + ROOT, "--silent"]
if options.werror:
configure.append("--enable-Werror")
if options.mandir:
configure.append("--mandir=" + options.mandir)
+ if options.optimize is None:
+ options.optimize = 0
+ ENV["CFLAGS"] = "%s -O%d" % (ENV["CFLAGS"], options.optimize)
+
_sh("./boot.sh")
try:
pass # Directory exists.
os.chdir(BUILD_GCC)
- _sh(*configure)
+ _sh(*(configure + ["--with-linux=/lib/modules/%s/build" % uname()]))
try:
_sh("clang --version", check=True)
libssl-dev gdb linux-headers-`uname -r`
# Next clone the Open vSwitch source.
- git clone git://git.openvswitch.org/openvswitch %(ovs)s
+ git clone https://github.com/openvswitch/ovs.git %(ovs)s
# Setup environment variables.
`%(v)s env`
action="store_true", help="configure with cached timing")
group.add_option("--mandir", dest="mandir", metavar="MANDIR",
help="configure the man documentation install directory")
+
+ for i in range(4):
+ group.add_option("--O%d" % i, dest="optimize", action="store_const",
+ const=i, help="compile with -O%d" % i)
parser.add_option_group(group)
group = optparse.OptionGroup(parser, "run")