mirror of
https://github.com/openembedded/meta-openembedded.git
synced 2026-06-14 05:49:57 +00:00
nodejs: ensure to use correct compiler & flags always
NodeJS comes with an embedded, patched, version of gyp.
Normally, gyp supports compiling for the build machine, e.g.
native tools that need to be compiled to run during the build,
and for the host, using different variables, e.g. CC and
CC.host, etc.
Most of this has been patched out in the NodeJS version of gyp,
and essentially it only supports compiling using one compiler -
${CC}. This modification excludes LDFLAGS for native tools, and
those still evaluate LDFLAGS.host (only).
While this modified behaviour is OK for the OE use-case of building
native and target tools separately, it means that this recipe can
not work as-is with standard gyp, and wrong LDFLAGS are being used
for some of the tools compiled (torque) in either case.
By setting the make variables that gyp-generated makefiles inspect,
we support use of unpatched gyp, and we ensure that all tools
are compiled with correct LDFLAGS in either case.
This now also allows us to drop the patch that had been applied to
work-around this problem.
Signed-off-by: André Draszik <git@andred.net>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
This commit is contained in:
@@ -19,7 +19,6 @@ SRC_URI = "http://nodejs.org/dist/v${PV}/node-v${PV}.tar.xz \
|
||||
file://0001-Disable-running-gyp-files-for-bundled-deps.patch \
|
||||
file://0004-Make-compatibility-with-gcc-4.8.patch \
|
||||
file://0005-Link-atomic-library.patch \
|
||||
file://0006-Use-target-ldflags.patch \
|
||||
"
|
||||
SRC_URI_append_class-target = " \
|
||||
file://0002-Using-native-torque.patch \
|
||||
@@ -58,6 +57,18 @@ PACKAGECONFIG[libuv] = "--shared-libuv,,libuv"
|
||||
PACKAGECONFIG[nghttp2] = "--shared-nghttp2,,nghttp2"
|
||||
PACKAGECONFIG[zlib] = "--shared-zlib,,zlib"
|
||||
|
||||
# We don't want to cross-compile during target compile,
|
||||
# and we need to use the right flags during host compile,
|
||||
# too.
|
||||
EXTRA_OEMAKE = "\
|
||||
CC.host='${CC}' \
|
||||
CFLAGS.host='${CPPFLAGS} ${CFLAGS}' \
|
||||
CXX.host='${CXX}' \
|
||||
CXXFLAGS.host='${CPPFLAGS} ${CXXFLAGS}' \
|
||||
LDFLAGS.host='${LDFLAGS}' \
|
||||
AR.host='${AR}' \
|
||||
"
|
||||
|
||||
# Node is way too cool to use proper autotools, so we install two wrappers to forcefully inject proper arch cflags to workaround gypi
|
||||
do_configure () {
|
||||
rm -rf ${S}/deps/openssl
|
||||
|
||||
Reference in New Issue
Block a user