-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile.ssh.def
62 lines (49 loc) · 2.43 KB
/
Makefile.ssh.def
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
SSH_INSTALL_ROOT=$(FILESYSTEM_ROOT)
ZLIB_INSTALL_ROOT=$(FILESYSTEM_ROOT)/usr
DIRECTORIES += $(ZLIB_INSTALL_ROOT) # $(SSH_INSTALL_ROOT)
zlib-git-repo="https://github.com/madler/zlib"
GIT_PROJECTS += zlib
zlib-build: $(ZLIB_INSTALL_ROOT)/lib/libz.a
comma=,
$(ZLIB_INSTALL_ROOT)/lib/libz.a: | zlib gnu-tools $(FILESYSTEM_ROOT) $(SSH_INSTALL_ROOT)
$(call remote-maybe, cd $(SOURCES_DIR)/zlib-git/; \
CC="$(CROSS_COMPILE)gcc" LDSHARED="$$CC -shared -Wl$(comma)-soname$(comma)libz.so.1" ./configure --shared --prefix=$(ZLIB_INSTALL_ROOT))
$(call remote-maybe, make -C $(SOURCES_DIR)/zlib-git/)
$(call remote-maybe, make -C $(SOURCES_DIR)/zlib-git/ install)
zlib-clean:
rm -rf $(ZLIB_INSTALL_ROOT)/lib/libz.a
openssl-git-repo="git://git.openssl.org/openssl.git"
GIT_PROJECTS += openssl
openssl-build: zlib-build $(ZLIB_INSTALL_ROOT)/lib/libssl.a
$(SSH_INSTALL_ROOT)/lib/libssl.a: | openssl gnu-tools filesystem-nossh $(FILESYSTEM_ROOT) $(SSH_INSTALL_ROOT)
$(call remote-maybe, \
cd $(SOURCES_DIR)/openssl-git/; \
CPATH="$(SSH_INSTALL_ROOT)/include" CROSS_COMPILE=$(CROSS_COMPILE) \
CC="gcc --sysroot=$(SSH_INSTALL_ROOT)" \
./Configure dist zlib no-asm --prefix="$(SSH_INSTALL_ROOT)" )
$(call remote-maybe, make -C $(SOURCES_DIR)/openssl-git/ all install_sw )
openssl-check-libcrypto:
$(CROSS_COMPILE)objdump -S $(SSH_INSTALL_ROOT)/lib/libcrypto.a > /dev/null
openssl-distclean:
cd $(SOURCES_DIR)/openssl-git/ && make dclean
# Make an organized way of getting ziped sources like you did with
# git.
openssh-tar-url="ftp://ftp.cc.uoc.gr/mirrors/OpenBSD/OpenSSH/portable/openssh-6.2p2.tar.gz"
TAR_PROJECTS += openssh
openssh-build: $(SSH_INSTALL_ROOT)/bin/ssh
$(SSH_INSTALL_ROOT)/bin/ssh: | openssh gnu-tools openssl-build zlib-build $(SSH_INSTALL_ROOT)
@echo "Building openssh-archive"
$(call remote-maybe, \
cd $(SOURCES_DIR)/openssh-archive/*/ && \
./configure CROSS_COMPILE=$(CROSS_COMPILE) \
CC="$(CROSS_COMPILE)gcc --sysroot=$(FILESYSTEM_ROOT)" \
--prefix=$(SSH_INSTALL_ROOT) \
--host=$(GNU_TOOLS_HOST) \
--with-privsep-path=$(FILESYSTEM_ROOT)/var/empty \
--with-libs --with-zlib=$(ZLIB_INSTALL_ROOT) \
--with-ssl-dir=$(SSH_INSTALL_ROOT) \
--disable-etc-default-login INSTALL="/usr/bin/install -c --strip-program=$(CROSS_COMPILE)strip")
$(call remote-maybe, make -C $(SOURCES_DIR)/openssh-archive/*/ && make install-nokeys -C $(SOURCES_DIR)/openssh-archive/*/)
ssh-clean:
rm -rf $(SSH_INSTALL_ROOT)/bin/ssh
openssh-clean: openssh-archive-clean