1# $FreeBSD$ 2 3.include <src.opts.mk> 4 5PROG= sshd 6SRCS= sshd.c auth-rhosts.c auth-passwd.c auth-rsa.c auth-rh-rsa.c \ 7 audit.c audit-bsm.c audit-linux.c platform.c \ 8 sshpty.c sshlogin.c servconf.c serverloop.c \ 9 auth.c auth1.c auth2.c auth-options.c session.c \ 10 auth-chall.c auth2-chall.c groupaccess.c \ 11 auth-skey.c auth-bsdauth.c auth2-hostbased.c auth2-kbdint.c \ 12 auth2-none.c auth2-passwd.c auth2-pubkey.c \ 13 monitor_mm.c monitor.c monitor_wrap.c kexdhs.c kexgexs.c kexecdhs.c \ 14 kexc25519s.c auth-krb5.c \ 15 auth2-gss.c gss-serv.c gss-serv-krb5.c \ 16 loginrec.c auth-pam.c auth-shadow.c auth-sia.c md5crypt.c \ 17 sftp-server.c sftp-common.c \ 18 roaming_common.c roaming_serv.c \ 19 sandbox-null.c sandbox-rlimit.c sandbox-systrace.c sandbox-darwin.c \ 20 sandbox-seccomp-filter.c sandbox-capsicum.c 21 22# gss-genr.c really belongs in libssh; see src/secure/lib/libssh/Makefile 23SRCS+= gss-genr.c 24 25MAN= sshd.8 sshd_config.5 26CFLAGS+=-I${SSHDIR} -include ssh_namespace.h 27 28DPADD= ${LIBSSH} ${LIBUTIL} ${LIBWRAP} ${LIBPAM} 29LDADD= ${LDSSH} -lutil -lwrap ${MINUSLPAM} 30USEPRIVATELIB= ssh 31 32.if ${MK_LDNS} != "no" 33CFLAGS+= -DHAVE_LDNS=1 34#DPADD+= ${LIBLDNS} 35#LDADD+= -lldns 36#USEPRIVATELIB+= ldns 37.endif 38 39.if ${MK_AUDIT} != "no" 40CFLAGS+= -DUSE_BSM_AUDIT -DHAVE_GETAUDIT_ADDR 41DPADD+= ${LIBBSM} 42LDADD+= -lbsm 43.endif 44 45.if ${MK_KERBEROS_SUPPORT} != "no" 46CFLAGS+= -include krb5_config.h 47DPADD+= ${LIBGSSAPI_KRB5} ${LIBGSSAPI} ${LIBKRB5} ${LIBHX509} ${LIBASN1} \ 48 ${LIBCOM_ERR} ${LIBROKEN} ${LIBWIND} ${LIBHEIMBASE} ${LIBHEIMIPCC} 49LDADD+= -lgssapi_krb5 -lgssapi -lkrb5 -lhx509 -lasn1 \ 50 -lcom_err -lroken -lwind -lheimbase ${LDHEIMIPCC} 51.endif 52 53.if ${MK_OPENSSH_NONE_CIPHER} != "no" 54CFLAGS+= -DNONE_CIPHER_ENABLED 55.endif 56 57DPADD+= ${LIBCRYPT} ${LIBCRYPTO} ${LIBZ} 58LDADD+= -lcrypt -lcrypto -lz 59 60# Fix the order of NEEDED entries for libthr and libc. The libthr 61# needs to interpose libc symbols, leaving the libthr loading as 62# dependency of krb causes reversed order and broken interposing. Put 63# the threading library last on the linker command line, just before 64# the -lc added by a compiler driver. 65.if ${MK_KERBEROS_SUPPORT} != "no" 66DPADD+= ${LIBPTHREAD} 67LDADD+= -lpthread 68.endif 69 70.if defined(LOCALBASE) 71CFLAGS+= -DXAUTH_PATH=\"${LOCALBASE}/bin/xauth\" 72.endif 73 74.include <bsd.prog.mk> 75 76.PATH: ${SSHDIR} 77 78${OBJS} ${POBJS} ${SOBJS}: ssh_namespace.h 79.if ${MK_KERBEROS_SUPPORT} != "no" 80${OBJS} ${POBJS} ${SOBJS}: krb5_config.h 81.endif 82