diff options
| author | Andre McCurdy <armccurdy@gmail.com> | 2018-07-23 19:38:48 -0700 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2018-07-26 13:16:41 +0100 |
| commit | 85b477ba3676280f37d0dfc6108ef5e06078fd8d (patch) | |
| tree | 455f4d03b4bd62c4543207eaf548099eb53e5b02 /meta/recipes-connectivity | |
| parent | cfbe08fba26447faf7bf003ddecd8819eedeb21d (diff) | |
| download | poky-85b477ba3676280f37d0dfc6108ef5e06078fd8d.tar.gz | |
openssl_1.0: minor recipe formatting tweaks etc
Drop redundant setting of S to its default value, fix inconsistent
indent and re-order variables to align more closely to the OE
style-guide.
(From OE-Core rev: c36637a0304551bf2736bb15796947d9aaf00076)
Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-connectivity')
| -rw-r--r-- | meta/recipes-connectivity/openssl/openssl_1.0.2o.bb | 121 |
1 files changed, 61 insertions, 60 deletions
diff --git a/meta/recipes-connectivity/openssl/openssl_1.0.2o.bb b/meta/recipes-connectivity/openssl/openssl_1.0.2o.bb index 619f3d8bfa..7f32d0920e 100644 --- a/meta/recipes-connectivity/openssl/openssl_1.0.2o.bb +++ b/meta/recipes-connectivity/openssl/openssl_1.0.2o.bb | |||
| @@ -46,7 +46,7 @@ SRC_URI = "http://www.openssl.org/source/openssl-${PV}.tar.gz \ | |||
| 46 | file://0001-openssl-force-soft-link-to-avoid-rare-race.patch \ | 46 | file://0001-openssl-force-soft-link-to-avoid-rare-race.patch \ |
| 47 | " | 47 | " |
| 48 | 48 | ||
| 49 | SRC_URI_append_class-target = "\ | 49 | SRC_URI_append_class-target = " \ |
| 50 | file://reproducible-cflags.patch \ | 50 | file://reproducible-cflags.patch \ |
| 51 | file://reproducible-mkbuildinf.patch \ | 51 | file://reproducible-mkbuildinf.patch \ |
| 52 | " | 52 | " |
| @@ -58,75 +58,55 @@ SRC_URI_append_class-nativesdk = " \ | |||
| 58 | SRC_URI[md5sum] = "44279b8557c3247cbe324e2322ecd114" | 58 | SRC_URI[md5sum] = "44279b8557c3247cbe324e2322ecd114" |
| 59 | SRC_URI[sha256sum] = "ec3f5c9714ba0fd45cb4e087301eb1336c317e0d20b575a125050470e8089e4d" | 59 | SRC_URI[sha256sum] = "ec3f5c9714ba0fd45cb4e087301eb1336c317e0d20b575a125050470e8089e4d" |
| 60 | 60 | ||
| 61 | S = "${WORKDIR}/openssl-${PV}" | ||
| 62 | UPSTREAM_CHECK_REGEX = "openssl-(?P<pver>1\.0.+)\.tar" | 61 | UPSTREAM_CHECK_REGEX = "openssl-(?P<pver>1\.0.+)\.tar" |
| 63 | 62 | ||
| 63 | inherit pkgconfig siteinfo multilib_header ptest relative_symlinks | ||
| 64 | |||
| 64 | PACKAGECONFIG ?= "cryptodev-linux" | 65 | PACKAGECONFIG ?= "cryptodev-linux" |
| 65 | PACKAGECONFIG[perl] = ",,," | 66 | PACKAGECONFIG[perl] = ",,," |
| 66 | PACKAGECONFIG[cryptodev-linux] = "-DHAVE_CRYPTODEV -DUSE_CRYPTODEV_DIGESTS,,cryptodev-linux" | 67 | PACKAGECONFIG[cryptodev-linux] = "-DHAVE_CRYPTODEV -DUSE_CRYPTODEV_DIGESTS,,cryptodev-linux" |
| 67 | 68 | ||
| 68 | TERMIO_libc-musl = "-DTERMIOS" | 69 | # Remove this to enable SSLv3. SSLv3 is defaulted to disabled due to the POODLE |
| 69 | TERMIO ?= "-DTERMIO" | 70 | # vulnerability |
| 70 | # Avoid binaries being marked as requiring an executable stack since it | 71 | EXTRA_OECONF = "-no-ssl3" |
| 71 | # doesn't(which causes and this causes issues with SELinux | ||
| 72 | CFLAG = "${@oe.utils.conditional('SITEINFO_ENDIANNESS', 'le', '-DL_ENDIAN', '-DB_ENDIAN', d)} \ | ||
| 73 | ${TERMIO} ${CFLAGS} -Wall -Wa,--noexecstack" | ||
| 74 | |||
| 75 | # For target side versions of openssl enable support for OCF Linux driver | ||
| 76 | # if they are available. | ||
| 77 | |||
| 78 | CFLAG += "-DHAVE_CRYPTODEV -DUSE_CRYPTODEV_DIGESTS" | ||
| 79 | CFLAG_append_class-native = " -fPIC" | ||
| 80 | 72 | ||
| 81 | export DIRS = "crypto ssl apps engines" | 73 | export DIRS = "crypto ssl apps engines" |
| 82 | export EX_LIBS = "-lgcc -ldl" | ||
| 83 | export AS = "${CC} -c" | 74 | export AS = "${CC} -c" |
| 84 | 75 | export EX_LIBS = "-lgcc -ldl" | |
| 85 | export OE_LDFLAGS = "${LDFLAGS}" | 76 | export OE_LDFLAGS = "${LDFLAGS}" |
| 86 | 77 | ||
| 87 | # openssl fails with ccache: https://bugzilla.yoctoproject.org/show_bug.cgi?id=12810 | 78 | # openssl fails with ccache: https://bugzilla.yoctoproject.org/show_bug.cgi?id=12810 |
| 88 | CCACHE = "" | 79 | CCACHE = "" |
| 89 | 80 | ||
| 90 | inherit pkgconfig siteinfo multilib_header ptest relative_symlinks | 81 | TERMIO ?= "-DTERMIO" |
| 82 | TERMIO_libc-musl = "-DTERMIOS" | ||
| 91 | 83 | ||
| 92 | PACKAGES =+ "libcrypto libssl ${PN}-misc openssl-conf" | 84 | CFLAG = "${@oe.utils.conditional('SITEINFO_ENDIANNESS', 'le', '-DL_ENDIAN', '-DB_ENDIAN', d)} \ |
| 93 | FILES_libcrypto = "${libdir}/libcrypto${SOLIBS}" | 85 | ${TERMIO} ${CFLAGS} -Wall" |
| 94 | FILES_libssl = "${libdir}/libssl${SOLIBS}" | ||
| 95 | FILES_${PN} =+ " ${libdir}/ssl/*" | ||
| 96 | FILES_${PN}-misc = "${libdir}/ssl/misc" | ||
| 97 | RDEPENDS_${PN}-misc = "${@bb.utils.filter('PACKAGECONFIG', 'perl', d)}" | ||
| 98 | 86 | ||
| 99 | # Add the openssl.cnf file to the openssl-conf package. Make the libcrypto | 87 | # Avoid binaries being marked as requiring an executable stack since they don't |
| 100 | # package RRECOMMENDS on this package. This will enable the configuration | 88 | # (and it causes issues with SELinux) |
| 101 | # file to be installed for both the base openssl package and the libcrypto | 89 | CFLAG += "-Wa,--noexecstack" |
| 102 | # package since the base openssl package depends on the libcrypto package. | ||
| 103 | FILES_openssl-conf = "${sysconfdir}/ssl/openssl.cnf" | ||
| 104 | CONFFILES_openssl-conf = "${sysconfdir}/ssl/openssl.cnf" | ||
| 105 | RRECOMMENDS_libcrypto += "openssl-conf" | ||
| 106 | RDEPENDS_${PN}-ptest += "${PN}-misc make perl perl-module-filehandle bc" | ||
| 107 | 90 | ||
| 108 | PACKAGES =+ "${PN}-engines" | 91 | # For target side versions of openssl enable support for OCF Linux driver |
| 109 | FILES_${PN}-engines = "${libdir}/ssl/engines/*.so ${libdir}/engines" | 92 | # if they are available. |
| 93 | CFLAG += "-DHAVE_CRYPTODEV -DUSE_CRYPTODEV_DIGESTS" | ||
| 110 | 94 | ||
| 111 | # Remove this to enable SSLv3. SSLv3 is defaulted to disabled due to the POODLE | 95 | CFLAG_append_class-native = " -fPIC" |
| 112 | # vulnerability | ||
| 113 | EXTRA_OECONF = " -no-ssl3" | ||
| 114 | 96 | ||
| 115 | do_configure_prepend_darwin () { | 97 | do_configure_prepend_darwin () { |
| 116 | sed -i -e '/version-script=openssl\.ld/d' Configure | 98 | sed -i -e '/version-script=openssl\.ld/d' Configure |
| 117 | } | 99 | } |
| 118 | 100 | ||
| 119 | # The crypto_use_bigint patch means that perl's bignum module needs to be | 101 | do_configure () { |
| 120 | # installed, but some distributions (for example Fedora 23) don't ship it by | 102 | # The crypto_use_bigint patch means that perl's bignum module needs to be |
| 121 | # default. As the resulting error is very misleading check for bignum before | 103 | # installed, but some distributions (for example Fedora 23) don't ship it by |
| 122 | # building. | 104 | # default. As the resulting error is very misleading check for bignum before |
| 123 | do_configure_prepend() { | 105 | # building. |
| 124 | if ! perl -Mbigint -e true; then | 106 | if ! perl -Mbigint -e true; then |
| 125 | bbfatal "The perl module 'bignum' was not found but this is required to build openssl. Please install this module (often packaged as perl-bignum) and re-run bitbake." | 107 | bbfatal "The perl module 'bignum' was not found but this is required to build openssl. Please install this module (often packaged as perl-bignum) and re-run bitbake." |
| 126 | fi | 108 | fi |
| 127 | } | ||
| 128 | 109 | ||
| 129 | do_configure () { | ||
| 130 | cd util | 110 | cd util |
| 131 | perl perlpath.pl ${STAGING_BINDIR_NATIVE} | 111 | perl perlpath.pl ${STAGING_BINDIR_NATIVE} |
| 132 | cd .. | 112 | cd .. |
| @@ -141,7 +121,7 @@ do_configure () { | |||
| 141 | linux-musl ) | 121 | linux-musl ) |
| 142 | os=linux | 122 | os=linux |
| 143 | ;; | 123 | ;; |
| 144 | *) | 124 | *) |
| 145 | ;; | 125 | ;; |
| 146 | esac | 126 | esac |
| 147 | target="$os-${HOST_ARCH}" | 127 | target="$os-${HOST_ARCH}" |
| @@ -203,12 +183,12 @@ do_configure () { | |||
| 203 | linux-powerpc64) | 183 | linux-powerpc64) |
| 204 | target=linux-ppc64 | 184 | target=linux-ppc64 |
| 205 | ;; | 185 | ;; |
| 206 | linux-riscv64) | ||
| 207 | target=linux-generic64 | ||
| 208 | ;; | ||
| 209 | linux-riscv32) | 186 | linux-riscv32) |
| 210 | target=linux-generic32 | 187 | target=linux-generic32 |
| 211 | ;; | 188 | ;; |
| 189 | linux-riscv64) | ||
| 190 | target=linux-generic64 | ||
| 191 | ;; | ||
| 212 | linux-supersparc) | 192 | linux-supersparc) |
| 213 | target=linux-sparcv8 | 193 | target=linux-sparcv8 |
| 214 | ;; | 194 | ;; |
| @@ -219,19 +199,21 @@ do_configure () { | |||
| 219 | target=darwin-i386-cc | 199 | target=darwin-i386-cc |
| 220 | ;; | 200 | ;; |
| 221 | esac | 201 | esac |
| 202 | |||
| 222 | # inject machine-specific flags | 203 | # inject machine-specific flags |
| 223 | sed -i -e "s|^\(\"$target\",\s*\"[^:]\+\):\([^:]\+\)|\1:${CFLAG}|g" Configure | 204 | sed -i -e "s|^\(\"$target\",\s*\"[^:]\+\):\([^:]\+\)|\1:${CFLAG}|g" Configure |
| 224 | useprefix=${prefix} | 205 | |
| 225 | if [ "x$useprefix" = "x" ]; then | 206 | useprefix=${prefix} |
| 226 | useprefix=/ | 207 | if [ "x$useprefix" = "x" ]; then |
| 227 | fi | 208 | useprefix=/ |
| 209 | fi | ||
| 228 | libdirleaf="$(echo ${libdir} | sed s:$useprefix::)" | 210 | libdirleaf="$(echo ${libdir} | sed s:$useprefix::)" |
| 229 | perl ./Configure ${EXTRA_OECONF} shared --prefix=$useprefix --openssldir=${libdir}/ssl --libdir=${libdirleaf} $target | 211 | perl ./Configure ${EXTRA_OECONF} shared --prefix=$useprefix --openssldir=${libdir}/ssl --libdir=${libdirleaf} $target |
| 230 | } | 212 | } |
| 231 | 213 | ||
| 232 | do_compile_prepend_class-target () { | 214 | do_compile_prepend_class-target () { |
| 233 | sed -i 's/\((OPENSSL=\)".*"/\1"openssl"/' Makefile | 215 | sed -i 's/\((OPENSSL=\)".*"/\1"openssl"/' Makefile |
| 234 | oe_runmake depend | 216 | oe_runmake depend |
| 235 | cc_sanitized=`echo "${CC} ${CFLAG}" | sed -e 's,--sysroot=${STAGING_DIR_TARGET},,g' -e 's|${DEBUG_PREFIX_MAP}||g'` | 217 | cc_sanitized=`echo "${CC} ${CFLAG}" | sed -e 's,--sysroot=${STAGING_DIR_TARGET},,g' -e 's|${DEBUG_PREFIX_MAP}||g'` |
| 236 | oe_runmake CC_INFO="${cc_sanitized}" | 218 | oe_runmake CC_INFO="${cc_sanitized}" |
| 237 | } | 219 | } |
| @@ -296,8 +278,8 @@ do_install () { | |||
| 296 | do_install_ptest () { | 278 | do_install_ptest () { |
| 297 | cp -r -L Makefile.org Makefile test ${D}${PTEST_PATH} | 279 | cp -r -L Makefile.org Makefile test ${D}${PTEST_PATH} |
| 298 | 280 | ||
| 299 | # Replace the path to native perl with the path to target perl | 281 | # Replace the path to native perl with the path to target perl |
| 300 | sed -i 's,^PERL=.*,PERL=${bindir}/perl,' ${D}${PTEST_PATH}/Makefile | 282 | sed -i 's,^PERL=.*,PERL=${bindir}/perl,' ${D}${PTEST_PATH}/Makefile |
| 301 | 283 | ||
| 302 | cp Configure config e_os.h ${D}${PTEST_PATH} | 284 | cp Configure config e_os.h ${D}${PTEST_PATH} |
| 303 | cp -r -L include ${D}${PTEST_PATH} | 285 | cp -r -L include ${D}${PTEST_PATH} |
| @@ -336,9 +318,9 @@ do_install_ptest () { | |||
| 336 | 318 | ||
| 337 | # Remove build host references | 319 | # Remove build host references |
| 338 | sed -i \ | 320 | sed -i \ |
| 339 | -e 's,--sysroot=${STAGING_DIR_TARGET},,g' \ | 321 | -e 's,--sysroot=${STAGING_DIR_TARGET},,g' \ |
| 340 | -e 's|${DEBUG_PREFIX_MAP}||g' \ | 322 | -e 's|${DEBUG_PREFIX_MAP}||g' \ |
| 341 | ${D}${PTEST_PATH}/Makefile ${D}${PTEST_PATH}/Configure | 323 | ${D}${PTEST_PATH}/Makefile ${D}${PTEST_PATH}/Configure |
| 342 | } | 324 | } |
| 343 | 325 | ||
| 344 | do_install_append_class-native() { | 326 | do_install_append_class-native() { |
| @@ -350,10 +332,29 @@ do_install_append_class-native() { | |||
| 350 | } | 332 | } |
| 351 | 333 | ||
| 352 | do_install_append_class-nativesdk() { | 334 | do_install_append_class-nativesdk() { |
| 353 | mkdir -p ${D}${SDKPATHNATIVE}/environment-setup.d | 335 | mkdir -p ${D}${SDKPATHNATIVE}/environment-setup.d |
| 354 | install -m 644 ${WORKDIR}/environment.d-openssl.sh ${D}${SDKPATHNATIVE}/environment-setup.d/openssl.sh | 336 | install -m 644 ${WORKDIR}/environment.d-openssl.sh ${D}${SDKPATHNATIVE}/environment-setup.d/openssl.sh |
| 355 | } | 337 | } |
| 356 | 338 | ||
| 339 | # Add the openssl.cnf file to the openssl-conf package. Make the libcrypto | ||
| 340 | # package RRECOMMENDS on this package. This will enable the configuration | ||
| 341 | # file to be installed for both the base openssl package and the libcrypto | ||
| 342 | # package since the base openssl package depends on the libcrypto package. | ||
| 343 | |||
| 344 | PACKAGES =+ "libcrypto libssl openssl-conf ${PN}-engines ${PN}-misc" | ||
| 345 | |||
| 346 | FILES_libcrypto = "${libdir}/libcrypto${SOLIBS}" | ||
| 347 | FILES_libssl = "${libdir}/libssl${SOLIBS}" | ||
| 348 | FILES_openssl-conf = "${sysconfdir}/ssl/openssl.cnf" | ||
| 349 | FILES_${PN}-engines = "${libdir}/ssl/engines/*.so ${libdir}/engines" | ||
| 350 | FILES_${PN}-misc = "${libdir}/ssl/misc" | ||
| 351 | FILES_${PN} =+ "${libdir}/ssl/*" | ||
| 357 | FILES_${PN}_append_class-nativesdk = " ${SDKPATHNATIVE}/environment-setup.d/openssl.sh" | 352 | FILES_${PN}_append_class-nativesdk = " ${SDKPATHNATIVE}/environment-setup.d/openssl.sh" |
| 358 | 353 | ||
| 354 | CONFFILES_openssl-conf = "${sysconfdir}/ssl/openssl.cnf" | ||
| 355 | |||
| 356 | RRECOMMENDS_libcrypto += "openssl-conf" | ||
| 357 | RDEPENDS_${PN}-misc = "${@bb.utils.filter('PACKAGECONFIG', 'perl', d)}" | ||
| 358 | RDEPENDS_${PN}-ptest += "${PN}-misc make perl perl-module-filehandle bc" | ||
| 359 | |||
| 359 | BBCLASSEXTEND = "native nativesdk" | 360 | BBCLASSEXTEND = "native nativesdk" |
