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:
|
2011-10-22 17:38:27 -07:00
|
|
|
# cd $RUST_DIR
|
|
|
|
# rm -r mk/libuv
|
2011-09-23 16:47:04 -07:00
|
|
|
# cd $LIBUV_DIR
|
|
|
|
# git archive --prefix libuv/ $REVISION > libuv.tar.gz
|
|
|
|
# cd $RUST_DIR/src/rt
|
|
|
|
# rm -r libuv
|
|
|
|
# tar -xvf $LIBUV_DIR/libuv.tar.gz
|
2011-10-13 12:23:50 -07:00
|
|
|
# mkdir -p libuv/build
|
|
|
|
# svn co http://gyp.googlecode.com/svn/trunk libuv/build/gyp
|
|
|
|
# cd ../..
|
|
|
|
# ./src/etc/gyp_uv
|
2011-09-23 16:47:04 -07:00
|
|
|
|
2011-09-23 16:13:14 -07:00
|
|
|
set -e
|
|
|
|
|
|
|
|
cd `dirname $0`
|
|
|
|
cd ../..
|
|
|
|
|
2011-10-13 12:23:50 -07:00
|
|
|
for ARCH in ia32 x86_64
|
|
|
|
do
|
|
|
|
args="--depth . -Dlibrary=static_library -Dtarget_arch=$ARCH"
|
|
|
|
|
2011-11-08 14:36:19 -08:00
|
|
|
./src/libuv/build/gyp/gyp src/libuv/uv.gyp $args \
|
2011-10-13 12:23:50 -07:00
|
|
|
-f make-mac \
|
|
|
|
--generator-output mk/libuv/$ARCH/mac \
|
|
|
|
-DOS=mac
|
|
|
|
|
2011-11-08 14:36:19 -08:00
|
|
|
./src/libuv/build/gyp/gyp src/libuv/uv.gyp $args \
|
2011-10-13 12:23:50 -07:00
|
|
|
-f make-linux \
|
|
|
|
--generator-output mk/libuv/$ARCH/unix \
|
|
|
|
-DOS=linux
|
|
|
|
|
2011-11-08 14:36:19 -08:00
|
|
|
./src/libuv/build/gyp/gyp src/libuv/uv.gyp $args \
|
2011-10-13 12:23:50 -07:00
|
|
|
-f make-linux \
|
|
|
|
--generator-output mk/libuv/$ARCH/win \
|
|
|
|
-DOS=win
|
|
|
|
|
|
|
|
# Comment out the gyp auto regeneration
|
|
|
|
for os in mac unix win; do
|
2011-11-07 19:24:25 -08:00
|
|
|
sed -i \
|
2011-10-13 12:23:50 -07:00
|
|
|
-e 's/^\(Makefile: $(srcdir)\/src\/rt\/libuv\/uv\.gyp\)/#\1/' \
|
|
|
|
mk/libuv/$ARCH/$os/Makefile
|
|
|
|
|
2011-11-07 19:24:25 -08:00
|
|
|
sed -i \
|
2011-10-13 12:23:50 -07:00
|
|
|
-e 's/^\( $(call do_cmd,regen_makefile)\)/#\1/' \
|
|
|
|
mk/libuv/$ARCH/$os/Makefile
|
|
|
|
done
|
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
|