diff options
Diffstat (limited to 'build.sh')
-rwxr-xr-x | build.sh | 25 |
1 files changed, 19 insertions, 6 deletions
@@ -7,15 +7,25 @@ PREFIX="`pwd`/_build" [ -z "$MAKE" ] && MAKE="make -j4" HOSTFLAG= -[ -n "$HOST" ] && HOSTFLAG="--host=$HOST" - -[ -z "$CC" ] && CC=gcc +if [ -n "$HOST" ]; then + HOSTFLAG="--host=$HOST" + [ -z "$CC" ] && export CC=$HOST-gcc + [ -z "$AR" ] && export AR=$HOST-ar + [ -z "$RANLIB" ] && export RANLIB=$HOST-ranlib + [ -z "$LD" ] && export LD=$HOST-ld + [ -z "$STRIP" ] && export STRIP=$HOST-strip +else + [ -z "$CC" ] && CC=gcc + [ -z "$STRIP"] && STRIP=strip +fi build_zlib() { cd zlib if $CC -dumpmachine | grep -q 'w64-mingw32'; then - $MAKE -f win32/Makefile.gcc + TOOLPREFIX= + [ -n "$HOST" ] && TOOLPREFIX="$HOST-" + $MAKE -f win32/Makefile.gcc PREFIX="$TOOLPREFIX" $MAKE -f win32/Makefile.gcc install\ INCLUDE_PATH="$PREFIX/include" LIBRARY_PATH="$PREFIX/lib" BINARY_PATH="$PREFIX/bin" else @@ -78,5 +88,8 @@ build_openssl build_libevent build_tor -cp "$PREFIX/bin/tor" tor-static -strip tor-static{,.exe} +EXT= +[ -e "$PREFIX/bin/tor.exe" ] && EXT=.exe + +cp "$PREFIX/bin/tor$EXT" tor-static$EXT +$STRIP tor-static$EXT |