build: allow to build LEDE on latest MacOS X

Latest Xcode doesn't include openssl anymore. To compile
mkimage from u-boot source you need SSL headers on your host.
This patch provides libressl host package for any Darwin
compilation. Unfortunately openssl from MacPorts can not be
used, as the installed headers in /opt/local are breaking
GDB compilation. Tested with a RB532 image build and resulting
kernel booted on a device via TFTP.

Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name> [fixes, dependencies]
This commit is contained in:
Waldemar Brodkorb 2016-05-25 23:47:09 +02:00 committed by Felix Fietkau
parent 4c5a49031e
commit f7fb6e49f2
3 changed files with 32 additions and 0 deletions

View file

@ -71,10 +71,13 @@ $(eval $(call TestHostCommand,zlib, \
echo 'int main(int argc, char **argv) { gzdopen(0, "rb"); return 0; }' | \ echo 'int main(int argc, char **argv) { gzdopen(0, "rb"); return 0; }' | \
gcc -include zlib.h -x c -o $(TMP_DIR)/a.out - $(zlib_link_flags))) gcc -include zlib.h -x c -o $(TMP_DIR)/a.out - $(zlib_link_flags)))
# Xcode deprecated openssl, MacPorts doesn't work nicely for other packages
ifneq ($(HOST_OS),Darwin)
$(eval $(call TestHostCommand,libssl, \ $(eval $(call TestHostCommand,libssl, \
Please install the openssl library (with development headers), \ Please install the openssl library (with development headers), \
echo 'int main(int argc, char **argv) { SSL_library_init(); return 0; }' | \ echo 'int main(int argc, char **argv) { SSL_library_init(); return 0; }' | \
gcc $(HOST_CFLAGS) -include openssl/ssl.h -x c -o $(TMP_DIR)/a.out - -lcrypto -lssl $(HOST_LDFLAGS))) gcc $(HOST_CFLAGS) -include openssl/ssl.h -x c -o $(TMP_DIR)/a.out - -lcrypto -lssl $(HOST_LDFLAGS)))
endif
$(eval $(call TestHostCommand,perl-thread-queue, \ $(eval $(call TestHostCommand,perl-thread-queue, \
Please install the Perl Thread::Queue module, \ Please install the Perl Thread::Queue module, \
@ -160,8 +163,10 @@ $(eval $(call SetupHostCommand,git,Please install Git (git-core) >= 1.7.12.2, \
$(eval $(call SetupHostCommand,file,Please install the 'file' package, \ $(eval $(call SetupHostCommand,file,Please install the 'file' package, \
file --version 2>&1 | grep file)) file --version 2>&1 | grep file))
ifneq ($(HOST_OS),Darwin)
$(eval $(call SetupHostCommand,openssl,Please install the 'openssl' utility, \ $(eval $(call SetupHostCommand,openssl,Please install the 'openssl' utility, \
openssl version | grep '\(OpenSSL\|LibreSSL\)')) openssl version | grep '\(OpenSSL\|LibreSSL\)'))
endif
# Install ldconfig stub # Install ldconfig stub

View file

@ -77,6 +77,11 @@ $(curdir)/bc/compile := $(curdir)/bison/install
$(curdir)/findutils/compile := $(curdir)/bison/install $(curdir)/findutils/compile := $(curdir)/bison/install
$(curdir)/gengetopt/compile := $(curdir)/libtool/install $(curdir)/gengetopt/compile := $(curdir)/libtool/install
$(curdir)/patchelf/compile := $(curdir)/libtool/install $(curdir)/patchelf/compile := $(curdir)/libtool/install
ifeq ($(HOST_OS),Darwin)
tools-y += libressl
$(curdir)/mkimage/compile += $(curdir)/libressl/install
$(curdir)/firmware-utils/compile += $(curdir)/libressl/install
endif
ifneq ($(CONFIG_CCACHE)$(CONFIG_SDK),) ifneq ($(CONFIG_CCACHE)$(CONFIG_SDK),)
$(foreach tool, $(filter-out patch,$(tools-y)), $(eval $(curdir)/$(tool)/compile += $(curdir)/ccache/install)) $(foreach tool, $(filter-out patch,$(tools-y)), $(eval $(curdir)/$(tool)/compile += $(curdir)/ccache/install))

22
tools/libressl/Makefile Normal file
View file

@ -0,0 +1,22 @@
#
# Copyright (C) 2016 LEDE project
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=libressl
PKG_VERSION:=2.3.4
PKG_MD5SUM:=b81d990b7eceb156df6eaa7e9f4a353e
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://ftp.openbsd.org/pub/OpenBSD/LibreSSL/
HOST_BUILD_PARALLEL:=1
include $(INCLUDE_DIR)/host-build.mk
$(eval $(call HostBuild))