1 # $NetBSD: Makefile,v 1.50 2026/09/21 21:31:01 christos Exp $ 2 3 # libssh is not meant for applications to link against -- it's a 4 # private library of the ssh/sshd/&c. executables we ship. So don't 5 # expose the .so symlink or .a static library for applications to link 6 # against. 7 # 8 # (We do, however, build compat libssh intentionally for other ABIs -- 9 # not because other-ABI applications might be linked against it, but 10 # because other-ABI applications might _load_ other-ABI pam_ssh.so 11 # which is legitimately linked against the private libssh.) 12 # 13 # Note that while NOLINKLIB suppresses _installing_ the .so symlink, 14 # the .so symlink is still created in the objdir so bin/ssh can still 15 # use it to link. 16 NOLINKLIB= # defined 17 18 .include <bsd.own.mk> 19 20 .include "../Makefile.inc" 21 22 CWARNFLAGS.clang+= -Wno-error=sizeof-array-div 23 CWARNFLAGS.clang+= -Wno-error=format-nonliteral 24 LIB= ssh 25 SRCS=\ 26 addr.c \ 27 addrmatch.c \ 28 atomicio.c \ 29 authfd.c \ 30 authfile.c \ 31 bcrypt_pbkdf.c \ 32 bitmap.c \ 33 blowfish.c \ 34 canohost.c \ 35 chacha.c \ 36 channels.c \ 37 cipher-chachapoly.c \ 38 cipher.c \ 39 cleanup.c \ 40 compat.c \ 41 dispatch.c \ 42 dns.c \ 43 ed25519.c \ 44 fatal.c \ 45 freezero.c \ 46 hmac.c \ 47 hostfile.c \ 48 kex.c \ 49 kexc25519.c \ 50 kex-names.c \ 51 kexgen.c \ 52 kexmlkem768ecdh.c \ 53 kexmlkem768x25519.c \ 54 kexsntrup761x25519.c \ 55 krl.c \ 56 libcrux-mlkem-mldsa.c \ 57 log.c \ 58 mac.c \ 59 match.c \ 60 misc.c \ 61 monitor_fdpass.c \ 62 msg.c \ 63 nchan.c \ 64 packet.c \ 65 poly1305.c \ 66 progressmeter.c \ 67 readpass.c \ 68 recallocarray.c \ 69 smult_curve25519_ref.c \ 70 sntrup761.c \ 71 ssh-ed25519.c \ 72 ssh-ed25519-sk.c \ 73 ssh-mldsa-eddsa.c \ 74 ssh-pkcs11.c \ 75 ssh-sk-client.c \ 76 sshbuf-getput-basic.c \ 77 sshbuf-misc.c \ 78 sshbuf-io.c \ 79 sshbuf.c \ 80 ssherr.c \ 81 ssherr-libcrypto.c \ 82 sshkey.c \ 83 ttymodes.c \ 84 uidswap.c \ 85 umac.c \ 86 umac128.c \ 87 utf8.c \ 88 xmalloc.c 89 90 OPENSSL_SRCS=\ 91 dh.c \ 92 digest-openssl.c \ 93 kexdh.c \ 94 kexecdh.c \ 95 kexgex.c \ 96 kexgexc.c \ 97 sshbuf-getput-crypto.c \ 98 ssh-ecdsa.c \ 99 ssh-ecdsa-sk.c \ 100 ssh-rsa.c 101 102 SRCS+= fmt_scaled.c 103 SRCS+= readpassphrase.c getpeereid.c getrrsetbyname.c 104 COPTS.monitor_fdpass.c+=-Wno-stack-protector 105 COPTS.sntrup761.c+= -Wno-stack-protector 106 107 .ifdef WITH_OPENSSL 108 SRCS+= ${OPENSSL_SRCS} 109 LIBDPLIBS+= crypto ${NETBSDSRCDIR}/crypto/external/${EXTERNAL_OPENSSL_SUBDIR}/lib/libcrypto 110 .else 111 SRCS+= cipher-aesctr.c digest-libc.c rijndael.c 112 .endif 113 114 CPPFLAGS+= -DHAVE_BLF_H 115 116 CPPFLAGS+= -I${SSHDIST} 117 .PATH: ${SSHDIST} 118 119 LIBDPLIBS+= crypt ${NETBSDSRCDIR}/lib/libcrypt \ 120 z ${NETBSDSRCDIR}/lib/libz 121 122 .for f in dns channels hostfile ssh-pkcs11 123 COPTS.${f}.c+= -Wno-pointer-sign 124 .endfor 125 126 # XXX 127 COPTS.channels.c+= -fno-strict-aliasing 128 129 COPTS.hostfile.c+= ${CC_WNO_FORMAT_TRUNCATION} 130 COPTS.sshkey.c+= ${CC_WNO_FORMAT_TRUNCATION} 131 COPTS.cipher.c+= -Wno-error=deprecated-declarations 132 COPTS.dh.c+= -Wno-error=deprecated-declarations 133 COPTS.digest-libc.c+= -Wno-error=cast-function-type 134 COPTS.kex.c+= -Wno-error=deprecated-declarations 135 COPTS.kexmlkem768ecdh.c+= -Wno-error=deprecated-declarations 136 COPTS.kexdh.c+= -Wno-error=deprecated-declarations 137 COPTS.kexecdh.c+= -Wno-error=deprecated-declarations 138 COPTS.kexgexc.c+= -Wno-error=deprecated-declarations 139 COPTS.ssh-ecdsa-sk.c+= -Wno-error=deprecated-declarations 140 COPTS.ssh-ecdsa.c+= -Wno-error=deprecated-declarations 141 COPTS.ssh-pkcs11.c+= -Wno-error=deprecated-declarations 142 COPTS.ssh-rsa.c+= -Wno-error=deprecated-declarations 143 COPTS.sshbuf-getput-crypto.c+= -Wno-error=deprecated-declarations 144 COPTS.sshkey.c+= -Wno-error=deprecated-declarations 145 COPTS.umac.c+= -Wno-error=deprecated-declarations 146 COPTS.umac128.c+= -Wno-error=deprecated-declarations 147 COPTS.ssherr-libcrypto.c+= -Wno-error=deprecated-declarations 148 COPTS.kexmlkem768x25519.c+=${${ACTIVE_CC} == "clang":? -Wno-error=missing-noreturn:} 149 150 151 152 .include <bsd.lib.mk> 153