JSON-182 fixes iconv symbols not found by using MakeFile of Release_2.1.0-RC14 JSON-182 Release_2.1.0-RC17+MakefileFix
authorbuff <andreas@pep-project.org>
Thu, 04 Feb 2021 14:56:41 +0100
branchJSON-182
changeset 1140dac68b75f1ec
parent 1132 220c1362694f
child 1143 97518deaaf64
JSON-182 fixes iconv symbols not found by using MakeFile of Release_2.1.0-RC14
server/Makefile
     1.1 --- a/server/Makefile	Mon Jan 25 20:42:20 2021 +0100
     1.2 +++ b/server/Makefile	Thu Feb 04 14:56:41 2021 +0100
     1.3 @@ -6,32 +6,23 @@
     1.4  
     1.5  # default config
     1.6  
     1.7 -# set to 'etpan' or 'pEpMIME'
     1.8 -MIME_LIB?=etpan
     1.9 -
    1.10 -PREFIX?=$(HOME)/local
    1.11 -
    1.12 -# where pEp stuff is installed into:
    1.13 -PEP_LIB_PATH?=$(PREFIX)/lib
    1.14 -PEP_INCLUDE?=$(PREFIX)/include
    1.15 -
    1.16 -# where libs from the packages systems are installed into:
    1.17 -LIBRARY_PATH?=/usr/local/lib
    1.18 -
    1.19 +# these are source builds
    1.20  
    1.21 -# paths to the .a libraries. Can be overridden in local.conf
    1.22 -PEP_WEBSERVER?=$(PEP_LIB_PATH)
    1.23 -PEP_ADAPTER_LIBRARY=$(PEP_LIB_PATH)
    1.24 -PEP_ENGINE?=$(PEP_LIB_PATH)
    1.25 -LIBETPAN_FDIK?=$(PEP_LIB_PATH)
    1.26 -PEP_MIME_PATH?=$(PEP_LIB_PATH)
    1.27 -SEQUOIA_PGP?=$(PEP_LIB_PATH)
    1.28 -ASN1_PATH?=$(PEP_LIB_PATH)
    1.29 -NETTLE?=$(LIBRARY_PATH)
    1.30 +PEP_WEBSERVER?=../../webserver
    1.31 +PEP_ADAPTER_LIBRARY=../../libpEpAdapter
    1.32 +PEP_ENGINE?=../../pEpEngine/src
    1.33 +LIBETPAN_FDIK?=../../libetpan/src/.libs
    1.34 +SEQUOIA_PGP?=../../sequoia/target/release
    1.35 +NETTLE?=../../nettle
    1.36 +BOOST_INCLUDE_PATH?=../../boost_1_72_0
    1.37 +BOOST_LIBRARY_PATH?=../../boost_1_72_0/stage/lib
    1.38 +ASN1_PATH?=$(PEP_ENGINE)/asn.1
    1.39  
    1.40 -BOOST_INCLUDE_PATH?=/usr/local/include
    1.41 -BOOST_LIBRARY_PATH?=$(LIBRARY_PATH)
    1.42 +# path to installed libraries
    1.43  
    1.44 +PREFIX?=$(HOME)
    1.45 +
    1.46 +PEP_INCLUDE?=$(PREFIX)/include
    1.47  
    1.48  LIBRARY_PATH?=$(PREFIX)/lib
    1.49  
    1.50 @@ -41,78 +32,39 @@
    1.51  ICONV_LIBRARY_PATH?=$(LIBRARY_PATH)
    1.52  LIBEVENT_LIBRARY_PATH=$(LIBRARY_PATH)
    1.53  
    1.54 -AR?=/usr/bin/ar
    1.55 +AR?=ar
    1.56  CC?=cc
    1.57  CXX?=c++
    1.58 -CFLAGS+=-std=c14 -fvisibility=hidden
    1.59 -CXXFLAGS+=-I$(BOOST_INCLUDE_PATH) -I$(PEP_INCLUDE) -std=c++14 -fvisibility=hidden -fsanitize=address
    1.60 +CFLAGS+=-std=c14
    1.61 +CXXFLAGS+=-I$(BOOST_INCLUDE_PATH) -I$(PEP_INCLUDE) -std=c++14
    1.62  LDFLAGS+=-std=c++14
    1.63  
    1.64  ifdef NDEBUG
    1.65 -	CFLAGS+=-O3 -DNDEBUG  
    1.66 -	CXXFLAGS+=-O3 -DNDEBUG
    1.67 +	CFLAGS+=-O3 -DNDEBUG -fvisibility=hidden -fno-stack-check
    1.68 +	CXXFLAGS+=-O3 -DNDEBUG -fvisibility=hidden -fno-stack-check
    1.69  else
    1.70 -	CFLAGS+=-O0 -g -DDEBUG_ENABLED
    1.71 -	CXXFLAGS+=-O0 -g -DDEBUG_ENABLED
    1.72 +	CFLAGS+=-O0 -g -DDEBUG_ENABLED -fvisibility=hidden -fno-stack-check
    1.73 +	CXXFLAGS+=-O0 -g -DDEBUG_ENABLED -fvisibility=hidden -fno-stack-check
    1.74  endif
    1.75  
    1.76  TARGET=pEp-mini-json-adapter
    1.77  LIB_TARGET=libjson-adapter.a
    1.78  
    1.79 -ifeq ($(MIME_LIB),etpan)
    1.80 -    LDLIBS+=-letpan
    1.81 -    MIME_LIB_A=$(LIBETPAN_FDIK)/libetpan.a
    1.82 -    OMIT_NFC_SOURCE=
    1.83 -else ifeq ($(MIME_LIB),pEpMIME)
    1.84 -    LDLUBS+=-lpEpMIME
    1.85 -    MIME_LIB_A=$(PEP_MIME_PATH)/libpEpMIME.a
    1.86 -    
    1.87 -    # is already in libpEpMIME:
    1.88 -    OMIT_NFC_SOURCE=nfc.cc nfc_sets.cc
    1.89 -else
    1.90 -    $(error "You must set MIME_LIB to 'etpan' or 'pEpMIME'!" )
    1.91 -endif
    1.92 -
    1.93 -
    1.94 -ALL_SOURCE=$(filter-out parse_mail.cc unittest_%.cc, $(wildcard *.cc))
    1.95 -MA_SOURCE=$(wildcard mini-adapter-*.cc)
    1.96 -
    1.97 -LIB_SOURCE=$(filter-out $(MA_SOURCE) $(OMIT_NFC_SOURCE), $(ALL_SOURCE))
    1.98 -
    1.99 +ALL_SOURCE=$(filter-out unittest_%.cc,$(wildcard *.cc))
   1.100 +LIB_SOURCE=$(filter-out miniadapter-%.cc,$(ALL_SOURCE))
   1.101 +MA_SOURCE=$(wildcard miniadapter-*.cc)
   1.102  DEPENDS=$(subst .cc,.d,$(ALL_SOURCE))
   1.103 -
   1.104  ALL_OBJECTS=$(subst .d,.o,$(DEPENDS))
   1.105  LIB_OBJECTS=$(subst .cc,.o,$(LIB_SOURCE))
   1.106  MA_OBJECTS=$(subst .cc,.o,$(MA_SOURCE))
   1.107 -
   1.108  SPIRIT_SOURCE=$(wildcard json_spirit/*.cpp)
   1.109  SPIRIT_OBJECTS=$(subst .cpp,.o,$(SPIRIT_SOURCE))
   1.110  
   1.111 -TEST_SOURCE=$(wildcard unittest_*.cc)
   1.112 +TEST_SOURCE=$(wildcard test_*.cc)
   1.113  TEST_OBJECTS=$(subst .cc,.o,$(TEST_SOURCE))
   1.114 -
   1.115 -
   1.116 +TESTS=$(subst .cc,,$(TEST_SOURCE))
   1.117  
   1.118 -ALL_STATIC_LIBS=$(PEP_ENGINE)/libpEpEngine.a \
   1.119 -		$(PEP_ADAPTER_LIBRARY)/libpEpAdapter.a \
   1.120 -		$(PEP_WEBSERVER)/libpEpwebserver.a \
   1.121 -		$(BOOST_LIBRARY_PATH)/libboost_filesystem$(BOOST_MT).a \
   1.122 -		$(BOOST_LIBRARY_PATH)/libboost_program_options$(BOOST_MT).a \
   1.123 -		$(BOOST_LIBRARY_PATH)/libboost_system$(BOOST_MT).a \
   1.124 -		$(BOOST_LIBRARY_PATH)/libboost_thread$(BOOST_MT).a \
   1.125 -		$(BOOST_LIBRARY_PATH)/libboost_regex$(BOOST_MT).a \
   1.126 -		$(SEQUOIA_PGP)/libsequoia_openpgp_ffi.a \
   1.127 -		$(MIME_LIB_A) \
   1.128 -		$(ASN1_PATH)/libasn1.a \
   1.129 -		$(LIBZ_LIBRARY_PATH)/libz.a \
   1.130 -		$(SQLITE3_LIBRARY_PATH)/libsqlite3.a \
   1.131 -		$(NETTLE)/libhogweed.a \
   1.132 -		$(NETTLE)/libnettle.a \
   1.133 -		$(GMP_LIBRARY_PATH)/libgmp.a \
   1.134 -		$(ICONV_LIBRARY_PATH)/libiconv.a
   1.135 -
   1.136 -
   1.137 -all: $(TARGET) unittests parse_mail
   1.138 +all: $(TARGET)
   1.139  
   1.140  %.d: %.cc
   1.141  	@set -e; rm -f $@; \
   1.142 @@ -129,20 +81,35 @@
   1.143  	$(AR) -cr $@ $^
   1.144  
   1.145  $(TARGET): $(LIB_TARGET) $(MA_OBJECTS) $(SPIRIT_OBJECTS)
   1.146 -	$(CXX) $(LDFLAGS) \
   1.147 -		$(MA_OBJECTS) $(SPIRIT_OBJECTS)  $(LIB_TARGET) \
   1.148 +	$(CXX) $(LDFLAGS) -liconv \
   1.149  		-lobjc -framework Foundation -framework Security \
   1.150 -		$(ALL_STATIC_LIBS)
   1.151 -		-o "$@"
   1.152 +		$(PEP_WEBSERVER)/libpEpwebserver.a \
   1.153 +		$(BOOST_LIBRARY_PATH)/libboost_filesystem$(BOOST_MT).a \
   1.154 +		$(BOOST_LIBRARY_PATH)/libboost_program_options$(BOOST_MT).a \
   1.155 +		$(BOOST_LIBRARY_PATH)/libboost_system$(BOOST_MT).a \
   1.156 +		$(BOOST_LIBRARY_PATH)/libboost_thread$(BOOST_MT).a \
   1.157 +		$(BOOST_LIBRARY_PATH)/libboost_regex$(BOOST_MT).a \
   1.158 +		$(ICONV_LIBRARY_PATH)/libiconv.a \
   1.159 +		$(LIBZ_LIBRARY_PATH)/libz.a \
   1.160 +		$(SQLITE3_LIBRARY_PATH)/libsqlite3.a \
   1.161 +		$(GMP_LIBRARY_PATH)/libgmp.a \
   1.162 +		$(NETTLE)/libnettle.a $(NETTLE)/libhogweed.a \
   1.163 +		$(SEQUOIA_PGP)/libsequoia_ffi.a \
   1.164 +		$(SEQUOIA_PGP)/libsequoia_openpgp_ffi.a \
   1.165 +		$(LIBETPAN_FDIK)/libetpan.a \
   1.166 +		$(PEP_ENGINE)/libpEpEngine.a \
   1.167 +		$(ASN1_PATH)/libasn1.a \
   1.168 +		$(PEP_ADAPTER_LIBRARY)/libpEpAdapter.a \
   1.169 +		$(MA_OBJECTS) $(SPIRIT_OBJECTS) $(LIB_TARGET) -o "$@"
   1.170  
   1.171  %.o: %.cc
   1.172  	$(CXX) $(CXXFLAGS) -c -o $@ $^
   1.173  
   1.174 -unittests: $(TEST_OBJECTS)
   1.175 -	$(CXX) $(CXXFLAGS) -o $@ $^ $(ALL_STATIC_LIBS)
   1.176 +test_%: test_%.o $(TARGET)
   1.177 +	$(CXX) $(LDFLAGS) $(TARGET) -o $@ $<
   1.178  
   1.179 -parse_mail: parse_mail.o $(LIB_TARGET) $(SPIRIT_OBJECTS)
   1.180 -	$(CXX) $(CXXFLAGS) -o $@ $^ $(ALL_STATIC_LIBS) $(LIB_TARGET) -liconv
   1.181 +test: $(TESTS)
   1.182 +	for i in $(TESTS) ; do ./$$i ; done
   1.183  
   1.184  .PHONY: clean uninstall install
   1.185  
   1.186 @@ -155,7 +122,7 @@
   1.187  	for i in *.hh; do rm -f $(PREFIX)/include/pEp/\$i ; done
   1.188  
   1.189  clean:
   1.190 -	rm -vf *.o *.d *.d.* $(TARGET) $(TESTS) encode_decode
   1.191 +	rm -vf *.o *.d *.d.* $(TARGET) $(TESTS)
   1.192  
   1.193  local.conf:
   1.194  	@echo "# the following are directories with the source build" >> local.conf