Skip to content

Commit

Permalink
ovs-dev.py: Add compiler optimization options.
Browse files Browse the repository at this point in the history
Signed-off-by: Ethan Jackson <[email protected]>
Acked-by: Jarno Rajahalme <[email protected]>
  • Loading branch information
ejj committed Jan 22, 2014
1 parent 6e4ffd0 commit a2a2ac7
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion utilities/ovs-dev.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
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
Expand Down Expand Up @@ -74,6 +74,10 @@ def conf():
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:
Expand Down Expand Up @@ -320,6 +324,10 @@ def main():
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")
Expand Down

0 comments on commit a2a2ac7

Please sign in to comment.