Makefile.am 5.77 KB
Newer Older
1
AUTOMAKE_OPTIONS = subdir-objects
2 3
GITVERSION_FILE=liblinphone_gitversion.h
GITVERSION_FILE_TMP=liblinphone_gitversion.h.tmp
4 5 6
GITDESCRIBE=`cd $(top_srcdir) && git describe --always`
GIT_TAG=`cd $(top_srcdir) && git describe --abbrev=0`
GITREVISION=`cd $(top_srcdir) && git rev-parse HEAD`
7

8
## This command is used to check if the sources are cloned in a git repo.
9
## We can't only depend on the presence of the .git/ directory anymore,
10
## because of gits submodule handling.
11
## We now simply issue a git log on configure.ac and if the output is empty (error or file not tracked), then we are not in git.
12
GITLOG=`cd $(top_srcdir) && git log -1 --pretty=format:%H configure.ac`
13

14
ECHO=/bin/echo
15

Simon Morlat's avatar
Simon Morlat committed
16
SUBDIRS=. help
aymeric's avatar
aymeric committed
17

18 19 20 21 22
EXTRA_DIST=linphonecore_jni.cc $(GITVERSION_FILE)

BUILT_SOURCES=$(GITVERSION_FILE)

CLEANFILES=$(GITVERSION_FILE)
Simon Morlat's avatar
Simon Morlat committed
23

aymeric's avatar
aymeric committed
24 25 26
## Process this file with automake to produce Makefile.in
linphone_includedir=$(includedir)/linphone

27
linphone_include_HEADERS=\
28
	account_creator.h \
29
	buffer.h \
30 31 32 33
	call_log.h \
	call_params.h \
	content.h \
	event.h \
34
	friendlist.h \
35 36 37 38
	linphonecore.h \
	linphonecore_utils.h \
	linphonefriend.h \
	linphonepresence.h \
39
	linphone_proxy_config.h \
40 41 42 43
	linphone_tunnel.h \
	lpc2xml.h \
	lpconfig.h \
	sipsetup.h \
44
	xml2lpc.h \
Sylvain Berfini's avatar
Sylvain Berfini committed
45 46
	xmlrpc.h \
	carddav.h
aymeric's avatar
aymeric committed
47 48 49 50

lib_LTLIBRARIES=liblinphone.la

liblinphone_la_SOURCES=\
51
	account_creator.c \
52
	address.c \
aymeric's avatar
aymeric committed
53
	authentication.c \
54
	buffer.c \
55 56 57
	callbacks.c \
	call_log.c \
	call_params.c \
aymeric's avatar
aymeric committed
58
	chat.c \
59
	chat_file_transfer.c \
Simon Morlat's avatar
Simon Morlat committed
60
	conference.cc conference.h \
61
	contactprovider.c contactprovider.h contact_providers_priv.h \
62
	content.c \
63
	dict.c \
64 65
	ec-calibrator.c \
	enum.c enum.h \
66
	event.c \
67
	friend.c \
68
	friendlist.c \
69 70 71
	info.c \
	ldap/ldapprovider.c ldap/ldapprovider.h \
	linphonecall.c \
72
	linphonecore.c \
73
	localplayer.c \
74
	lpc2xml.c \
75
	lime.c lime.h\
76
	lpconfig.c \
77 78 79 80
	lsd.c \
	message_storage.c \
	misc.c  \
	offeranswer.c offeranswer.h\
81
	player.c \
82 83 84 85 86 87 88
	presence.c \
	private.h \
	proxy.c \
	quality_reporting.c quality_reporting.h\
	remote_provisioning.c \
	sal.c \
	siplogin.c \
89
	sipsetup.c \
90 91
	xml2lpc.c \
	xml.c \
92
	xmlrpc.c \
Simon Morlat's avatar
Simon Morlat committed
93
	vtables.c \
94
	carddav.c \
95
	ringtoneplayer.c ringtoneplayer.h\
96
	$(GITVERSION_FILE)
Yann Diorcet's avatar
Yann Diorcet committed
97 98

if BUILD_UPNP
Yann Diorcet's avatar
Yann Diorcet committed
99
liblinphone_la_SOURCES+=upnp.c upnp.h
Yann Diorcet's avatar
Yann Diorcet committed
100
endif
101

Simon Morlat's avatar
Simon Morlat committed
102
liblinphone_la_SOURCES+=	bellesip_sal/sal_address_impl.c \
jehan's avatar
jehan committed
103
				bellesip_sal/sal_impl.c bellesip_sal/sal_impl.h \
Simon Morlat's avatar
Simon Morlat committed
104 105 106 107 108 109 110 111
				bellesip_sal/sal_op_impl.c \
				bellesip_sal/sal_op_call.c \
				bellesip_sal/sal_op_registration.c \
				bellesip_sal/sal_sdp.c  \
				bellesip_sal/sal_op_message.c \
				bellesip_sal/sal_op_presence.c \
				bellesip_sal/sal_op_publish.c \
				bellesip_sal/sal_op_call_transfer.c \
112 113
				bellesip_sal/sal_op_info.c \
				bellesip_sal/sal_op_events.c
114

115
liblinphone_la_SOURCES+=linphone_tunnel_config.c
Guillaume Beraudo's avatar
Guillaume Beraudo committed
116
if BUILD_TUNNEL
117
liblinphone_la_SOURCES+=linphone_tunnel.cc TunnelManager.cc TunnelManager.hh linphone_tunnel.h
118
else
119
liblinphone_la_SOURCES+=linphone_tunnel_stubs.c linphone_tunnel.h
Guillaume Beraudo's avatar
Guillaume Beraudo committed
120 121
endif

122
if BUILD_VCARD
123
liblinphone_la_SOURCES+=vcard.cc vcard.h
124
liblinphone_la_CXXFLAGS=-std=c++11
125 126 127
else
liblinphone_la_SOURCES+=vcard_stubs.c vcard.h
endif
aymeric's avatar
aymeric committed
128

129
liblinphone_la_LDFLAGS= -version-info $(LIBLINPHONE_SO_VERSION) -no-undefined
aymeric's avatar
aymeric committed
130

131 132 133 134
if HAVE_LD_OUTPUT_DEF
liblinphone_la_LDFLAGS += -Wl,--output-def,liblinphone-$(LIBLINPHONE_SO_CURRENT).def
defexecdir = $(libdir)
defexec_DATA = liblinphone-$(LIBLINPHONE_SO_CURRENT).def
135
CLEANFILES += $(defexec_DATA)
136 137 138 139 140 141 142 143 144 145

liblinphone-$(LIBLINPHONE_SO_CURRENT).def: liblinphone.la

if BUILD_WIN32
defexec_DATA += liblinphone-$(LIBLINPHONE_SO_CURRENT).lib
liblinphone-$(LIBLINPHONE_SO_CURRENT).lib: liblinphone-$(LIBLINPHONE_SO_CURRENT).def liblinphone.la
	$(DLLTOOL) --dllname liblinphone-$(LIBLINPHONE_SO_CURRENT).dll --input-def liblinphone-$(LIBLINPHONE_SO_CURRENT).def --output-lib $@ liblinphone.la
endif
endif

aymeric's avatar
aymeric committed
146
liblinphone_la_LIBADD= \
147
		$(MEDIASTREAMER_LIBS) \
148 149
		$(ORTP_LIBS) \
		$(SIPSTACK_LIBS) \
Sylvain Berfini's avatar
Sylvain Berfini committed
150
		$(TUNNEL_LIBS) \
151
		$(SQLITE3_LIBS) \
152
		$(LIBXML2_LIBS) \
153 154
		$(LDAP_LIBS) \
		$(SASL_LIBS) \
155
		$(BELCARD_LIBS) \
156
		$(ZLIB_LIBS)
Margaux Clerc's avatar
Margaux Clerc committed
157

aymeric's avatar
aymeric committed
158

Yann Diorcet's avatar
Yann Diorcet committed
159
AM_CPPFLAGS=\
160
	-I$(top_srcdir) -I$(top_srcdir)/include -I$(builddir) \
Sylvain Berfini's avatar
Sylvain Berfini committed
161
	$(ORTP_CFLAGS) \
162 163
	$(MEDIASTREAMER_CFLAGS) \
	$(LIBXML2_CFLAGS)
Simon Morlat's avatar
Simon Morlat committed
164

165 166 167
COMMON_CFLAGS=\
	$(STRICT_OPTIONS) \
	-DIN_LINPHONE \
jehan's avatar
jehan committed
168
	$(SIPSTACK_CFLAGS) \
Sylvain Berfini's avatar
Sylvain Berfini committed
169
	-DENABLE_TRACE \
aymeric's avatar
aymeric committed
170
	-DLOG_DOMAIN=\"LinphoneCore\" \
Guillaume Beraudo's avatar
Guillaume Beraudo committed
171 172 173
	$(IPV6_CFLAGS) \
	-DORTP_INET6 \
	$(VIDEO_CFLAGS) \
Margaux Clerc's avatar
Margaux Clerc committed
174
	$(TUNNEL_CFLAGS) \
175
	$(SQLITE3_CFLAGS) \
176
	$(LIBXML2_CFLAGS) \
177 178
	$(LDAP_CFLAGS) \
	$(SASL_CFLAGS) \
179
	$(BELCARD_CFLAGS) \
180
	$(ZLIB_CFLAGS)
181

182 183 184 185
if BUILD_WIZARD
COMMON_CFLAGS+= -DBUILD_WIZARD
endif

186
COMMON_CFLAGS+= -DUSE_BELLESIP
187

188 189
AM_CFLAGS=$(COMMON_CFLAGS) $(STRICT_OPTIONS_CC)
AM_CXXFLAGS=$(COMMON_CFLAGS) $(STRICT_OPTIONS_CXX)
190

191
#Make sure that we are in linphone's git tree by doing git log $(top_srcdir)/configure.ac.
192
#if it is something known to git, then that will be ok to check the git describe number and make sure it is consistent with
193 194
#the PACKAGE_VERSION given in configure.ac

195
make_gitversion_h:
196
	if test -n "$(GITLOG)" ; then  \
197
		if test "$(GITDESCRIBE)" != "" ; then \
198
			if [ "$(GIT_TAG)" != "$(PACKAGE_VERSION)" ]; then \
199
				$(ECHO) "*** PACKAGE_VERSION and git tag differ. Please put them identical."; \
200 201
				exit 1; \
			fi ; \
202
			printf "#define LIBLINPHONE_GIT_VERSION \"$(GITDESCRIBE)\"\n" > $(builddir)/$(GITVERSION_FILE_TMP) ; \
203
		elif test "$(GITREVISION)" != "" ; then \
204
			printf "#define LIBLINPHONE_GIT_VERSION \"$(LINPHONE_VERSION)_$(GITREVISION)\"\n" > $(builddir)/$(GITVERSION_FILE_TMP) ; \
205
		else \
206
			printf "" > $(builddir)/$(GITVERSION_FILE_TMP) ; \
207
		fi ; \
208 209 210 211 212 213 214
		if ! test -f $(builddir)/$(GITVERSION_FILE) ; then \
			cp -f $(builddir)/$(GITVERSION_FILE_TMP) $(builddir)/$(GITVERSION_FILE) ; \
		fi ; \
		if test "`cat $(builddir)/$(GITVERSION_FILE_TMP)`" != "`cat $(builddir)/$(GITVERSION_FILE)`" ; then \
			cp -f $(builddir)/$(GITVERSION_FILE_TMP) $(builddir)/$(GITVERSION_FILE) ; \
		fi ; \
		rm -f $(builddir)/$(GITVERSION_FILE_TMP) ; \
215
	fi
216 217

$(GITVERSION_FILE): make_gitversion_h