2013-05-09 01:50:20 +01:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
# This script is used to cross-compile binaries for
|
|
|
|
# platforms other than the current one
|
|
|
|
|
|
|
|
# Usage: $0 <platformname> <configure options>
|
|
|
|
# <platformname> is arbitrary, it is the name
|
|
|
|
# of the directory which will be created to contain
|
|
|
|
# the output binaries.
|
|
|
|
|
|
|
|
# e.g. $0 win32 --host=i686-w64-mingw32
|
|
|
|
|
|
|
|
set -e
|
2013-05-11 14:57:58 +01:00
|
|
|
cd `dirname "$0"`/../build
|
2013-05-09 01:50:20 +01:00
|
|
|
|
2014-06-04 18:15:44 -05:00
|
|
|
jobs=-j4
|
|
|
|
case "X$1" in
|
|
|
|
X-j*) jobs=$1; shift;;
|
|
|
|
esac
|
|
|
|
|
2013-05-09 01:50:20 +01:00
|
|
|
plat="$1"
|
|
|
|
[ -z "$plat" ] && exit 1
|
|
|
|
shift
|
|
|
|
|
2014-06-18 16:29:37 -05:00
|
|
|
case "$plat" in
|
|
|
|
*/*) echo "platform name must not be a path"; exit 1;;
|
|
|
|
*..*) echo "platform name must not be a path"; exit 1;;
|
|
|
|
*) plat=$PWD/$plat;;
|
|
|
|
esac
|
|
|
|
|
2013-05-09 01:50:20 +01:00
|
|
|
[ -d "$plat" ] || mkdir "$plat"
|
|
|
|
rm -rf "$plat/tmp"
|
|
|
|
mkdir "$plat/tmp"
|
|
|
|
cd "$plat/tmp"
|
2014-06-18 16:29:37 -05:00
|
|
|
../../../configure "$@"
|
|
|
|
make "$jobs" DESTDIR=$plat install
|
|
|
|
set -x
|
|
|
|
for jq in `find . -type f \( -name jq -o -name jq.exe \) -print`; do
|
|
|
|
cp "$jq" ..
|
|
|
|
done
|
2014-06-04 18:15:44 -05:00
|
|
|
rm -rf tmp
|
|
|
|
|