X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=utilities%2Fovs-dev.py;h=f73899bba86b3433bf5badb04d72ae6562d74922;hb=cfc50ae514f805dcd9c14589f21158185424daf6;hp=c5445e25ee87b954b9a1074c8db8b42e19d551d3;hpb=30fbc7b61c3ba9ad66b9974f266ec8dd41b09291;p=sliver-openvswitch.git diff --git a/utilities/ovs-dev.py b/utilities/ovs-dev.py index c5445e25e..f73899bba 100755 --- a/utilities/ovs-dev.py +++ b/utilities/ovs-dev.py @@ -1,5 +1,5 @@ #!/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. @@ -28,7 +28,7 @@ BUILD_GCC = OVS_SRC + "/_build-gcc" BUILD_CLANG = OVS_SRC + "/_build-clang" PATH = "%(ovs)s/utilities:%(ovs)s/ovsdb:%(ovs)s/vswitchd" % {"ovs": BUILD_GCC} -ENV["CFLAGS"] = "-g -O0" +ENV["CFLAGS"] = "-g -fno-omit-frame-pointer" ENV["PATH"] = PATH + ":" + ENV["PATH"] options = None @@ -62,8 +62,7 @@ def conf(): 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") @@ -74,6 +73,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: @@ -82,7 +85,7 @@ def conf(): pass # Directory exists. os.chdir(BUILD_GCC) - _sh(*configure) + _sh(*(configure + ["--with-linux=/lib/modules/%s/build" % uname()])) try: _sh("clang --version", check=True) @@ -216,7 +219,7 @@ def run(): if options.gdb: cmd = ["gdb", "--args"] + cmd elif options.valgrind: - cmd = ["valgrind", "--track-origins=yes", + cmd = ["valgrind", "--track-origins=yes", "--leak-check=full", "--suppressions=%s/tests/glibc.supp" % OVS_SRC, "--suppressions=%s/tests/openssl.supp" % OVS_SRC] + cmd else: @@ -272,7 +275,7 @@ Basic Configuration: 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` @@ -320,6 +323,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")