default.conf
branchENGINE-261
changeset 2210 17c30881c885
child 2211 588c4a473ef1
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/default.conf	Thu Oct 26 15:43:22 2017 +0200
     1.3 @@ -0,0 +1,260 @@
     1.4 +# Copyright 2017, pEp Foundation
     1.5 +# This file is part of pEpEngine
     1.6 +# This file may be used under the terms of the GNU General Public License version 3
     1.7 +# see LICENSE.txt
     1.8 +
     1.9 +# This file gives an overview over all the parameters that can be easily customized for a build.
    1.10 +# There are three ways in which you can customize your build:
    1.11 +# 1) Edit the variable assignments in this file
    1.12 +# 2) Create `local.conf` and fill it with variable assignments.
    1.13 +#    These `local.conf` takes precedence over the assignments below.
    1.14 +# 3) Set the environment variable `BUILD_CONFIG` to an absolute path.
    1.15 +#    The variable assignments found at the path indicated by `BUILD_CONFIG` take precedence over the assignments below and the assignments in `local.conf`.
    1.16 +# If nothing is changed according to these 3 methods, a default configuration for your platform will be used for the build.
    1.17 +
    1.18 +
    1.19 +######### Header #########
    1.20 +HERE:=$(dir $(lastword $(MAKEFILE_LIST)))
    1.21 +
    1.22 +######### General #########
    1.23 +# To use (only) system libraries, set all the *_INC and *_LIB variables to the empty string.
    1.24 +# All the *_INC and *_LIB variables are command line flags, not paths.
    1.25 +# Thus, all *_INC variables' values must start with "-I", and all *_LIB variables' values must start with "-L".
    1.26 +
    1.27 +BUILD_ON:=$(shell uname)
    1.28 +
    1.29 +# This variable specifies the platform that the engine should be cross-compiled for.
    1.30 +BUILD_FOR=$(BUILD_ON)
    1.31 +
    1.32 +# Cross-compiling is currently not supported.
    1.33 +# Maybe you can hack something with `local.conf`.
    1.34 +ifneq ($(BUILD_ON),$(BUILD_FOR))
    1.35 +    $(error I don't know how to build for $(BUILD_FOR) on $(BUILD_ON).)
    1.36 +endif
    1.37 +
    1.38 +# Installation path prefix for libraries and binaries, except for system.db
    1.39 +PREFIX=$(HOME)
    1.40 +
    1.41 +# Installation path for system.db
    1.42 +SYSTEM_DB=/usr/local/share/pEp/system.db
    1.43 +
    1.44 +# Filename of the pEpEngine library
    1.45 +ifeq ($(BUILD_FOR),Linux)
    1.46 +    TARGET=libpEpEngine.so
    1.47 +else ifeq ($(BUILD_FOR),Darwin)
    1.48 +    TARGET=libpEpEngine.dylib
    1.49 +endif
    1.50 +
    1.51 +# If empty, create a release build.
    1.52 +# Otherwise, create a debug build.
    1.53 +# This variable is ineffective in your local.conf file.
    1.54 +DEBUG=YES
    1.55 +
    1.56 +# If empty, suppress compiler warnings.
    1.57 +# Otherwise, print warnings.
    1.58 +# This variable is ineffective in your local.conf file.
    1.59 +WARN=placeholder
    1.60 +
    1.61 +
    1.62 +######### C and C++ #########
    1.63 +TARGET_ARCH=
    1.64 +# The following two variables will be appended to.
    1.65 +# You can thus not set them to a fixed value here.
    1.66 +ifeq ($(BUILD_FOR),Linux)
    1.67 +    LDFLAGS=
    1.68 +else ifeq ($(BUILD_FOR),Darwin)
    1.69 +    # "-bind_at_load" helps find symbol resolution errors faster
    1.70 +    LDFLAGS=-bind_at_load
    1.71 +endif
    1.72 +
    1.73 +LDLIBS=
    1.74 +
    1.75 +
    1.76 +######### C #########
    1.77 +ifeq ($(BUILD_FOR),Linux)
    1.78 +    CC=gcc -std=c99 -pthread
    1.79 +else ifeq ($(BUILD_FOR),Darwin)
    1.80 +    # clang issues a warning when "-pthread" is used for linking.
    1.81 +    # So, include it in CFLAGS, and not in CC
    1.82 +    CC=clang -std=c99
    1.83 +endif
    1.84 +
    1.85 +ifeq ($(BUILD_FOR),Linux)
    1.86 +    CFLAGS=-fPIC -fstrict-aliasing -fdiagnostics-color=always
    1.87 +else ifeq ($(BUILD_FOR),Darwin)
    1.88 +    CFLAGS=-pthread -fPIC -fstrict-aliasing -fcolor-diagnostics
    1.89 +endif
    1.90 +
    1.91 +CPPFLAGS=
    1.92 +
    1.93 +# The flag -DNDEBUG will always be removed from CFLAGS for compiling tests.
    1.94 +# The tests do not work properly, if compiled with -DNDEBUG
    1.95 +ifeq ($(BUILD_FOR),Linux)
    1.96 +    ifdef WARN
    1.97 +        CFLAGS+= -Wall -pedantic -Wstrict-aliasing=3
    1.98 +    else
    1.99 +        CFLAGS+= -w
   1.100 +    endif
   1.101 +    ifdef DEBUG
   1.102 +        CFLAGS+= -Og -ggdb -DDEBUG_ERRORSTACK
   1.103 +    else
   1.104 +        CFLAGS+= -O3 -DNDEBUG
   1.105 +    endif
   1.106 +else ifeq ($(BUILD_FOR),Darwin)
   1.107 +    ifdef WARN
   1.108 +        # FIXME Remove 'no-extended-offsetof' after ENGINE-236 is closed.
   1.109 +        CFLAGS+= -Wall -pedantic -Wno-extended-offsetof
   1.110 +    else
   1.111 +        CFLAGS+= -w
   1.112 +    endif
   1.113 +    ifdef DEBUG
   1.114 +        CFLAGS+= -O0 -g -DDEBUG_ERRORSTACK
   1.115 +    else
   1.116 +        CFLAGS+= -O3 -DNDEBUG
   1.117 +    endif
   1.118 +endif
   1.119 +
   1.120 +# Additional CFLAGS used for compiling ASN1C-generated code
   1.121 +ifeq ($(BUILD_FOR),Linux)
   1.122 +    # The '_DEFAULT_SOURCE' feature test macro is required to suppress the warning
   1.123 +    #   _BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE
   1.124 +    # otherwise printed during the compilation of every asn1c-generated C file.
   1.125 +    # It's a glibc specific warning, only present in few versions around ~2.19.
   1.126 +    # See https://lwn.net/Articles/590381/ for a discussion.
   1.127 +    CFLAGS_GENERATED=-D_DEFAULT_SOURCE
   1.128 +else ifeq ($(BUILD_FOR),Darwin)
   1.129 +    CFLAGS_GENERATED=
   1.130 +endif
   1.131 +
   1.132 +
   1.133 +######### C++ #########
   1.134 +ifeq ($(BUILD_FOR),Linux)
   1.135 +    CXX=g++ -std=gnu++11 -pthread
   1.136 +else ifeq ($(BUILD_FOR),Darwin)
   1.137 +    # clang issues a warning when "-pthread" is used for linking. So, include it in CXXFLAGS, and not in CXX
   1.138 +    CXX=clang -std=c++11
   1.139 +endif
   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 +# YML_PATH is needed in the environment of every call to a program of the YML2 distribution
   1.178 +export YML_PATH=$(YML2_PATH)
   1.179 +
   1.180 +######### asn1c #########
   1.181 +# asn1c binary
   1.182 +ASN1C=asn1c
   1.183 +
   1.184 +# asn1c include search flag
   1.185 +ASN1C_INC=
   1.186 +#ASN1C_INC=-I$(HOME)/include
   1.187 +
   1.188 +
   1.189 +######### libetpan #########
   1.190 +# libetpan library search flag
   1.191 +ETPAN_LIB=-L$(PREFIX)/lib
   1.192 +
   1.193 +# libetpan include search flag
   1.194 +ETPAN_INC=-I$(PREFIX)/include
   1.195 +
   1.196 +
   1.197 +######### sqlite3 #########
   1.198 +# If empty (or undefined), compile sqlite3 from the sources shipped with the pEp distribution.
   1.199 +# Otherwise, use an sqlite3 implementation found in the OS's include/library paths.
   1.200 +SQLITE3_FROM_OS=placeholder
   1.201 +
   1.202 +
   1.203 +######### OpenPGP #########
   1.204 +# Path of GPG binary
   1.205 +# gpgconf is not available for old version of GPG, for example GPG 2.0.30. Override this variable, if you compile the engine for such an old version.
   1.206 +GPG_CMD:=$(shell gpgconf --list-components | awk -F: '/^gpg:/ { print $$3; exit 0; }')
   1.207 +
   1.208 +# Selects OpenPGP implementation. must be either `GPG` or `NETPGP`
   1.209 +OPENPGP=GPG
   1.210 +
   1.211 +# Path of libGPGME binary
   1.212 +ifeq ($(BUILD_FOR),Linux)
   1.213 +    LIBGPGME=libgpgme.so.11
   1.214 +else ifeq ($(BUILD_FOR),Darwin)
   1.215 +    LIBGPGME=libgpgme.dylib
   1.216 +endif
   1.217 +
   1.218 +# libGPGME library search flag
   1.219 +ifeq ($(BUILD_FOR),Linux)
   1.220 +    GPGME_LIB=
   1.221 +else ifeq ($(BUILD_FOR),Darwin)
   1.222 +    GPGME_LIB=-L$(HOME)/lib
   1.223 +endif
   1.224 +
   1.225 +# libGPGME include search flag
   1.226 +ifeq ($(BUILD_FOR),Linux)
   1.227 +    GPGME_INC=
   1.228 +else ifeq ($(BUILD_FOR),Darwin)
   1.229 +    GPGME_INC=-I$(HOME)/include
   1.230 +endif
   1.231 +
   1.232 +# NETPGP library search flag
   1.233 +NETPGP_LIB=
   1.234 +#NETPGP_LIB=-L$(PREFIX)/lib
   1.235 +
   1.236 +# libGPGME include search flag
   1.237 +NETPGP_INC=
   1.238 +#NETPGP_INC=-I$(PREFIX)/include
   1.239 +
   1.240 +
   1.241 +######### Engine internals #########
   1.242 +# C macros (not environment variables) that can be overridden:
   1.243 +# DEFAULT_KEYSERVER - string with default keyserver
   1.244 +# CRASHDUMP_DEFAULT_LINES - number of log lines to deliver for crashdumps
   1.245 +# Example:
   1.246 +#    EXTRA_MACROS=-DDEFAULT_KEYSERVER=\"default-server.org\" -DCRASHDUMP_DEFAULT_LINES=23
   1.247 +EXTRA_MACROS=
   1.248 +
   1.249 +
   1.250 +######### Misc #########
   1.251 +# FIXME Maybe include these variables here.
   1.252 +# Check how they are used throughout the project before setting them here
   1.253 +#LLDB_BIN
   1.254 +
   1.255 +
   1.256 +######### Footer #########
   1.257 +include $(HERE)/Makefile.conf
   1.258 +
   1.259 +-include $(HERE)/local.conf
   1.260 +
   1.261 +ifdef BUILD_CONFIG
   1.262 +    include $(BUILD_CONFIG)
   1.263 +endif