Remove dependency on ninja-build

Change-Id: Ib13212ec6a2cebbdda8ab1220b71fdaa39c91927
Reviewed-on: https://weave-review.googlesource.com/1631
Reviewed-by: Vitaly Buka <vitalybuka@google.com>
Reviewed-by: Alex Vakulenko <avakulenko@google.com>
diff --git a/README b/README
index 79b48f1..9b357a0 100644
--- a/README
+++ b/README
@@ -71,7 +71,6 @@
   libtool
   gyp
   libexpat1-dev
-  ninja-build
 
 For tests:
 
@@ -90,18 +89,18 @@
 ---------
 Everywhere below Debug can be replaced with Release.
 
-Generate ninja build files:
+Generate build files:
 
   gyp -I libweave_common.gypi --toplevel-dir=. --depth=. \
-      -f ninja libweave_standalone.gyp
+      -f make libweave_standalone.gyp
 
 Build library with tests:
 
-  ninja -C out/Debug
+  make
 
 Build library only:
 
-  ninja -C out/Debug libweave
+  make libweave
 
 Testing
 -------
diff --git a/examples/build.sh b/examples/build.sh
index e4c412d..262c56b 100755
--- a/examples/build.sh
+++ b/examples/build.sh
@@ -8,7 +8,7 @@
 
 cd $ROOT_DIR
 
-gyp -Ilibweave_common.gypi --toplevel-dir=. --depth=. -f ninja $DIR/daemon/examples.gyp
+gyp -Ilibweave_common.gypi --toplevel-dir=. --depth=. -f make $DIR/daemon/examples.gyp
 
 if [ -z "$BUILD_CONFIG" ]; then
    export BUILD_CONFIG=Debug
@@ -20,7 +20,7 @@
 fi
 
 export CORES=`cat /proc/cpuinfo | grep processor | wc -l`
-ninja -j $CORES -C out/${BUILD_CONFIG} $BUILD_TARGET || exit 1
+BUILDTYPE=$BUILD_CONFIG make -j $CORES $BUILD_TARGET || exit 1
 
 if [[ $BUILD_TARGET == *"libweave_testrunner"* ]]; then
   out/${BUILD_CONFIG}/libweave_testrunner --gtest_break_on_failure || exit 1
diff --git a/examples/prerequisites.sh b/examples/prerequisites.sh
index 7358b71..1b27806 100755
--- a/examples/prerequisites.sh
+++ b/examples/prerequisites.sh
@@ -20,7 +20,6 @@
   libnl-route-3-dev \
   libssl-dev \
   libtool \
-  ninja-build \
   || exit 1
 
 mkdir -p $ROOT_DIR/third_party/lib $ROOT_DIR/third_party/include 2> /dev/null
diff --git a/examples/provider/event_http_client.cc b/examples/provider/event_http_client.cc
index 03da97f..1931547 100644
--- a/examples/provider/event_http_client.cc
+++ b/examples/provider/event_http_client.cc
@@ -91,7 +91,7 @@
                                   const Headers& headers,
                                   const std::string& data,
                                   const SendRequestCallback& callback) {
-  evhttp_cmd_type method_id;
+  evhttp_cmd_type method_id = EVHTTP_REQ_GET;
   CHECK(weave::StringToEnum(weave::EnumToString(method), &method_id));
   EventPtr<evhttp_uri> http_uri{evhttp_uri_parse(url.c_str())};
   CHECK(http_uri);
diff --git a/libweave_common.gypi b/libweave_common.gypi
index 4b12363..2e1fa10 100644
--- a/libweave_common.gypi
+++ b/libweave_common.gypi
@@ -48,6 +48,10 @@
       '-Wpointer-arith',
       '-Wwrite-strings',
     ],
+    'libraries': [
+      # 'library_dirs' does not work as expected with make files
+      '-Lthird_party/lib',
+    ],
     'library_dirs': ['third_party/lib']
   },
 }
diff --git a/libweave_standalone.gyp b/libweave_standalone.gyp
index fd87f16..d6418db 100644
--- a/libweave_standalone.gyp
+++ b/libweave_standalone.gyp
@@ -8,9 +8,9 @@
   'target_defaults': {
     'libraries': [
       '-lcrypto',
-      '-lgtest',
-      '-lgmock',
       '-lexpat',
+      '-lgmock',
+      '-lgtest',
       '-lpthread',
     ],
   },