2
0
mirror of https://github.com/openvswitch/ovs synced 2025-10-23 14:57:06 +00:00

ovs-dev.py: Add support for clang builds.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
This commit is contained in:
Ethan Jackson
2013-07-26 17:06:15 -07:00
parent edfe54d09e
commit 47e501e172

View File

@@ -52,6 +52,9 @@ def uname():
def conf():
tag()
if options.clang:
ENV["CC"] = "clang"
configure = ["./configure", "--prefix=" + ROOT, "--localstatedir=" + ROOT,
"--with-logdir=%s/log" % ROOT, "--with-rundir=%s/run" % ROOT,
"--with-linux=/lib/modules/%s/build" % uname(),
@@ -75,7 +78,11 @@ def make(args=""):
make = "make -s -j 8 " + args
try:
_sh("cgcc", "--version", capture=True)
make += " C=1"
# XXX: For some reason the clang build doesn't place nicely with
# sparse. At some point this needs to be figured out and this check
# removed.
if not options.clang:
make += " C=1"
except OSError:
pass
_sh(make)
@@ -275,6 +282,8 @@ def main():
help="run ovs-vswitchd under gdb")
group.add_option("--valgrind", dest="valgrind", action="store_true",
help="run ovs-vswitchd under valgrind")
group.add_option("--clang", dest="clang", action="store_true",
help="build ovs-vswitchd with clang")
parser.add_option_group(group)
options, args = parser.parse_args()