From 4e36f13b04a8b7ff19a4205c66b3b27f0800ab9a Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Fri, 7 May 2021 22:44:23 -0700 Subject: python3-m2crypto: Pass correct ABI defines to swig This ensures that WORDSIZE is as per the target, currently this does not get it right for cross-compilation env, and OE uses multilib headers by default ( even when you do not use multilib ) which means if WORDSIZE is wrong it will go on to include wrong headers due to these artificial stubs Fixes swig -python -py3 -ITOPDIR/tmp-glibc/work/cortexa57-oe-linux/python3-m2crypto/0.37.1-r0/recipe-sysroot-native/usr/bin/aarch64-oe-linux/../../lib/aarch64-oe-linux/gcc/aarch64-oe-linux/11.1.0/include -ITOPDIR/tmp-glibc/work/cortexa57-oe-linux/python3-m2crypto/0.37.1-r0/recipe-sysroot-native/usr/bin/aarch64-oe-linux/../../lib/aarch64-oe-linux/gcc/aarch64-oe-linux/11.1.0/include-fixed -ITOPDIR/tmp-glibc/work/cortexa57-oe-linux/python3-m2crypto/0.37.1-r0/recipe-sysroot/usr/lib/aarch64-oe-linux/11.1.0/include -ITOPDIR/tmp-glibc/work/cortexa57-oe-linux/python3-m2crypto/0.37.1-r0/recipe-sysroot/usr/include -ITOPDIR/tmp-glibc/work/cortexa57-oe-linux/python3-m2crypto/0.37.1-r0/recipe-sysroot/usr/include -ITOPDIR/tmp-glibc/work/cortexa57-oe-linux/python3-m2crypto/0.37.1-r0/recipe-sysroot/usr/include/python3.9 -I/usr/include/openssl -includeall -modern -builtin -outdir TOPDIR/tmp-glibc/work/cortexa57-oe-linux/python3-m2crypto/0.37.1-r0/M2Crypto-0.37.1/M2Crypto -o SWIG/_m2crypto_wrap.c SWIG/_m2crypto.i TOPDIR/tmp-glibc/work/cortexa57-oe-linux/python3-m2crypto/0.37.1-r0/recipe-sysroot/usr/include/openssl/opensslconf.h:23: Error: Unable to find 'openssl/opensslconf-32.h' Signed-off-by: Khem Raj Cc: Martin Jansa Signed-off-by: Trevor Gamblin --- .../python/python3-m2crypto_0.37.1.bb | 28 +++------------------- 1 file changed, 3 insertions(+), 25 deletions(-) diff --git a/meta-python/recipes-devtools/python/python3-m2crypto_0.37.1.bb b/meta-python/recipes-devtools/python/python3-m2crypto_0.37.1.bb index 896d9d2cc4..ef123075c7 100644 --- a/meta-python/recipes-devtools/python/python3-m2crypto_0.37.1.bb +++ b/meta-python/recipes-devtools/python/python3-m2crypto_0.37.1.bb @@ -33,31 +33,9 @@ DISTUTILS_INSTALL_ARGS += "build_ext --openssl=${STAGING_EXECPREFIXDIR}" SWIG_FEATURES_x86 = "-D__i386__" SWIG_FEATURES_x32 = "-D__ILP32__" -SWIG_FEATURES ?= "-D__${HOST_ARCH}__" -export SWIG_FEATURES -# Get around a problem with swig, but only if the -# multilib header file exists. -# -do_configure_prepend() { - ${CPP} -dM - < /dev/null | grep -v '__\(STDC\|REGISTER_PREFIX\|GNUC\|STDC_HOSTED\)__' \ - | sed 's/^\(#define \([^ ]*\) .*\)$/#undef \2\n\1/' > ${S}/SWIG/gcc_macros.h - - if [ "${SITEINFO_BITS}" = "64" ];then - bit="64" - else - bit="32" - fi - - if [ -e ${STAGING_INCDIR}/openssl/opensslconf-${bit}.h ] ;then - for i in SWIG/_ec.i SWIG/_evp.i; do - sed -i -e "s/opensslconf.*\./opensslconf-${bit}\./" "${S}/$i" - done - elif [ -e ${STAGING_INCDIR}/openssl/opensslconf-n${bit}.h ] ;then - for i in SWIG/_ec.i SWIG/_evp.i; do - sed -i -e "s/opensslconf.*\./opensslconf-n${bit}\./" "${S}/$i" - done - fi -} +SWIG_FEATURES ?= "-D__${HOST_ARCH}__ ${@['-D__ILP32__','-D__LP64__'][d.getVar('SITEINFO_BITS') != '32']}" + +export SWIG_FEATURES BBCLASSEXTEND = "native" -- cgit 1.2.3-korg