Makefile.am 5.64 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

16
SUBDIRS=.
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 27
## Process this file with automake to produce Makefile.in
lib_LTLIBRARIES=liblinphone.la

liblinphone_la_SOURCES=\
28
	account_creator.c \
29
	account_creator_service.c \
30
	address.c \
aymeric's avatar
aymeric committed
31
	authentication.c \
32
	buffer.c \
33
	callbacks.c \
34
	carddav.h \
35 36
	call_log.c \
	call_params.c \
37
	carddav.c \
aymeric's avatar
aymeric committed
38
	chat.c \
39
	chat_file_transfer.c \
40
	conference.cc conference_private.h \
Ghislain MARY's avatar
Ghislain MARY committed
41
	contactprovider.c contact_providers_priv.h \
42
	content.c \
43
	dial_plan.c \
44
	dict.c \
45
	ec-calibrator.c \
Erwan Croze's avatar
Erwan Croze committed
46
	echo-tester.c \
47
	enum.c enum.h \
48
	error_info.c \
49
	event.c \
50
	factory.c \
51
	friend.c \
52
	friendlist.c \
Ghislain MARY's avatar
Ghislain MARY committed
53
	im_notif_policy.c \
54
	info.c \
Ghislain MARY's avatar
Ghislain MARY committed
55
	ldapprovider.c \
56
	linphonecall.c \
57
	linphonecore.c \
58
	localplayer.c \
59
	lpc2xml.c lpc2xml.h \
60
	lime.c lime.h\
61
	im_encryption_engine.c \
62
	lpconfig.c \
63 64 65
	lsd.c \
	message_storage.c \
	misc.c  \
66
	nat_policy.c \
67
	offeranswer.c offeranswer.h\
68
	payload_type.c \
69
	player.c \
70 71 72 73 74
	presence.c \
	private.h \
	proxy.c \
	quality_reporting.c quality_reporting.h\
	remote_provisioning.c \
75
	ringtoneplayer.c \
76 77
	sal.c \
	siplogin.c \
78
	sipsetup.c \
79
	sqlite3_bctbx_vfs.c sqlite3_bctbx_vfs.h\
80
	vcard_private.h \
81 82
	vtables.c \
	video_definition.c \
83
	xml2lpc.c xml2lpc.h \
84
	xml.c \
85
	xmlrpc.c \
86
	$(GITVERSION_FILE)
Yann Diorcet's avatar
Yann Diorcet committed
87 88

if BUILD_UPNP
Yann Diorcet's avatar
Yann Diorcet committed
89
liblinphone_la_SOURCES+=upnp.c upnp.h
Yann Diorcet's avatar
Yann Diorcet committed
90
endif
91

Simon Morlat's avatar
Simon Morlat committed
92
liblinphone_la_SOURCES+=	bellesip_sal/sal_address_impl.c \
jehan's avatar
jehan committed
93
				bellesip_sal/sal_impl.c bellesip_sal/sal_impl.h \
Simon Morlat's avatar
Simon Morlat committed
94 95 96 97 98 99 100 101
				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 \
102 103
				bellesip_sal/sal_op_info.c \
				bellesip_sal/sal_op_events.c
104

105
liblinphone_la_SOURCES+=linphone_tunnel_config.c
Guillaume Beraudo's avatar
Guillaume Beraudo committed
106
if BUILD_TUNNEL
107
liblinphone_la_SOURCES+=linphone_tunnel.cc TunnelManager.cc TunnelManager.hh
108
else
109
liblinphone_la_SOURCES+=linphone_tunnel_stubs.c
Guillaume Beraudo's avatar
Guillaume Beraudo committed
110 111
endif

112
if BUILD_VCARD
113
liblinphone_la_SOURCES+=vcard.cc
114
else
115
liblinphone_la_SOURCES+=vcard_stubs.c
116
endif
aymeric's avatar
aymeric committed
117

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

120 121 122 123
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
124
CLEANFILES += $(defexec_DATA)
125 126 127 128 129 130 131 132 133 134

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
135
liblinphone_la_LIBADD= \
136
		$(MEDIASTREAMER_LIBS) \
137 138
		$(ORTP_LIBS) \
		$(SIPSTACK_LIBS) \
Sylvain Berfini's avatar
Sylvain Berfini committed
139
		$(TUNNEL_LIBS) \
140
		$(SQLITE3_LIBS) \
141
		$(LIBXML2_LIBS) \
142 143
		$(LDAP_LIBS) \
		$(SASL_LIBS) \
144
		$(BELCARD_LIBS) \
145 146
		$(ZLIB_LIBS) \
		$(BCTOOLBOX_LIBS)
Margaux Clerc's avatar
Margaux Clerc committed
147

aymeric's avatar
aymeric committed
148

Yann Diorcet's avatar
Yann Diorcet committed
149
AM_CPPFLAGS=\
150
	-I$(top_srcdir) -I$(top_srcdir)/include -I$(builddir) \
Sylvain Berfini's avatar
Sylvain Berfini committed
151
	$(ORTP_CFLAGS) \
152 153
	$(MEDIASTREAMER_CFLAGS) \
	$(LIBXML2_CFLAGS)
Simon Morlat's avatar
Simon Morlat committed
154

155 156
COMMON_CFLAGS=\
	$(STRICT_OPTIONS) \
jehan's avatar
jehan committed
157
	$(SIPSTACK_CFLAGS) \
Sylvain Berfini's avatar
Sylvain Berfini committed
158
	-DENABLE_TRACE \
aymeric's avatar
aymeric committed
159
	-DLOG_DOMAIN=\"LinphoneCore\" \
Guillaume Beraudo's avatar
Guillaume Beraudo committed
160 161 162
	$(IPV6_CFLAGS) \
	-DORTP_INET6 \
	$(VIDEO_CFLAGS) \
Margaux Clerc's avatar
Margaux Clerc committed
163
	$(TUNNEL_CFLAGS) \
164
	$(SQLITE3_CFLAGS) \
165
	$(LIBXML2_CFLAGS) \
166 167
	$(LDAP_CFLAGS) \
	$(SASL_CFLAGS) \
168
	$(BELCARD_CFLAGS) \
169 170
	$(ZLIB_CFLAGS) \
	$(BCTOOLBOX_CFLAGS)
171

172 173 174 175
if BUILD_WIZARD
COMMON_CFLAGS+= -DBUILD_WIZARD
endif

176
COMMON_CFLAGS+= -DUSE_BELLESIP
177

178 179
AM_CFLAGS=$(COMMON_CFLAGS) $(STRICT_OPTIONS_CC)
AM_CXXFLAGS=$(COMMON_CFLAGS) $(STRICT_OPTIONS_CXX)
180 181 182
if BUILD_VCARD
AM_CXXFLAGS+=-std=c++11
endif
183

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

188
make_gitversion_h:
189
	if test -n "$(GITLOG)" ; then  \
190
		if test "$(GITDESCRIBE)" != "" ; then \
191
			if [ "$(GIT_TAG)" != "$(PACKAGE_VERSION)" ]; then \
192
				$(ECHO) "*** PACKAGE_VERSION and git tag differ. Please put them identical."; \
193 194
				exit 1; \
			fi ; \
195
			printf "#define LIBLINPHONE_GIT_VERSION \"$(GITDESCRIBE)\"\n" > $(builddir)/$(GITVERSION_FILE_TMP) ; \
196
		elif test "$(GITREVISION)" != "" ; then \
197
			printf "#define LIBLINPHONE_GIT_VERSION \"$(LINPHONE_VERSION)_$(GITREVISION)\"\n" > $(builddir)/$(GITVERSION_FILE_TMP) ; \
198
		else \
199
			printf "" > $(builddir)/$(GITVERSION_FILE_TMP) ; \
200
		fi ; \
201 202 203 204 205 206 207
		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) ; \
208 209
	else \
		touch $(GITVERSION_FILE) ; \
210
	fi
211 212

$(GITVERSION_FILE): make_gitversion_h