Skip to content

Commit

Permalink
pkg_install: compile openssl statically
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonathan Perkin authored and jperkin committed Dec 20, 2023
1 parent 05cad28 commit f818429
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
1 change: 0 additions & 1 deletion pkgtools/pkg_install/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ BUILDLINK_API_DEPENDS.libarchive+= libarchive>=3.3.1
.include "../../archivers/xz/builtin.mk"
.include "../../archivers/libarchive/builtin.mk"
.include "../../devel/zlib/builtin.mk"
.include "../../security/openssl/builtin.mk"

.include "options.mk"

Expand Down
13 changes: 12 additions & 1 deletion pkgtools/pkg_install/options.mk
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,19 @@ MAKE_ENV+= FETCH_WITH_INET6=no
.if !empty(PKG_OPTIONS:Mopenssl)
CONFIGURE_ARGS+= --with-ssl
MAKE_ENV+= FETCH_WITH_OPENSSL=yes
LDFLAGS+= -lssl -lcrypto
CONFIGURE_ARGS+= --with-ssl

# Ensure that openssl is linked statically to avoid bootstrap issues.
pre-configure: static-openssl
.PHONY: static-openssl
static-openssl:
.for lib in crypto ssl
. for ext in dylib so
${RM} -f ${BUILDLINK_DIR:U/nonexistant}/lib/lib${lib}*.${ext}*
. endfor
.endfor

BUILDLINK_DEPMETHOD.openssl= build
.include "../../security/openssl/buildlink3.mk"
.else
LIBARCHIVE_CONFIGURE_ARGS+= --without-openssl
Expand Down

0 comments on commit f818429

Please sign in to comment.