Add workaround for not linking against GnuTLS
[platform/upstream/connman.git] / Makefile.am
1
2 AM_MAKEFLAGS = --no-print-directory
3
4 includedir = @includedir@/connman
5
6 include_HEADERS = include/types.h include/log.h include/plugin.h \
7                         include/notifier.h \
8                         include/storage.h include/service.h \
9                         include/resolver.h include/ipconfig.h \
10                         include/device.h include/network.h include/inet.h \
11                         include/ondemand.h
12
13 nodist_include_HEADERS = include/version.h
14
15 noinst_HEADERS = include/driver.h include/element.h include/property.h \
16                         include/rtnl.h include/wifi.h include/task.h \
17                         include/dbus.h include/rfkill.h include/option.h \
18                         include/profile.h include/provider.h include/dhcp.h \
19                         include/utsname.h include/timeserver.h \
20                         include/location.h include/technology.h
21
22 local_headers = $(foreach file,$(include_HEADERS) $(nodist_include_HEADERS) \
23                         $(noinst_HEADERS), include/connman/$(notdir $(file)))
24
25
26 gdbus_sources = gdbus/gdbus.h gdbus/mainloop.c gdbus/watch.c \
27                                         gdbus/object.c gdbus/polkit.c
28
29 gdhcp_sources = gdhcp/gdhcp.h gdhcp/common.h gdhcp/common.c gdhcp/client.c
30
31 gweb_sources = gweb/gweb.h gweb/gweb.c gweb/gresolv.h gweb/gresolv.c \
32                                         gweb/giognutls.h gweb/giognutls.c
33
34 if DATAFILES
35 dbusconfdir = @DBUS_CONFDIR@
36
37 dbusconf_DATA = src/connman.conf
38
39 if SYSTEMD
40 systemdunitdir = @SYSTEMD_UNITDIR@
41
42 systemdunit_DATA = src/connman.service
43 endif
44 endif
45
46 plugin_LTLIBRARIES =
47
48 plugin_objects =
49
50 builtin_modules =
51 builtin_sources =
52 builtin_libadd =
53 builtin_cflags =
54
55 noinst_PROGRAMS =
56
57 sbin_PROGRAMS = src/connmand
58
59 src_connmand_SOURCES = $(gdbus_sources) $(gdhcp_sources) \
60                         gweb/gweb.h gweb/gweb.c \
61                         gweb/gresolv.h gweb/gresolv.c \
62                         gweb/giognutls.h gweb/gionotls.c \
63                         $(builtin_sources) src/connman.ver \
64                         src/main.c src/connman.h src/log.c src/selftest.c \
65                         src/error.c src/plugin.c src/task.c src/element.c \
66                         src/device.c src/network.c src/connection.c \
67                         src/manager.c src/profile.c src/service.c \
68                         src/agent.c src/notifier.c src/provider.c \
69                         src/resolver.c src/ipconfig.c src/detect.c \
70                         src/ipv4.c src/dhcp.c src/rtnl.c src/inet.c \
71                         src/utsname.c src/timeserver.c src/rfkill.c \
72                         src/wifi.c src/storage.c src/dbus.c src/config.c \
73                         src/technology.c src/counter.c src/location.c \
74                         src/session.c src/tethering.c src/ondemand.c \
75                         src/wpad.c src/stats.c src/iptables.c
76
77 src_connmand_LDADD = $(builtin_libadd) @GLIB_LIBS@ @DBUS_LIBS@ \
78                                 @CAPNG_LIBS@ @XTABLES_LIBS@ -lresolv -ldl
79
80 src_connmand_LDFLAGS = -Wl,--export-dynamic \
81                                 -Wl,--version-script=$(srcdir)/src/connman.ver
82
83 CLEANFILES = src/connman.conf src/builtin.h $(local_headers)
84
85 statedir = $(localstatedir)/run/connman
86
87 plugindir = $(libdir)/connman/plugins
88
89 scriptdir = $(libdir)/connman/scripts
90
91 storagedir = $(localstatedir)/lib/connman
92
93 if MAINTAINER_MODE
94 build_plugindir = $(abs_top_srcdir)/plugins/.libs
95 build_scriptdir = $(abs_top_srcdir)/scripts
96 else
97 build_plugindir = $(plugindir)
98 build_scriptdir = $(scriptdir)
99 endif
100
101 AM_CFLAGS = @DBUS_CFLAGS@ @GLIB_CFLAGS@ @CAPNG_CFLAGS@ @XTABLES_CFLAGS@ \
102                                 @NETLINK_CFLAGS@ @GNUTLS_CFLAGS@ \
103                                 $(builtin_cflags) \
104                                 -DCONNMAN_PLUGIN_BUILTIN \
105                                 -DSTATEDIR=\""$(statedir)"\" \
106                                 -DPLUGINDIR=\""$(build_plugindir)"\" \
107                                 -DSCRIPTDIR=\""$(build_scriptdir)"\" \
108                                 -DSTORAGEDIR=\""$(storagedir)\""
109
110 INCLUDES = -I$(builddir)/include -I$(builddir)/src -I$(srcdir)/gdbus
111
112 EXTRA_DIST = src/genbuiltin src/connman-dbus.conf src/connman-polkit.conf
113
114
115 script_DATA =
116 script_PROGRAMS =
117 script_LTLIBRARIES =
118
119 include Makefile.plugins
120
121 if CLIENT
122 noinst_PROGRAMS += client/cm
123
124 client_cm_SOURCES = client/main.c
125 client_cm_LDADD = @DBUS_LIBS@
126 endif
127
128 if TOOLS
129 noinst_PROGRAMS += tools/wispr tools/wifi-scan \
130                         tools/supplicant-test tools/dhcp-test \
131                         tools/addr-test tools/web-test tools/resolv-test \
132                         tools/dbus-test tools/polkit-test tools/portal-test \
133                         tools/iptables-test tools/tap-test tools/wpad-test \
134                         tools/stats-ringbuffer-dump
135
136 tools_wispr_SOURCES = $(gweb_sources) tools/wispr.c
137 tools_wispr_LDADD = @GLIB_LIBS@ @GNUTLS_LIBS@ -lresolv
138
139 tools_wifi_scan_LDADD = @GLIB_LIBS@ @NETLINK_LIBS@
140
141 tools_supplicant_test_SOURCES = $(gdbus_sources) tools/supplicant-test.c \
142                         tools/supplicant-dbus.h tools/supplicant-dbus.c \
143                         tools/supplicant.h tools/supplicant.c
144 tools_supplicant_test_LDADD = @GLIB_LIBS@ @DBUS_LIBS@
145
146 tools_web_test_SOURCES = $(gweb_sources) tools/web-test.c
147 tools_web_test_LDADD = @GLIB_LIBS@ @GNUTLS_LIBS@ -lresolv
148
149 tools_resolv_test_SOURCES = gweb/gresolv.h gweb/gresolv.c tools/resolv-test.c
150 tools_resolv_test_LDADD = @GLIB_LIBS@ -lresolv
151
152 tools_wpad_test_SOURCES = gweb/gresolv.h gweb/gresolv.c tools/wpad-test.c
153 tools_wpad_test_LDADD = @GLIB_LIBS@ -lresolv
154
155 tools_dhcp_test_SOURCES = $(gdhcp_sources) tools/dhcp-test.c
156 tools_dhcp_test_LDADD = @GLIB_LIBS@
157
158 tools_dbus_test_SOURCES = $(gdbus_sources) tools/dbus-test.c
159 tools_dbus_test_LDADD = @GLIB_LIBS@ @DBUS_LIBS@
160
161 tools_polkit_test_LDADD = @DBUS_LIBS@
162
163 tools_portal_test_LDADD = @GLIB_LIBS@
164
165 tools_iptables_test_LDADD = @GLIB_LIBS@ @XTABLES_LIBS@
166
167 if DHCLIENT
168 noinst_PROGRAMS += tools/dhclient-test
169
170 tools_dhclient_test_SOURCES = gdbus/gdbus.h gdbus/mainloop.c gdbus/watch.c \
171                                                         tools/dhclient-test.c
172 tools_dhclient_test_LDADD = @GLIB_LIBS@ @DBUS_LIBS@
173
174 tools_dhclient_test_CFLAGS = $(AM_CFLAGS) -DDHCLIENT=\"@DHCLIENT@\"
175 endif
176 endif
177
178 test_scripts = test/get-state test/list-profiles test/list-services \
179                 test/connect-service test/monitor-services \
180                 test/set-address test/test-profile \
181                 test/simple-agent test/show-introspection test/test-compat \
182                 test/test-manager test/test-connman test/monitor-connman \
183                 test/connect-vpn test/disconnect-vpn test/list-providers \
184                 test/monitor-manager test/test-counter test/set-ip-method \
185                 test/set-nameservers test/set-domains test/find-service \
186                 test/get-services test/get-proxy-autoconfig test/set-proxy \
187                 test/enable-tethering test/disable-tethering test/backtrace
188
189 if TEST
190 testdir = $(pkglibdir)/test
191 test_SCRIPTS = $(test_scripts)
192 endif
193
194 EXTRA_DIST += $(test_scripts)
195
196 EXTRA_DIST += doc/overview-api.txt doc/behavior-api.txt \
197                                 doc/ipconfig-api.txt doc/plugin-api.txt \
198                                 doc/manager-api.txt doc/agent-api.txt \
199                                 doc/profile-api.txt doc/service-api.txt \
200                                 doc/technology-api.txt doc/counter-api.txt \
201                                 doc/advanced-configuration.txt \
202                                 doc/config-format.txt
203
204 pkgconfigdir = $(libdir)/pkgconfig
205
206 pkgconfig_DATA = connman.pc
207
208 DISTCHECK_CONFIGURE_FLAGS = --disable-gtk-doc \
209                                 --disable-datafiles \
210                                 --enable-loopback \
211                                 --enable-ethernet \
212                                 --enable-wifi \
213                                 --enable-bluetooth \
214                                 --enable-ofono \
215                                 --enable-dhclient \
216                                 --enable-dnsproxy \
217                                 --enable-pacrunner \
218                                 --enable-google \
219                                 --enable-meego \
220                                 --enable-client \
221                                 --enable-portal \
222                                 --enable-hh2serial-gps \
223                                 --enable-ntpd \
224                                 --enable-openconnect \
225                                 --enable-tools
226
227 DISTCLEANFILES = $(pkgconfig_DATA)
228
229 MAINTAINERCLEANFILES = Makefile.in \
230         aclocal.m4 configure config.h.in config.sub config.guess \
231         ltmain.sh depcomp compile missing install-sh mkinstalldirs
232
233
234 src/plugin.$(OBJEXT): src/builtin.h
235
236 src/builtin.h: src/genbuiltin $(builtin_sources)
237         $(AM_V_GEN)$(srcdir)/src/genbuiltin $(builtin_modules) > $@
238
239 src/connman.conf: src/connman-dbus.conf src/connman-polkit.conf
240 if POLKIT
241         $(AM_V_GEN)cp $(srcdir)/src/connman-polkit.conf $@
242 else
243         $(AM_V_GEN)cp $(srcdir)/src/connman-dbus.conf $@
244 endif
245
246 $(src_connmand_OBJECTS) $(plugin_objects): $(local_headers)
247
248 include/connman/version.h: include/version.h
249         $(AM_V_at)$(MKDIR_P) include/connman
250         $(AM_V_GEN)$(LN_S) $(abs_top_builddir)/$< $@
251
252 include/connman/%.h: include/%.h
253         $(AM_V_at)$(MKDIR_P) include/connman
254         $(AM_V_GEN)$(LN_S) $(abs_top_srcdir)/$< $@
255
256 clean-local:
257         @$(RM) -rf include/connman