Skip to content
This repository was archived by the owner on Aug 19, 2019. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,19 @@ This is the Stackdriver metadata agent.
curl -O ${VENDOR_URL}/boost-static-1.54.0-1.el7.x86_64.rpm)
$ sudo rpm --nodeps -ivp /tmp/boost-{devel,static}-1.54.0-1.el7.x86_64.rpm

## MacOS 10.12 special edition

1. Install runtime dependencies (MacOS 10.12 special edition):

$ brew install boost -c++11 && \
(cd /usr/local/lib && ln -s libboost_thread-mt.a libboost_thread.a && \
ln -s libboost_thread-mt.dylib libboost_thread.dylib)
$ brew install yajl

2. Install build dependencies (MacOS 10.12 special edition):

$ brew install cmake

# Building

1. Build the metadata agent:
Expand Down
14 changes: 12 additions & 2 deletions src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,22 @@ CPP_NETLIB_LIBDIR=$(CPP_NETLIB_DIR)/libs/network/src
YAML_CPP_DIR=$(LIBDIR)/yaml-cpp
YAML_CPP_LIBDIR=$(YAML_CPP_DIR)

SED=/usr/bin/env sed
SED_I=/usr/bin/env sed -i
CMAKE=cmake
CXXFLAGS=-std=c++11 -g -DENABLE_KUBERNETES_METADATA -I$(CPP_NETLIB_DIR) -I$(YAML_CPP_DIR)/include
LDFLAGS=-L$(CPP_NETLIB_LIBDIR) -L$(YAML_CPP_LIBDIR)
LDLIBS=-lcppnetlib-uri -lcppnetlib-client-connections -lboost_system \
-lboost_thread -lpthread -lyajl -lssl -lcrypto -lyaml-cpp
SED_EXTRA=

UNAME_S=$(shell uname -s)
ifeq ($(UNAME_S),Darwin)
CXXFLAGS+= -Wno-deprecated-declarations -I/usr/local/include
LDFLAGS+= -L/usr/local/lib
SED_I+= ''
SED_EXTRA+=-e \
's/-Wall/-Wall -Wno-deprecated-declarations -Wno-unused-local-typedef/'
endif

SRCS=\
metadatad.cc \
Expand Down Expand Up @@ -109,7 +119,7 @@ init-submodules:

$(CPP_NETLIB_DIR)/Makefile: init-submodules
cd $(CPP_NETLIB_DIR) && \
$(SED) -i -e 's/unit_test_framework //' CMakeLists.txt && \
$(SED_I) -e 's/unit_test_framework //' $(SED_EXTRA) CMakeLists.txt && \
$(CMAKE) -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS=-std=c++11 \
-DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ \
-DCPP-NETLIB_BUILD_TESTS=OFF -DCPP-NETLIB_BUILD_EXAMPLES=OFF
Expand Down