]> code.ossystems Code Review - openembedded-core.git/commitdiff
distutils-common-base.bbclass: Define commonly used compiler variables
authorKhem Raj <raj.khem@gmail.com>
Tue, 28 Aug 2018 17:50:37 +0000 (10:50 -0700)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 4 Sep 2018 10:03:31 +0000 (11:03 +0100)
This is inspired from
https://github.com/python/cpython/blob/master/configure.ac

Helps cross compiling python C modules in some cases where they do
not respect normal CFLAGS

Errors like using gcc to link when compiler is clang is fixed

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes/distutils-common-base.bbclass

index 824a1b68b1f8316f6af677bfe7703a94fc192c0e..94b5fd426d7c15b651217fe5920d8d11ab503213 100644 (file)
@@ -1,6 +1,18 @@
 export STAGING_INCDIR
 export STAGING_LIBDIR
 
+# LDSHARED is the ld *command* used to create shared library
+export LDSHARED  = "${CCLD} -shared"
+# LDXXSHARED is the ld *command* used to create shared library of C++
+# objects
+export LDCXXSHARED  = "${CXX} -shared"
+# CCSHARED are the C *flags* used to create objects to go into a shared
+# library (module)
+export CCSHARED  = "-fPIC -DPIC"
+# LINKFORSHARED are the flags passed to the $(CC) command that links
+# the python executable
+export LINKFORSHARED = "{SECURITY_CFLAGS} -Xlinker -export-dynamic"
+
 FILES_${PN} += "${libdir}/* ${libdir}/${PYTHON_DIR}/*"
 
 FILES_${PN}-staticdev += "\