Browse Source

merging

ENGINE-703
Volker Birk 2 years ago
parent
commit
59c9a83722
7 changed files with 173 additions and 18 deletions
  1. +3
    -2
      Makefile
  2. +1
    -1
      Makefile.conf
  3. +6
    -1
      asn.1/Makefile
  4. +3
    -2
      build-mac/pEpEngine.xcodeproj/project.pbxproj
  5. +55
    -11
      build-windows/generate_code.cmd
  6. +1
    -1
      build-windows/libpEpasn1/libpEpasn1.vcxproj
  7. +104
    -0
      doc/build-fedora.md

+ 3
- 2
Makefile View File

@ -25,7 +25,8 @@ build: asn1
$(MAKE) -C src
all: build
make -C test
# `make all` is not for tests, that's what `make test` is for
# $(MAKE) -C test
sync:
$(MAKE) -C sync
@ -51,8 +52,8 @@ clean:
$(MAKE) -C src clean
$(MAKE) -C test clean
$(MAKE) -C db clean
$(MAKE) -C sync clean
$(MAKE) -C asn.1 clean
$(MAKE) -C sync clean
tags:
$(MAKE) -C asn.1 tags


+ 1
- 1
Makefile.conf View File

@ -48,7 +48,7 @@ PREFIX=$(HOME)
# necessary
#PER_USER_DIRECTORY=.pEp
PER_MACHINE_DIRECTORY:=/usr/local/share/pEp
PER_MACHINE_DIRECTORY=/usr/local/share/pEp
# Filename of the pEpEngine library
ifeq ($(BUILD_FOR),Linux)


+ 6
- 1
asn.1/Makefile View File

@ -5,6 +5,11 @@ include ../Makefile.conf
ALL_SOURCE=$(subst $(NO_SOURCE),,$(wildcard *.c))
ALL_OBJECTS=$(subst .c,.o,$(ALL_SOURCE))
CPPFLAGS+=$(CFLAGS_GENERATED)
ASN1_INCL_LIST=-I.
#ifdef ASN1C_INC
#ASN1_INCL_LIST+= -I$(ASN1C_INC)
#endif
.PHONY: all clean install uninstall
@ -15,7 +20,7 @@ libasn1.a: $(ALL_OBJECTS)
$(AR) -rc $@ $(ALL_OBJECTS)
%.o: %.c %.h
$(CC) $(CFLAGS) $(OPTIMIZE) -I. $(ASN1C_INC) -c $< -o $@
$(CC) $(CPPFLAGS) $(CFLAGS) $(OPTIMIZE) $(ASN1_INC_LIST) -c $< -o $@
Sync.c: sync.asn1 keysync.asn1 pEp.asn1
$(ASN1C) -gen-PER -fincludes-quoted -fcompound-names -pdu=auto pEp.asn1 keysync.asn1 $<


+ 3
- 2
build-mac/pEpEngine.xcodeproj/project.pbxproj View File

@ -929,7 +929,7 @@
isa = PBXNativeTarget;
buildConfigurationList = 64796A531B455AA5004B1C24 /* Build configuration list for PBXNativeTarget "pEpEngine" */;
buildPhases = (
43D47B08225DEBD600E97C5B /* ShellScript */,
43D47B08225DEBD600E97C5B /* Generate src files */,
64796A3B1B455AA5004B1C24 /* Sources */,
64796A3C1B455AA5004B1C24 /* Frameworks */,
64796A3D1B455AA5004B1C24 /* CopyFiles */,
@ -1024,7 +1024,7 @@
/* End PBXResourcesBuildPhase section */
/* Begin PBXShellScriptBuildPhase section */
43D47B08225DEBD600E97C5B /* ShellScript */ = {
43D47B08225DEBD600E97C5B /* Generate src files */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
@ -1033,6 +1033,7 @@
);
inputPaths = (
);
name = "Generate src files";
outputFileListPaths = (
"$(SRCROOT)/generated-files-asn1.txt",
"$(SRCROOT)/generated-files-sync.txt",


+ 55
- 11
build-windows/generate_code.cmd View File

@ -1,32 +1,76 @@
pushd .
set pwd=%cd%
cd %pwd%\sync
@ECHO OFF
PUSHD .
SET pwd=%cd%
CD %pwd%\sync
if not exist generated mkdir generated
IF NOT EXIST generated MKDIR generated
ECHO py "%YML_PATH%\yml2proc" -E utf-8 -y gen_actions.ysl2 sync.fsm
py "%YML_PATH%\yml2proc" -E utf-8 -y gen_actions.ysl2 sync.fsm
IF %ERRORLEVEL% NEQ 0 (
POPD
EXIT /B 1
)
ECHO py "%YML_PATH%\yml2proc" -E utf-8 -y gen_codec.ysl2 distribution.fsm
py "%YML_PATH%\yml2proc" -E utf-8 -y gen_codec.ysl2 distribution.fsm
IF %ERRORLEVEL% NEQ 0 (
POPD
EXIT /B 1
)
ECHO py "%YML_PATH%\yml2proc" -E utf-8 -y gen_codec.ysl2 sync.fsm
py "%YML_PATH%\yml2proc" -E utf-8 -y gen_codec.ysl2 sync.fsm
IF %ERRORLEVEL% NEQ 0 (
POPD
EXIT /B 1
)
ECHO py "%YML_PATH%\yml2proc" -E utf-8 -y gen_messages.ysl2 sync.fsm
py "%YML_PATH%\yml2proc" -E utf-8 -y gen_messages.ysl2 sync.fsm
IF %ERRORLEVEL% NEQ 0 (
POPD
EXIT /B 1
)
ECHO py "%YML_PATH%\yml2proc" -E utf-8 -y gen_messages.ysl2 distribution.fsm
py "%YML_PATH%\yml2proc" -E utf-8 -y gen_messages.ysl2 distribution.fsm
IF %ERRORLEVEL% NEQ 0 (
POPD
EXIT /B 1
)
ECHO py "%YML_PATH%\yml2proc" -E utf-8 -y gen_message_func.ysl2 sync.fsm
py "%YML_PATH%\yml2proc" -E utf-8 -y gen_message_func.ysl2 sync.fsm
IF %ERRORLEVEL% NEQ 0 (
POPD
EXIT /B 1
)
ECHO py "%YML_PATH%\yml2proc" -E utf-8 -y gen_statemachine.ysl2 sync.fsm
py "%YML_PATH%\yml2proc" -E utf-8 -y gen_statemachine.ysl2 sync.fsm
IF %ERRORLEVEL% NEQ 0 (
POPD
EXIT /B 1
)
xcopy /y generated\*.asn1 ..\asn.1\
xcopy /y generated\*.c ..\src\
xcopy /y generated\*.h ..\src\
cd %pwd%\asn.1
CD %pwd%\asn.1
del *.h
del *.c
DEL *.h
DEL *.c
..\..\Tools\asn1c\bin\asn1c -S ../../Tools/asn1c/share/asn1c -gen-PER -fincludes-quoted -fcompound-names -pdu=auto pEp.asn1 keysync.asn1 sync.asn1
IF %ERRORLEVEL% NEQ 0 (
POPD
EXIT /B 1
)
..\..\Tools\asn1c\bin\asn1c -S ../../Tools/asn1c/share/asn1c -gen-PER -fincludes-quoted -fcompound-names -pdu=auto pEp.asn1 keyreset.asn1 distribution.asn1
IF %ERRORLEVEL% NEQ 0 (
POPD
EXIT /B 1
)
del *-sample.c
DEL *-sample.c
cd %pwd%\..
if not exist pEp mklink /d pEp pEpEngine\src
CD %pwd%\..
IF NOT EXIST pEp mklink /d pEp pEpEngine\src
popd
POPD

+ 1
- 1
build-windows/libpEpasn1/libpEpasn1.vcxproj View File

@ -82,7 +82,7 @@
<OptimizeReferences>true</OptimizeReferences>
</Link>
<PreBuildEvent>
<Command>"$(ProjectDir)..\generate_code.cmd" "$(ProjectDir)..\.."</Command>
<Command>cd "$(ProjectDir)..\.." &amp;&amp; "$(ProjectDir)..\generate_code.cmd"</Command>
<Message>Generating Code for pEp Sync</Message>
</PreBuildEvent>
</ItemDefinitionGroup>


+ 104
- 0
doc/build-fedora.md View File

@ -0,0 +1,104 @@
<!-- Copyright 2015-2020, pEp foundation, Switzerland
This file is part of the pEp Engine
This file may be used under the terms of the Creative Commons Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0) License
See CC_BY-SA.txt -->
# Build instructions for Fedora 31
# Installing package dependencies
~~~
# Version control
dnf install -y mercurial git
# build dependencies (YML2, libetpan, asn1c)
dnf install -y python-lxml automake libtool autoconf
# build-essentials equivalent for rpm based systems
dnf groupinstall -y "Development Tools"
# other engine dependencies (uuid, gpg, sqlite)
dnf install -y uuid-devel gpgme-devel libsqlite3x-devel libsqlite3x sqlite
# asn1c
dnf -y install asn1c
~~~
# Installing unpackaged dependencies
## YML2
~~~
mkdir -p ~/code/yml2
hg clone https://pep.foundation/dev/repos/yml2/ ~/code/yml2
~~~
## libetpan (pEp Engine requires libetpan with a set of patches that have not been upstreamed yet)
~~~
mkdir -p ~/code/libetpan
git clone https://github.com/fdik/libetpan ~/code/libetpan
cd ~/code/libetpan
mkdir ~/code/libetpan/build
./autogen.sh --prefix="$HOME/code/libetpan/build"
make
make install
~~~
# pEp Engine
~~~
mkdir -p ~/code/pep-engine
hg clone https://pep.foundation/dev/repos/pEpEngine/ ~/code/pep-engine
cd ~/code/pep-engine
hg update sync
mkdir ~/code/pep-engine/build
~~~
Edit the build configuration to your needs in `Makefile.conf`, or create a `local.conf` that sets any of the make variables documented in `Makefile.conf`. All the default values for the build configuration variables on each platform are documented in `Makefile.conf`.
If a dependency is not found in your system's default include or library paths, you will have to specify the according paths in a make variable. Typically, this has to be done at least for YML2, and libetpan.
For a more detailed explanation of the mechanics of these build configuration files, and overriding defaults, see the comments in `Makefile.conf`.
Below is a sample `./local.conf` file, for orientation.
~~~
PREFIX=$(HOME)/code/pep-engine/build
PER_MACHINE_DIRECTORY=$(PREFIX)/share/pEp
YML2_PATH=$(HOME)/code/yml2
ETPAN_LIB=-L$(HOME)/code/libetpan/build/lib
ETPAN_INC=-I$(HOME)/code/libetpan/build/include
LIBGPGME=libgpgme.so
~~~
The engine is built as follows:
~~~
make all
make db
~~~
Installation:
~~~
make dbinstall
make install
~~~
The unit tests can be run without the engine library being installed, however `system.db` must be installed:
~~~
make dbinstall
~~~
Since `system.db` rarely changes, its installation is not needed for every build.
Tests can be compiled and executed with the following commands:
~~~
make -C test compile
make test
~~~

Loading…
Cancel
Save