summaryrefslogtreecommitdiff
path: root/Makefile.plugins
blob: 294cae04573aa7c4f856fcec49611cd48f495603 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268

plugin_cflags = -fvisibility=hidden -I$(srcdir)/gdbus \
					@DBUS_CFLAGS@ @GLIB_CFLAGS@
plugin_ldflags = -no-undefined -module -avoid-version

script_cflags = -fvisibility=hidden -I$(srcdir)/gdbus \
					@DBUS_CFLAGS@

if LOOPBACK
builtin_modules += loopback
builtin_sources += plugins/loopback.c
endif

if ETHERNET
builtin_modules += ethernet
builtin_sources += plugins/ethernet.c
endif

if GADGET
builtin_modules += gadget
builtin_sources += plugins/gadget.c
endif

gsupplicant_sources = gsupplicant/gsupplicant.h gsupplicant/dbus.h \
			gsupplicant/supplicant.c gsupplicant/dbus.c

if WIFI
builtin_modules += wifi
builtin_sources += plugins/wifi.c $(gsupplicant_sources)
endif

if BLUETOOTH
builtin_modules += bluetooth_legacy
builtin_sources += plugins/bluetooth_legacy.c
builtin_modules += bluetooth
builtin_sources += plugins/bluetooth.c
endif

if HH2SERIAL_GPS
if HH2SERIAL_GPS_BUILTIN
builtin_modules += hh2serial_gps
builtin_sources += plugins/hh2serial-gps.c
else
plugin_LTLIBRARIES += plugins/hh2serial-gps.la
plugin_objects += $(plugins_hh2serial_gps_la_OBJECTS)
plugins_hh2serial_gps_la_CFLAGS = $(plugin_cflags)
plugins_hh2serial_gps_la_LDFLAGS = $(plugin_ldflags)
endif
endif

if OFONO
builtin_modules += ofono
builtin_sources += plugins/mcc.h plugins/ofono.c
endif

if DUNDEE
builtin_modules += dundee
builtin_sources += plugins/dundee.c
endif

if VPN
builtin_modules += vpn
builtin_sources += plugins/vpn.c

if OPENCONNECT
if OPENCONNECT_BUILTIN
builtin_vpn_modules += openconnect
builtin_vpn_sources += vpn/plugins/openconnect.c
builtin_vpn_source = vpn/plugins/vpn.c vpn/plugins/vpn.h
builtin_vpn_cflags += -DOPENCONNECT=\"@OPENCONNECT@\"
else
vpn_plugin_LTLIBRARIES += vpn/plugins/openconnect.la
vpn_plugin_objects += $(plugins_openconnect_la_OBJECTS)
vpn_plugins_openconnect_la_SOURCES = vpn/plugins/vpn.h vpn/plugins/vpn.c \
						vpn/plugins/openconnect.c
vpn_plugins_openconnect_la_CFLAGS = $(plugin_cflags) \
					-DOPENCONNECT=\"@OPENCONNECT@\" \
					-DVPN_STATEDIR=\""$(vpn_statedir)"\" \
					-DSCRIPTDIR=\""$(build_scriptdir)"\"
vpn_plugins_openconnect_la_LDFLAGS = $(plugin_ldflags)
endif
endif

if OPENVPN
if OPENVPN_BUILTIN
builtin_vpn_modules += openvpn
builtin_vpn_sources += vpn/plugins/openvpn.c
builtin_vpn_source = vpn/plugins/vpn.c vpn/plugins/vpn.h
builtin_vpn_cflags += -DOPENVPN=\"@OPENVPN@\"
else
vpn_plugin_LTLIBRARIES += vpn/plugins/openvpn.la
vpn_plugin_objects += $(plugins_openvpn_la_OBJECTS)
vpn_plugins_openvpn_la_SOURCES = vpn/plugins/vpn.h vpn/plugins/vpn.c \
						vpn/plugins/openvpn.c
vpn_plugins_openvpn_la_CFLAGS = $(plugin_cflags) -DOPENVPN=\"@OPENVPN@\" \
					-DVPN_STATEDIR=\""$(vpn_statedir)"\" \
					-DSCRIPTDIR=\""$(build_scriptdir)"\"
vpn_plugins_openvpn_la_LDFLAGS = $(plugin_ldflags)
endif
endif

if VPNC
if VPNC_BUILTIN
builtin_vpn_modules += vpnc
builtin_vpn_sources += vpn/plugins/vpnc.c
builtin_vpn_source = vpn/plugins/vpn.c vpn/plugins/vpn.h
builtin_vpn_cflags += -DVPNC=\"@VPNC@\"
else
vpn_plugin_LTLIBRARIES += vpn/plugins/vpnc.la
vpn_plugin_objects += $(plugins_vpnc_la_OBJECTS)
vpn_plugins_vpnc_la_SOURCES = vpn/plugins/vpn.h vpn/plugins/vpn.c \
						vpn/plugins/vpnc.c
vpn_plugins_vpnc_la_CFLAGS = $(plugin_cflags) -DVPNC=\"@VPNC@\" \
					-DVPN_STATEDIR=\""$(vpn_statedir)"\" \
					-DSCRIPTDIR=\""$(build_scriptdir)"\"
vpn_plugins_vpnc_la_LDFLAGS = $(plugin_ldflags)
endif
endif

if L2TP
if L2TP_BUILTIN
builtin_vpn_modules += l2tp
builtin_vpn_sources += vpn/plugins/l2tp.c
builtin_vpn_source = vpn/plugins/vpn.c vpn/plugins/vpn.h
builtin_vpn_cflags += -DL2TP=\"@L2TP@\"
else
vpn_plugin_LTLIBRARIES += vpn/plugins/l2tp.la
vpn_plugin_objects += $(plugins_l2tp_la_OBJECTS)
vpn_plugins_l2tp_la_SOURCES = vpn/plugins/vpn.h vpn/plugins/vpn.c \
						vpn/plugins/l2tp.c
vpn_plugins_l2tp_la_CFLAGS = $(plugin_cflags) -DL2TP=\"@L2TP@\" \
					-DVPN_STATEDIR=\""$(vpn_statedir)"\" \
					-DSCRIPTDIR=\""$(build_scriptdir)"\"
vpn_plugins_l2tp_la_LDFLAGS = $(plugin_ldflags)
endif
endif

if PPTP
if PPTP_BUILTIN
builtin_vpn_modules += pptp
builtin_vpn_sources += vpn/plugins/pptp.c
builtin_vpn_source = vpn/plugins/vpn.c vpn/plugins/vpn.h
builtin_vpn_cflags += -DPPPD=\"@PPPD@\" -DPPTP=\"@PPTP@\"
else
vpn_plugin_LTLIBRARIES += vpn/plugins/pptp.la
vpn_plugin_objects += $(plugins_pptp_la_OBJECTS)
vpn_plugins_pptp_la_SOURCES = vpn/plugins/vpn.h vpn/plugins/vpn.c \
						vpn/plugins/pptp.c
vpn_plugins_pptp_la_CFLAGS = $(plugin_cflags) -DPPPD=\"@PPPD@\" \
					-DPPTP=\"@PPTP@\" \
					-DVPN_STATEDIR=\""$(vpn_statedir)"\" \
					-DSCRIPTDIR=\""$(build_scriptdir)"\"
vpn_plugins_pptp_la_LDFLAGS = $(plugin_ldflags)
endif
endif

if PPTP
script_LTLIBRARIES += scripts/libppp-plugin.la
scripts_libppp_plugin_la_LDFLAGS = $(script_cflags) @DBUS_CFLAGS@
scripts_libppp_plugin_la_LIBADD = @DBUS_LIBS@
else
if L2TP
script_LTLIBRARIES += scripts/libppp-plugin.la
scripts_libppp_plugin_la_LDFLAGS = $(script_cflags) @DBUS_CFLAGS@
scripts_libppp_plugin_la_LIBADD = @DBUS_LIBS@
endif
endif

if VPN
builtin_vpn_sources += $(builtin_vpn_source)
endif
endif

if PACRUNNER
builtin_modules += pacrunner
builtin_sources += plugins/pacrunner.c
endif

if POLKIT
builtin_modules += polkit
builtin_sources += plugins/polkit.c

if DATAFILES
policydir = @POLKIT_DATADIR@

policy_DATA = plugins/net.connman.policy

if VPN
policy_DATA += vpn/net.connman.vpn.policy
endif
endif
endif

if IOSPM
plugin_LTLIBRARIES += plugins/iospm.la
plugin_objects += $(plugins_iospm_la_OBJECTS)
plugins_iospm_la_CFLAGS = $(plugin_cflags)
plugins_iospm_la_LDFLAGS = $(plugin_ldflags)
endif

if OPENCONNECT
script_PROGRAMS += scripts/openconnect-script

scripts_openconnect_script_LDADD = @DBUS_LIBS@
else
if VPNC
script_PROGRAMS += scripts/openconnect-script

scripts_openconnect_script_LDADD = @DBUS_LIBS@
endif
endif

if OPENVPN
script_PROGRAMS += scripts/openvpn-script

scripts_openvpn_script_LDADD = @DBUS_LIBS@
endif

if NMCOMPAT
builtin_modules += nmcompat
builtin_sources += plugins/nmcompat.c
endif

if TIST
if TIST_BUILTIN
builtin_modules += tist
builtin_sources += plugins/tist.c
else
plugin_LTLIBRARIES += plugins/tist.la
plugin_objects += $(plugins_tist_la_OBJECTS)
plugins_tist_la_CFLAGS = $(plugin_cflags)
plugins_tist_la_LDFLAGS = $(plugin_ldflags)
endif
endif

if SESSION_POLICY_LOCAL
if SESSION_POLICY_LOCAL_BUILTIN
builtin_modules += session_policy_local
builtin_sources += plugins/session_policy_local.c
else
plugin_LTLIBRARIES += plugins/session_policy_local.la
plugin_objects += $(plugins_session_policy_local_la_OBJECTS)
plugins_session_policy_local_la_CFLAGS = $(plugin_cflags) \
				-DSTORAGEDIR=\""$(storagedir)\""
plugins_session_policy_local_la_LDFLAGS = $(plugin_ldflags)
endif
endif

if NEARD
builtin_modules += neard
builtin_sources += plugins/neard.c
endif

EXTRA_DIST += plugins/polkit.policy

plugins/net.connman.policy: plugins/polkit.policy
if POLKIT
	$(AM_V_GEN)cp $< $@
endif

EXTRA_DIST += vpn/vpn-polkit.policy

if VPN
vpn/net.connman.vpn.policy: vpn/vpn-polkit.policy
if POLKIT
	$(AM_V_GEN)cp $< $@
endif
endif