mirror of
https://github.com/opnsense/src.git
synced 2026-06-08 16:22:46 -04:00
crypto/openssl: apply polish to new vendor import process
This change does the following 2 things: - Makes the build more repeatable by isolating the environment. This prevents bmake from leaking variables into gmake and makes the overall process a bit more robust. - Add debug printouts to make the process more straightforward to the reader and whoever is executing doing the current vendor import. MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D52420 (cherry picked from commit d18058b7b850c78f2ca1be746ab411c0bed5acc9)
This commit is contained in:
parent
85b1f782a1
commit
fd7ef6a342
1 changed files with 44 additions and 27 deletions
|
|
@ -12,8 +12,10 @@ LCRYPTO_SRC= ${SRCTOP}/crypto/openssl
|
|||
LCRYPTO_DOC= ${LCRYPTO_SRC}/doc
|
||||
|
||||
CAT?= /bin/cat
|
||||
GMAKE?= gmake
|
||||
MV?= /bin/mv
|
||||
PERL?= perl
|
||||
SETENVI= /usr/bin/env -i
|
||||
|
||||
BN_CONF_H= include/crypto/bn_conf.h
|
||||
BN_CONF_H_ORIG= ${BN_CONF_H}.orig
|
||||
|
|
@ -23,8 +25,11 @@ CONFIGURATION_H_ORIG= ${CONFIGURATION_H}.orig
|
|||
.PHONY: configure patch all
|
||||
.ORDER: configure patch all
|
||||
|
||||
LOCALBASE= /usr/local
|
||||
WRK_ENV= PATH=${LOCALBASE}/bin:/bin:/usr/bin
|
||||
|
||||
configure:
|
||||
@cd ${.CURDIR} && \
|
||||
@(cd ${.CURDIR} && ${SETENVI} \
|
||||
${PERL} ./Configure \
|
||||
disable-aria \
|
||||
disable-egd \
|
||||
|
|
@ -37,34 +42,45 @@ configure:
|
|||
enable-ktls \
|
||||
enable-sctp \
|
||||
--openssldir=etc \
|
||||
--prefix=/usr
|
||||
@cd ${.CURDIR} && gmake configdata.pm
|
||||
@cd ${LCRYPTO_SRC} && ${PERL} \
|
||||
${LCRYPTO_SRC}/freebsd/dump_version_from_configdata.pl > \
|
||||
${SRCTOP}/secure/lib/libcrypto/Makefile.version
|
||||
--prefix=/usr)
|
||||
@echo "Building configdata.pm for later use."
|
||||
@(cd ${.CURDIR} && \
|
||||
${SETENVI} ${WRK_ENV} ${GMAKE} -j ${.MAKE.JOBS} configdata.pm)
|
||||
|
||||
@echo "Populating Makefile.version with release information"
|
||||
@(cd ${LCRYPTO_SRC} && ${SETENVI} ${WRK_ENV} ${PERL} \
|
||||
${LCRYPTO_SRC}/freebsd/dump_version_from_configdata.pl > \
|
||||
${SRCTOP}/secure/lib/libcrypto/Makefile.version)
|
||||
|
||||
all: patch
|
||||
# Passing `-j ${.MAKE.JOBS}` doesn't work here for some reason.
|
||||
@cd ${.CURDIR} && gmake build_all_generated
|
||||
@echo "==> Building generated files (headers, manpages, etc)"
|
||||
@(cd ${.CURDIR} && \
|
||||
${SETENVI} ${WRK_ENV} ${GMAKE} -j ${.MAKE.JOBS} build_all_generated)
|
||||
|
||||
# Clean the pkgconfig files:
|
||||
# 1. Fix --prefix (not sure why configure --prefix isn't honored properly).
|
||||
# 1. Fix --prefix.
|
||||
# a. Not sure why --prefix isn't honored properly, even though it's
|
||||
# passed to Configure; the files might be getting rebuilt
|
||||
# post-Configure, somehow.
|
||||
# 2. Remove duplicate path in CFLAGS.
|
||||
# 3. Remove duplicate path in includedir(s).
|
||||
@echo "==> Fixing pkgconfig files"
|
||||
@find . -name \*.pc -print -exec sed -i '' -E \
|
||||
-e 's,^prefix=.+,prefix=/usr,' \
|
||||
-e 's,[[:space:]]+(\-I)?\$\{prefix\}/\./include[[:space:]]*,,g' \
|
||||
{} +
|
||||
|
||||
@cd ${SRCTOP}/secure/lib/libcrypto && \
|
||||
${MAKE} cleanasm && \
|
||||
${MAKE} buildasm
|
||||
@echo "==> Cleaning / rebuilding ASM"
|
||||
@(cd ${SRCTOP}/secure/lib/libcrypto && \
|
||||
${SETENVI} ${WRK_ENV} ${MAKE} cleanasm && \
|
||||
${SETENVI} ${WRK_ENV} ${MAKE} buildasm)
|
||||
|
||||
@echo "==> Syncing manpages (section 1)"
|
||||
@rsync -a --delete \
|
||||
--exclude 'Makefile*' --exclude '*.1' \
|
||||
${LCRYPTO_DOC}/man/ \
|
||||
${SRCTOP}/secure/lib/libcrypto/man
|
||||
|
||||
@echo "==> Syncing manpages (sections {3,5,7})"
|
||||
@rsync -a --delete \
|
||||
--exclude 'Makefile*' --exclude '*.[357]' \
|
||||
${LCRYPTO_DOC}/man/man1/ \
|
||||
|
|
@ -75,25 +91,26 @@ all: patch
|
|||
# depending on the host architecture.
|
||||
patch: configure
|
||||
# Spam arch-specific overrides to config files.
|
||||
@echo "==> Patching headers"
|
||||
@(cd ${.CURDIR} && ${SETENVI} ${WRK_ENV} ${GMAKE} ${BN_CONF_H} && \
|
||||
${MV} ${BN_CONF_H} ${BN_CONF_H_ORIG} && \
|
||||
${CAT} ${BN_CONF_H}.orig \
|
||||
${LCRYPTO_SRC}/freebsd/${BN_CONF_H} >> \
|
||||
${BN_CONF_H})
|
||||
|
||||
@cd ${.CURDIR} && gmake ${BN_CONF_H} && \
|
||||
${MV} ${BN_CONF_H} ${BN_CONF_H_ORIG} && \
|
||||
${CAT} ${BN_CONF_H}.orig \
|
||||
${LCRYPTO_SRC}/freebsd/${BN_CONF_H} >> \
|
||||
${BN_CONF_H}
|
||||
|
||||
@cd ${.CURDIR} && \
|
||||
${MV} ${CONFIGURATION_H} ${CONFIGURATION_H_ORIG} && \
|
||||
${CAT} ${CONFIGURATION_H_ORIG} \
|
||||
${LCRYPTO_SRC}/freebsd/${CONFIGURATION_H} >> \
|
||||
${CONFIGURATION_H}
|
||||
@(cd ${.CURDIR} && \
|
||||
${MV} ${CONFIGURATION_H} ${CONFIGURATION_H_ORIG} && \
|
||||
${CAT} ${CONFIGURATION_H_ORIG} \
|
||||
${LCRYPTO_SRC}/freebsd/${CONFIGURATION_H} >> \
|
||||
${CONFIGURATION_H})
|
||||
|
||||
|
||||
clean: .PHONY
|
||||
@cd ${.CURDIR} && rm -f ${BN_CONF_H_ORIG} ${CONFIGURATION_H_ORIG}
|
||||
@(cd ${.CURDIR} && rm -f ${BN_CONF_H_ORIG} ${CONFIGURATION_H_ORIG})
|
||||
|
||||
@cd ${SRCTOP}/secure/lib/libcrypto && ${MAKE} cleanasm
|
||||
@(cd ${SRCTOP}/secure/lib/libcrypto && \
|
||||
${SETENVI} ${WRK_ENV} ${MAKE} cleanasm)
|
||||
|
||||
-@cd ${.CURDIR} && gmake ${.TARGET}
|
||||
-@(cd ${.CURDIR} && ${GMAKE} ${.TARGET})
|
||||
|
||||
.include <sys.mk>
|
||||
|
|
|
|||
Loading…
Reference in a new issue