1.1 --- a/Makefile.conf Wed Sep 20 11:57:26 2017 +0200
1.2 +++ b/Makefile.conf Wed Sep 20 17:53:25 2017 +0200
1.3 @@ -3,22 +3,237 @@
1.4 # This file may be used under the terms of the GNU General Public License version 3
1.5 # see LICENSE.txt
1.6
1.7 -# This file assembles all the make variables that a maintainer or dev may want to adapt for a distribution.
1.8 +# This file gives an overview over all the parameters that can be easily customized for a build.
1.9 +# If you want to customized the build configuration without making the working copy unclean, create an addional makefile at `local.conf`.
1.10 +# `local.conf` will be included at the end of this file, and thus allows overriding any of the variables here.
1.11 +# If nothing is changed here (or in `local.conf`) a default configuration for your platform will be used.
1.12 +
1.13 +HERE:=$(dir $(lastword $(MAKEFILE_LIST)))
1.14
1.15 -# To use custom build configuration variables, put them in a new file with the path `build-config/<name>.conf`.
1.16 -# Execute `export PLATFORM_OVERRIDE=<name>` before running make.
1.17 -# If this environment variable is not set, make will load a default configuration for your platform.
1.18 +######### General #########
1.19 +# To use (only) system libraries, set all the *_INC and *_LIB variables to the empty string.
1.20 +# All the *_INC and *_LIB variables are command line flags, not paths.
1.21 +# Thus, all *_INC variables' values must start with "-I", and all *_LIB variables' values must start with "-L".
1.22
1.23 -BUILD_CONFIG:=$(dir $(lastword $(MAKEFILE_LIST)))build-config
1.24 +BUILD_ON:=$(shell uname)
1.25
1.26 -include $(BUILD_CONFIG)/common.conf
1.27 +# This variable specifies the platform that the engine should be cross-compiled for.
1.28 +BUILD_FOR=$(BUILD_ON)
1.29 +
1.30 # Cross-compiling is currently not supported.
1.31 -# Maybe you can hack something with `PLATFORM_OVERRIDE`
1.32 -ifeq ($(BUILD_ON),$(BUILD_FOR))
1.33 - include $(BUILD_CONFIG)/$(BUILD_ON).conf
1.34 -else
1.35 - $(error I don't know how to build for $(BUILD_FOR) on $(BUILD_ON))
1.36 +# Maybe you can hack something with `local.conf`.
1.37 +ifneq ($(BUILD_ON),$(BUILD_FOR))
1.38 + $(error I don't know how to build for $(BUILD_FOR) on $(BUILD_ON).)
1.39 +endif
1.40 +
1.41 +# Installation path prefix for libraries and binaries, except for system.db
1.42 +PREFIX=$(HOME)
1.43 +
1.44 +# Installation path for system.db
1.45 +SYSTEM_DB=/usr/local/share/pEp/system.db
1.46 +
1.47 +# Filename of the pEpEngine library
1.48 +ifeq ($(BUILD_FOR),Linux)
1.49 + TARGET=libpEpEngine.so
1.50 +else ifeq ($(BUILD_FOR),Darwin)
1.51 + TARGET=libpEpEngine.dylib
1.52 +endif
1.53 +
1.54 +# If empty, create a release build.
1.55 +# Otherwise, create a debug build.
1.56 +# This variable is ineffective in your override.conf file.
1.57 +DEBUG=
1.58 +
1.59 +# If empty, suppress compiler warnings.
1.60 +# Otherwise, print warnings.
1.61 +# This variable is ineffective in your override.conf file.
1.62 +WARN=placeholder
1.63 +
1.64 +
1.65 +######### C and C++ #########
1.66 +TARGET_ARCH=
1.67 +# The following two variables will be appended to.
1.68 +# You can thus not set them to a fixed value here.
1.69 +ifeq ($(BUILD_FOR),Linux)
1.70 + LDFLAGS=
1.71 +else ifeq ($(BUILD_FOR),Darwin)
1.72 + # "-bind_at_load" helps find symbol resolution errors faster
1.73 + LDFLAGS=-bind_at_load
1.74 +endif
1.75 +
1.76 +LDLIBS=
1.77 +
1.78 +
1.79 +######### C #########
1.80 +ifeq ($(BUILD_FOR),Linux)
1.81 + CC=gcc -std=c99 -pthread
1.82 +else ifeq ($(BUILD_FOR),Darwin)
1.83 + # clang issues a warning when "-pthread" is used for linking. So, include it in CFLAGS, and not in CC
1.84 + CC=clang -std=c99
1.85 +endif
1.86 +
1.87 +ifeq ($(BUILD_FOR),Linux)
1.88 + CFLAGS=-fPIC -fstrict-aliasing -fdiagnostics-color=always
1.89 +else ifeq ($(BUILD_FOR),Darwin)
1.90 + CFLAGS=-pthread -fPIC -fstrict-aliasing -fcolor-diagnostics
1.91 +endif
1.92 +
1.93 +CPPFLAGS=
1.94 +
1.95 +# The flag -DNDEBUG will always be removed from CFLAGS for compiling tests.
1.96 +# The tests do not work properly, if compiled with -DNDEBUG
1.97 +ifeq ($(BUILD_FOR),Linux)
1.98 + ifdef WARN
1.99 + CFLAGS+= -Wall -pedantic -Wstrict-aliasing=3
1.100 + else
1.101 + CFLAGS+= -w
1.102 + endif
1.103 + ifdef DEBUG
1.104 + CFLAGS+= -Og -ggdb -DDEBUG_ERRORSTACK
1.105 + else
1.106 + CFLAGS+= -O3 -DNDEBUG
1.107 + endif
1.108 +else ifeq ($(BUILD_FOR),Darwin)
1.109 + ifdef WARN
1.110 + # FIXME Remove 'no-extended-offsetof' after ENGINE-236 is closed.
1.111 + CFLAGS+= -Wall -pedantic -Wno-extended-offsetof
1.112 + else
1.113 + CFLAGS+= -w
1.114 + endif
1.115 + ifdef DEBUG
1.116 + CFLAGS+= -O0 -g -DDEBUG_ERRORSTACK
1.117 + else
1.118 + CFLAGS+= -O3 -DNDEBUG
1.119 + endif
1.120 +endif
1.121 +
1.122 +# Additional CFLAGS used for compiling ASN1C-generated code
1.123 +ifeq ($(BUILD_FOR),Linux)
1.124 + # The '_DEFAULT_SOURCE' feature test macro is required to suppress the warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE" otherwise printed during the compilation of every asn1c-generated C file. It's a glibc specific warning, only present in few versions around ~2.19. See https://lwn.net/Articles/590381/ for a discussion.
1.125 + CFLAGS_GENERATED=-D_DEFAULT_SOURCE
1.126 +else ifeq ($(BUILD_FOR),Darwin)
1.127 + CFLAGS_GENERATED=
1.128 +endif
1.129 +
1.130 +
1.131 +######### C++ #########
1.132 +ifeq ($(BUILD_FOR),Linux)
1.133 + CXX=g++ -std=gnu++11 -pthread
1.134 +else ifeq ($(BUILD_FOR),Darwin)
1.135 + # clang issues a warning when "-pthread" is used for linking. So, include it in CXXFLAGS, and not in CXX
1.136 + CXX=clang -std=c++11
1.137 endif
1.138 -ifdef PLATFORM_OVERRIDE
1.139 - include $(BUILD_CONFIG)/$(PLATFORM_OVERRIDE).conf
1.140 +
1.141 +# The flag -DNDEBUG will always be removed from CXXFLAGS for compiling tests.
1.142 +# The tests do not work properly, if compiled with -DNDEBUG
1.143 +ifeq ($(BUILD_FOR),Linux)
1.144 + CXXFLAGS=-fdiagnostics-color=always -I../src -I../asn.1 $(ETPAN_INC)
1.145 + ifdef WARN
1.146 + CXXFLAGS+=
1.147 + else
1.148 + CXXFLAGS+= -w
1.149 + endif
1.150 + ifdef DEBUG
1.151 + CXXFLAGS+= -Og -ggdb
1.152 + else
1.153 + CXXFLAGS+= -O3 -DNDEBUG
1.154 + endif
1.155 +else ifeq ($(BUILD_FOR),Darwin)
1.156 + CXXFLAGS=-pthread -fcolor-diagnostics -I../src -I../asn.1 $(ETPAN_INC)
1.157 + ifdef WARN
1.158 + CXXFLAGS+=
1.159 + else
1.160 + CXXFLAGS+= -w
1.161 + endif
1.162 + ifdef DEBUG
1.163 + CXXFLAGS+= -O0 -g
1.164 + else
1.165 + CXXFLAGS+= -O3 -DNDEBUG
1.166 + endif
1.167 endif
1.168 +
1.169 +
1.170 +######### YML2 #########
1.171 +YML2_PATH=$(HOME)/yml2
1.172 +
1.173 +YML2_PROC=$(YML2_PATH)/yml2proc
1.174 +
1.175 +YML2_OPTS=--encoding=utf8
1.176 +
1.177 +
1.178 +######### asn1c #########
1.179 +# asn1c binary
1.180 +ASN1C=asn1c
1.181 +
1.182 +# asn1c include search flag
1.183 +ASN1C_INC=
1.184 +#ASN1C_INC=-I$(HOME)/include
1.185 +
1.186 +
1.187 +######### libetpan #########
1.188 +# libetpan library search flag
1.189 +ETPAN_LIB=-L$(PREFIX)/lib
1.190 +
1.191 +# libetpan include search flag
1.192 +ETPAN_INC=-I$(PREFIX)/include
1.193 +
1.194 +
1.195 +######### sqlite3 #########
1.196 +# If empty (or undefined), compile sqlite3 from the sources shipped with the pEp distribution.
1.197 +# Otherwise, use an sqlite3 implementation found in the OS's include/library paths.
1.198 +SQLITE3_FROM_OS=placeholder
1.199 +
1.200 +
1.201 +######### OpenPGP #########
1.202 +# Path of GPG binary
1.203 +GPG_CMD:=$(shell gpgconf --list-components | awk -F: '/^gpg:/ { print $$3; exit 0; }')
1.204 +
1.205 +# Selects OpenPGP implementation. must be either `GPG` or `NETPGP`
1.206 +OPENPGP=GPG
1.207 +
1.208 +# Path of libGPGME binary
1.209 +ifeq ($(BUILD_FOR),Linux)
1.210 + LIBGPGME=libgpgme.so.11
1.211 +else ifeq ($(BUILD_FOR),Darwin)
1.212 + LIBGPGME=libgpgme.dylib
1.213 +endif
1.214 +
1.215 +# libGPGME library search flag
1.216 +ifeq ($(BUILD_FOR),Linux)
1.217 + GPGME_LIB=
1.218 +else ifeq ($(BUILD_FOR),Darwin)
1.219 + GPGME_LIB=-L$(HOME)/lib
1.220 +endif
1.221 +
1.222 +# libGPGME include search flag
1.223 +ifeq ($(BUILD_FOR),Linux)
1.224 + GPGME_INC=
1.225 +else ifeq ($(BUILD_FOR),Darwin)
1.226 + GPGME_INC=-I$(HOME)/include
1.227 +endif
1.228 +
1.229 +# NETPGP library search flag
1.230 +NETPGP_LIB=
1.231 +#NETPGP_LIB=-L$(PREFIX)/lib
1.232 +
1.233 +# libGPGME include search flag
1.234 +NETPGP_INC=
1.235 +#NETPGP_INC=-I$(PREFIX)/include
1.236 +
1.237 +
1.238 +######### Engine internals #########
1.239 +# C macros (not environment variables) that can be overridden:
1.240 +# DEFAULT_KEYSERVER - string with default keyserver
1.241 +# CRASHDUMP_DEFAULT_LINES - number of log lines to deliver for crashdumps
1.242 +# Example:
1.243 +# EXTRA_MACROS=-DDEFAULT_KEYSERVER=\"default-server.org\" -DCRASHDUMP_DEFAULT_LINES=23
1.244 +EXTRA_MACROS=
1.245 +
1.246 +
1.247 +######### Misc #########
1.248 +# FIXME Maybe include these variables here.
1.249 +# Check how they are used throughout the project before setting them here
1.250 +#LLDB_BIN
1.251 +
1.252 +
1.253 +-include HERE/local.conf
1.254 \ No newline at end of file
4.1 --- a/build-config/common.conf Wed Sep 20 11:57:26 2017 +0200
4.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
4.3 @@ -1,213 +0,0 @@
4.4 -# Copyright 2017, pEp Foundation
4.5 -# This file is part of pEpEngine
4.6 -# This file may be used under the terms of the GNU General Public License version 3
4.7 -# see LICENSE.txt
4.8 -
4.9 -# General remark: to use (only) system libraries, set all the *_INC and *_LIB variables to the empty string.
4.10 -# All the *_INC and *_LIB variables are command line flags, not paths.
4.11 -# Thus, all *_INC variables' values must start with "-I", and all *_LIB variables' values must start with "-L".
4.12 -
4.13 -######### General #########
4.14 -BUILD_ON:=$(shell uname)
4.15 -
4.16 -# This variable specifies the platform that the engine should be cross-compiled for.
4.17 -BUILD_FOR=$(BUILD_ON)
4.18 -
4.19 -# Installation path prefix for libraries and binaries, except for system.db
4.20 -PREFIX=$(HOME)
4.21 -
4.22 -# Installation path for system.db
4.23 -SYSTEM_DB=/usr/local/share/pEp/system.db
4.24 -
4.25 -# Filename of the pEpEngine library
4.26 -ifeq ($(BUILD_FOR),Linux)
4.27 - TARGET=libpEpEngine.so
4.28 -else ifeq ($(BUILD_FOR),Darwin)
4.29 - TARGET=libpEpEngine.dylib
4.30 -endif
4.31 -
4.32 -# If empty, create a release build.
4.33 -# Otherwise, create a debug build.
4.34 -# This variable is ineffective in your override.conf file.
4.35 -DEBUG=
4.36 -
4.37 -# If empty, suppress compiler warnings.
4.38 -# Otherwise, print warnings.
4.39 -# This variable is ineffective in your override.conf file.
4.40 -WARN=placeholder
4.41 -
4.42 -######### C #########
4.43 -ifeq ($(BUILD_FOR),Linux)
4.44 - CC=gcc -std=c99 -pthread
4.45 -else ifeq ($(BUILD_FOR),Darwin)
4.46 - # clang issues a warning when "-pthread" is used for linking. So, include it in CFLAGS, and not in CC
4.47 - CC=clang -std=c99
4.48 -endif
4.49 -
4.50 -ifeq ($(BUILD_FOR),Linux)
4.51 - CFLAGS=-fPIC -fstrict-aliasing -fdiagnostics-color=always
4.52 -else ifeq ($(BUILD_FOR),Darwin)
4.53 - CFLAGS=-pthread -fPIC -fstrict-aliasing -fcolor-diagnostics
4.54 -endif
4.55 -
4.56 -CPPFLAGS=
4.57 -
4.58 -# The flag -DNDEBUG will always be removed from CFLAGS for compiling tests.
4.59 -# The tests do not work properly, if compiled with -DNDEBUG
4.60 -ifeq ($(BUILD_FOR),Linux)
4.61 - ifdef WARN
4.62 - CFLAGS+= -Wall -pedantic -Wstrict-aliasing=3
4.63 - else
4.64 - CFLAGS+= -w
4.65 - endif
4.66 - ifdef DEBUG
4.67 - CFLAGS+= -Og -ggdb -DDEBUG_ERRORSTACK
4.68 - else
4.69 - CFLAGS+= -O3 -DNDEBUG
4.70 - endif
4.71 -else ifeq ($(BUILD_FOR),Darwin)
4.72 - ifdef WARN
4.73 - # FIXME Remove 'no-extended-offsetof' after ENGINE-236 is closed.
4.74 - CFLAGS+= -Wall -pedantic -Wno-extended-offsetof
4.75 - else
4.76 - CFLAGS+= -w
4.77 - endif
4.78 - ifdef DEBUG
4.79 - CFLAGS+= -O0 -g -DDEBUG_ERRORSTACK
4.80 - else
4.81 - CFLAGS+= -O3 -DNDEBUG
4.82 - endif
4.83 -endif
4.84 -
4.85 -# Additional CFLAGS used for compiling ASN1C-generated code
4.86 -ifeq ($(BUILD_FOR),Linux)
4.87 - # The '_DEFAULT_SOURCE' feature test macro is required to suppress the warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE" otherwise printed during the compilation of every asn1c-generated C file. It's a glibc specific warning, only present in few versions around ~2.19. See https://lwn.net/Articles/590381/ for a discussion.
4.88 - CFLAGS_GENERATED=-D_DEFAULT_SOURCE
4.89 -else ifeq ($(BUILD_FOR),Darwin)
4.90 - CFLAGS_GENERATED=
4.91 -endif
4.92 -
4.93 -######### C++ #########
4.94 -ifeq ($(BUILD_FOR),Linux)
4.95 - CXX=g++ -std=gnu++11 -pthread
4.96 -else ifeq ($(BUILD_FOR),Darwin)
4.97 - # clang issues a warning when "-pthread" is used for linking. So, include it in CXXFLAGS, and not in CXX
4.98 - CXX=clang -std=c++11
4.99 -endif
4.100 -
4.101 -# The flag -DNDEBUG will always be removed from CXXFLAGS for compiling tests.
4.102 -# The tests do not work properly, if compiled with -DNDEBUG
4.103 -ifeq ($(BUILD_FOR),Linux)
4.104 - CXXFLAGS=-fdiagnostics-color=always -I../src -I../asn.1 $(ETPAN_INC)
4.105 - ifdef WARN
4.106 - CXXFLAGS+=
4.107 - else
4.108 - CXXFLAGS+= -w
4.109 - endif
4.110 - ifdef DEBUG
4.111 - CXXFLAGS+= -Og -ggdb
4.112 - else
4.113 - CXXFLAGS+= -O3 -DNDEBUG
4.114 - endif
4.115 -else ifeq ($(BUILD_FOR),Darwin)
4.116 - CXXFLAGS=-pthread -fcolor-diagnostics -I../src -I../asn.1 $(ETPAN_INC)
4.117 - ifdef WARN
4.118 - CXXFLAGS+=
4.119 - else
4.120 - CXXFLAGS+= -w
4.121 - endif
4.122 - ifdef DEBUG
4.123 - CXXFLAGS+= -O0 -g
4.124 - else
4.125 - CXXFLAGS+= -O3 -DNDEBUG
4.126 - endif
4.127 -endif
4.128 -
4.129 -######### C and C++ #########
4.130 -TARGET_ARCH=
4.131 -# The following two variables will be appended to.
4.132 -# You can thus not set them to a fixed value here.
4.133 -ifeq ($(BUILD_FOR),Linux)
4.134 - LDFLAGS=
4.135 -else ifeq ($(BUILD_FOR),Darwin)
4.136 - # "-bind_at_load" helps find symbol resolution errors faster
4.137 - LDFLAGS=-bind_at_load
4.138 -endif
4.139 -
4.140 -LDLIBS=
4.141 -
4.142 -######### YML2 #########
4.143 -YML2_PATH=$(HOME)/yml2
4.144 -
4.145 -YML2_PROC=$(YML2_PATH)/yml2proc
4.146 -
4.147 -YML2_OPTS=--encoding=utf8
4.148 -
4.149 -######### asn1c #########
4.150 -# asn1c binary
4.151 -ASN1C=asn1c
4.152 -
4.153 -# asn1c include search flag
4.154 -ASN1C_INC=
4.155 -#ASN1C_INC=-I$(HOME)/include
4.156 -
4.157 -######### libetpan #########
4.158 -# libetpan library search flag
4.159 -ETPAN_LIB=-L$(PREFIX)/lib
4.160 -
4.161 -# libetpan include search flag
4.162 -ETPAN_INC=-I$(PREFIX)/include
4.163 -
4.164 -######### sqlite3 #########
4.165 -# If empty (or undefined), compile sqlite3 from the sources shipped with the pEp distribution.
4.166 -# Otherwise, use an sqlite3 implementation found in the OS's include/library paths.
4.167 -SQLITE3_FROM_OS=placeholder
4.168 -
4.169 -######### OpenPGP #########
4.170 -# Path of GPG binary
4.171 -GPG_CMD:=$(shell gpgconf --list-components | awk -F: '/^gpg:/ { print $$3; exit 0; }')
4.172 -
4.173 -# Selects OpenPGP implementation. must be either `GPG` or `NETPGP`
4.174 -OPENPGP=GPG
4.175 -
4.176 -# Path of libGPGME binary
4.177 -ifeq ($(BUILD_FOR),Linux)
4.178 - LIBGPGME=libgpgme.so.11
4.179 -else ifeq ($(BUILD_FOR),Darwin)
4.180 - LIBGPGME=libgpgme.dylib
4.181 -endif
4.182 -
4.183 -# libGPGME library search flag
4.184 -ifeq ($(BUILD_FOR),Linux)
4.185 - GPGME_LIB=
4.186 -else ifeq ($(BUILD_FOR),Darwin)
4.187 - GPGME_LIB=-L$(HOME)/lib
4.188 -endif
4.189 -
4.190 -# libGPGME include search flag
4.191 -ifeq ($(BUILD_FOR),Linux)
4.192 - GPGME_INC=
4.193 -else ifeq ($(BUILD_FOR),Darwin)
4.194 - GPGME_INC=-I$(HOME)/include
4.195 -endif
4.196 -
4.197 -# NETPGP library search flag
4.198 -NETPGP_LIB=
4.199 -#NETPGP_LIB=-L$(PREFIX)/lib
4.200 -
4.201 -# libGPGME include search flag
4.202 -NETPGP_INC=
4.203 -#NETPGP_INC=-I$(PREFIX)/include
4.204 -
4.205 -######### Engine internals #########
4.206 -# C macros (not environment variables) that can be overridden:
4.207 -# DEFAULT_KEYSERVER - string with default keyserver
4.208 -# CRASHDUMP_DEFAULT_LINES - number of log lines to deliver for crashdumps
4.209 -# Example:
4.210 -# EXTRA_MACROS=-DDEFAULT_KEYSERVER=\"default-server.org\" -DCRASHDUMP_DEFAULT_LINES=23
4.211 -EXTRA_MACROS=
4.212 -
4.213 -######### Misc #########
4.214 -# FIXME Maybe include these variables here.
4.215 -# Check how they are used throughout the project before setting them here
4.216 -#LLDB_BIN