git: d71e7e57fc14 - main - ssh: Consolidate HAVE_LDNS / LIBWRAP in ssh.mk
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Thu, 20 Feb 2025 23:33:57 UTC
The branch main has been updated by emaste:
URL: https://cgit.FreeBSD.org/src/commit/?id=d71e7e57fc1472e3ea6d31c44e187c2819d2c71e
commit d71e7e57fc1472e3ea6d31c44e187c2819d2c71e
Author: Ed Maste <emaste@FreeBSD.org>
AuthorDate: 2022-04-12 13:18:20 +0000
Commit: Ed Maste <emaste@FreeBSD.org>
CommitDate: 2025-02-20 23:33:46 +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
---
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 43fa46149dfa..d5292be88a4b 100644
--- a/secure/lib/libssh/Makefile
+++ b/secure/lib/libssh/Makefile
@@ -45,7 +45,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 40d86926d1bb..29f7a8df9fdd 100644
--- a/secure/libexec/sftp-server/Makefile
+++ b/secure/libexec/sftp-server/Makefile
@@ -7,12 +7,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 6027b164a35f..e66ed527affd 100644
--- a/secure/libexec/ssh-keysign/Makefile
+++ b/secure/libexec/ssh-keysign/Makefile
@@ -6,15 +6,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 4bc3a814ab8e..84374fdca43b 100644
--- a/secure/libexec/ssh-pkcs11-helper/Makefile
+++ b/secure/libexec/ssh-pkcs11-helper/Makefile
@@ -5,15 +5,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 dbc896286dd3..2ecea0ef52da 100644
--- a/secure/usr.bin/scp/Makefile
+++ b/secure/usr.bin/scp/Makefile
@@ -7,12 +7,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 841c89b71c67..f903f5e611d5 100644
--- a/secure/usr.bin/sftp/Makefile
+++ b/secure/usr.bin/sftp/Makefile
@@ -8,12 +8,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 ec709c721089..8df3789534af 100644
--- a/secure/usr.bin/ssh-add/Makefile
+++ b/secure/usr.bin/ssh-add/Makefile
@@ -7,12 +7,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 bc5985a7325e..06abc627fcd5 100644
--- a/secure/usr.bin/ssh-agent/Makefile
+++ b/secure/usr.bin/ssh-agent/Makefile
@@ -5,20 +5,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 149dc6936659..89e61e68ee55 100644
--- a/secure/usr.bin/ssh-keygen/Makefile
+++ b/secure/usr.bin/ssh-keygen/Makefile
@@ -6,13 +6,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 b842841f765f..baa7f54b048d 100644
--- a/secure/usr.bin/ssh-keyscan/Makefile
+++ b/secure/usr.bin/ssh-keyscan/Makefile
@@ -7,12 +7,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 aba1bce9c9a1..df85f47d5975 100644
--- a/secure/usr.bin/ssh/Makefile
+++ b/secure/usr.bin/ssh/Makefile
@@ -17,10 +17,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 d3b228bbbeb4..23a053f27ae7 100644
--- a/secure/usr.sbin/sshd/Makefile
+++ b/secure/usr.sbin/sshd/Makefile
@@ -21,7 +21,6 @@ LIBADD+= gssapi_krb5 gssapi krb5
.endif
.if ${MK_TCP_WRAPPERS} != "no"
-CFLAGS+= -DLIBWRAP=1
LIBADD+= wrap
.endif