Skip to content
Myr

crosscompile

This file

Path

scripts/crosscompile

43 lines · 854 bytes

Last changed by

Not known.

History of this file

Take it

1#!/bin/sh23# This script is used to cross-compile binaries for4# platforms other than the current one56# Usage: $0 <platformname> <configure options>7# <platformname> is arbitrary, it is the name8# of the directory which will be created to contain9# the output binaries.1011# e.g. $0 win32 --host=i686-w64-mingw321213set -e14cd `dirname "$0"`/../build1516jobs=-j417case "X$1" in18X-j*) jobs=$1; shift;;19esac2021plat="$1"22[ -z "$plat" ] && exit 123shift2425case "$plat" in26*/*) echo "platform name must not be a path"; exit 1;;27*..*) echo "platform name must not be a path"; exit 1;;28*) plat=$PWD/$plat;;29esac3031[ -d "$plat" ] || mkdir "$plat"32rm -rf "$plat/tmp"33mkdir "$plat/tmp"34cd "$plat/tmp"35../../../configure "$@"36make "$jobs" DESTDIR=$plat install37set -x38for jq in `find . -type f \( -name jq -o -name jq.exe \) -print`; do39    cp "$jq" ..40done41cd ..42rm -rf tmp43