a0c17cfa3033e80fad826add660c655e38422ea5
[platform/upstream/connman.git] / Makefile.plugins
1
2 plugin_cflags = -fvisibility=hidden -I$(srcdir)/gdbus \
3                                         @DLOG_CFLAGS@ @DBUS_CFLAGS@ @GLIB_CFLAGS@
4 plugin_ldflags = -no-undefined -module -avoid-version
5
6 if LOOPBACK
7 builtin_modules += loopback
8 builtin_sources += plugins/loopback.c
9 endif
10
11 if ETHERNET
12 builtin_modules += ethernet
13 builtin_sources += plugins/ethernet.c
14 endif
15
16 if GADGET
17 builtin_modules += gadget
18 builtin_sources += plugins/gadget.c
19 endif
20
21 gsupplicant_sources = gsupplicant/gsupplicant.h gsupplicant/dbus.h \
22                         gsupplicant/supplicant.c gsupplicant/dbus.c
23
24 if WIFI
25 builtin_modules += wifi
26 builtin_sources += plugins/wifi.c $(gsupplicant_sources)
27 endif
28
29 if IWD
30 builtin_modules += iwd
31 builtin_sources += plugins/iwd.c
32 endif
33
34 if BLUETOOTH
35 builtin_modules += bluetooth
36 builtin_sources += plugins/bluetooth.c
37 endif
38
39 if HH2SERIAL_GPS
40 if HH2SERIAL_GPS_BUILTIN
41 builtin_modules += hh2serial_gps
42 builtin_sources += plugins/hh2serial-gps.c
43 else
44 plugin_LTLIBRARIES += plugins/hh2serial-gps.la
45 plugin_objects += $(plugins_hh2serial_gps_la_OBJECTS)
46 plugins_hh2serial_gps_la_CFLAGS = $(plugin_cflags)
47 plugins_hh2serial_gps_la_LDFLAGS = $(plugin_ldflags)
48 endif
49 endif
50
51 if OFONO
52 builtin_modules += ofono
53 builtin_sources += plugins/mcc.h plugins/ofono.c
54 endif
55
56 if DUNDEE
57 builtin_modules += dundee
58 builtin_sources += plugins/dundee.c
59 endif
60
61 if TELEPHONY
62 if TELEPHONY_BUILTIN
63 builtin_modules += telephony
64 builtin_sources += plugins/telephony.c
65 else
66 plugin_LTLIBRARIES += plugins/telephony.la
67 plugin_objects += $(plugins_telephony_la_OBJECTS)
68 plugins_telephony_la_CFLAGS = $(plugin_cflags)
69 plugins_telephony_la_LDFLAGS = $(plugin_ldflags)
70 endif
71 endif
72
73 if VPN
74 builtin_modules += vpn
75 builtin_sources += plugins/vpn.c
76
77 if WIREGUARD
78 builtin_vpn_source = vpn/plugins/vpn.c vpn/plugins/vpn.h
79 if WIREGUARD_BUILTIN
80 builtin_vpn_modules += wireguard
81 builtin_vpn_sources += src/shared/mnlg.h src/shared/mnlg.c \
82                         vpn/plugins/wireguard.h vpn/plugins/libwireguard.c \
83                         vpn/plugins/wireguard.c
84 builtin_vpn_cflags += @LIBMNL_CFLAGS@ -DWIREGUARD=\"@WIREGUARD@\"
85 builtin_vpn_libadd += @LIBMNL_LIBS@
86 else
87 vpn_plugin_LTLIBRARIES += vpn/plugins/wireguard.la
88 vpn_plugin_objects += $(plugins_wireguard_la_OBJECTS)
89 vpn_plugins_wireguard_la_SOURCES = src/shared/mnlg.h src/shared/mnlg.c \
90                                         vpn/plugins/wireguard.h \
91                                         vpn/plugins/libwireguard.c \
92                                         vpn/plugins/wireguard.c
93 vpn_plugins_wireguard_la_CFLAGS = $(plugin_cflags) @LIBMNL_CFLAGS@ \
94                                         -DWIREGUARD=\"@WIREGUARD@\" \
95                                         -DVPN_STATEDIR=\""$(vpn_statedir)"\" \
96                                         -DSCRIPTDIR=\""$(build_scriptdir)"\"
97 vpn_plugins_wireguard_la_LDFLAGS = $(plugin_ldflags)
98 vpn_plugins_wireguard_la_LIBADD = @LIBMNL_LIBS@
99 endif
100 endif
101
102 if OPENCONNECT
103 builtin_vpn_source = vpn/plugins/vpn.c vpn/plugins/vpn.h
104 if OPENCONNECT_BUILTIN
105 builtin_vpn_modules += openconnect
106 builtin_vpn_sources += vpn/plugins/openconnect.c
107 builtin_vpn_cflags += -DOPENCONNECT=\"@OPENCONNECT@\" \
108                                         @LIBOPENCONNECT_CFLAGS@
109 builtin_vpn_libadd += @LIBOPENCONNECT_LIBS@
110 else
111 vpn_plugin_LTLIBRARIES += vpn/plugins/openconnect.la
112 vpn_plugin_objects += $(plugins_openconnect_la_OBJECTS)
113 vpn_plugins_openconnect_la_SOURCES = vpn/plugins/openconnect.c
114 vpn_plugins_openconnect_la_CFLAGS = $(plugin_cflags) \
115                                         -DOPENCONNECT=\"@OPENCONNECT@\" \
116                                         -DVPN_STATEDIR=\""$(vpn_statedir)"\" \
117                                         -DSCRIPTDIR=\""$(build_scriptdir)"\" \
118                                         @LIBOPENCONNECT_CFLAGS@
119 vpn_plugins_openconnect_la_LDFLAGS = $(plugin_ldflags)
120 vpn_plugins_openconnect_la_LIBADD = @LIBOPENCONNECT_LIBS@
121 endif
122 endif
123
124 if OPENVPN
125 builtin_vpn_source = vpn/plugins/vpn.c vpn/plugins/vpn.h
126 if OPENVPN_BUILTIN
127 builtin_vpn_modules += openvpn
128 builtin_vpn_sources += vpn/plugins/openvpn.c
129 builtin_vpn_cflags += -DOPENVPN=\"@OPENVPN@\"
130 else
131 vpn_plugin_LTLIBRARIES += vpn/plugins/openvpn.la
132 vpn_plugin_objects += $(plugins_openvpn_la_OBJECTS)
133 vpn_plugins_openvpn_la_SOURCES = vpn/plugins/openvpn.c
134 vpn_plugins_openvpn_la_CFLAGS = $(plugin_cflags) -DOPENVPN=\"@OPENVPN@\" \
135                                         -DVPN_STATEDIR=\""$(vpn_statedir)"\" \
136                                         -DSCRIPTDIR=\""$(build_scriptdir)"\"
137 vpn_plugins_openvpn_la_LDFLAGS = $(plugin_ldflags)
138 endif
139 endif
140
141 if IPSEC
142 if IPSEC_BUILTIN
143 builtin_vpn_modules += ipsec
144 builtin_vpn_sources += vpn/plugins/ipsec.h vpn/plugins/ipsec.c
145 builtin_vpn_sources += vpn/plugins/vici-client.h vpn/plugins/vici-client.c
146 builtin_vpn_source = vpn/plugins/vpn.c vpn/plugins/vpn.h
147 builtin_vpn_cflags += -DIPSEC=\"@IPSEC@\"
148 else
149 vpn_plugin_LTLIBRARIES += vpn/plugins/ipsec.la
150 vpn_plugin_objects += $(plugins_ipsec_la_OBJECTS)
151 vpn_plugins_ipsec_la_SOURCES = vpn/plugins/vpn.h vpn/plugins/vpn.c \
152                                                 vpn/plugins/ipsec.c vpn/plugins/vici-client.c
153 vpn_plugins_ipsec_la_CFLAGS = $(plugin_cflags) -DIPSEC=\"@IPSEC@\" \
154                                         -DVPN_STATEDIR=\""$(vpn_statedir)"\" \
155                                         -DSCRIPTDIR=\""$(build_scriptdir)"\" @GIO_CFLAGS@
156 vpn_plugins_ipsec_la_LDFLAGS = $(plugin_ldflags) @GIO_LIBS@
157 endif
158 endif
159
160 if VPNC
161 builtin_vpn_source = vpn/plugins/vpn.c vpn/plugins/vpn.h
162 if VPNC_BUILTIN
163 builtin_vpn_modules += vpnc
164 builtin_vpn_sources += vpn/plugins/vpnc.c
165 builtin_vpn_cflags += -DVPNC=\"@VPNC@\"
166 else
167 vpn_plugin_LTLIBRARIES += vpn/plugins/vpnc.la
168 vpn_plugin_objects += $(plugins_vpnc_la_OBJECTS)
169 vpn_plugins_vpnc_la_SOURCES = vpn/plugins/vpnc.c
170 vpn_plugins_vpnc_la_CFLAGS = $(plugin_cflags) -DVPNC=\"@VPNC@\" \
171                                         -DVPN_STATEDIR=\""$(vpn_statedir)"\" \
172                                         -DSCRIPTDIR=\""$(build_scriptdir)"\"
173 vpn_plugins_vpnc_la_LDFLAGS = $(plugin_ldflags)
174 endif
175 endif
176
177 if L2TP
178 builtin_vpn_source = vpn/plugins/vpn.c vpn/plugins/vpn.h
179 if L2TP_BUILTIN
180 builtin_vpn_modules += l2tp
181 builtin_vpn_sources += vpn/plugins/l2tp.c
182 builtin_vpn_cflags += -DL2TP=\"@L2TP@\"
183 else
184 vpn_plugin_LTLIBRARIES += vpn/plugins/l2tp.la
185 vpn_plugin_objects += $(plugins_l2tp_la_OBJECTS)
186 vpn_plugins_l2tp_la_SOURCES = vpn/plugins/l2tp.c
187 vpn_plugins_l2tp_la_CFLAGS = $(plugin_cflags) -DL2TP=\"@L2TP@\" \
188                                         -DVPN_STATEDIR=\""$(vpn_statedir)"\" \
189                                         -DSCRIPTDIR=\""$(build_scriptdir)"\"
190 vpn_plugins_l2tp_la_LDFLAGS = $(plugin_ldflags)
191 endif
192 endif
193
194 if PPTP
195 builtin_vpn_source = vpn/plugins/vpn.c vpn/plugins/vpn.h
196 if PPTP_BUILTIN
197 builtin_vpn_modules += pptp
198 builtin_vpn_sources += vpn/plugins/pptp.c
199 builtin_vpn_cflags += -DPPPD=\"@PPPD@\" -DPPTP=\"@PPTP@\"
200 else
201 vpn_plugin_LTLIBRARIES += vpn/plugins/pptp.la
202 vpn_plugin_objects += $(plugins_pptp_la_OBJECTS)
203 vpn_plugins_pptp_la_SOURCES = vpn/plugins/pptp.c
204 vpn_plugins_pptp_la_CFLAGS = $(plugin_cflags) -DPPPD=\"@PPPD@\" \
205                                         -DPPTP=\"@PPTP@\" \
206                                         -DVPN_STATEDIR=\""$(vpn_statedir)"\" \
207                                         -DSCRIPTDIR=\""$(build_scriptdir)"\"
208 vpn_plugins_pptp_la_LDFLAGS = $(plugin_ldflags)
209 endif
210 endif
211
212 if PPTP
213 script_LTLIBRARIES += scripts/libppp-plugin.la
214 scripts_libppp_plugin_la_LDFLAGS = $(plugin_ldflags)
215 scripts_libppp_plugin_la_LIBADD = @DBUS_LIBS@
216 else
217 if L2TP
218 script_LTLIBRARIES += scripts/libppp-plugin.la
219 scripts_libppp_plugin_la_LDFLAGS = $(plugin_ldflags)
220 scripts_libppp_plugin_la_LIBADD = @DBUS_LIBS@
221 endif
222 endif
223
224 if VPN
225 builtin_vpn_sources += $(builtin_vpn_source)
226 endif
227 endif
228
229 if PACRUNNER
230 builtin_modules += pacrunner
231 builtin_sources += plugins/pacrunner.c
232 endif
233
234 if POLKIT
235 builtin_modules += polkit
236 builtin_sources += plugins/polkit.c
237
238 if DATAFILES
239 policydir = @POLKIT_DATADIR@
240
241 policy_DATA = plugins/net.connman.policy
242
243 if VPN
244 policy_DATA += vpn/net.connman.vpn.policy
245 endif
246 endif
247 endif
248
249 if IOSPM
250 plugin_LTLIBRARIES += plugins/iospm.la
251 plugin_objects += $(plugins_iospm_la_OBJECTS)
252 plugins_iospm_la_CFLAGS = $(plugin_cflags)
253 plugins_iospm_la_LDFLAGS = $(plugin_ldflags)
254 endif
255
256 if OPENCONNECT
257 scripts_openconnect_script_LDADD = @DBUS_LIBS@ @DLOG_LIBS@
258 else
259 if VPNC
260 script_PROGRAMS += scripts/vpn-script
261
262 scripts_vpn_script_LDADD = @DBUS_LIBS@
263 endif
264 endif
265
266 if OPENVPN
267 script_PROGRAMS += scripts/openvpn-script
268
269 scripts_openvpn_script_LDADD = @DBUS_LIBS@ @DLOG_LIBS@
270 endif
271
272 if IPSEC
273 script_PROGRAMS += scripts/ipsec-script
274
275 scripts_ipsec_script_LDADD = @DBUS_LIBS@ @DLOG_LIBS@
276 endif
277
278 if NMCOMPAT
279 builtin_modules += nmcompat
280 builtin_sources += plugins/nmcompat.c
281 endif
282
283 if TIST
284 if TIST_BUILTIN
285 builtin_modules += tist
286 builtin_sources += plugins/tist.c
287 else
288 plugin_LTLIBRARIES += plugins/tist.la
289 plugin_objects += $(plugins_tist_la_OBJECTS)
290 plugins_tist_la_CFLAGS = $(plugin_cflags)
291 plugins_tist_la_LDFLAGS = $(plugin_ldflags)
292 endif
293 endif
294
295 if SESSION_POLICY_LOCAL
296 if SESSION_POLICY_LOCAL_BUILTIN
297 builtin_modules += session_policy_local
298 builtin_sources += plugins/session_policy_local.c
299 else
300 plugin_LTLIBRARIES += plugins/session_policy_local.la
301 plugin_objects += $(plugins_session_policy_local_la_OBJECTS)
302 plugins_session_policy_local_la_CFLAGS = $(plugin_cflags) \
303                                 -DSTORAGEDIR=\""$(storagedir)\""
304 plugins_session_policy_local_la_LDFLAGS = $(plugin_ldflags)
305 endif
306 endif
307
308 if NEARD
309 builtin_modules += neard
310 builtin_sources += plugins/neard.c
311 endif
312
313 EXTRA_DIST += plugins/polkit.policy
314
315 plugins/net.connman.policy: plugins/polkit.policy
316 if POLKIT
317         $(AM_V_GEN)cp $< $@
318 endif
319
320 EXTRA_DIST += vpn/vpn-polkit.policy
321
322 if VPN
323 vpn/net.connman.vpn.policy: vpn/vpn-polkit.policy
324 if POLKIT
325         $(AM_V_GEN)cp $< $@
326 endif
327 endif