Use -pthread instead of adding -lc_r for linking the thread library.
[dragonfly.git] / secure / usr.sbin / sshd / Makefile
1 # $FreeBSD: src/secure/usr.sbin/sshd/Makefile,v 1.5.2.9 2003/02/03 17:31:12 des Exp $
2 # $DragonFly: src/secure/usr.sbin/sshd/Makefile,v 1.7 2005/02/17 13:59:00 joerg Exp $
3 #
4
5 PROG=   sshd
6 SRCS=   sshd.c auth-rhosts.c auth-passwd.c auth-rsa.c auth-rh-rsa.c \
7         sshpty.c sshlogin.c servconf.c serverloop.c uidswap.c \
8         auth.c auth1.c auth2.c auth-options.c session.c \
9         auth-chall.c auth2-chall.c groupaccess.c auth-skey.c \
10         auth-bsdauth.c auth2-pam-freebsd.c auth2-hostbased.c \
11         auth2-kbdint.c auth2-none.c auth2-passwd.c auth2-pubkey.c \
12         monitor_mm.c monitor.c monitor_wrap.c monitor_fdpass.c \
13         kexdhs.c kexgexs.c misc.c dh.c kex.c channels.c \
14         bsd-closefrom.c
15
16 # Portability layer
17 SRCS+=  loginrec.c xmmap.c
18 MAN=    sshd.8 sshd_config.5
19
20 # Passwd routine
21 SRCS+=  auth-passwd-freebsd.c
22 CFLAGS+=-DCUSTOM_SYS_AUTH_PASSWD
23
24 SRCS+=  auth-skey.c.patch auth.h.patch auth2.c.patch \
25         loginrec.c.patch monitor.c.patch \
26         myproposal.h.patch servconf.c.patch session.c.patch sshd.c.patch 
27
28 SRCS+=  sshd.8.no_obj.patch sshd_config.5.no_obj.patch sshd_config.no_obj.patch
29
30 .if defined(MAKE_KERBEROS5)
31 DISTRIBUTION=krb5
32 CFLAGS+= -DKRB5 -DHEIMDAL
33 SRCS+=  auth-krb5.c
34 LDADD+=  -lkrb5 -lasn1 -lcom_err -lmd -L${.OBJDIR}/../../../kerberos5/lib/libroken -lroken
35 DPADD+=  ${LIBKRB5} ${LIBCOM_ERR} ${LIBASN1} ${LIBMD}
36 .endif
37
38 LDADD+= -lopie -lmd
39 DPADD+= ${LIBOPIE} ${LIBMD}
40
41 .if defined(X11BASE)
42 CFLAGS+= -DXAUTH_PATH=\"${X11BASE}/bin/xauth\"
43 .endif
44
45 LDADD+= -lcrypt -lutil -lz -lwrap ${MINUSLPAM}
46 DPADD+= ${LIBCRYPT} ${LIBUTIL} ${LIBZ} ${LIBWRAP} ${LIBPAM}
47
48 # There's a privilege separation bug when PAM authentication is
49 # used and posix threads are disabled.  Both descriptors of the socketpair
50 # used for the communication between the [net] and the [pam] process are
51 # left open, and when a timeout kills one procses the other does not see
52 # it because it still has both end points open.  This eventually causes
53 # sshd to start rejecting connections.  So, enable posix threading
54 # here even though I don't want to use it.
55 #
56 OPENSSH_USE_POSIX_THREADS=1
57
58 .if defined(OPENSSH_USE_POSIX_THREADS) && !defined(NOLIBC_R)
59 CFLAGS+=-DUSE_POSIX_THREADS
60 LDADD+= -pthread
61 DPADD+= ${LIBC_R}
62 .endif
63
64 etc-ssh: sshd_config
65         ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 ${.ALLSRC} ${DESTDIR}/etc/ssh
66
67 .include "../../Makefile.ssh.common"
68 .include <bsd.prog.mk>
69
70 .PATH: ${SSHDIR}/openbsd-compat
71