- #XXX: node.js build does not handle already installed headers
- # https://github.com/nodejs/node/issues/2637
- # So we remove them here and restore afterwards.
- rm -Rf $TERMUX_PKG_CACHEDIR/gtest-include-dir $TERMUX_PKG_CACHEDIR/ares-includes
- test -d $TERMUX_PREFIX/include/gtest &&
- mv $TERMUX_PREFIX/include/gtest $TERMUX_PKG_CACHEDIR/gtest-include-dir
- test -f $TERMUX_PREFIX/include/ares.h &&
- mkdir $TERMUX_PKG_CACHEDIR/ares-includes/ &&
- mv $TERMUX_PREFIX/include/ares* $TERMUX_PKG_CACHEDIR/ares-includes/
+ # See https://github.com/nodejs/build/issues/266 about enabling snapshots
+ # when cross compiling. We use {CC,CXX}_host for compilation of code to
+ # be run on the build maching (snapshots when cross compiling are
+ # generated using a CPU emulator provided by v8) and {CC,CXX} for the
+ # cross compile. We unset flags such as CFLAGS as they would affect
+ # both the host and cross compiled build.
+ # Remaining issue to be solved before enabling snapshots by removing
+ # the --without-snapshot flag is that pkg-config picks up cross compilation
+ # flags which breaks the host build.
+ #export CC_host="gcc -pthread"
+ #export CXX_host="g++ -pthread"
+ #export CC="$CC $CFLAGS $CPPFLAGS $LDFLAGS"
+ #export CXX="$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS"
+ #export CFLAGS="-Os"
+ #export CXXFLAGS="-Os"
+ #unset CPPFLAGS LDFLAGS