forked from drachtio/drachtio-server
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.am
123 lines (101 loc) · 5.37 KB
/
Makefile.am
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
MYVERSION=$(shell git describe --always 2>/dev/null || echo 1.0.0)
INCLUDES= -I${srcdir}/deps/sofia-sip/libsofia-sip-ua/su -I${srcdir}/deps/sofia-sip/libsofia-sip-ua/nta \
-I${srcdir}/deps/sofia-sip/libsofia-sip-ua/sip -I${srcdir}/deps/sofia-sip/libsofia-sip-ua/msg \
-I${srcdir}/deps/sofia-sip/libsofia-sip-ua/url -I${srcdir}/deps/sofia-sip/libsofia-sip-ua/tport \
-I${srcdir}/deps/sofia-sip/libsofia-sip-ua/bnf -I${srcdir}/deps/jansson/src \
-I${srcdir}/deps/hiredis \
-I${srcdir}/deps/prometheus-cpp/build/include -I/usr/local/include
AM_LDFLAGS= -L/usr/local/lib -L${srcdir}/deps/prometheus-cpp/build/lib
LDADD= -lboost_thread -lpthread -lssl -lcrypto -lz
if DEP_BOOST
INCLUDES += -I${srcdir}/deps/boost
AM_LDFLAGS += -L${srcdir}/deps/boost/stage/lib
endif
bin_PROGRAMS= drachtio timer ssltest parser uri_test test_https test_asio_curl
ACLOCAL_AMFLAGS = -I m4
drachtio_SOURCES= src/main.cpp src/controller.cpp src/drachtio-config.cpp \
src/client-controller.cpp src/client.cpp src/drachtio.cpp src/sip-dialog.cpp \
src/sip-dialog-controller.cpp src/sip-proxy-controller.cpp src/pending-request-controller.cpp \
src/timer-queue.cpp src/cdr.cpp src/timer-queue-manager.cpp src/sip-transports.cpp \
src/request-handler.cpp src/request-router.cpp src/stats-collector.cpp \
src/invite-in-progress.cpp src/blacklist.cpp src/ua-invalid.cpp
drachtio_CPPFLAGS=-D_REENTRANT -DDRACHTIO_VERSION=\"$(MYVERSION)\" -Wno-error=deprecated-declarations \
-DBOOST_ALLOW_DEPRECATED_HEADERS -O2 -Wno-stringop-overflow
drachtio_LDADD= ${srcdir}/deps/sofia-sip/libsofia-sip-ua/.libs/libsofia-sip-ua.a \
${srcdir}/deps/jansson/src/.libs/libjansson.a \
${srcdir}/deps/hiredis/libhiredis.a -lcurl -lpthread -lssl -lcrypto -lz
if ! DEP_BOOST
drachtio_CPPFLAGS+=-DBOOST_LOG_DYN_LINK
endif
timer_SOURCES= src/test_timer.cpp src/timer-queue.cpp
timer_CPPFLAGS=-D_REENTRANT -DTEST
timer_LDADD=${srcdir}/deps/sofia-sip/libsofia-sip-ua/.libs/libsofia-sip-ua.a -lboost_thread \
-lboost_system -lpthread
parser_SOURCES= src/test_parser.cpp
parser_CPPFLAGS=-D_REENTRANT -DTEST
parser_LDADD=${srcdir}/deps/sofia-sip/libsofia-sip-ua/.libs/libsofia-sip-ua.a -lboost_thread \
-lboost_system -lboost_log -lboost_filesystem -lpthread -lssl -lcrypto -lz
uri_test_SOURCES= src/test_uri_parser.cpp
uri_test_CPPFLAGS=-D_REENTRANT -DTEST
uri_test_LDADD=-lboost_thread -lboost_system -lboost_filesystem -lpthread -lz
ssltest_SOURCES= src/ssltest.cpp
ssltest_CPPFLAGS=-D_REENTRANT -DDEBUG -g -O2
ssltest_LDADD= -lssl -lcrypto -lz
test_https_SOURCES= src/test_https.cpp
test_https_CPPFLAGS=-D_REENTRANT -DDEBUG -g -O2
test_https_LDADD= -lssl -lcrypto -lz
test_asio_curl_SOURCES= src/test_asio_curl.cpp
test_asio_curl_CPPFLAGS=-D_REENTRANT -DDEBUG -g -O2
test_asio_curl_LDADD=-lboost_thread -lboost_system -lpthread -lcurl -lssl -lcrypto -lz
if LINUX
drachtio_LDADD += -lboost_thread -lboost_system -lboost_log -lboost_filesystem \
${srcdir}/deps/prometheus-cpp/build/lib/libprometheus-cpp-pull.a \
${srcdir}/deps/prometheus-cpp/build/lib/libprometheus-cpp-core.a \
-lpthread -lssl -lcrypto -lz -lrt
timer_LDADD += -lrt
parser_LDADD += -lrt
test_https_LDADD += -lrt -lpthread -lboost_system
if DEP_BOOST
make_BOOST_CMD = cd ${srcdir}/deps/boost && ./bootstrap.sh --with-libraries=thread,system,log,filesystem && ./b2 link=static variant=release stage
endif
endif
if OSX
drachtio_LDADD += -L/usr/local/opt/openssl/lib -lboost_thread \
-lboost_system -lboost_log \
-lboost_filesystem \
${srcdir}/deps/prometheus-cpp/build/lib/libprometheus-cpp-pull.a \
${srcdir}/deps/prometheus-cpp/build/lib/libprometheus-cpp-core.a \
-lpthread -lssl -lcrypto -lz
drachtio_CPPFLAGS += -I/usr/local/opt/openssl/include -fvisibility=hidden
test_https_LDADD += -L/usr/local/opt/openssl/lib -lboost_system
test_https_CPPFLAGS += -I/usr/local/opt/openssl/include
if DEP_BOOST
make_BOOST_CMD = cd ${srcdir}/deps/boost && ./bootstrap.sh --with-toolset=clang --with-libraries=thread,system,log,filesystem && ./b2 cxxflags=-std=c++14 link=static variant=release stage && rm -f ./stage/lib/*.dylib
endif
endif
if TCMALLOC
drachtio_LDADD += -ltcmalloc
endif
BUILT_SOURCES=${srcdir}/deps/sofia-sip/libsofia-sip-ua/.libs/libsofia-sip-ua.a \
${srcdir}/deps/jansson/src/.libs/libjansson.a ${srcdir}/deps/prometheus-cpp/build/lib/libprometheus-cpp-core.a
if DEP_BOOST
BUILT_SOURCES += ${srcdir}/deps/boost/stage/lib/libboost_thread.a
endif
clean-local:
if DEP_BOOST
cd ${srcdir}/deps/boost && ./bootstrap.sh && ./b2 clean
endif
if DEP_BOOST
${srcdir}/deps/boost/stage/lib/libboost_thread.a ${srcdir}/deps/boost/stage/lib/libboost_system.a ${srcdir}/deps/boost/stage/lib/libboost_filesystem.a ${srcdir}/deps/boost/stage/lib/libboost_log.a:
$(make_BOOST_CMD)
endif
${srcdir}/deps/sofia-sip/libsofia-sip-ua/.libs/libsofia-sip-ua.a:
cd ${srcdir}/deps/sofia-sip && ./bootstrap.sh && ./configure CFLAGS="$(CFLAGS)" CXXFLAGS="$(CXXFLAGS)" --with-glib=no && $(MAKE)
${srcdir}/deps/jansson/src/.libs/libjansson.a:
cd ${srcdir}/deps/jansson && autoreconf -fi && ./configure && $(MAKE)
${srcdir}/deps/prometheus-cpp/build/lib/libprometheus-cpp-core.a ${srcdir}/deps/prometheus-cpp/build/lib/libprometheus-cpp-pull.a:
cd ${srcdir}/deps/prometheus-cpp && mkdir -p build && cd build && \
cmake .. -DBUILD_SHARED_LIBS=OFF -DCMAKE_INSTALL_LIBDIR=lib -DCMAKE_INSTALL_PREFIX=`pwd` && \
$(MAKE) && make install
${srcdir}/deps/hiredis/libhiredis.a:
cd ${srcdir}/deps/hiredis && cmake -DBUILD_SHARED_LIBS=OFF -DENABLE_SSL=ON . && $(MAKE)