Bumped P4Runtime to v1.0.0

Change-Id: Ie6419e45980a0394ce1e0439831f4b011a4d7487
diff --git a/tools/build/bazel/p4lang_workspace.bzl b/tools/build/bazel/p4lang_workspace.bzl
index bc054fe..fba260e 100644
--- a/tools/build/bazel/p4lang_workspace.bzl
+++ b/tools/build/bazel/p4lang_workspace.bzl
@@ -1,17 +1,17 @@
 load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
 
-P4RUNTIME_COMMIT = "a6f81ac53c6b56d75a9603690794196d67c5dc07"
-PI_COMMIT = "539e4624f16aac39f8890a6dfb11c65040e735ad"
+P4RUNTIME_VER = "1.0.0"
+P4RUNTIME_SHA = "667464bd369b40b58dc9552be2c84e190a160b6e77137b735bd86e5b81c6adc0"
 
-P4RUNTIME_SHA = "28b79868bcfd61058cdd3f77a7a021a1add19154fa6717bf921a64cece32caf3"
+PI_COMMIT = "539e4624f16aac39f8890a6dfb11c65040e735ad"
 PI_SHA = "a16024972c15e6d35466996bbb748e4b7bef819c1c93f05a0f2228062736c35a"
 
 def generate_p4lang():
     http_archive(
         name = "com_github_p4lang_p4runtime",
-        urls = ["https://github.com/p4lang/p4runtime/archive/%s.zip" % P4RUNTIME_COMMIT],
+        urls = ["https://github.com/p4lang/p4runtime/archive/v%s.zip" % P4RUNTIME_VER],
         sha256 = P4RUNTIME_SHA,
-        strip_prefix = "p4runtime-%s/proto" % P4RUNTIME_COMMIT,
+        strip_prefix = "p4runtime-%s/proto" % P4RUNTIME_VER,
         build_file = "//tools/build/bazel:p4runtime_BUILD",
     )
 
diff --git a/tools/dev/p4vm/install-p4-tools.sh b/tools/dev/p4vm/install-p4-tools.sh
index 8efc4a3..07feecc 100755
--- a/tools/dev/p4vm/install-p4-tools.sh
+++ b/tools/dev/p4vm/install-p4-tools.sh
@@ -21,9 +21,9 @@
 BUILD_DIR=~/p4tools
 # in case BMV2_COMMIT value is updated, the same variable in
 # protocols/bmv2/thrift-api/BUCK file should also be updated
-BMV2_COMMIT="ae87b4d4523488ac935133b4aef437796ad1bbd1"
-PI_COMMIT="539e4624f16aac39f8890a6dfb11c65040e735ad"
-P4C_COMMIT="380830f6c26135d1d65e1312e3ba2da628c18145"
+BMV2_COMMIT="7fd3b39519ca892c2e160b8be358d3f487b1b00e"
+PI_COMMIT="a95222eca9b039f6398c048d7e1a1bf7f49b7235"
+P4C_COMMIT="264da2c524c849df0d9ba478cdd1d61b29d64722"
 PROTOBUF_COMMIT="tags/v3.2.0"
 GRPC_COMMIT="tags/v1.3.2"
 LIBYANG_COMMIT="v0.14-r1"
@@ -170,6 +170,9 @@
 }
 
 function do_protobuf {
+    if check_lib libprotobuf; then
+        return
+    fi
     cd ${BUILD_DIR}
     if [ ! -d protobuf ]; then
       git clone https://github.com/google/protobuf.git
@@ -193,6 +196,9 @@
 }
 
 function do_grpc {
+    if check_lib libgrpc; then
+        return
+    fi
     cd ${BUILD_DIR}
     if [ ! -d grpc ]; then
       git clone https://github.com/grpc/grpc.git
@@ -395,6 +401,15 @@
     [ "$1" == "$latest" ]
 }
 
+function check_lib {
+    ldconfig -p | grep $1 &> /dev/null
+    if [ $? == 0 ]; then
+        echo "$1 found!"
+        return 0 # true
+    fi
+    return 1 # false
+}
+
 MUST_DO_ALL=false
 DID_REQUIREMENTS=false
 function check_and_do {
@@ -430,9 +445,13 @@
             DID_REQUIREMENTS=true
         fi
         eval ${func_name}
-        echo ${commit_id} > ${commit_file}
-        # Build all next projects as they might depend on this one.
-        MUST_DO_ALL=true
+        if [[ -d ${BUILD_DIR}/${proj_dir} ]]; then
+            # If project was built, we expect its dir. Otherwise, we assume
+            # build was skipped.
+            echo ${commit_id} > ${commit_file}
+            # Build all next projects as they might depend on this one.
+            MUST_DO_ALL=true
+        fi
         # Disable printing to reduce output
         set +x
     else