2011-09-23 16:13:14 -07:00
|
|
|
#!/bin/sh
|
|
|
|
|
2011-09-23 16:47:04 -07:00
|
|
|
# This script generates rust compatible makefiles from libuv. When upgrading
|
|
|
|
# libuv, do:
|
2012-02-02 17:39:47 -08:00
|
|
|
#
|
2011-10-22 17:38:27 -07:00
|
|
|
# cd $RUST_DIR
|
2012-02-02 17:39:47 -08:00
|
|
|
# cd src/libuv
|
|
|
|
# git checkout master
|
|
|
|
# git pull
|
|
|
|
# svn co http://gyp.googlecode.com/svn/trunk build/gyp
|
2011-10-13 12:23:50 -07:00
|
|
|
# cd ../..
|
2012-02-02 17:39:47 -08:00
|
|
|
# rm -r mk/libuv
|
|
|
|
# ./src/etc/gyp-uv
|
|
|
|
#
|
|
|
|
# Note: you must not run gyp on windows. It will get the backslashes
|
|
|
|
# incorrect in its rules, and not work.
|
2011-09-23 16:47:04 -07:00
|
|
|
|
2011-09-23 16:13:14 -07:00
|
|
|
set -e
|
|
|
|
|
|
|
|
cd `dirname $0`
|
|
|
|
cd ../..
|
|
|
|
|
2012-02-02 17:39:47 -08:00
|
|
|
GYPFILE=src/libuv/uv.gyp
|
|
|
|
INCLUDES="-I src/libuv/common.gypi"
|
|
|
|
|
2011-10-13 12:23:50 -07:00
|
|
|
for ARCH in ia32 x86_64
|
|
|
|
do
|
2012-02-02 17:39:47 -08:00
|
|
|
ARGS="$GYPFILE \
|
|
|
|
$INCLUDES \
|
|
|
|
--depth . \
|
|
|
|
-Dcomponent=static_library \
|
|
|
|
-Dlibrary=static_library \
|
|
|
|
-Dtarget_arch=$ARCH"
|
2011-10-13 12:23:50 -07:00
|
|
|
|
2012-02-02 17:39:47 -08:00
|
|
|
./src/libuv/build/gyp/gyp $ARGS \
|
2011-10-13 12:23:50 -07:00
|
|
|
-f make-mac \
|
|
|
|
--generator-output mk/libuv/$ARCH/mac \
|
|
|
|
-DOS=mac
|
|
|
|
|
2012-02-02 17:39:47 -08:00
|
|
|
./src/libuv/build/gyp/gyp $ARGS \
|
2011-10-13 12:23:50 -07:00
|
|
|
-f make-linux \
|
|
|
|
--generator-output mk/libuv/$ARCH/unix \
|
|
|
|
-DOS=linux
|
|
|
|
|
2012-02-02 17:39:47 -08:00
|
|
|
./src/libuv/build/gyp/gyp $ARGS \
|
2011-10-13 12:23:50 -07:00
|
|
|
-f make-linux \
|
|
|
|
--generator-output mk/libuv/$ARCH/win \
|
|
|
|
-DOS=win
|
|
|
|
|
2011-09-23 16:13:14 -07:00
|
|
|
done
|
2011-10-13 17:11:28 -07:00
|
|
|
|
|
|
|
# On Mac, GYP hardcodes a -arch i386 into the output. Fix that.
|
2011-11-07 19:24:25 -08:00
|
|
|
sed -i \
|
2011-10-13 17:11:28 -07:00
|
|
|
-e 's/-arch i386/-arch x86_64/' \
|
2011-11-08 14:36:19 -08:00
|
|
|
mk/libuv/x86_64/mac/src/libuv/*.mk
|
2012-02-02 17:39:47 -08:00
|
|
|
|
|
|
|
MKFILES=$(find mk/libuv -name \*.mk -o -name Makefile)
|
|
|
|
|
|
|
|
# Comment out the gyp auto regeneration
|
|
|
|
perl -i -p -e 's@^(Makefile:.*)@#\1@go' $MKFILES
|
|
|
|
perl -i -p -e 's@^(Makefile:.*)@#\1@go' $MKFILES
|
|
|
|
perl -i -p -e 's@(.*regen_makefile.*)@#\1@go' $MKFILES
|