Inline Makefile.ssh.common
authorzrj <rimvydas.jasinskas@gmail.com>
Thu, 18 Apr 2019 11:45:20 +0000 (14:45 +0300)
committerzrj <zrj@dragonflybsd.org>
Wed, 24 Apr 2019 17:17:21 +0000 (20:17 +0300)
This fixes path, include and libraries order sequences and will be needed
for further PRIV changes.

Requested-by: swildner
16 files changed:
Makefile.ssh.common [deleted file]
lib/libssh/Makefile
lib/libssh/Makefile.etc
libexec/sftp-server/Makefile
libexec/ssh-keysign/Makefile
libexec/ssh-pkcs11-helper/Makefile
usr.bin/scp/Makefile
usr.bin/sftp/Makefile
usr.bin/ssh-add/Makefile
usr.bin/ssh-agent/Makefile
usr.bin/ssh-keygen/Makefile
usr.bin/ssh-keyscan/Makefile
usr.bin/ssh/Makefile
usr.bin/ssh/Makefile.etc
usr.sbin/sshd/Makefile
usr.sbin/sshd/Makefile.etc

diff --git a/Makefile.ssh.common b/Makefile.ssh.common
deleted file mode 100644 (file)
index 3719004..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-# SSH common setup
-#
-
-# Bad hack because .INCLUDEDFROMDIR does not work.
-#
-.if exists(${.CURDIR}/../../Makefile.inc1)
-SSHC_SYSDIR=${.CURDIR}/../..
-.elif exists(${.CURDIR}/../../../Makefile.inc1)
-SSHC_SYSDIR=${.CURDIR}/../../..
-.else
-.error "Cannot find source base"
-.endif
-
-SSHDIR=                ${SSHC_SYSDIR}/crypto/openssh
-
-XAUTH_PATH?=   /usr/local/bin/xauth
-CFLAGS+=       -DXAUTH_PATH=\"${XAUTH_PATH}\"
-CFLAGS+=       -I${SSHC_SYSDIR}/crypto/libressl/include
-CFLAGS+=       -I${SSHC_SYSDIR}/lib/libssh -I${SSHDIR}
-
-.if ${.CURDIR:T} != "libssh"
-DPADD+=                ${LIBSSH} ${LIBCRYPTO} ${LIBUTIL} ${LIBZ}
-LDADD+=                -lprivate_ssh -lprivate_crypto -lutil -lz
-LDFLAGS+=      -rpath /usr/lib/priv ${PRIVATELIB_LDFLAGS}
-.endif
-
-.PATH: ${SSHDIR} ${SSHDIR}/openbsd-compat
index e4e4733..08fda77 100644 (file)
@@ -2,6 +2,7 @@ LIB=    private_ssh
 SHLIB_MAJOR= 4
 PRIVATELIB=
 
+.PATH: ${.CURDIR}/../../crypto/openssh
 SRCS=  addrmatch.c atomicio.c authfd.c authfile.c bitmap.c canohost.c \
        chacha.c channels.c cipher.c cipher-chachapoly.c cleanup.c compat.c \
        dh.c digest-openssl.c dispatch.c dns.c entropy.c fatal.c \
@@ -52,5 +53,13 @@ MAN= moduli.5
 WARNS?=        2
 NO_STRICT_ALIASING=
 
-.include "../../Makefile.ssh.common"
+CFLAGS+=       -I${.CURDIR} -I${.CURDIR}/../../crypto/openssh
+CFLAGS+=       -I${.CURDIR}/../../crypto/libressl/include
+# XXX investigate why
+.if 0
+DPADD=         ${LIBCRYPTO} ${LIBUTIL} ${LIBZ}
+LDADD=         -lprivate_crypto -lutil -lz
+LDFLAGS+=      -rpath /usr/lib/priv ${PRIVATELIB_LDFLAGS}
+.endif
+
 .include <bsd.lib.mk>
index 6ee0cc5..7c69f81 100644 (file)
@@ -1,9 +1,6 @@
-# $DragonFly: src/secure/lib/libssh/Makefile.etc,v 1.5 2008/05/24 09:15:43 corecode Exp $
-#
+.PATH: ${.CURDIR}/../../crypto/openssh
 
-.include "../../Makefile.ssh.common"
-
-FILES=         ${SSHDIR}/moduli
+FILES=         moduli
 FILESDIR=      /etc/ssh
 FILESOWN=      ${BINOWN}
 FILESGRP=      ${BINGRP}
@@ -12,7 +9,7 @@ FILESMODE=     644
 # make confuses the text file `moduli' with a binary which needs
 # to be created from `moduli.c'.  Override this implicit rule by an
 # explicit do-nothing.
-${SSHDIR}/moduli:
+moduli:
        @true
 
 .include <bsd.prog.mk>
index 15ca512..dd75132 100644 (file)
@@ -1,4 +1,5 @@
 # $FreeBSD: src/secure/libexec/sftp-server/Makefile,v 1.1.2.3 2002/07/03 22:13:22 des Exp $
+.PATH: ${.CURDIR}/../../crypto/openssh
 
 PROG=  sftp-server
 SRCS=  sftp-server.c
@@ -6,5 +7,10 @@ SRCS+= sftp-common.c sftp-server-main.c
 MAN=   sftp-server.8
 WARNS?=        3
 
-.include "../../Makefile.ssh.common"
+CFLAGS+=       -I${.CURDIR}/../../lib/libssh -I${.CURDIR}/../../crypto/openssh
+CFLAGS+=       -I${.CURDIR}/../../crypto/libressl/include
+DPADD=         ${LIBSSH} ${LIBCRYPTO} ${LIBUTIL} ${LIBZ}
+LDADD=         -lprivate_ssh -lprivate_crypto -lutil -lz
+LDFLAGS+=      -rpath /usr/lib/priv ${PRIVATELIB_LDFLAGS}
+
 .include <bsd.prog.mk>
index 0fbb89f..664271c 100644 (file)
@@ -1,4 +1,5 @@
 # $FreeBSD: src/secure/libexec/ssh-keysign/Makefile,v 1.1.2.2 2003/02/03 17:31:12 des Exp $
+.PATH: ${.CURDIR}/../../crypto/openssh
 
 PROG=  ssh-keysign
 SRCS=  ssh-keysign.c
@@ -10,5 +11,14 @@ BINMODE=4511
 
 WARNS= 3
 
-.include "../../Makefile.ssh.common"
+.if defined(XAUTH_PATH)
+CFLAGS+= -DXAUTH_PATH=\"${XAUTH_PATH}\"
+.endif
+
+CFLAGS+=       -I${.CURDIR}/../../lib/libssh -I${.CURDIR}/../../crypto/openssh
+CFLAGS+=       -I${.CURDIR}/../../crypto/libressl/include
+DPADD=         ${LIBSSH} ${LIBCRYPTO} ${LIBUTIL} ${LIBZ}
+LDADD=         -lprivate_ssh -lprivate_crypto -lutil -lz
+LDFLAGS+=      -rpath /usr/lib/priv ${PRIVATELIB_LDFLAGS}
+
 .include <bsd.prog.mk>
index 540ea39..479ca92 100644 (file)
@@ -1,3 +1,5 @@
+.PATH: ${.CURDIR}/../../crypto/openssh
+
 PROG=  ssh-pkcs11-helper
 SRCS=  ssh-pkcs11-helper.c
 # disabled:
@@ -6,5 +8,12 @@ MAN=   ssh-pkcs11-helper.8
 
 WARNS= 3
 
-.include "../../Makefile.ssh.common"
+.PATH: ${.CURDIR}/../../crypto/openssh
+
+CFLAGS+=       -I${.CURDIR}/../../lib/libssh -I${.CURDIR}/../../crypto/openssh
+CFLAGS+=       -I${.CURDIR}/../../crypto/libressl/include
+DPADD=         ${LIBSSH} ${LIBCRYPTO} ${LIBUTIL} ${LIBZ}
+LDADD=         -lprivate_ssh -lprivate_crypto -lutil -lz
+LDFLAGS+=      -rpath /usr/lib/priv ${PRIVATELIB_LDFLAGS}
+
 .include <bsd.prog.mk>
index 2a40ff5..dd193b1 100644 (file)
@@ -1,9 +1,15 @@
 # $FreeBSD: src/secure/usr.bin/scp/Makefile,v 1.2.2.3 2002/07/03 22:20:29 des Exp $
+.PATH: ${.CURDIR}/../../crypto/openssh
 
 PROG=  scp
 SRCS=  scp.c
 SRCS+= progressmeter.c
 WARNS?=        3
 
-.include "../../Makefile.ssh.common"
+CFLAGS+=       -I${.CURDIR}/../../lib/libssh -I${.CURDIR}/../../crypto/openssh
+CFLAGS+=       -I${.CURDIR}/../../crypto/libressl/include
+DPADD=         ${LIBSSH} ${LIBCRYPTO} ${LIBUTIL} ${LIBZ}
+LDADD=         -lprivate_ssh -lprivate_crypto -lutil -lz
+LDFLAGS+=      -rpath /usr/lib/priv ${PRIVATELIB_LDFLAGS}
+
 .include <bsd.prog.mk>
index 743ce81..9dc0ac3 100644 (file)
@@ -1,14 +1,16 @@
 # $FreeBSD: src/secure/usr.bin/sftp/Makefile,v 1.1.2.3 2002/07/03 22:20:30 des Exp $
+.PATH: ${.CURDIR}/../../crypto/openssh
 
 PROG=  sftp
 SRCS=  sftp.c
 SRCS+= progressmeter.c sftp-client.c sftp-common.c sftp-glob.c
 WARNS?=        3
 
-DPADD+=        ${LIBEDIT} ${LIBNCURSES}
-LDADD+=        -lprivate_edit -lprivate_ncurses
-# LDFLAGS is set to same value by Makefile.ssh.common so avoid duplication
-#LDFLAGS+=     ${PRIVATELIB_LDFLAGS}
+CFLAGS+=       -I${.CURDIR}/../../lib/libssh -I${.CURDIR}/../../crypto/openssh
+CFLAGS+=       -I${.CURDIR}/../../crypto/libressl/include
+
+DPADD= ${LIBSSH} ${LIBCRYPTO} ${LIBUTIL} ${LIBZ} ${LIBEDIT} ${LIBNCURSES}
+LDADD= -lprivate_ssh -lprivate_crypto -lutil -lz -lprivate_edit -lprivate_ncurses
+LDFLAGS+=      -rpath /usr/lib/priv ${PRIVATELIB_LDFLAGS}
 
-.include "../../Makefile.ssh.common"
 .include <bsd.prog.mk>
index 20d244b..bcb3a41 100644 (file)
@@ -1,8 +1,13 @@
 # $FreeBSD: src/secure/usr.bin/ssh-add/Makefile,v 1.2.2.3 2002/07/03 22:20:31 des Exp $
-# $DragonFly: src/secure/usr.bin/ssh-add/Makefile,v 1.3 2004/07/31 19:03:01 geekgod Exp $
+.PATH: ${.CURDIR}/../../crypto/openssh
 
 PROG=  ssh-add
 WARNS?=        3
 
-.include "../../Makefile.ssh.common"
+CFLAGS+=       -I${.CURDIR}/../../lib/libssh -I${.CURDIR}/../../crypto/openssh
+CFLAGS+=       -I${.CURDIR}/../../crypto/libressl/include
+DPADD=         ${LIBSSH} ${LIBCRYPTO} ${LIBUTIL} ${LIBZ}
+LDADD=         -lprivate_ssh -lprivate_crypto -lutil -lz
+LDFLAGS+=      -rpath /usr/lib/priv ${PRIVATELIB_LDFLAGS}
+
 .include <bsd.prog.mk>
index dc731fb..dbe37db 100644 (file)
@@ -1,4 +1,5 @@
 # $FreeBSD: src/secure/usr.bin/ssh-agent/Makefile,v 1.2.2.3 2002/07/03 22:20:31 des Exp $
+.PATH: ${.CURDIR}/../../crypto/openssh
 
 PROG=  ssh-agent
 SRCS=  ssh-agent.c
@@ -6,5 +7,10 @@ WARNS?=        3
 
 # not needed: ssh-pkcs11-client.c
 
-.include "../../Makefile.ssh.common"
+CFLAGS+=       -I${.CURDIR}/../../lib/libssh -I${.CURDIR}/../../crypto/openssh
+CFLAGS+=       -I${.CURDIR}/../../crypto/libressl/include
+DPADD=         ${LIBSSH} ${LIBCRYPTO} ${LIBUTIL} ${LIBZ}
+LDADD=         -lprivate_ssh -lprivate_crypto -lutil -lz
+LDFLAGS+=      -rpath /usr/lib/priv ${PRIVATELIB_LDFLAGS}
+
 .include <bsd.prog.mk>
index 0e77e9b..e4f6473 100644 (file)
@@ -1,8 +1,13 @@
 # $FreeBSD: src/secure/usr.bin/ssh-keygen/Makefile,v 1.2.2.4 2002/07/03 22:20:31 des Exp $
-# $DragonFly: src/secure/usr.bin/ssh-keygen/Makefile,v 1.3 2004/07/31 19:03:01 geekgod Exp $
+.PATH: ${.CURDIR}/../../crypto/openssh
 
 PROG=  ssh-keygen
 WARNS?=        3
 
-.include "../../Makefile.ssh.common"
+CFLAGS+=       -I${.CURDIR}/../../lib/libssh -I${.CURDIR}/../../crypto/openssh
+CFLAGS+=       -I${.CURDIR}/../../crypto/libressl/include
+DPADD=         ${LIBSSH} ${LIBCRYPTO} ${LIBUTIL} ${LIBZ}
+LDADD=         -lprivate_ssh -lprivate_crypto -lutil -lz
+LDFLAGS+=      -rpath /usr/lib/priv ${PRIVATELIB_LDFLAGS}
+
 .include <bsd.prog.mk>
index eb903ec..cc17190 100644 (file)
@@ -1,8 +1,13 @@
 # $FreeBSD: src/secure/usr.bin/ssh-keyscan/Makefile,v 1.1.2.3 2002/07/03 22:20:32 des Exp $
-# $DragonFly: src/secure/usr.bin/ssh-keyscan/Makefile,v 1.4 2008/04/07 01:20:18 pavalos Exp $
+.PATH: ${.CURDIR}/../../crypto/openssh
 
 PROG=  ssh-keyscan
 WARNS?=        3
 
-.include "../../Makefile.ssh.common"
+CFLAGS+=       -I${.CURDIR}/../../lib/libssh -I${.CURDIR}/../../crypto/openssh
+CFLAGS+=       -I${.CURDIR}/../../crypto/libressl/include
+DPADD=         ${LIBSSH} ${LIBCRYPTO} ${LIBUTIL} ${LIBZ}
+LDADD=         -lprivate_ssh -lprivate_crypto -lutil -lz
+LDFLAGS+=      -rpath /usr/lib/priv ${PRIVATELIB_LDFLAGS}
+
 .include <bsd.prog.mk>
index 54333f3..f350a04 100644 (file)
@@ -1,4 +1,5 @@
 # $FreeBSD: src/secure/usr.bin/ssh/Makefile,v 1.4.2.8 2003/02/03 17:31:12 des Exp $
+.PATH: ${.CURDIR}/../../crypto/openssh
 
 PROG=  ssh
 LINKS= ${BINDIR}/ssh ${BINDIR}/slogin
@@ -10,5 +11,14 @@ SRCS=        ssh.c
 SRCS+= clientloop.c mux.c readconf.c \
        sshconnect.c sshconnect2.c sshtty.c
 
-.include "../../Makefile.ssh.common"
+.if defined(XAUTH_PATH)
+CFLAGS+= -DXAUTH_PATH=\"${XAUTH_PATH}\"
+.endif
+
+CFLAGS+=       -I${.CURDIR}/../../lib/libssh -I${.CURDIR}/../../crypto/openssh
+CFLAGS+=       -I${.CURDIR}/../../crypto/libressl/include
+DPADD=         ${LIBSSH} ${LIBCRYPTO} ${LIBUTIL} ${LIBZ}
+LDADD=         -lprivate_ssh -lprivate_crypto -lutil -lz
+LDFLAGS+=      -rpath /usr/lib/priv ${PRIVATELIB_LDFLAGS}
+
 .include <bsd.prog.mk>
index 28b1c0c..c43fc54 100644 (file)
@@ -1,5 +1,4 @@
-# $DragonFly: src/secure/usr.bin/ssh/Makefile.etc,v 1.2 2008/04/08 12:12:53 swildner Exp $
-#
+.PATH: ${.CURDIR}/../../crypto/openssh
 
 FILES=         ssh_config
 FILESDIR=      /etc/ssh
@@ -7,5 +6,4 @@ FILESOWN=       ${BINOWN}
 FILESGRP=      ${BINGRP}
 FILESMODE=     644
 
-.include "../../Makefile.ssh.common"
 .include <bsd.prog.mk>
index b0eb2fb..dfe53d6 100644 (file)
@@ -22,8 +22,17 @@ MAN= sshd.8 sshd_config.5
 CFLAGS+= -DUSE_PAM
 #CFLAGS+= -DHAVE_SECURITY_PAM_APPL_H -DHAVE_PAM_GETENVLIST -DHAVE_PAM_PUTENV
 
+.if defined(XAUTH_PATH)
+CFLAGS+= -DXAUTH_PATH=\"${XAUTH_PATH}\"
+.endif
+
 LDADD+=        -lcrypt ${MINUSLPAM}
 DPADD+=        ${LIBCRYPT} ${LIBPAM}
 
-.include "../../Makefile.ssh.common"
+CFLAGS+=       -I${.CURDIR}/../../lib/libssh -I${.CURDIR}/../../crypto/openssh
+CFLAGS+=       -I${.CURDIR}/../../crypto/libressl/include
+DPADD+=                ${LIBSSH} ${LIBCRYPTO} ${LIBUTIL} ${LIBZ}
+LDADD+=                -lprivate_ssh -lprivate_crypto -lutil -lz
+LDFLAGS+=      -rpath /usr/lib/priv ${PRIVATELIB_LDFLAGS}
+
 .include <bsd.prog.mk>
index 7a77d2f..c45dacd 100644 (file)
@@ -1,3 +1,5 @@
+.PATH: ${.CURDIR}/../../crypto/openssh
+
 FILES=         sshd_config
 FILESDIR=      /etc/ssh
 FILESMODE=     644
@@ -12,5 +14,4 @@ beforeinstall:
                exit 1; \
        fi
 
-.include "../../Makefile.ssh.common"
 .include <bsd.prog.mk>