Compiling nodejs

cd ~/compile
#wget http://nodejs.org/dist/v0.10.30/node-v0.10.30.tar.gz
rm -r ~/compile/node-v0.10.30
tar xvzf node-v0.10.30.tar.gz
cd ~/compile/node-v0.10.30
find . -type f -exec sed -i s/"\/usr\/bin\/bash"/"\/ffp\/bin\/bash"/ {} \;
find . -type f -exec sed -i s/"\/usr\/bin\/sh"/"\/ffp\/bin\/sh"/ {} \;
find . -type f -exec sed -i s/"\/usr\/bin\/env"/"\/ffp\/bin\/env"/ {} \;
find . -type f -exec sed -i s/"\/bin\/bash"/"\/ffp\/bin\/bash"/ {} \;
find . -type f -exec sed -i s/"\/bin\/sh"/"\/ffp\/bin\/sh"/ {} \;
find . -type f -exec sed -i s/"\/bin\/env"/"\/ffp\/bin\/env"/ {} \;
find . -type f -exec sed -i s/"\/ffp\/ffp\/"/"\/ffp\/"/ {} \;
#cp -r ~/compile/node-v0.10.30 ~/compile/node-v0.10.30-paths
#ERROR1:
    ../deps/v8/src/arm/macro-assembler-arm.cc:65:3: error: #error "For thumb inter-working we require an architecture which supports blx"
    make[1]: *** [/usr/local/zy-pkgs/ffproot/ffp/home/root/compile/node-v0.10.30/out/Release/obj.target/v8_base/deps/v8/src/arm/macro-assembler-arm.o] Error 1
    make[1]: Leaving directory `/usr/local/zy-pkgs/ffproot/ffp/home/root/compile/node-v0.10.30/out'
    make: *** [node] Error 2
#SOLUTION1:
    /ffp/home/root/compile/node-v0.10.30/deps/v8/src/arm/macro-assembler-arm.cc
    #if defined(__thumb__) && !defined(USE_THUMB_INTERWORK)
    #error "flag -mthumb-interwork missing"
    #endif

    // ADD THESE THREE LINES
    #if !defined(CAN_USE_THUMB_INSTRUCTIONS)
    # define CAN_USE_THUMB_INSTRUCTIONS 1
    #endif

    // We do not support thumb inter-working with an arm architecture not supporting
    // the blx instruction (below v5t). If you know what CPU you are compiling for
    // you can use -march=armv7 or similar.
    #if defined(USE_THUMB_INTERWORK) && !defined(CAN_USE_THUMB_INSTRUCTIONS)
    # error "For thumb inter-working we require an architecture which supports blx"
    #endif
export CFLAGS="-march=armv5te -mtune=xscale -mfloat-abi=soft -mfpu=vfp -mabi=aapcs-linux -mthumb -O2 -Wall"
export LDFLAGS="-L/ffp/lib -lintl"
export CPPFLAGS="-I/ffp/include -I/ffp/include/readline"
export CXXFLAGS="-I/ffp/include -I/ffp/include/readline"
export LD_LIBRARY_PATH=/ffp/lib:/ffp/opt/serf-1.3.6/lib:/ffp/lib/python2.7/lib-dynload:/usr/local/zy-pkgs/lib
./configure --help > configure.help.txt
#./configure --prefix=/ffp/opt/nodejs --shared-openssl --shared-openssl-includes=/ffp/include/openssl --shared-openssl-libname=/ffp/lib/libcrypto.so --shared-zlib --shared-zlib-includes=/ffp/include --shared-zlib-libname=/ffp/lib/libz.so --without-perfctr --dest-cpu=arm --dest-os=linux --with-arm-float-abi=soft
#./configure --prefix=/ffp/opt/nodejs --shared-openssl --shared-zlib --without-perfctr --dest-cpu=arm --dest-os=linux --with-arm-float-abi=soft
./configure --prefix=/ffp/opt/nodejs --shared-openssl --shared-openssl-includes=/ffp/include --shared-openssl-libpath=/ffp/lib --shared-zlib --shared-zlib-includes=/ffp/include --shared-zlib-libpath=/ffp/lib --without-perfctr --dest-cpu=arm --dest-os=linux --with-arm-float-abi=soft
nohup make &
tail -f nohup.out
nohup make test &
rm -r /ffp/opt/nodejs
nohup make install &

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.