diff --git a/crypto/openssl/BSDmakefile b/crypto/openssl/BSDmakefile new file mode 100644 --- /dev/null +++ b/crypto/openssl/BSDmakefile @@ -0,0 +1,32 @@ +NO_OBJ= + +vendor-import: .PHONY + cd ${SRCTOP}/crypto/openssl && \ + perl ./Configure \ + disable-aria \ + disable-idea \ + disable-mdc2 \ + disable-sm2 \ + disable-sm3 \ + disable-sm4 \ + enable-ktls \ + enable-sctp \ + --openssldir=etc \ + --prefix=/usr + # Spam arch-specific overrides to config file. + cat ${.CURDIR}/dynamic_freebsd_configuration.h >> \ + ${SRCTOP}/crypto/openssl/include/openssl/configuration.h + cd ${SRCTOP}/secure/lib/libcrypto && \ + ${MAKE} cleanasm && \ + ${MAKE} buildasm + # Passing `-j ${.MAKE.JOBS}` doesn't work here for some reason. + cd ${SRCTOP}/crypto/openssl && \ + gmake build_man_docs + rsync -av --delete \ + --exclude 'Makefile*' --exclude '*.1' \ + ${SRCTOP}/crypto/openssl/doc/man/ \ + ${SRCTOP}/secure/lib/libcrypto/man + rsync -av --delete \ + --exclude 'Makefile*' --exclude '*.[357]' \ + ${SRCTOP}/crypto/openssl/doc/man/man1/ \ + ${SRCTOP}/secure/usr.bin/openssl/man diff --git a/crypto/openssl/dynamic_freebsd_configuration.h b/crypto/openssl/dynamic_freebsd_configuration.h new file mode 100644 --- /dev/null +++ b/crypto/openssl/dynamic_freebsd_configuration.h @@ -0,0 +1,40 @@ + +/** + * OpenSSL's Configure script generates these values automatically for the host + * architecture, but FreeBSD provides values which are universal for all + * supported target architectures. + */ + +#ifndef __DYNAMIC_FREEBSD_CONFIGURATION_H__ +#define __DYNAMIC_FREEBSD_CONFIGURATION_H__ + +# undef OPENSSL_NO_EC_NISTP_64_GCC_128 +# if !defined(__LP64__) || __BYTE_ORDER__ != __ORDER_LITTLE_ENDIAN__ +# ifndef OPENSSL_NO_EC_NISTP_64_GCC_128 +# define OPENSSL_NO_EC_NISTP_64_GCC_128 +# endif +# endif + +# undef BN_LLONG +# undef SIXTY_FOUR_BIT_LONG +# undef SIXTY_FOUR_BIT +# undef THIRTY_TWO_BIT +# if !defined(OPENSSL_SYS_UEFI) +# if __SIZEOF_LONG__ == 8 +# undef BN_LLONG +/* Only one for the following should be defined */ +# define SIXTY_FOUR_BIT_LONG +# undef SIXTY_FOUR_BIT +# undef THIRTY_TWO_BIT +# elif __SIZEOF_LONG__ == 4 +# define BN_LLONG +/* Only one for the following should be defined */ +# undef SIXTY_FOUR_BIT_LONG +# undef SIXTY_FOUR_BIT +# define THIRTY_TWO_BIT +# else +# error Unsupported size of long +# endif +# endif + +#endif /* __DYNAMIC_FREEBSD_CONFIGURATION_H__ */