[ovs-dev] [PATCH 3/3] ovs-dev.py: Add compiler optimization options.

Jarno Rajahalme jrajahalme at nicira.com
Wed Jan 22 00:53:34 UTC 2014


 Looks ok, but as I don't parse python, I'll want to try this out tomorrow. Is there a place where this could be documented?

  Jarno


> On Jan 21, 2014, at 3:06 PM, Ethan Jackson <ethan at nicira.com> wrote:
> 
> Signed-off-by: Ethan Jackson <ethan at nicira.com>
> ---
> utilities/ovs-dev.py | 10 +++++++++-
> 1 file changed, 9 insertions(+), 1 deletion(-)
> 
> diff --git a/utilities/ovs-dev.py b/utilities/ovs-dev.py
> index 39af37a..dff1a3a 100755
> --- a/utilities/ovs-dev.py
> +++ b/utilities/ovs-dev.py
> @@ -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 -fno-omit-frame-pointer -O0"
> +ENV["CFLAGS"] = "-g -fno-omit-frame-pointer"
> ENV["PATH"] = PATH + ":" + ENV["PATH"]
> 
> options = None
> @@ -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:
> @@ -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")
> -- 
> 1.8.1.2
> 
> _______________________________________________
> dev mailing list
> dev at openvswitch.org
> http://openvswitch.org/mailman/listinfo/dev



More information about the dev mailing list