
6 changed files with 220 additions and 55 deletions
@ -0,0 +1,62 @@ |
|||
# p≡p JNI Adapter |
|||
|
|||
## Prerequisites |
|||
|
|||
### yml2 |
|||
To set up yml2 properly, consult the documentation of pEp Engine (linked below). yml2 is a build dependency of pEp Engine. |
|||
|
|||
### C and C++ compiler |
|||
Any gcc or clang distribution offered by your OS is fine. |
|||
|
|||
### pEp Engine |
|||
Instructions for obtaining the pEp Engine can be found on [https://pep.foundation/dev/repos/pEpEngine/file/](). |
|||
|
|||
### libpEpAdapter |
|||
Instructions for obtaining libpEpAdapter can be found on [https://pep.foundation/dev/repos/libpEpAdapter/file/](). |
|||
|
|||
### Java 8 (or newer) JDK |
|||
Download Oracle Java from [https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html](). |
|||
|
|||
OpenJDK can be installed from macports on macOS with one of the following commands: |
|||
|
|||
~~~ |
|||
sudo port install openjdk8 |
|||
sudo port install openjdk11 |
|||
~~~ |
|||
|
|||
## Building |
|||
Customization of the build can be done in `src/Makefile.conf`, or in a file `src/local.conf` which is not part of the source code distribution. |
|||
|
|||
An example `src/local.conf` looks like this: |
|||
|
|||
~~~ |
|||
JAVA_HOME=/Library/Java/JavaVirtualMachines/openjdk8/Contents/Home |
|||
|
|||
YML2_PATH=$(HOME)/code/yml2 |
|||
|
|||
ENGINE_INC=-I$(HOME)/code/engine/build/include |
|||
ENGINE_LIB=-L$(HOME)/code/engine/build/lib |
|||
|
|||
AD_INC=-L$(HOME)/code/libad/build/include |
|||
AD_LIB=-L$(HOME)/code/libad/build/lib |
|||
~~~ |
|||
|
|||
Depending on what is already set in your environment, or can be found in your default include/library paths, setting any of these variables may be optional on your platform. |
|||
|
|||
Now, build the Adapter with |
|||
|
|||
On Linux: |
|||
|
|||
~~~ |
|||
cd src |
|||
make |
|||
~~~ |
|||
|
|||
On macOS: |
|||
|
|||
~~~ |
|||
cd src |
|||
gmake |
|||
~~~ |
|||
|
|||
(The GNU Make distributed with macOS is too old, install GNU Make "gmake" from macPorts). |
@ -1,4 +1,70 @@ |
|||
CXXFLAGS=-I$(JAVA_HOME)/include -I$(JAVA_HOME)/include/darwin -I$(HOME)/include -fpermissive -DDISABLE_SYNC |
|||
LDFLAGS=-L$(HOME)/lib |
|||
SHARED=libpEpJNI.dylib |
|||
PEP_ADAPTER_OBJECT_LIB=$(HOMEI)/pEp/libpEpAdapter |
|||
# Copyright 2018, pEp Foundation
|
|||
# This file is part of pEp JNI Adapter
|
|||
# This file may be used under the terms of the GNU General Public License version 3
|
|||
# see LICENSE.txt
|
|||
|
|||
######### Header #########
|
|||
HERE:=$(dir $(lastword $(MAKEFILE_LIST))) |
|||
|
|||
|
|||
######### General #########
|
|||
BUILD_FOR:=$(shell uname) |
|||
|
|||
|
|||
######### Java #########
|
|||
#JAVA_HOME=
|
|||
|
|||
|
|||
######### C and C++ #########
|
|||
LDFLAGS=-shared $(ENGINE_LIB) $(AD_LIB) |
|||
|
|||
LDLIBS=-lstdc++ -lpEpEngine |
|||
|
|||
|
|||
######### C++ #########
|
|||
ifeq ($(BUILD_FOR),Linux) |
|||
CXX=g++ -std=c++14 |
|||
else ifeq ($(BUILD_FOR),Darwin) |
|||
CXX=clang -std=c++14 |
|||
endif |
|||
|
|||
ifeq ($(BUILD_FOR),Linux) |
|||
CXXFLAGS=-fdiagnostics-color=always -fpermissive -fPIC -I$(JAVA_HOME)/include -I$(JAVA_HOME)/include/linux $(AD_INC) $(ENGINE_INC) -DDISABLE_SYNC |
|||
else ifeq ($(BUILD_FOR),Darwin) |
|||
CXXFLAGS=-fcolor-diagnostics -fpermissive -fPIC -I$(JAVA_HOME)/include -I$(JAVA_HOME)/include/darwin $(AD_INC) $(ENGINE_INC) -DDISABLE_SYNC |
|||
endif |
|||
|
|||
|
|||
######### YML2 #########
|
|||
YML2_PATH=$(HOME)/yml2 |
|||
|
|||
YML2_PROC=$(YML2_PATH)/yml2proc $(YML2_OPTS) |
|||
|
|||
YML2_OPTS=--encoding=utf8 |
|||
|
|||
|
|||
######### Engine #########
|
|||
ENGINE_LIB= |
|||
#ENGINE_LIB=-L$(HOME)/local/lib
|
|||
|
|||
ENGINE_INC= |
|||
#ENGINE_INC=-I$(HOME)/local/inc
|
|||
|
|||
|
|||
######### libAdapter #########
|
|||
AD_LIB= |
|||
#AD_LIB=-L$(HOME)/local/lib
|
|||
|
|||
AD_INC= |
|||
#AD_INC=-I$(HOME)/local/inc
|
|||
|
|||
|
|||
######### Footer #########
|
|||
-include $(HERE)/local.conf |
|||
|
|||
ifdef BUILD_CONFIG |
|||
include $(BUILD_CONFIG) |
|||
endif |
|||
|
|||
# YML_PATH is needed in the environment of every call to a program of the YML2 distribution
|
|||
export YML_PATH=$(YML2_PATH) |
|||
|
Loading…
Reference in new issue