rust/src/etc/gyp-uv

57 lines
1.4 KiB
Plaintext
Raw Normal View History

#!/bin/sh
# This script generates rust compatible makefiles from libuv. When upgrading
# libuv, do:
# cd $RUST_DIR
# rm -r mk/libuv
# 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
# mkdir -p libuv/build
# svn co http://gyp.googlecode.com/svn/trunk libuv/build/gyp
# cd ../..
# ./src/etc/gyp_uv
set -e
cd `dirname $0`
cd ../..
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 \
-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 \
-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 \
-f make-linux \
--generator-output mk/libuv/$ARCH/win \
-DOS=win
# Comment out the gyp auto regeneration
for os in mac unix win; do
sed -i \
-e 's/^\(Makefile: $(srcdir)\/src\/rt\/libuv\/uv\.gyp\)/#\1/' \
mk/libuv/$ARCH/$os/Makefile
sed -i \
-e 's/^\( $(call do_cmd,regen_makefile)\)/#\1/' \
mk/libuv/$ARCH/$os/Makefile
done
done
2011-10-13 17:11:28 -07:00
# On Mac, GYP hardcodes a -arch i386 into the output. Fix that.
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