9f31d63a29b869a46c7486a0283f6ee71d91e8d8
[platform/upstream/connman.git] / Makefile.plugins
1
2 plugin_cflags = -fvisibility=hidden -I$(srcdir)/gdbus \
3                                         @DBUS_CFLAGS@ @GLIB_CFLAGS@
4 plugin_ldflags = -no-undefined -module -avoid-version
5
6 script_cflags = -fvisibility=hidden -I$(srcdir)/gdbus \
7                                         @DBUS_CFLAGS@
8
9 if LOOPBACK
10 builtin_modules += loopback
11 builtin_sources += plugins/loopback.c
12 endif
13
14 if ETHERNET
15 builtin_modules += ethernet
16 builtin_sources += plugins/ethernet.c
17 endif
18
19 gsupplicant_sources = gsupplicant/gsupplicant.h gsupplicant/dbus.h \
20                         gsupplicant/supplicant.c gsupplicant/dbus.c
21
22 if WIFI
23 builtin_modules += wifi
24 builtin_sources += plugins/wifi.c $(gsupplicant_sources)
25 endif
26
27 if BLUETOOTH
28 builtin_modules += bluetooth
29 builtin_sources += plugins/bluetooth.c
30 endif
31
32 if HH2SERIAL_GPS
33 if HH2SERIAL_GPS_BUILTIN
34 builtin_modules += hh2serial_gps
35 builtin_sources += plugins/hh2serial-gps.c
36 else
37 plugin_LTLIBRARIES += plugins/hh2serial-gps.la
38 plugin_objects += $(plugins_hh2serial_gps_la_OBJECTS)
39 plugins_hh2serial_gps_la_CFLAGS = $(plugin_cflags)
40 plugins_hh2serial_gps_la_LDFLAGS = $(plugin_ldflags)
41 endif
42 endif
43
44 if OFONO
45 builtin_modules += ofono
46 builtin_sources += plugins/mcc.h plugins/ofono.c
47 endif
48
49 if DUNDEE
50 builtin_modules += dundee
51 builtin_sources += plugins/dundee.c
52 endif
53
54 if VPN
55 builtin_modules += vpn
56 builtin_sources += plugins/vpn.c
57
58 if OPENCONNECT
59 if OPENCONNECT_BUILTIN
60 builtin_vpn_modules += openconnect
61 builtin_vpn_sources += vpn/plugins/openconnect.c
62 builtin_vpn_source = vpn/plugins/vpn.c vpn/plugins/vpn.h
63 builtin_vpn_cflags += -DOPENCONNECT=\"@OPENCONNECT@\"
64 else
65 vpn_plugin_LTLIBRARIES += vpn/plugins/openconnect.la
66 vpn_plugin_objects += $(plugins_openconnect_la_OBJECTS)
67 vpn_plugins_openconnect_la_SOURCES = vpn/plugins/vpn.h vpn/plugins/vpn.c \
68                                                 vpn/plugins/openconnect.c
69 vpn_plugins_openconnect_la_CFLAGS = $(plugin_cflags) \
70                                         -DOPENCONNECT=\"@OPENCONNECT@\" \
71                                         -DSTATEDIR=\""$(statedir)"\" \
72                                         -DSCRIPTDIR=\""$(build_scriptdir)"\"
73 vpn_plugins_openconnect_la_LDFLAGS = $(plugin_ldflags)
74 endif
75 endif
76
77 if OPENVPN
78 if OPENVPN_BUILTIN
79 builtin_vpn_modules += openvpn
80 builtin_vpn_sources += vpn/plugins/openvpn.c
81 builtin_vpn_source = vpn/plugins/vpn.c vpn/plugins/vpn.h
82 builtin_vpn_cflags += -DOPENVPN=\"@OPENVPN@\"
83 else
84 vpn_plugin_LTLIBRARIES += vpn/plugins/openvpn.la
85 vpn_plugin_objects += $(plugins_openvpn_la_OBJECTS)
86 vpn_plugins_openvpn_la_SOURCES = vpn/plugins/vpn.h vpn/plugins/vpn.c \
87                                                 vpn/plugins/openvpn.c
88 vpn_plugins_openvpn_la_CFLAGS = $(plugin_cflags) -DOPENVPN=\"@OPENVPN@\" \
89                                         -DSTATEDIR=\""$(statedir)"\" \
90                                         -DSCRIPTDIR=\""$(build_scriptdir)"\"
91 vpn_plugins_openvpn_la_LDFLAGS = $(plugin_ldflags)
92 endif
93 endif
94
95 if VPNC
96 if VPNC_BUILTIN
97 builtin_vpn_modules += vpnc
98 builtin_vpn_sources += vpn/plugins/vpnc.c
99 builtin_vpn_source = vpn/plugins/vpn.c vpn/plugins/vpn.h
100 builtin_vpn_cflags += -DVPNC=\"@VPNC@\"
101 else
102 vpn_plugin_LTLIBRARIES += vpn/plugins/vpnc.la
103 vpn_plugin_objects += $(plugins_vpnc_la_OBJECTS)
104 vpn_plugins_vpnc_la_SOURCES = vpn/plugins/vpn.h vpn/plugins/vpn.c \
105                                                 vpn/plugins/vpnc.c
106 vpn_plugins_vpnc_la_CFLAGS = $(plugin_cflags) -DVPNC=\"@VPNC@\" \
107                                         -DSTATEDIR=\""$(statedir)"\" \
108                                         -DSCRIPTDIR=\""$(build_scriptdir)"\"
109 vpn_plugins_vpnc_la_LDFLAGS = $(plugin_ldflags)
110 endif
111 endif
112
113 if L2TP
114 if L2TP_BUILTIN
115 builtin_vpn_modules += l2tp
116 builtin_vpn_sources += vpn/plugins/l2tp.c
117 builtin_vpn_source = vpn/plugins/vpn.c vpn/plugins/vpn.h
118 builtin_vpn_cflags += -DL2TP=\"@L2TP@\"
119 else
120 vpn_plugin_LTLIBRARIES += vpn/plugins/l2tp.la
121 vpn_plugin_objects += $(plugins_l2tp_la_OBJECTS)
122 vpn_plugins_l2tp_la_SOURCES = vpn/plugins/vpn.h vpn/plugins/vpn.c \
123                                                 vpn/plugins/l2tp.c
124 vpn_plugins_l2tp_la_CFLAGS = $(plugin_cflags) -DL2TP=\"@L2TP@\" \
125                                         -DSTATEDIR=\""$(statedir)"\" \
126                                         -DSCRIPTDIR=\""$(build_scriptdir)"\"
127 vpn_plugins_l2tp_la_LDFLAGS = $(plugin_ldflags)
128 endif
129 endif
130
131 if PPTP
132 if PPTP_BUILTIN
133 builtin_vpn_modules += pptp
134 builtin_vpn_sources += vpn/plugins/pptp.c
135 builtin_vpn_source = vpn/plugins/vpn.c vpn/plugins/vpn.h
136 builtin_vpn_cflags += -DPPPD=\"@PPPD@\" -DPPTP=\"@PPTP@\"
137 else
138 vpn_plugin_LTLIBRARIES += vpn/plugins/pptp.la
139 vpn_plugin_objects += $(plugins_pptp_la_OBJECTS)
140 vpn_plugins_pptp_la_SOURCES = vpn/plugins/vpn.h vpn/plugins/vpn.c \
141                                                 vpn/plugins/pptp.c
142 vpn_plugins_pptp_la_CFLAGS = $(plugin_cflags) -DPPPD=\"@PPPD@\" \
143                                         -DPPTP=\"@PPTP@\" \
144                                         -DSTATEDIR=\""$(statedir)"\" \
145                                         -DSCRIPTDIR=\""$(build_scriptdir)"\"
146 vpn_plugins_pptp_la_LDFLAGS = $(plugin_ldflags)
147 endif
148 endif
149
150 if PPTP
151 script_LTLIBRARIES += scripts/libppp-plugin.la
152 scripts_libppp_plugin_la_LDFLAGS = $(script_cflags) @DBUS_CFLAGS@
153 scripts_libppp_plugin_la_LIBADD = @DBUS_LIBS@
154 else
155 if L2TP
156 script_LTLIBRARIES += scripts/libppp-plugin.la
157 scripts_libppp_plugin_la_LDFLAGS = $(script_cflags) @DBUS_CFLAGS@
158 scripts_libppp_plugin_la_LIBADD = @DBUS_LIBS@
159 endif
160 endif
161
162 if VPN
163 builtin_vpn_sources += $(builtin_vpn_source)
164 endif
165 endif
166
167 if PACRUNNER
168 builtin_modules += pacrunner
169 builtin_sources += plugins/pacrunner.c
170 endif
171
172 if POLKIT
173 builtin_modules += polkit
174 builtin_sources += plugins/polkit.c
175
176 if DATAFILES
177 policydir = @POLKIT_DATADIR@
178
179 policy_DATA = plugins/net.connman.policy
180
181 if VPN
182 policy_DATA += vpn/net.connman.vpn.policy
183 endif
184 endif
185 endif
186
187 if IWMX
188 plugin_LTLIBRARIES += plugins/iwmxsdk.la
189 plugin_objects += $(plugins_iwmxsdk_la_OBJECTS)
190 plugins_iwmxsdk_la_SOURCES = plugins/iwmx.h plugins/iwmx.c plugins/iwmxsdk.c
191 plugins_iwmxsdk_la_CFLAGS = $(plugin_cflags) @IWMXSDK_CFLAGS@
192 plugins_iwmxsdk_la_LIBADD = @IWMXSDK_LIBS@ @GLIB_LIBS@
193 plugins_iwmxsdk_la_LDFLAGS = $(plugin_ldflags)
194 endif
195
196 if IOSPM
197 plugin_LTLIBRARIES += plugins/iospm.la
198 plugin_objects += $(plugins_iospm_la_OBJECTS)
199 plugins_iospm_la_CFLAGS = $(plugin_cflags)
200 plugins_iospm_la_LDFLAGS = $(plugin_ldflags)
201 endif
202
203 if OPENCONNECT
204 script_PROGRAMS += scripts/openconnect-script
205
206 scripts_openconnect_script_LDADD = @DBUS_LIBS@
207 else
208 if VPNC
209 script_PROGRAMS += scripts/openconnect-script
210
211 scripts_openconnect_script_LDADD = @DBUS_LIBS@
212 endif
213 endif
214
215 if OPENVPN
216 script_PROGRAMS += scripts/openvpn-script
217
218 scripts_openvpn_script_LDADD = @DBUS_LIBS@
219 endif
220
221 if NMCOMPAT
222 builtin_modules += nmcompat
223 builtin_sources += plugins/nmcompat.c
224 endif
225
226 if TIST
227 if TIST_BUILTIN
228 builtin_modules += tist
229 builtin_sources += plugins/tist.c
230 else
231 plugin_LTLIBRARIES += plugins/tist.la
232 plugin_objects += $(plugins_tist_la_OBJECTS)
233 plugins_tist_la_CFLAGS = $(plugin_cflags)
234 plugins_tist_la_LDFLAGS = $(plugin_ldflags)
235 endif
236 endif
237
238 if SESSION_POLICY_LOCAL
239 if SESSION_POLICY_LOCAL_BUILTIN
240 builtin_modules += session_policy_local
241 builtin_sources += plugins/session_policy_local.c
242 else
243 plugin_LTLIBRARIES += plugins/session_policy_local.la
244 plugin_objects += $(plugins_session_policy_local_la_OBJECTS)
245 plugins_session_policy_local_la_CFLAGS = $(plugin_cflags) \
246                                 -DSTORAGEDIR=\""$(storagedir)\""
247 plugins_session_policy_local_la_LDFLAGS = $(plugin_ldflags)
248 endif
249 endif
250
251 EXTRA_DIST += plugins/polkit.policy
252
253 plugins/net.connman.policy: plugins/polkit.policy
254 if POLKIT
255         $(AM_V_GEN)cp $< $@
256 endif
257
258 EXTRA_DIST += vpn/vpn-polkit.policy
259
260 if VPN
261 vpn/net.connman.vpn.policy: vpn/vpn-polkit.policy
262 if POLKIT
263         $(AM_V_GEN)cp $< $@
264 endif
265 endif