blob: 129f719caaabb76c34f376e12a3da77f19105fbc [file] [log] [blame]
Greg Hartmanbd77cf72015-02-25 13:21:06 -08001LOCAL_PATH:= $(call my-dir)
2
Chih-Hung Hsieh596e9162017-10-30 10:57:15 -07003openssh_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
Greg Hartmanbd77cf72015-02-25 13:21:06 -080024###################### libssh ######################
25include $(CLEAR_VARS)
26
27LOCAL_MODULE_TAGS := optional
28
29LOCAL_SRC_FILES := \
Adam Langleyd0592972015-03-30 14:49:51 -070030 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 \
Greg Hartmanbd77cf72015-02-25 13:21:06 -080092 openbsd-compat/bsd-openpty.c \
Adam Langleyd0592972015-03-30 14:49:51 -070093 openbsd-compat/bsd-statvfs.c \
94 openbsd-compat/explicit_bzero.c \
Greg Hartmanbd77cf72015-02-25 13:21:06 -080095 openbsd-compat/fmt_scaled.c \
Adam Langleyd0592972015-03-30 14:49:51 -070096 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 \
Adam Langleyd0592972015-03-30 14:49:51 -0700110 packet.c \
Greg Hartman9768ca42017-06-22 20:49:52 -0700111 platform-pledge.c \
112 platform-tracing.c \
Adam Langleyd0592972015-03-30 14:49:51 -0700113 poly1305.c \
114 readpass.c \
115 rijndael.c \
Adam Langleyd0592972015-03-30 14:49:51 -0700116 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 \
Greg Hartman9768ca42017-06-22 20:49:52 -0700133 utf8.c \
Adam Langleyd0592972015-03-30 14:49:51 -0700134 uuencode.c \
135 verify.c \
136 xmalloc.c
Greg Hartmanbd77cf72015-02-25 13:21:06 -0800137
Adam Langleyd0592972015-03-30 14:49:51 -0700138LOCAL_C_INCLUDES := \
139 external/zlib \
140 external/openssl/include \
141 external/openssh/openbsd-compat
Greg Hartmanbd77cf72015-02-25 13:21:06 -0800142
143LOCAL_SHARED_LIBRARIES += libssl libcrypto libdl libz
144
Keun Soo Yimcfb649f2015-05-15 11:32:43 -0700145LOCAL_MODULE := libssh
Greg Hartmanbd77cf72015-02-25 13:21:06 -0800146
Chih-Hung Hsieh596e9162017-10-30 10:57:15 -0700147LOCAL_CFLAGS += -O3 $(openssh_common_cflags)
148LOCAL_CLANG_CFLAGS += $(openssh_common_clang_cflags)
Greg Hartmanbd77cf72015-02-25 13:21:06 -0800149
Dan Willemsen125dbf42015-12-17 13:52:31 -0800150LOCAL_CFLAGS += -DGCE_PLATFORM_SDK_VERSION=$(PLATFORM_SDK_VERSION)
Tomasz Wiszkowski8a3abef2017-10-23 14:45:58 -0700151ifneq ($(filter gce_x86 gce_x86_64 calypso, $(TARGET_DEVICE)),)
Keun Soo Yimeab54b02016-02-09 13:24:06 -0800152LOCAL_CFLAGS += -DANDROID_GCE -DSSHDIR=\"/var/run/ssh\"
153endif
Greg Hartmane7f7ce92016-06-10 14:05:35 -0700154
155ifneq (,$(SSHDIR))
156LOCAL_CFLAGS += -DSSHDIR=\"$(SSHDIR)\"
Keun Soo Yim55b26ed2016-02-09 13:24:06 -0800157endif
Dan Willemsen125dbf42015-12-17 13:52:31 -0800158
Greg Hartmanbd77cf72015-02-25 13:21:06 -0800159include $(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 \
Greg Hartman9768ca42017-06-22 20:49:52 -0700169 sshconnect.c sshconnect1.c sshconnect2.c mux.c
Greg Hartmanbd77cf72015-02-25 13:21:06 -0800170
Keun Soo Yimcfb649f2015-05-15 11:32:43 -0700171LOCAL_MODULE := ssh
Greg Hartmanbd77cf72015-02-25 13:21:06 -0800172
173
Chih-Hung Hsieh596e9162017-10-30 10:57:15 -0700174LOCAL_CFLAGS += $(openssh_common_cflags)
175LOCAL_CLANG_CFLAGS += $(openssh_common_clang_cflags)
Adam Langleyd0592972015-03-30 14:49:51 -0700176
177LOCAL_C_INCLUDES := \
178 external/zlib \
179 external/openssl/include \
180 external/openssh/openbsd-compat
Greg Hartmanbd77cf72015-02-25 13:21:06 -0800181
Keun Soo Yimcfb649f2015-05-15 11:32:43 -0700182LOCAL_SHARED_LIBRARIES += libssh libssl libcrypto libdl libz
Greg Hartmanbd77cf72015-02-25 13:21:06 -0800183
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
Keun Soo Yimcfb649f2015-05-15 11:32:43 -0700195LOCAL_MODULE := sftp
Greg Hartmanbd77cf72015-02-25 13:21:06 -0800196
Chih-Hung Hsieh596e9162017-10-30 10:57:15 -0700197LOCAL_CFLAGS += $(openssh_common_cflags)
198LOCAL_CLANG_CFLAGS += $(openssh_common_clang_cflags)
Adam Langleyd0592972015-03-30 14:49:51 -0700199
200LOCAL_C_INCLUDES := \
201 external/zlib \
202 external/openssl/include \
203 external/openssh/openbsd-compat
Greg Hartmanbd77cf72015-02-25 13:21:06 -0800204
Keun Soo Yimcfb649f2015-05-15 11:32:43 -0700205LOCAL_SHARED_LIBRARIES += libssh libssl libcrypto libdl libz
Greg Hartmanbd77cf72015-02-25 13:21:06 -0800206
207include $(BUILD_EXECUTABLE)
208
209###################### scp ######################
210
211include $(CLEAR_VARS)
212
213LOCAL_MODULE_TAGS := optional
214
215LOCAL_SRC_FILES := \
Adam Langleyd0592972015-03-30 14:49:51 -0700216 scp.c progressmeter.c
Greg Hartmanbd77cf72015-02-25 13:21:06 -0800217
Keun Soo Yimcfb649f2015-05-15 11:32:43 -0700218LOCAL_MODULE := scp
Greg Hartmanbd77cf72015-02-25 13:21:06 -0800219
Chih-Hung Hsieh596e9162017-10-30 10:57:15 -0700220LOCAL_CFLAGS += $(openssh_common_cflags)
221LOCAL_CLANG_CFLAGS += $(openssh_common_clang_cflags)
Adam Langleyd0592972015-03-30 14:49:51 -0700222
223LOCAL_C_INCLUDES := \
224 external/zlib \
225 external/openssl/include \
226 external/openssh/openbsd-compat
Greg Hartmanbd77cf72015-02-25 13:21:06 -0800227
Keun Soo Yimcfb649f2015-05-15 11:32:43 -0700228LOCAL_SHARED_LIBRARIES += libssh libssl libcrypto libdl libz
Greg Hartmanbd77cf72015-02-25 13:21:06 -0800229
230include $(BUILD_EXECUTABLE)
231
232###################### sshd ######################
233
234include $(CLEAR_VARS)
235
236LOCAL_MODULE_TAGS := optional
237
238LOCAL_SRC_FILES := \
Adam Langleyd0592972015-03-30 14:49:51 -0700239 audit-bsm.c \
240 audit-linux.c \
241 audit.c \
242 auth-bsdauth.c \
Adam Langleyd0592972015-03-30 14:49:51 -0700243 auth-krb5.c \
244 auth-options.c \
245 auth-pam.c \
Adam Langleyd0592972015-03-30 14:49:51 -0700246 auth-rhosts.c \
Adam Langleyd0592972015-03-30 14:49:51 -0700247 auth-shadow.c \
248 auth-sia.c \
249 auth-skey.c \
250 auth.c \
Adam Langleyd0592972015-03-30 14:49:51 -0700251 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 \
Adam Langleyd0592972015-03-30 14:49:51 -0700269 monitor_wrap.c \
270 platform.c \
Adam Langleyd0592972015-03-30 14:49:51 -0700271 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
Greg Hartmanbd77cf72015-02-25 13:21:06 -0800282
Keun Soo Yimcfb649f2015-05-15 11:32:43 -0700283LOCAL_MODULE := sshd
Greg Hartmanbd77cf72015-02-25 13:21:06 -0800284
Chih-Hung Hsieh596e9162017-10-30 10:57:15 -0700285LOCAL_CFLAGS += $(openssh_common_cflags)
286LOCAL_CLANG_CFLAGS += $(openssh_common_clang_cflags)
Tomasz Wiszkowski8a3abef2017-10-23 14:45:58 -0700287ifneq ($(filter gce_x86 gce_x86_64 calypso, $(TARGET_DEVICE)),)
Tomasz Wiszkowski721b0752017-10-18 11:51:30 -0700288LOCAL_CFLAGS += -DANDROID_GCE $(GCE_VERSION_CFLAGS)
289endif
Adam Langleyd0592972015-03-30 14:49:51 -0700290
291LOCAL_C_INCLUDES := \
292 external/zlib \
293 external/openssl/include \
294 external/openssh/openbsd-compat
Greg Hartmanbd77cf72015-02-25 13:21:06 -0800295
Keun Soo Yimcfb649f2015-05-15 11:32:43 -0700296LOCAL_SHARED_LIBRARIES += libssh libssl libcrypto libdl libz libcutils
Jiyong Park3173e4c2019-01-12 09:13:58 +0900297
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)),)
Jiyong Parkbdff1782019-01-12 09:13:58 +0900303LOCAL_SHARED_LIBRARIES += libc.bootstrap
Jiyong Park3173e4c2019-01-12 09:13:58 +0900304endif
305endif
Greg Hartmanbd77cf72015-02-25 13:21:06 -0800306
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
Keun Soo Yimcfb649f2015-05-15 11:32:43 -0700318LOCAL_MODULE := ssh-keygen
Greg Hartmanbd77cf72015-02-25 13:21:06 -0800319
Chih-Hung Hsieh596e9162017-10-30 10:57:15 -0700320LOCAL_CFLAGS += $(openssh_common_cflags)
321LOCAL_CLANG_CFLAGS += $(openssh_common_clang_cflags)
Adam Langleyd0592972015-03-30 14:49:51 -0700322
323LOCAL_C_INCLUDES := \
324 external/zlib \
325 external/openssl/include \
326 external/openssh/openbsd-compat
Greg Hartmanbd77cf72015-02-25 13:21:06 -0800327
Keun Soo Yimcfb649f2015-05-15 11:32:43 -0700328LOCAL_SHARED_LIBRARIES += libssh libssl libcrypto libdl libz
Greg Hartmanbd77cf72015-02-25 13:21:06 -0800329
330include $(BUILD_EXECUTABLE)
331
332###################### sshd_config ######################
333
334include $(CLEAR_VARS)
335LOCAL_MODULE_TAGS := optional
Keun Soo Yimcfb649f2015-05-15 11:32:43 -0700336LOCAL_MODULE := sshd_config
Greg Hartmanbd77cf72015-02-25 13:21:06 -0800337LOCAL_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
Keun Soo Yimcfb649f2015-05-15 11:32:43 -0700346LOCAL_MODULE := start-ssh
Greg Hartmanbd77cf72015-02-25 13:21:06 -0800347LOCAL_MODULE_CLASS := EXECUTABLES
348LOCAL_SRC_FILES := start-ssh
349include $(BUILD_PREBUILT)