• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1LOCAL_PATH:= $(call my-dir)
2
3openssh_common_cflags := \
4    -Wall \
5    -Werror \
6    -Wno-error=implicit-function-declaration \
7    -Wno-pointer-sign \
8    -Wno-sign-compare \
9    -Wno-type-limits \
10    -Wno-unused-parameter \
11    -Wno-unused-variable \
12    -Wno-error \
13
14# Use -Wno-error to allow at least the following warnings:
15# (1) bsd-openpty.c calls to 'ptsname' declared with attribute warning:
16#     ptsname is not thread-safe; use ptsname_r instead [-Werror]
17# (2) external/boringssl/src/include/openssl/opensslfeatures.h:
18#     error: "OPENSSL_NO_BF" redefined [-Werror]
19
20openssh_common_clang_cflags := \
21    -Wno-incompatible-pointer-types \
22    -Wno-macro-redefined \
23
24###################### libssh ######################
25include $(CLEAR_VARS)
26
27LOCAL_MODULE_TAGS := optional
28
29LOCAL_SRC_FILES := \
30    addrmatch.c \
31    atomicio.c \
32    authfd.c \
33    authfile.c \
34    bitmap.c \
35    blocks.c \
36    bufaux.c \
37    bufbn.c \
38    bufec.c \
39    buffer.c \
40    canohost.c \
41    chacha.c \
42    channels.c \
43    cipher-aes.c \
44    cipher-aesctr.c \
45    cipher-chachapoly.c \
46    cipher-ctr.c \
47    cipher.c \
48    cleanup.c \
49    compat.c \
50    crc32.c \
51    deattack.c \
52    dh.c \
53    digest-openssl.c \
54    dispatch.c \
55    dns.c \
56    ed25519.c \
57    entropy.c \
58    fatal.c \
59    fe25519.c \
60    ge25519.c \
61    gss-genr.c \
62    hash.c \
63    hmac.c \
64    hostfile.c \
65    kex.c \
66    kexc25519.c \
67    kexc25519c.c \
68    kexdh.c \
69    kexdhc.c \
70    kexecdh.c \
71    kexecdhc.c \
72    kexgex.c \
73    kexgexc.c \
74    key.c \
75    krl.c \
76    log.c \
77    mac.c \
78    match.c \
79    md-sha256.c \
80    misc.c \
81    moduli.c \
82    monitor_fdpass.c \
83    msg.c \
84    nchan.c \
85    opacket.c \
86    openbsd-compat/bcrypt_pbkdf.c \
87    openbsd-compat/bindresvport.c \
88    openbsd-compat/blowfish.c \
89    openbsd-compat/bsd-closefrom.c \
90    openbsd-compat/bsd-getpeereid.c \
91    openbsd-compat/bsd-misc.c \
92    openbsd-compat/bsd-openpty.c \
93    openbsd-compat/bsd-statvfs.c \
94    openbsd-compat/explicit_bzero.c \
95    openbsd-compat/fmt_scaled.c \
96    openbsd-compat/getopt_long.c \
97    openbsd-compat/glob.c \
98    openbsd-compat/openssl-compat.c \
99    openbsd-compat/port-linux.c \
100    openbsd-compat/port-tun.c \
101    openbsd-compat/pwcache.c \
102    openbsd-compat/readpassphrase.c \
103    openbsd-compat/reallocarray.c \
104    openbsd-compat/rresvport.c \
105    openbsd-compat/setproctitle.c \
106    openbsd-compat/strmode.c \
107    openbsd-compat/strtonum.c \
108    openbsd-compat/timingsafe_bcmp.c \
109    openbsd-compat/vis.c \
110    packet.c \
111    platform-pledge.c \
112    platform-tracing.c \
113    poly1305.c \
114    readpass.c \
115    rijndael.c \
116    rsa.c \
117    sc25519.c \
118    smult_curve25519_ref.c \
119    ssh-dss.c \
120    ssh-ecdsa.c \
121    ssh-ed25519.c \
122    ssh-rsa.c \
123    sshbuf-getput-basic.c \
124    sshbuf-getput-crypto.c \
125    sshbuf-misc.c \
126    sshbuf.c \
127    ssherr.c \
128    sshkey.c \
129    ttymodes.c \
130    uidswap.c \
131    umac.c \
132    umac128.c \
133    utf8.c \
134    uuencode.c \
135    verify.c \
136    xmalloc.c
137
138LOCAL_C_INCLUDES := \
139    external/zlib \
140    external/openssl/include \
141    external/openssh/openbsd-compat
142
143LOCAL_SHARED_LIBRARIES += libssl libcrypto libdl libz
144
145LOCAL_MODULE := libssh
146
147LOCAL_CFLAGS += -O3 $(openssh_common_cflags)
148LOCAL_CLANG_CFLAGS += $(openssh_common_clang_cflags)
149
150LOCAL_CFLAGS += -DGCE_PLATFORM_SDK_VERSION=$(PLATFORM_SDK_VERSION)
151ifneq ($(filter gce_x86 gce_x86_64 calypso, $(TARGET_DEVICE)),)
152LOCAL_CFLAGS += -DANDROID_GCE -DSSHDIR=\"/var/run/ssh\"
153endif
154
155ifneq (,$(SSHDIR))
156LOCAL_CFLAGS += -DSSHDIR=\"$(SSHDIR)\"
157endif
158
159include $(BUILD_SHARED_LIBRARY)
160
161###################### ssh ######################
162
163include $(CLEAR_VARS)
164
165LOCAL_MODULE_TAGS := optional
166
167LOCAL_SRC_FILES := \
168    ssh.c readconf.c clientloop.c sshtty.c \
169    sshconnect.c sshconnect1.c sshconnect2.c mux.c
170
171LOCAL_MODULE := ssh
172
173
174LOCAL_CFLAGS += $(openssh_common_cflags)
175LOCAL_CLANG_CFLAGS += $(openssh_common_clang_cflags)
176
177LOCAL_C_INCLUDES := \
178    external/zlib \
179    external/openssl/include \
180    external/openssh/openbsd-compat
181
182LOCAL_SHARED_LIBRARIES += libssh libssl libcrypto libdl libz
183
184include $(BUILD_EXECUTABLE)
185
186###################### sftp ######################
187
188include $(CLEAR_VARS)
189
190LOCAL_MODULE_TAGS := optional
191
192LOCAL_SRC_FILES := \
193    sftp.c sftp-client.c sftp-common.c sftp-glob.c progressmeter.c
194
195LOCAL_MODULE := sftp
196
197LOCAL_CFLAGS += $(openssh_common_cflags)
198LOCAL_CLANG_CFLAGS += $(openssh_common_clang_cflags)
199
200LOCAL_C_INCLUDES := \
201    external/zlib \
202    external/openssl/include \
203    external/openssh/openbsd-compat
204
205LOCAL_SHARED_LIBRARIES += libssh libssl libcrypto libdl libz
206
207include $(BUILD_EXECUTABLE)
208
209###################### scp ######################
210
211include $(CLEAR_VARS)
212
213LOCAL_MODULE_TAGS := optional
214
215LOCAL_SRC_FILES := \
216    scp.c progressmeter.c
217
218LOCAL_MODULE := scp
219
220LOCAL_CFLAGS += $(openssh_common_cflags)
221LOCAL_CLANG_CFLAGS += $(openssh_common_clang_cflags)
222
223LOCAL_C_INCLUDES := \
224    external/zlib \
225    external/openssl/include \
226    external/openssh/openbsd-compat
227
228LOCAL_SHARED_LIBRARIES += libssh libssl libcrypto libdl libz
229
230include $(BUILD_EXECUTABLE)
231
232###################### sshd ######################
233
234include $(CLEAR_VARS)
235
236LOCAL_MODULE_TAGS := optional
237
238LOCAL_SRC_FILES := \
239    audit-bsm.c \
240    audit-linux.c \
241    audit.c \
242    auth-bsdauth.c \
243    auth-krb5.c \
244    auth-options.c \
245    auth-pam.c \
246    auth-rhosts.c \
247    auth-shadow.c \
248    auth-sia.c \
249    auth-skey.c \
250    auth.c \
251    auth2-chall.c \
252    auth2-gss.c \
253    auth2-hostbased.c \
254    auth2-kbdint.c \
255    auth2-none.c \
256    auth2-passwd.c \
257    auth2-pubkey.c \
258    auth2.c \
259    groupaccess.c \
260    gss-serv-krb5.c \
261    gss-serv.c \
262    kexc25519s.c \
263    kexdhs.c \
264    kexecdhs.c \
265    kexgexs.c \
266    loginrec.c \
267    md5crypt.c \
268    monitor.c \
269    monitor_wrap.c \
270    platform.c \
271    sandbox-null.c \
272    sandbox-rlimit.c \
273    sandbox-systrace.c \
274    servconf.c \
275    serverloop.c \
276    session.c \
277    sftp-common.c \
278    sftp-server.c \
279    sshd.c \
280    sshlogin.c \
281    sshpty.c
282
283LOCAL_MODULE := sshd
284
285LOCAL_CFLAGS += $(openssh_common_cflags)
286LOCAL_CLANG_CFLAGS += $(openssh_common_clang_cflags)
287ifneq ($(filter gce_x86 gce_x86_64 calypso, $(TARGET_DEVICE)),)
288LOCAL_CFLAGS += -DANDROID_GCE $(GCE_VERSION_CFLAGS)
289endif
290
291LOCAL_C_INCLUDES := \
292    external/zlib \
293    external/openssl/include \
294    external/openssh/openbsd-compat
295
296LOCAL_SHARED_LIBRARIES += libssh libssl libcrypto libdl libz libcutils
297
298# libc.bootstrap is available/required since Q
299ifneq ($(PLATFORM_VERSION_CODENAME)|$(call math_lt,$(PLATFORM_SDK_VERSION),29),REL|true)
300# This filter is for old branches that does not have math_lt macro
301# This is equivalently PLATFORM_SDK_VERSION > 27
302ifeq ($(filter 14 15 16 17 18 19 20 21 22 23 24 25 26 27,$(PLATFORM_SDK_VERSION)),)
303LOCAL_SHARED_LIBRARIES += libc.bootstrap
304endif
305endif
306
307include $(BUILD_EXECUTABLE)
308
309###################### ssh-keygen ######################
310
311include $(CLEAR_VARS)
312
313LOCAL_MODULE_TAGS := optional
314
315LOCAL_SRC_FILES := \
316    ssh-keygen.c
317
318LOCAL_MODULE := ssh-keygen
319
320LOCAL_CFLAGS += $(openssh_common_cflags)
321LOCAL_CLANG_CFLAGS += $(openssh_common_clang_cflags)
322
323LOCAL_C_INCLUDES := \
324    external/zlib \
325    external/openssl/include \
326    external/openssh/openbsd-compat
327
328LOCAL_SHARED_LIBRARIES += libssh libssl libcrypto libdl libz
329
330include $(BUILD_EXECUTABLE)
331
332###################### sshd_config ######################
333
334include $(CLEAR_VARS)
335LOCAL_MODULE_TAGS := optional
336LOCAL_MODULE := sshd_config
337LOCAL_MODULE_CLASS := ETC
338LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/ssh
339LOCAL_SRC_FILES := sshd_config.android
340include $(BUILD_PREBUILT)
341
342###################### start-ssh ######################
343
344include $(CLEAR_VARS)
345LOCAL_MODULE_TAGS := optional
346LOCAL_MODULE := start-ssh
347LOCAL_MODULE_CLASS := EXECUTABLES
348LOCAL_SRC_FILES := start-ssh
349include $(BUILD_PREBUILT)
350