-if BUILD_ER_DIAGRAMS
-$(srcdir)/vswitchd/vswitch.pic: ovsdb/ovsdb-dot.in ovsdb/dot2pic \
- vswitchd/vswitch.ovsschema
- $(OVSDB_DOT) $(srcdir)/vswitchd/vswitch.ovsschema \
- | dot -T plain \
- | $(srcdir)/ovsdb/dot2pic \
- > $@.tmp
- mv $@.tmp $@
+#
+# There are two complications here. First, if "python" or "dot" is not
+# available, then we have to just use the existing diagram. Second, different
+# "dot" versions produce slightly different output for the same input, but we
+# don't want to gratuitously change vswitch.pic if someone tweaks the schema in
+# some minor way that doesn't affect the table structure. To avoid that we
+# store a checksum of vswitch.gv in vswitch.pic and only regenerate vswitch.pic
+# if vswitch.gv actually changes.
+$(srcdir)/vswitchd/vswitch.gv: ovsdb/ovsdb-dot.in vswitchd/vswitch.ovsschema
+if HAVE_PYTHON
+ $(OVSDB_DOT) $(srcdir)/vswitchd/vswitch.ovsschema > $@