From cd66a7dc868fe0d0ae00ab00f4274295c4a8db54 Mon Sep 17 00:00:00 2001 From: Damiano Boppart Date: Mon, 20 Mar 2017 18:05:09 +0100 Subject: [PATCH] Fix Makefile and update build instructions for macOS --- README-OSX.md | 48 +++++++++++++++++++++++++++++++----------------- server/Makefile | 4 ++-- 2 files changed, 33 insertions(+), 19 deletions(-) diff --git a/README-OSX.md b/README-OSX.md index 56a5e3d..b77ecca 100644 --- a/README-OSX.md +++ b/README-OSX.md @@ -1,45 +1,59 @@ -# Notes for OS X +# Building for OS X/macOS +Please see also README.md, these are only OS X specific instructions. Especially note the remarks on running the server. -Please see also the README.md, these are only OS X specific instructions. -You'll need some special environment to run the server, see "Running the server". +For compiling pEp Engine Server Adapter and its dependencies, make sure you have the LANG variable set. -# Building libevent on OS X +``` +export LANG=en_US.UTF-8 +``` -## MacPorts +## Dependencies -Install [MacPorts](https://www.macports.org/) for your -[version of OS X/macOS](https://www.macports.org/install.php). +### MacPorts +[Install MacPorts](https://www.macports.org/install.php) for your version of OS X/macOS. -Note that you need [Xcode installed](https://www.macports.org/install.php) -for MacPorts, and for building the engine. You also need to accept Xcode's EULA. +If MacPorts is already installed on your machine, but was installed by a different user, make sure your `PATH` variable is set as follows in `~/.profile`: ``` -sudo port install openssl -sudo port install boost -sudo port install ossp-uuid +export PATH="/opt/local/bin:/opt/local/sbin:$PATH" ``` -## libevent +Install dependencies packaged with MacPorts as follows. ``` +sudo port install openssl boost ossp-uuid +``` + +### Other Dependencies + +#### libevent + +``` +cd libevent-2.0.22-stable export LDFLAGS=-L/opt/local export CFLAGS=-I/opt/local/include -./configure --prefix $HOME +./configure --prefix "$HOME" make make install ``` -## server/Makefile +## Building pEp JSON Server Adapter ``` cd server make ``` -# Running the server +# Running pEp JSON Server Adapter + +``` +./pep-json-server +``` + +# Testing pEp JSON Server Adapter ``` -LD_LIBRARY_PATH=/opt/local/lib ./mt-server +./servertest ``` diff --git a/server/Makefile b/server/Makefile index ba02719..5b68ab4 100644 --- a/server/Makefile +++ b/server/Makefile @@ -7,7 +7,7 @@ ifeq ($(BUILD_ON),Darwin) ifeq ($(BUILD_FOR),Darwin) CXXFLAGS = -I/opt/local/include -I$(HOME)/include -Ijson_spirit -LDFLAGS = -L/opt/local/lib -L$(HOME)/lib -lpthread -levent -lpEpEngine -luuid -lgpgme-pthread -letpan -lboost_system-mt -lboost_filesystem-mt +LDFLAGS = -L/opt/local/lib -L$(HOME)/lib -lpthread -levent -lpEpEngine -luuid -lgpgme -letpan -lboost_system-mt -lboost_filesystem-mt -lboost_program_options-mt -lboost_thread-mt endif else @@ -17,7 +17,7 @@ LDFLAGS = -L$(HOME)/lib -L$(HOME)/local/lib -lpthread -levent -lpEpEngine -luui endif -.PHONY: all clear +.PHONY: all clean all: pep-json-server servertest