Skip to contentSkip to conversation

nodejs-0.8.18: export DESTDIR to fix build with dash

PATCH New Martin Jansa 1 participant 3 messages Feb 4, 2013 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

PATCH 1/3 nodejs-0.8.18: export DESTDIR to fix build with dash

* when building on machine with /bin/sh -> /bin/dash
DESTDIR is empty in install and it's trying to write to /usr/include and fails

---
 meta-oe/recipes-devtools/nodejs/nodejs_0.8.18.bb | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
meta-oe/recipes-devtools/nodejs/nodejs_0.8.18.bb +2 -1
index 9b39251..1a1c66b 100644
@@ -54,7 +54,8 @@ do_compile () {
 }
 
 do_install () {
-  DESTDIR=${D} oe_runmake install
+  export DESTDIR=${D}
+  oe_runmake install
 }
 
 RDEPENDS_${PN} = "curl python-shell python-datetime python-subprocess python-crypt python-textutils python-netclient "
Signature · 1 line
1.8.1.2
#2 lore raw

PATCH 2/3 nodejs-0.8.18: prefix CC/CXX with STAGING_BINDIR_TOOLCHAIN

* this way there is smaller chance that gcc/g++/ld wrapper will cause fork bomb

---
 meta-oe/recipes-devtools/nodejs/nodejs_0.8.18.bb | 17 ++++++++++++++---
 1 file changed, 14 insertions(+), 3 deletions(-)
meta-oe/recipes-devtools/nodejs/nodejs_0.8.18.bb +14 -3
index 1a1c66b..63c9660 100644
@@ -21,15 +21,26 @@ ARCHFLAGS_arm = "${@bb.utils.contains('TUNE_FEATURES', 'callconvention-hard', '-
 ARCHFLAGS ?= ""
 
 # 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_prepend_class-target () {
+  TOOLCHAIN_CC_PREFIX="${STAGING_BINDIR_TOOLCHAIN}"
+  TOOLCHAIN_CXX_PREFIX="${STAGING_BINDIR_TOOLCHAIN}"
+}
+do_configure_prepend_class-native () {
+  NATIVE_CC=`which gcc`
+  NATIVE_CXX=`which g++`
+  TOOLCHAIN_CC_PREFIX=`dirname "${NATIVE_CC}"`
+  TOOLCHAIN_CXX_PREFIX=`dirname "${NATIVE_CXX}"`
+}
+
 do_configure () {
   echo '#!/bin/sh' > ${WORKDIR}/gcc
-  echo '${CC} $@' >> ${WORKDIR}/gcc
+  echo "${TOOLCHAIN_CC_PREFIX}/${CC} \$@" >> ${WORKDIR}/gcc
 
   echo '#!/bin/sh' > ${WORKDIR}/g++
-  echo '${CXX} $@'>> ${WORKDIR}/g++
+  echo "${TOOLCHAIN_CXX_PREFIX}/${CXX} \$@" >> ${WORKDIR}/g++
 
   echo '#!/bin/sh' > ${WORKDIR}/ld
-  echo '${CXX} $@'>> ${WORKDIR}/ld
+  echo "${TOOLCHAIN_CXX_PREFIX}/${CXX} \$@" >> ${WORKDIR}/ld
 
   chmod +x ${WORKDIR}/gcc ${WORKDIR}/g++ ${WORKDIR}/ld
 
Signature · 1 line
1.8.1.2
#3 lore raw

PATCH 3/3 nodejs-0.8.18: use gcc/g++/ld wrappers also for native build

In reply to Martin Jansa

* it was calling ld with g++ arguments

---
 meta-oe/recipes-devtools/nodejs/nodejs_0.8.18.bb | 4 ----
 1 file changed, 4 deletions(-)
meta-oe/recipes-devtools/nodejs/nodejs_0.8.18.bb +0 -4
index 63c9660..6c79973 100644
@@ -52,10 +52,6 @@ do_configure () {
   ./configure --prefix=${prefix} --without-snapshot ${ARCHFLAGS}
 }
 
-do_compile_virtclass-native () {
-  make BUILDTYPE=Release
-}
-
 do_compile () {
   export PATH=${WORKDIR}:${PATH}
   export CC=gcc
Signature · 1 line
1.8.1.2