Skip to content

Commit

Permalink
Add openssl-1.0.2l binary and libraries
Browse files Browse the repository at this point in the history
This patch adds the openssl-1.0.2l binary and libraries to the sysroot
image.  To enable building openssl add this to machine.make:

  OPENSSL_ENABLE = yes

Signed-off-by: Curt Brune <[email protected]>
  • Loading branch information
Curt Brune committed Feb 27, 2018
1 parent 10c8ed1 commit d93265d
Show file tree
Hide file tree
Showing 4 changed files with 128 additions and 0 deletions.
4 changes: 4 additions & 0 deletions build-config/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,7 @@ SECURE_BOOT_ENABLE ?= no
ifeq ($(SECURE_BOOT_ENABLE),yes)
PESIGN_ENABLE = yes
GNU_EFI_ENABLE = yes
OPENSSL_ENABLE = yes
endif

include make/kernel-download.make
Expand Down Expand Up @@ -418,6 +419,9 @@ endif
ifeq ($(GNU_EFI_ENABLE),yes)
include make/gnu-efi.make
endif
ifeq ($(OPENSSL_ENABLE),yes)
include make/openssl.make
endif
include make/images.make
include make/demo.make

Expand Down
3 changes: 3 additions & 0 deletions build-config/make/images.make
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,9 @@ ifeq ($(BTRFS_PROGS_ENABLE),yes)
PACKAGES_INSTALL_STAMPS += $(BTRFSPROGS_INSTALL_STAMP)
endif

ifeq ($(OPENSSL_ENABLE),yes)
PACKAGES_INSTALL_STAMPS += $(OPENSSL_INSTALL_STAMP)
endif

ifndef MAKE_CLEAN
SYSROOT_NEW_FILES = $(shell \
Expand Down
120 changes: 120 additions & 0 deletions build-config/make/openssl.make
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
#-------------------------------------------------------------------------------
#
# Copyright (C) 2017 Curt Brune <[email protected]>
#
# SPDX-License-Identifier: GPL-2.0
#
#-------------------------------------------------------------------------------
#
# This is a makefile fragment that defines the build of openssl
#

OPENSSL_VERSION = 1.0.2l
OPENSSL_TARBALL = openssl-$(OPENSSL_VERSION).tar.gz
OPENSSL_TARBALL_URLS += $(ONIE_MIRROR) \
https://www.openssl.org/source
OPENSSL_BUILD_DIR = $(USER_BUILDDIR)/openssl
OPENSSL_DIR = $(OPENSSL_BUILD_DIR)/openssl-$(OPENSSL_VERSION)

OPENSSL_DOWNLOAD_STAMP = $(DOWNLOADDIR)/openssl-download
OPENSSL_SOURCE_STAMP = $(USER_STAMPDIR)/openssl-source
OPENSSL_CONFIGURE_STAMP = $(USER_STAMPDIR)/openssl-configure
OPENSSL_BUILD_STAMP = $(USER_STAMPDIR)/openssl-build
OPENSSL_INSTALL_STAMP = $(STAMPDIR)/openssl-install
OPENSSL_STAMP = $(OPENSSL_SOURCE_STAMP) \
$(OPENSSL_CONFIGURE_STAMP) \
$(OPENSSL_BUILD_STAMP) \
$(OPENSSL_INSTALL_STAMP)

PHONY += openssl openssl-download openssl-source \
openssl-configure openssl-build openssl-install openssl-clean \
openssl-download-clean

OPENSSL_LIBS = \
engines \
libcrypto.so libcrypto.so.1.0.0 \
libssl.so libssl.so.1.0.0

OPENSSL_BINS = openssl

openssl: $(OPENSSL_STAMP)

DOWNLOAD += $(OPENSSL_DOWNLOAD_STAMP)
openssl-download: $(OPENSSL_DOWNLOAD_STAMP)
$(OPENSSL_DOWNLOAD_STAMP): $(PROJECT_STAMP)
$(Q) rm -f $@ && eval $(PROFILE_STAMP)
$(Q) echo "==== Getting upstream openssl ===="
$(Q) $(SCRIPTDIR)/fetch-package $(DOWNLOADDIR) $(UPSTREAMDIR) \
$(OPENSSL_TARBALL) $(OPENSSL_TARBALL_URLS)
$(Q) touch $@

SOURCE += $(OPENSSL_SOURCE_STAMP)
openssl-source: $(OPENSSL_SOURCE_STAMP)
$(OPENSSL_SOURCE_STAMP): $(USER_TREE_STAMP) | $(OPENSSL_DOWNLOAD_STAMP)
$(Q) rm -f $@ && eval $(PROFILE_STAMP)
$(Q) echo "==== Extracting upstream openssl ===="
$(Q) $(SCRIPTDIR)/extract-package $(OPENSSL_BUILD_DIR) $(DOWNLOADDIR)/$(OPENSSL_TARBALL)
$(Q) touch $@

openssl-configure: $(OPENSSL_CONFIGURE_STAMP)
$(OPENSSL_CONFIGURE_STAMP): $(OPENSSL_SOURCE_STAMP) $(ZLIB_BUILD_STAMP) \
| $(DEV_SYSROOT_INIT_STAMP)
$(Q) rm -f $@ && eval $(PROFILE_STAMP)
$(Q) echo "==== Configure openssl-$(OPENSSL_VERSION) ===="
$(Q) cd $(OPENSSL_DIR) && PATH='$(CROSSBIN):$(PATH)' \
$(OPENSSL_DIR)/config \
--prefix=/usr \
--cross-compile-prefix=$(CROSSPREFIX) \
shared \
enable-ssl-trace \
zlib \
no-threads \
"$(ONIE_CFLAGS)"
$(Q) touch $@

ifndef MAKE_CLEAN
OPENSSL_NEW_FILES = $(shell test -d $(OPENSSL_DIR) && test -f $(OPENSSL_BUILD_STAMP) && \
find -L $(OPENSSL_DIR) -newer $(OPENSSL_BUILD_STAMP) -type f \
\! -name symlinks \! -name symlinks.o -print -quit)
endif

openssl-build: $(OPENSSL_BUILD_STAMP)
$(OPENSSL_BUILD_STAMP): $(OPENSSL_NEW_FILES) $(OPENSSL_CONFIGURE_STAMP)
$(Q) rm -f $@ && eval $(PROFILE_STAMP)
$(Q) echo "==== Building openssl-$(OPENSSL_VERSION) ===="
$(Q) PATH='$(CROSSBIN):$(PATH)' $(MAKE) -C $(OPENSSL_DIR)
$(Q) PATH='$(CROSSBIN):$(PATH)' $(MAKE) -C $(OPENSSL_DIR) \
INSTALL_PREFIX=$(DEV_SYSROOT) install_sw
$(Q) for file in $(OPENSSL_LIBS) ; do \
chmod u+w -R $(DEV_SYSROOT)/usr/lib/$$file ; \
done
$(Q) touch $@

openssl-install: $(OPENSSL_INSTALL_STAMP)
$(OPENSSL_INSTALL_STAMP): $(SYSROOT_INIT_STAMP) $(OPENSSL_BUILD_STAMP) $(ZLIB_INSTALL_STAMP)
$(Q) rm -f $@ && eval $(PROFILE_STAMP)
$(Q) echo "==== Installing openssl in $(SYSROOTDIR) ===="
$(Q) cp -av $(DEV_SYSROOT)/usr/ssl $(SYSROOTDIR)/usr
$(Q) for file in $(OPENSSL_LIBS) ; do \
cp -av $(DEV_SYSROOT)/usr/lib/$$file $(SYSROOTDIR)/usr/lib/ ; \
done
$(Q) for file in $(OPENSSL_BINS) ; do \
cp -av $(DEV_SYSROOT)/usr/bin/$$file $(SYSROOTDIR)/usr/bin/ ; \
done
$(Q) touch $@

USER_CLEAN += openssl-clean
openssl-clean:
$(Q) rm -rf $(OPENSSL_BUILD_DIR)
$(Q) rm -f $(OPENSSL_STAMP)
$(Q) echo "=== Finished making $@ for $(PLATFORM)"

DOWNLOAD_CLEAN += openssl-download-clean
openssl-download-clean:
$(Q) rm -f $(OPENSSL_DOWNLOAD_STAMP) $(DOWNLOADDIR)/openssl*

#-------------------------------------------------------------------------------
#
# Local Variables:
# mode: makefile-gmake
# End:
1 change: 1 addition & 0 deletions upstream/openssl-1.0.2l.tar.gz.sha1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
b58d5d0e9cea20e571d903aafa853e2ccd914138 openssl-1.0.2l.tar.gz

0 comments on commit d93265d

Please sign in to comment.