|
|
|
@ -67,26 +67,6 @@ DEBUG=placeholder
|
|
|
|
|
WARN=placeholder
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
######### MIME #########
|
|
|
|
|
# This is before the C/C++ stuff because pEpMIME runs on a different
|
|
|
|
|
# C++ version than we'd like for the moment and we need to set it conditionally
|
|
|
|
|
|
|
|
|
|
######### pEp MIME #########
|
|
|
|
|
PEP_MIME=0
|
|
|
|
|
PEP_MIME_SRC=$(HOME)/src/pEpMIME/src
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
######### libetpan #########
|
|
|
|
|
# libetpan library search flag
|
|
|
|
|
#
|
|
|
|
|
ETPAN_LIB=
|
|
|
|
|
#ETPAN_LIB=-L$(HOME)/lib
|
|
|
|
|
|
|
|
|
|
# libetpan include search flag
|
|
|
|
|
ETPAN_INC=
|
|
|
|
|
#ETPAN_INC=-I$(HOME)/include
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
######### C and C++ #########
|
|
|
|
|
TARGET_ARCH=
|
|
|
|
|
|
|
|
|
@ -99,22 +79,23 @@ else ifeq ($(BUILD_FOR),Darwin)
|
|
|
|
|
LDFLAGS+=-bind_at_load
|
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
# Are we wiping this on purpose?
|
|
|
|
|
LDLIBS=
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
######### C #########
|
|
|
|
|
ifeq ($(BUILD_FOR),Linux)
|
|
|
|
|
CC=gcc -std=c99 -pthread
|
|
|
|
|
CC=gcc
|
|
|
|
|
else ifeq ($(BUILD_FOR),Darwin)
|
|
|
|
|
# clang issues a warning when "-pthread" is used for linking.
|
|
|
|
|
# So, include it in CFLAGS, and not in CC
|
|
|
|
|
CC=clang -std=c99
|
|
|
|
|
CC=clang
|
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
CFLAGS+=-std=c99 -pthread
|
|
|
|
|
CFLAGS+=-fPIC -fstrict-aliasing
|
|
|
|
|
|
|
|
|
|
ifeq ($(BUILD_FOR),Linux)
|
|
|
|
|
CFLAGS+=-fPIC -fstrict-aliasing -fdiagnostics-color=auto
|
|
|
|
|
CFLAGS+=-fdiagnostics-color=auto
|
|
|
|
|
else ifeq ($(BUILD_FOR),Darwin)
|
|
|
|
|
CFLAGS+=-pthread -fPIC -fstrict-aliasing -fcolor-diagnostics
|
|
|
|
|
CFLAGS+=-fcolor-diagnostics
|
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
# The flag -DNDEBUG will always be removed from CFLAGS for compiling tests.
|
|
|
|
@ -150,33 +131,26 @@ ifeq ($(BUILD_FOR),Linux)
|
|
|
|
|
# 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.
|
|
|
|
|
CFLAGS_GENERATED=-D_DEFAULT_SOURCE
|
|
|
|
|
CPPFLAGS_GENERATED=-D_DEFAULT_SOURCE
|
|
|
|
|
else ifeq ($(BUILD_FOR),Darwin)
|
|
|
|
|
CFLAGS_GENERATED=
|
|
|
|
|
CPPFLAGS_GENERATED=
|
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
######### C++ #########
|
|
|
|
|
ifeq ($(BUILD_FOR),Linux)
|
|
|
|
|
ifndef PEP_MIME
|
|
|
|
|
CXX=g++ -std=gnu++11 -pthread
|
|
|
|
|
else
|
|
|
|
|
CXX=g++ -std=gnu++14 -pthread
|
|
|
|
|
endif
|
|
|
|
|
CXX=g++
|
|
|
|
|
CXXFLAGS+=-std=gnu++11
|
|
|
|
|
else ifeq ($(BUILD_FOR),Darwin)
|
|
|
|
|
ifndef PEP_MIME
|
|
|
|
|
# clang issues a warning when "-pthread" is used for linking. So, include it in CXXFLAGS, and not in CXX
|
|
|
|
|
CXX=clang -std=c++11
|
|
|
|
|
else
|
|
|
|
|
# clang issues a warning when "-pthread" is used for linking. So, include it in CXXFLAGS, and not in CXX
|
|
|
|
|
CXX=clang -std=c++14
|
|
|
|
|
endif
|
|
|
|
|
CXX=clang
|
|
|
|
|
CXXFLAGS+=-std=c++11
|
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
# The flag -DNDEBUG will always be removed from CXXFLAGS for compiling tests.
|
|
|
|
|
CXXFLAGS+=-pthread
|
|
|
|
|
|
|
|
|
|
# The flag -DNDEBUG will always be removed from CPPFLAGS for compiling tests.
|
|
|
|
|
#
|
|
|
|
|
# The tests do not work properly, if compiled with -DNDEBUG
|
|
|
|
|
# FIXME: -D flags traditionally go in CPPFLAGS, as they're preprocessor defines. We need to clean
|
|
|
|
|
# this up in the whole build system.
|
|
|
|
|
ifeq ($(BUILD_FOR),Linux)
|
|
|
|
|
CXXFLAGS+=-fdiagnostics-color=auto -I../src -I../asn.1 $(ETPAN_INC)
|
|
|
|
|
ifdef WARN
|
|
|
|
@ -187,10 +161,11 @@ ifeq ($(BUILD_FOR),Linux)
|
|
|
|
|
ifdef DEBUG
|
|
|
|
|
CXXFLAGS+= -g -ggdb
|
|
|
|
|
else
|
|
|
|
|
CXXFLAGS+= -O3 -DNDEBUG
|
|
|
|
|
CXXFLAGS+= -O3
|
|
|
|
|
CPPFLAGS+= -DNDEBUG
|
|
|
|
|
endif
|
|
|
|
|
else ifeq ($(BUILD_FOR),Darwin)
|
|
|
|
|
CXXFLAGS+=-pthread -fcolor-diagnostics -I../src -I../asn.1 $(ETPAN_INC)
|
|
|
|
|
CXXFLAGS+=-fcolor-diagnostics -I../src -I../asn.1 $(ETPAN_INC)
|
|
|
|
|
ifdef WARN
|
|
|
|
|
CXXFLAGS+=
|
|
|
|
|
else
|
|
|
|
@ -199,13 +174,11 @@ else ifeq ($(BUILD_FOR),Darwin)
|
|
|
|
|
ifdef DEBUG
|
|
|
|
|
CXXFLAGS+= -O0 -g
|
|
|
|
|
else
|
|
|
|
|
CXXFLAGS+= -O3 -DNDEBUG
|
|
|
|
|
CXXFLAGS+= -O3
|
|
|
|
|
CPPFLAGS+= -DNDEBUG
|
|
|
|
|
endif
|
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
ifdef PEP_MIME
|
|
|
|
|
CXXFLAGS+=-fPIC -fvisibility=hidden
|
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
######### C and C++ #########
|
|
|
|
|
ifeq ($(BUILD_FOR),Darwin)
|
|
|
|
@ -233,12 +206,36 @@ ASN1C=asn1c
|
|
|
|
|
ASN1C_INC=
|
|
|
|
|
#ASN1C_INC=-I$(HOME)/include
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
######### sqlite3 #########
|
|
|
|
|
# If empty (or undefined), compile sqlite3 from the sources shipped with the pEp distribution.
|
|
|
|
|
# Otherwise, use an sqlite3 implementation found in the OS's include/library paths.
|
|
|
|
|
SQLITE3_FROM_OS=placeholder
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
######### MIME #########
|
|
|
|
|
|
|
|
|
|
######### pEp MIME #########
|
|
|
|
|
# Set pEpMIME= anything (there are ifdefs on it) in your local.conf if you want
|
|
|
|
|
# to compile built-in pEpMIME (requires a separate libppEpMIME source repo to be
|
|
|
|
|
# checked out elsewhere on the system - define or redefine these in local.conf
|
|
|
|
|
# if you want to use it; otherwise, we default to etpan. (This will eventually
|
|
|
|
|
# become the default, but not yet.
|
|
|
|
|
#
|
|
|
|
|
PEP_MIME=
|
|
|
|
|
PEP_MIME_SRC=$(HOME)/src/pEpMIME/src
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
######### libetpan #########
|
|
|
|
|
# libetpan library search flag
|
|
|
|
|
#
|
|
|
|
|
ETPAN_LIB=
|
|
|
|
|
#ETPAN_LIB=-L$(HOME)/lib
|
|
|
|
|
|
|
|
|
|
# libetpan include search flag
|
|
|
|
|
ETPAN_INC=
|
|
|
|
|
#ETPAN_INC=-I$(HOME)/include
|
|
|
|
|
|
|
|
|
|
######### OpenPGP #########
|
|
|
|
|
# Selects OpenPGP implementation. must be `SEQUOIA`
|
|
|
|
|
OPENPGP=SEQUOIA
|
|
|
|
@ -271,6 +268,10 @@ EXCLUDE=
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
######### Footer #########
|
|
|
|
|
|
|
|
|
|
################################
|
|
|
|
|
# Include local.conf for any overrides and additional flags
|
|
|
|
|
################################
|
|
|
|
|
-include $(HERE)/local.conf
|
|
|
|
|
|
|
|
|
|
ifdef BUILD_CONFIG
|
|
|
|
@ -278,10 +279,9 @@ ifdef BUILD_CONFIG
|
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
######### Post processing assignments ########
|
|
|
|
|
# These variables are ineffective when set anywhere else but here.
|
|
|
|
|
# KB: I have no idea why we do this - it totally defeats the purpose of
|
|
|
|
|
# local.conf.
|
|
|
|
|
# For now: set if has no value.
|
|
|
|
|
|
|
|
|
|
# If sequoia has been set up and the SEQUOIA flags aren't defined, set them up.
|
|
|
|
|
# Otherwise, add them to the CFLAGS/CXXFLAGS/LDFLAGS and library/include variables
|
|
|
|
|
ifeq ($(OPENPGP),SEQUOIA)
|
|
|
|
|
ifeq ($(SEQUOIA_CFLAGS),)
|
|
|
|
|
SEQUOIA_CFLAGS+=$(shell pkg-config --cflags-only-other sequoia-openpgp)
|
|
|
|
@ -296,12 +296,18 @@ ifeq ($(SEQUOIA_INC),)
|
|
|
|
|
SEQUOIA_INC=$(shell pkg-config --cflags-only-I sequoia-openpgp)
|
|
|
|
|
endif
|
|
|
|
|
CFLAGS+= $(SEQUOIA_CFLAGS)
|
|
|
|
|
CXXFLAGS+= $(SEQUOIA_CFLAGS)
|
|
|
|
|
LD_FLAGS+= $(SEQUOIA_LDFLAGS)
|
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
# YML_PATH is needed in the environment of every call to a program of the YML2 distribution
|
|
|
|
|
export YML_PATH=$(YML2_PATH)
|
|
|
|
|
|
|
|
|
|
# Postprocess for pEpMIME
|
|
|
|
|
ifdef PEP_MIME
|
|
|
|
|
# Replace c++11 with c++14 for now (limiting the subst to the ++11 means it doesn't matter if gnu or not)
|
|
|
|
|
CXXFLAGS:=$(subst ++11,++14,$(CXXFLAGS)) -fPIC -fvisibility=hidden
|
|
|
|
|
endif
|
|
|
|
|
ifdef PEP_MIME
|
|
|
|
|
ifndef PEP_MIME_SRC
|
|
|
|
|
$(error "Compiling with the PEP_MIME option set requires the value of PEP_MIME_SRC to be set to the source directory for libpEpMIME")
|
|
|
|
|