git: 74776eba28d8 - stable/14 - ssh: Consolidate HAVE_LDNS / LIBWRAP in ssh.mk
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Tue, 11 Mar 2025 14:39:59 UTC
The branch stable/14 has been updated by emaste:
URL: https://cgit.FreeBSD.org/src/commit/?id=74776eba28d86b9384faa7fce5a699a73afced99
commit 74776eba28d86b9384faa7fce5a699a73afced99
Author: Ed Maste <emaste@FreeBSD.org>
AuthorDate: 2022-04-12 13:18:20 +0000
Commit: Ed Maste <emaste@FreeBSD.org>
CommitDate: 2025-03-11 14:39:36 +0000
ssh: Consolidate HAVE_LDNS / LIBWRAP in ssh.mk
Commit 9d63429fa163 ("ssh: move common Makefile boilerplate to a new
ssh.mk") introduced ssh.mk for common OpenSSH paths and flags, as part
of enabling FIDO/U2F. Move duplicated MK_LDNS and MK_TCP_WRAPPERS
handling there.
Reviewed by: kevans
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D31896
(cherry picked from commit d71e7e57fc1472e3ea6d31c44e187c2819d2c71e)
---
secure/lib/libssh/Makefile | 2 +-
secure/libexec/sftp-server/Makefile | 6 ------
secure/libexec/ssh-keysign/Makefile | 10 +---------
secure/libexec/ssh-pkcs11-helper/Makefile | 10 +---------
secure/libexec/sshd-session/Makefile | 6 ------
secure/ssh.mk | 8 ++++++++
secure/usr.bin/scp/Makefile | 6 ------
secure/usr.bin/sftp/Makefile | 6 ------
secure/usr.bin/ssh-add/Makefile | 6 ------
secure/usr.bin/ssh-agent/Makefile | 10 +---------
secure/usr.bin/ssh-keygen/Makefile | 8 +-------
secure/usr.bin/ssh-keyscan/Makefile | 6 ------
secure/usr.bin/ssh/Makefile | 4 ----
secure/usr.sbin/sshd/Makefile | 1 -
14 files changed, 13 insertions(+), 76 deletions(-)
diff --git a/secure/lib/libssh/Makefile b/secure/lib/libssh/Makefile
index 0a5b25e6780d..1917e0a58e31 100644
--- a/secure/lib/libssh/Makefile
+++ b/secure/lib/libssh/Makefile
@@ -46,7 +46,7 @@ SRCS+= bcrypt_pbkdf.c blowfish.c bsd-misc.c bsd-signal.c explicit_bzero.c \
SRCS+= getrrsetbyname.c
.else
LDNSDIR= ${SRCTOP}/contrib/ldns
-CFLAGS+= -DHAVE_LDNS=1 -I${LDNSDIR}
+CFLAGS+= -I${LDNSDIR}
SRCS+= getrrsetbyname-ldns.c
LIBADD+= ldns
.endif
diff --git a/secure/libexec/sftp-server/Makefile b/secure/libexec/sftp-server/Makefile
index 852055bfe625..4aac86ac01bf 100644
--- a/secure/libexec/sftp-server/Makefile
+++ b/secure/libexec/sftp-server/Makefile
@@ -8,12 +8,6 @@ MAN= sftp-server.8
LIBADD= ssh
-.if ${MK_LDNS} != "no"
-CFLAGS+= -DHAVE_LDNS=1
-#DPADD+= ${LIBLDNS}
-#LDADD+= -lldns
-.endif
-
.include <bsd.prog.mk>
.PATH: ${SSHDIR}
diff --git a/secure/libexec/ssh-keysign/Makefile b/secure/libexec/ssh-keysign/Makefile
index e5aa05f40f1d..129b34199fad 100644
--- a/secure/libexec/ssh-keysign/Makefile
+++ b/secure/libexec/ssh-keysign/Makefile
@@ -7,15 +7,7 @@ SRCS= ssh-keysign.c readconf.c uidswap.c
MAN= ssh-keysign.8
BINMODE=4555
-LIBADD= ssh
-
-.if ${MK_LDNS} != "no"
-CFLAGS+= -DHAVE_LDNS=1
-#DPADD+= ${LIBLDNS}
-#LDADD+= -lldns
-.endif
-
-LIBADD+= crypto
+LIBADD= crypto ssh
.include <bsd.prog.mk>
diff --git a/secure/libexec/ssh-pkcs11-helper/Makefile b/secure/libexec/ssh-pkcs11-helper/Makefile
index 2e04a0ed1fc2..506697531965 100644
--- a/secure/libexec/ssh-pkcs11-helper/Makefile
+++ b/secure/libexec/ssh-pkcs11-helper/Makefile
@@ -6,15 +6,7 @@ PROG= ssh-pkcs11-helper
SRCS= ssh-pkcs11.c ssh-pkcs11-helper.c
MAN= ssh-pkcs11-helper.8
-LIBADD= ssh
-
-.if ${MK_LDNS} != "no"
-CFLAGS+= -DHAVE_LDNS=1
-#DPADD+= ${LIBLDNS}
-#LDADD+= -lldns
-.endif
-
-LIBADD+= crypto
+LIBADD= crypto ssh
.include <bsd.prog.mk>
diff --git a/secure/libexec/sshd-session/Makefile b/secure/libexec/sshd-session/Makefile
index bce96112f65a..81e481559189 100644
--- a/secure/libexec/sshd-session/Makefile
+++ b/secure/libexec/sshd-session/Makefile
@@ -26,12 +26,6 @@ MAN=
# pam should always happen before ssh here for static linking
LIBADD= pam ssh util
-.if ${MK_LDNS} != "no"
-CFLAGS+= -DHAVE_LDNS=1
-#DPADD+= ${LIBLDNS}
-#LDADD+= -lldns
-.endif
-
.if ${MK_AUDIT} != "no"
CFLAGS+= -DUSE_BSM_AUDIT=1 -DHAVE_GETAUDIT_ADDR=1
LIBADD+= bsm
diff --git a/secure/ssh.mk b/secure/ssh.mk
index bd88e43aa0a3..8411fb11fb16 100644
--- a/secure/ssh.mk
+++ b/secure/ssh.mk
@@ -12,6 +12,14 @@ CFLAGS+= -include krb5_config.h
CFLAGS+= -DXAUTH_PATH=\"${LOCALBASE:U/usr/local}/bin/xauth\"
+.if ${MK_LDNS} != "no"
+CFLAGS+= -DHAVE_LDNS=1
+.endif
+
+.if ${MK_TCP_WRAPPERS} != "no"
+CFLAGS+= -DLIBWRAP=1
+.endif
+
.if ${MK_USB} != "no"
# Built-in security key support
CFLAGS+= -include sk_config.h
diff --git a/secure/usr.bin/scp/Makefile b/secure/usr.bin/scp/Makefile
index bb2623062333..a8d5eac77397 100644
--- a/secure/usr.bin/scp/Makefile
+++ b/secure/usr.bin/scp/Makefile
@@ -8,12 +8,6 @@ PACKAGE= ssh
LIBADD= ssh
-.if ${MK_LDNS} != "no"
-CFLAGS+= -DHAVE_LDNS=1
-#DPADD+= ${LIBLDNS}
-#LDADD+= -lldns
-.endif
-
.include <bsd.prog.mk>
.PATH: ${SSHDIR}
diff --git a/secure/usr.bin/sftp/Makefile b/secure/usr.bin/sftp/Makefile
index 72229d100c45..2f51bf524c6b 100644
--- a/secure/usr.bin/sftp/Makefile
+++ b/secure/usr.bin/sftp/Makefile
@@ -9,12 +9,6 @@ PACKAGE= ssh
LIBADD= ssh edit
-.if ${MK_LDNS} != "no"
-CFLAGS+= -DHAVE_LDNS=1
-#DPADD+= ${LIBLDNS}
-#LDADD+= -lldns
-.endif
-
.include <bsd.prog.mk>
.PATH: ${SSHDIR}
diff --git a/secure/usr.bin/ssh-add/Makefile b/secure/usr.bin/ssh-add/Makefile
index 43ee63c567e7..ddde52130027 100644
--- a/secure/usr.bin/ssh-add/Makefile
+++ b/secure/usr.bin/ssh-add/Makefile
@@ -8,12 +8,6 @@ PACKAGE= ssh
LIBADD= ssh
-.if ${MK_LDNS} != "no"
-CFLAGS+= -DHAVE_LDNS=1
-#DPADD+= ${LIBLDNS}
-#LDADD+= -lldns
-.endif
-
.include <bsd.prog.mk>
.PATH: ${SSHDIR}
diff --git a/secure/usr.bin/ssh-agent/Makefile b/secure/usr.bin/ssh-agent/Makefile
index 83813452e69a..a96af6255b7e 100644
--- a/secure/usr.bin/ssh-agent/Makefile
+++ b/secure/usr.bin/ssh-agent/Makefile
@@ -6,20 +6,12 @@ PROG= ssh-agent
SRCS= ssh-agent.c ssh-pkcs11-client.c
PACKAGE= ssh
-LIBADD= ssh
-
-.if ${MK_LDNS} != "no"
-CFLAGS+= -DHAVE_LDNS=1
-#DPADD+= ${LIBLDNS}
-#LDADD+= -lldns
-.endif
+LIBADD= crypto ssh
.if defined(LOCALBASE)
CFLAGS+= -DDEFAULT_PKCS11_WHITELIST='"/usr/lib*/*,${LOCALBASE}/lib*/*"'
.endif
-LIBADD+= crypto
-
.include <bsd.prog.mk>
.PATH: ${SSHDIR}
diff --git a/secure/usr.bin/ssh-keygen/Makefile b/secure/usr.bin/ssh-keygen/Makefile
index 6595ad3db132..e15b7aafbb45 100644
--- a/secure/usr.bin/ssh-keygen/Makefile
+++ b/secure/usr.bin/ssh-keygen/Makefile
@@ -7,13 +7,7 @@ PROG= ssh-keygen
SRCS= ssh-keygen.c sshsig.c ssh-sk-client.c
PACKAGE= ssh
-LIBADD= ssh
-
-.if ${MK_LDNS} != "no"
-CFLAGS+= -DHAVE_LDNS=1
-.endif
-
-LIBADD+= crypto
+LIBADD= crypto ssh
.include <bsd.prog.mk>
diff --git a/secure/usr.bin/ssh-keyscan/Makefile b/secure/usr.bin/ssh-keyscan/Makefile
index b71c07a91b90..72057781a286 100644
--- a/secure/usr.bin/ssh-keyscan/Makefile
+++ b/secure/usr.bin/ssh-keyscan/Makefile
@@ -8,12 +8,6 @@ PACKAGE= ssh
LIBADD= ssh
-.if ${MK_LDNS} != "no"
-CFLAGS+= -DHAVE_LDNS=1
-#DPADD+= ${LIBLDNS}
-#LDADD+= -lldns
-.endif
-
.include <bsd.prog.mk>
.PATH: ${SSHDIR}
diff --git a/secure/usr.bin/ssh/Makefile b/secure/usr.bin/ssh/Makefile
index e16433ec5d1d..ad4b692c961c 100644
--- a/secure/usr.bin/ssh/Makefile
+++ b/secure/usr.bin/ssh/Makefile
@@ -18,10 +18,6 @@ SRCS+= gss-genr.c
LIBADD= ssh
-.if ${MK_LDNS} != "no"
-CFLAGS+= -DHAVE_LDNS=1
-.endif
-
.if ${MK_GSSAPI} != "no" && ${MK_KERBEROS_SUPPORT} != "no"
LIBADD+= gssapi
.endif
diff --git a/secure/usr.sbin/sshd/Makefile b/secure/usr.sbin/sshd/Makefile
index 5d6dca203a0b..f0a6105e83b6 100644
--- a/secure/usr.sbin/sshd/Makefile
+++ b/secure/usr.sbin/sshd/Makefile
@@ -22,7 +22,6 @@ LIBADD+= gssapi_krb5 gssapi krb5
.endif
.if ${MK_TCP_WRAPPERS} != "no"
-CFLAGS+= -DLIBWRAP=1
LIBADD+= wrap
.endif