File: crosscompile

package info (click to toggle)
jq 1.4-2.1%2Bdeb8u1
  • links: PTS, VCS
  • area: main
  • in suites: jessie
  • size: 1,248 kB
  • ctags: 1,252
  • sloc: ansic: 9,375; yacc: 588; lex: 175; makefile: 95; sh: 56; python: 21
file content (37 lines) | stat: -rwxr-xr-x 688 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/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
cd `dirname "$0"`/../build

jobs=-j4
case "X$1" in
X-j*) jobs=$1; shift;;
esac

plat="$1"
[ -z "$plat" ] && exit 1
shift

[ -d "$plat" ] || mkdir "$plat"
rm -rf "$plat/tmp"
mkdir "$plat/tmp"
cd "$plat/tmp"
mkdir install_other
../../../configure \
    --prefix="`pwd`/install_other" \
    --bindir="`pwd`/.." \
    "$@"
make "$jobs" install-binaries
cd ..
rm -rf tmp