Fixed p4vm not building with debug flags disabled

Change-Id: I5089319b91c6b62166f4e506762f2552dd20744c
diff --git a/tools/dev/p4vm/install-p4-tools.sh b/tools/dev/p4vm/install-p4-tools.sh
index 9bf8840..6a8d3a3 100755
--- a/tools/dev/p4vm/install-p4-tools.sh
+++ b/tools/dev/p4vm/install-p4-tools.sh
@@ -264,11 +264,10 @@
     # FIXME: re-enable --with-sysrepo when gNMI support becomes more stable
     # ./configure --with-proto --with-sysrepo 'CXXFLAGS=-O0 -g'
     if [ "${DEBUG_FLAGS}" = true ] ; then
-        CONF_FLAGS="'CXXFLAGS=-O0 -g'"
+        ./configure --with-proto "CXXFLAGS=-O0 -g"
     else
-        CONF_FLAGS=""
+        ./configure --with-proto
     fi
-    ./configure --with-proto ${CONF_FLAGS}
     make -j${NUM_CORES}
     sudo make install
     sudo ldconfig
@@ -282,11 +281,10 @@
 
     ./autogen.sh
     if [ "${DEBUG_FLAGS}" = true ] ; then
-        CONF_FLAGS="--enable-debugger 'CXXFLAGS=-O0 -g'"
+        ./configure --with-pi --enable-debugger "CXXFLAGS=-O0 -g"
     else
-        CONF_FLAGS="--disable-logging-macros --disable-elogger --without-nanomsg"
+        ./configure --with-pi --disable-logging-macros --disable-elogger --without-nanomsg
     fi
-    ./configure --with-pi ${CONF_FLAGS}
     make -j${NUM_CORES}
     sudo make install
     sudo ldconfig
@@ -296,13 +294,12 @@
     ./autogen.sh
 
     if [ "${DEBUG_FLAGS}" = true ] ; then
-        CONF_FLAGS="'CXXFLAGS=-O0 -g'"
+        ./configure --with-thrift "CXXFLAGS=-O0 -g"
     else
-        CONF_FLAGS=""
+        ./configure --with-thrift
     fi
     # FIXME: re-enable --with-sysrepo when gNMI support becomes more stable
     # ./configure --with-sysrepo --with-thrift 'CXXFLAGS=-O0 -g'
-    ./configure --with-thrift ${CONF_FLAGS}
     make -j${NUM_CORES}
     sudo make install
     sudo ldconfig