forked from facebookarchive/fb-adb
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathstub-config.sh
executable file
·43 lines (41 loc) · 1.14 KB
/
stub-config.sh
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
38
39
40
41
42
43
#!/bin/bash
# Copyright (c) 2014, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in
# the LICENSE file in the root directory of this source tree. An
# additional grant of patent rights can be found in the PATENTS file
# in the same directory.
#
arch=$1
shift
srcdir=
declare -a cfgopts
for opt in "$@"; do
if [[ $opt = --srcdir=* ]]; then
srcdir=${opt:9}/..
cfgopts+=(--srcdir="$srcdir")
elif [[ $opt = 'CC='* ]] && ! [[ $arch = "local" ]]; then
# Stub will choose CC for cross-compile
unset CC
elif [[ $opt = '--host='* ]] && ! [[ $arch = "local" ]]; then
true
elif [[ $opt = '--build='* ]] && ! [[ $arch = "local" ]]; then
true
elif [[ $opt = '--target='* ]] && ! [[ $arch = "local" ]]; then
true
elif [[ $opt = 'host_alias='* ]] && ! [[ $arch = "local" ]]; then
true
else
cfgopts+=("$opt")
fi
done
if [[ $arch = "local" ]]; then
hostarg=STUB_LOCAL=1
else
hostarg=--host=$arch
fi
exec $srcdir/configure \
--build="$($srcdir/config.guess)" $hostarg \
BUILD_STUB=1 \
"${cfgopts[@]}"