mirror of
https://github.com/openvswitch/ovs
synced 2025-10-27 15:18: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:
@@ -52,6 +52,9 @@ def uname():
|
|||||||
|
|
||||||
def conf():
|
def conf():
|
||||||
tag()
|
tag()
|
||||||
|
if options.clang:
|
||||||
|
ENV["CC"] = "clang"
|
||||||
|
|
||||||
configure = ["./configure", "--prefix=" + ROOT, "--localstatedir=" + ROOT,
|
configure = ["./configure", "--prefix=" + ROOT, "--localstatedir=" + ROOT,
|
||||||
"--with-logdir=%s/log" % ROOT, "--with-rundir=%s/run" % ROOT,
|
"--with-logdir=%s/log" % ROOT, "--with-rundir=%s/run" % ROOT,
|
||||||
"--with-linux=/lib/modules/%s/build" % uname(),
|
"--with-linux=/lib/modules/%s/build" % uname(),
|
||||||
@@ -75,6 +78,10 @@ def make(args=""):
|
|||||||
make = "make -s -j 8 " + args
|
make = "make -s -j 8 " + args
|
||||||
try:
|
try:
|
||||||
_sh("cgcc", "--version", capture=True)
|
_sh("cgcc", "--version", capture=True)
|
||||||
|
# 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"
|
make += " C=1"
|
||||||
except OSError:
|
except OSError:
|
||||||
pass
|
pass
|
||||||
@@ -275,6 +282,8 @@ def main():
|
|||||||
help="run ovs-vswitchd under gdb")
|
help="run ovs-vswitchd under gdb")
|
||||||
group.add_option("--valgrind", dest="valgrind", action="store_true",
|
group.add_option("--valgrind", dest="valgrind", action="store_true",
|
||||||
help="run ovs-vswitchd under valgrind")
|
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)
|
parser.add_option_group(group)
|
||||||
|
|
||||||
options, args = parser.parse_args()
|
options, args = parser.parse_args()
|
||||||
|
|||||||
Reference in New Issue
Block a user