build: Allow NM and PolicyKit plugins only as builtins
[framework/connectivity/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 OPENCONNECT
50 if OPENCONNECT_BUILTIN
51 builtin_modules += openconnect
52 builtin_sources += plugins/openconnect.c
53 builtin_vpn_sources = plugins/vpn.c plugins/vpn.h
54 builtin_cflags += -DOPENCONNECT=\"@OPENCONNECT@\"
55 else
56 plugin_LTLIBRARIES += plugins/openconnect.la
57 plugin_objects += $(plugins_openconnect_la_OBJECTS)
58 plugins_openconnect_la_SOURCES = plugins/vpn.h plugins/vpn.c \
59                                                 plugins/openconnect.c
60 plugins_openconnect_la_CFLAGS = $(plugin_cflags) -DOPENCONNECT=\"@OPENCONNECT@\" \
61                                         -DSTATEDIR=\""$(statedir)"\" \
62                                         -DSCRIPTDIR=\""$(build_scriptdir)"\"
63 plugins_openconnect_la_LDFLAGS = $(plugin_ldflags)
64 endif
65 endif
66
67 if OPENVPN
68 if OPENVPN_BUILTIN
69 builtin_modules += openvpn
70 builtin_sources += plugins/openvpn.c
71 builtin_vpn_sources = plugins/vpn.c plugins/vpn.h
72 builtin_cflags += -DOPENVPN=\"@OPENVPN@\"
73 else
74 plugin_LTLIBRARIES += plugins/openvpn.la
75 plugin_objects += $(plugins_openvpn_la_OBJECTS)
76 plugins_openvpn_la_SOURCES = plugins/vpn.h plugins/vpn.c \
77                                                 plugins/openvpn.c
78 plugins_openvpn_la_CFLAGS = $(plugin_cflags) -DOPENVPN=\"@OPENVPN@\" \
79                                         -DSTATEDIR=\""$(statedir)"\" \
80                                         -DSCRIPTDIR=\""$(build_scriptdir)"\"
81 plugins_openvpn_la_LDFLAGS = $(plugin_ldflags)
82 endif
83 endif
84
85 if VPNC
86 if VPNC_BUILTIN
87 builtin_modules += vpnc
88 builtin_sources += plugins/vpnc.c
89 builtin_vpn_sources = plugins/vpn.c plugins/vpn.h
90 builtin_cflags += -DVPNC=\"@VPNC@\"
91 else
92 plugin_LTLIBRARIES += plugins/vpnc.la
93 plugin_objects += $(plugins_vpnc_la_OBJECTS)
94 plugins_vpnc_la_SOURCES = plugins/vpn.h plugins/vpn.c \
95                                                 plugins/vpnc.c
96 plugins_vpnc_la_CFLAGS = $(plugin_cflags) -DVPNC=\"@VPNC@\" \
97                                         -DSTATEDIR=\""$(statedir)"\" \
98                                         -DSCRIPTDIR=\""$(build_scriptdir)"\"
99 plugins_vpnc_la_LDFLAGS = $(plugin_ldflags)
100 endif
101 endif
102
103 if L2TP
104 if L2TP_BUILTIN
105 builtin_modules += l2tp
106 builtin_sources += plugins/l2tp.c
107 builtin_vpn_sources = plugins/vpn.c plugins/vpn.h
108 builtin_cflags += -DL2TP=\"@L2TP@\"
109 else
110 plugin_LTLIBRARIES += plugins/l2tp.la
111 plugin_objects += $(plugins_l2tp_la_OBJECTS)
112 plugins_l2tp_la_SOURCES = plugins/vpn.h plugins/vpn.c \
113                                                 plugins/l2tp.c
114 plugins_l2tp_la_CFLAGS = $(plugin_cflags) -DL2TP=\"@L2TP@\" \
115                                         -DSTATEDIR=\""$(statedir)"\" \
116                                         -DSCRIPTDIR=\""$(build_scriptdir)"\"
117 plugins_l2tp_la_LDFLAGS = $(plugin_ldflags)
118 endif
119 endif
120
121 if PPTP
122 if PPTP_BUILTIN
123 builtin_modules += pptp
124 builtin_sources += plugins/pptp.c
125 builtin_vpn_sources = plugins/vpn.c plugins/vpn.h
126 builtin_cflags += -DPPPD=\"@PPPD@\" -DPPTP=\"@PPTP@\"
127 else
128 plugin_LTLIBRARIES += plugins/pptp.la
129 plugin_objects += $(plugins_pptp_la_OBJECTS)
130 plugins_pptp_la_SOURCES = plugins/vpn.h plugins/vpn.c \
131                                                 plugins/pptp.c
132 plugins_pptp_la_CFLAGS = $(plugin_cflags) -DPPPD=\"@PPPD@\" \
133                                         -DPPTP=\"@PPTP@\" \
134                                         -DSTATEDIR=\""$(statedir)"\" \
135                                         -DSCRIPTDIR=\""$(build_scriptdir)"\"
136 plugins_pptp_la_LDFLAGS = $(plugin_ldflags)
137 endif
138 endif
139
140 if PPTP
141 script_LTLIBRARIES += scripts/libppp-plugin.la
142 scripts_libppp_plugin_la_LDFLAGS = $(script_cflags) @DBUS_CFLAGS@
143 scripts_libppp_plugin_la_LIBADD = @DBUS_LIBS@
144 else
145 if L2TP
146 script_LTLIBRARIES += scripts/libppp-plugin.la
147 scripts_libppp_plugin_la_LDFLAGS = $(script_cflags) @DBUS_CFLAGS@
148 scripts_libppp_plugin_la_LIBADD = @DBUS_LIBS@
149 endif
150 endif
151
152 builtin_sources += $(builtin_vpn_sources)
153
154 if PACRUNNER
155 builtin_modules += pacrunner
156 builtin_sources += plugins/pacrunner.c
157 endif
158
159 if POLKIT
160 builtin_modules += polkit
161 builtin_sources += plugins/polkit.c
162
163 if DATAFILES
164 policydir = @POLKIT_DATADIR@
165
166 policy_DATA = plugins/net.connman.policy
167 endif
168 endif
169
170 if IWMX
171 plugin_LTLIBRARIES += plugins/iwmxsdk.la
172 plugin_objects += $(plugins_iwmxsdk_la_OBJECTS)
173 plugins_iwmxsdk_la_SOURCES = plugins/iwmx.h plugins/iwmx.c plugins/iwmxsdk.c
174 plugins_iwmxsdk_la_CFLAGS = $(plugin_cflags) @IWMXSDK_CFLAGS@
175 plugins_iwmxsdk_la_LIBADD = @IWMXSDK_LIBS@ @GLIB_LIBS@
176 plugins_iwmxsdk_la_LDFLAGS = $(plugin_ldflags)
177 endif
178
179 if IOSPM
180 plugin_LTLIBRARIES += plugins/iospm.la
181 plugin_objects += $(plugins_iospm_la_OBJECTS)
182 plugins_iospm_la_CFLAGS = $(plugin_cflags)
183 plugins_iospm_la_LDFLAGS = $(plugin_ldflags)
184 endif
185
186 if OPENCONNECT
187 script_PROGRAMS += scripts/openconnect-script
188
189 scripts_openconnect_script_LDADD = @DBUS_LIBS@
190 else
191 if VPNC
192 script_PROGRAMS += scripts/openconnect-script
193
194 scripts_openconnect_script_LDADD = @DBUS_LIBS@
195 endif
196 endif
197
198 if OPENVPN
199 script_PROGRAMS += scripts/openvpn-script
200
201 scripts_openvpn_script_LDADD = @DBUS_LIBS@
202 endif
203
204 if NMCOMPAT
205 builtin_modules += nmcompat
206 builtin_sources += plugins/nmcompat.c
207 endif
208
209 if TIST
210 if TIST_BUILTIN
211 builtin_modules += tist
212 builtin_sources += plugins/tist.c
213 else
214 plugin_LTLIBRARIES += plugins/tist.la
215 plugin_objects += $(plugins_tist_la_OBJECTS)
216 plugins_tist_la_CFLAGS = $(plugin_cflags)
217 plugins_tist_la_LDFLAGS = $(plugin_ldflags)
218 endif
219 endif
220
221 EXTRA_DIST += plugins/polkit.policy
222
223 plugins/net.connman.policy: plugins/polkit.policy
224 if POLKIT
225         $(AM_V_GEN)cp $< $@
226 endif