-
-
Save adammw/1062306 to your computer and use it in GitHub Desktop.
Runs "configure"/"make" for Node.js, with the intent of cross-compiling Node for Windows 32 using mingw32
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
# | |
# Program : mingw32-node-configure | |
# Authors : Nathan Rajlich ([email protected]) | |
# Michael Aaron Safyan ([email protected]) | |
# Adam Malcontenti-Wilson ([email protected]) | |
# Synopsis : This program runs the "configure" script for Node.js. | |
# An install prefix of "/usr/i586-mingw32msvc" is assumed. | |
unset CPATH | |
unset C_INCLUDE_PATH | |
unset CPLUS_INCLUDE_PATH | |
unset OBJC_INCLUDE_PATH | |
unset LIBS | |
export TARGET="i586-mingw32msvc" | |
export TOOL_PREFIX="$TARGET-" | |
export SDKROOT="/usr/$TARGET" | |
if [ ! \( -d "$SDKROOT" \) ] ; then | |
echo "The mingw32 files could not be found. Folder \"$SDKROOT\" does not exist." | |
exit 1 | |
fi | |
if [ ! \( -x "./configure" \) ] ; then | |
echo "This script must be run in the folder containing the \"configure\" script." | |
exit 1 | |
fi | |
export AS="$SDKROOT/bin/as" | |
export ASCPP="$SDKROOT/bin/as" | |
export AR="$SDKROOT/bin/ar" | |
export RANLIB="$SDKROOT/bin/ranlib" | |
export CPPFLAGS="-I$SDKROOT/include" | |
export CFLAGS="--sysroot='$SDKROOT' -isystem $SDKROOT/include" | |
export CXXFLAGS="--sysroot='$SDKROOT' -isystem $SDKROOT/include" | |
export LDFLAGS="-I$SDKROOT/include -L$SDKROOT/lib" | |
export CPP="${TOOL_PREFIX}cpp" | |
export CC="${TOOL_PREFIX}gcc" | |
export CXX="${TOOL_PREFIX}-g++" | |
export LD="$SDKROOT/bin/ld" | |
export STRIP="$SDKROOT/bin/strip" | |
./configure \ | |
--target="$TARGET" \ | |
--dest-cpu="ia32" \ | |
--dest-os="win" \ | |
--without-snapshot \ | |
$@ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
# | |
# Program : mingw32-node-make | |
# Authors : Nathan Rajlich ([email protected]) | |
# Michael Aaron Safyan ([email protected]) | |
# Adam Malcontenti-Wilson ([email protected]) | |
# Synopsis : This program runs the "configure" script for Node.js. | |
# An install prefix of "/usr/i586-mingw32msvc" is assumed. | |
unset CPATH | |
unset C_INCLUDE_PATH | |
unset CPLUS_INCLUDE_PATH | |
unset OBJC_INCLUDE_PATH | |
unset LIBS | |
export TARGET="i586-mingw32msvc" | |
export TOOL_PREFIX="$TARGET-" | |
export SDKROOT="/usr/$PREFIX" | |
if [ ! \( -d "$SDKROOT" \) ] ; then | |
echo "The mingw32 files could not be found. Folder \"$SDKROOT\" does not exist." | |
exit 1 | |
fi | |
export AS="$SDKROOT/bin/as" | |
export ASCPP="$SDKROOT/bin/as" | |
export AR="$SDKROOT/bin/ar" | |
export RANLIB="$SDKROOT/bin/ranlib" | |
export CPPFLAGS="-I$SDKROOT/include" | |
export CFLAGS="--sysroot='$SDKROOT' -isystem $SDKROOT/include" | |
export CXXFLAGS="--sysroot='$SDKROOT' -isystem $SDKROOT/include" | |
export LDFLAGS="-I$SDKROOT/include -L$SDKROOT/lib" | |
export CPP="${TOOL_PREFIX}cpp" | |
export CC="${TOOL_PREFIX}gcc" | |
export CXX="${TOOL_PREFIX}-g++" | |
export LD="$SDKROOT/bin/ld" | |
export STRIP="$SDKROOT/bin/strip" | |
make \ | |
$@ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment