Makefile.am 5.78 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
	xmlrpc.h \
46
	vcard.h \
Sylvain Berfini's avatar
Sylvain Berfini committed
47
	carddav.h
aymeric's avatar
aymeric committed
48 49 50 51

lib_LTLIBRARIES=liblinphone.la

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

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

Simon Morlat's avatar
Simon Morlat committed
103
liblinphone_la_SOURCES+=	bellesip_sal/sal_address_impl.c \
jehan's avatar
jehan committed
104
				bellesip_sal/sal_impl.c bellesip_sal/sal_impl.h \
Simon Morlat's avatar
Simon Morlat committed
105 106 107 108 109 110 111 112
				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 \
113 114
				bellesip_sal/sal_op_info.c \
				bellesip_sal/sal_op_events.c
115

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

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

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

132 133 134 135
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
136
CLEANFILES += $(defexec_DATA)
137 138 139 140 141 142 143 144 145 146

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
147
liblinphone_la_LIBADD= \
148
		$(MEDIASTREAMER_LIBS) \
149 150
		$(ORTP_LIBS) \
		$(SIPSTACK_LIBS) \
Sylvain Berfini's avatar
Sylvain Berfini committed
151
		$(TUNNEL_LIBS) \
152
		$(SQLITE3_LIBS) \
153
		$(LIBXML2_LIBS) \
154 155
		$(LDAP_LIBS) \
		$(SASL_LIBS) \
156
		$(BELCARD_LIBS) \
157
		$(ZLIB_LIBS)
Margaux Clerc's avatar
Margaux Clerc committed
158

aymeric's avatar
aymeric committed
159

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

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

184 185 186 187
if BUILD_WIZARD
COMMON_CFLAGS+= -DBUILD_WIZARD
endif

188
COMMON_CFLAGS+= -DUSE_BELLESIP
189

190 191
AM_CFLAGS=$(COMMON_CFLAGS) $(STRICT_OPTIONS_CC)
AM_CXXFLAGS=$(COMMON_CFLAGS) $(STRICT_OPTIONS_CXX)
192

193
#Make sure that we are in linphone's git tree by doing git log $(top_srcdir)/configure.ac.
194
#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
195 196
#the PACKAGE_VERSION given in configure.ac

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

$(GITVERSION_FILE): make_gitversion_h