forked from adonais/iceweasel
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfx_build.sh
86 lines (81 loc) · 2.32 KB
/
fx_build.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
#! /usr/bin/bash
MYOBJ_DIR=
ICEWEASEL_TREE=`pwd -W 2>/dev/null || pwd`
FIND_FILE=".mozconfig"
export CARGO_TARGET_DIR=/tmp/cargo_target
if [ ! -f "$FIND_FILE" ]; then
[[ -f mozconfig32 ]] && cp mozconfig32 $FIND_FILE 2>/dev/null || cp mozconfig64 $FIND_FILE 2>/dev/null
fi
if [ ! -f "$FIND_FILE" ]; then
echo $FIND_FILE not exist!
exit 1;
fi
FIND_STR="ac_add_options --target=i686-pc-mingw32"
if [ "$OS" != "Windows_NT" ]; then
PATH=$PATH:~/.cargo/bin
MYOBJ_DIR="obju-linux64"
MAKE=make
PYTHON_SCRIPT=_virtualenvs/build/bin
LOCAL_WITH_VC15=1
else
if [ `grep -c "^$FIND_STR" $FIND_FILE` -ne '0' ];then
[[ -n $MY_OBJ ]] && MYOBJ_DIR=$MY_OBJ || MYOBJ_DIR="obju32-release"
else
[[ -n $MY_OBJ ]] && MYOBJ_DIR=$MY_OBJ || MYOBJ_DIR="obju64-release"
fi
MAKE=mozmake
PYTHON_SCRIPT=_virtualenvs/build/Scripts
compiler=$(which clang)
if [ -z "$compiler" ]; then
echo clang not exit
exit 1;
fi
compiler_version=$(clang -dumpversion)
if [ -z "$compiler_version" ]; then
exit 1;
fi
compiler_path=$(dirname $(dirname $compiler))
export LIB="$compiler_path/lib:$compiler_path/lib/clang/$compiler_version/lib/windows"
fi
rm -f ./configure >/dev/null 2>&1
rm -f ./configure.old >/dev/null 2>&1
rm -f ./js/src/configure.old >/dev/null 2>&1
autoconf-2.13
rm -rf "../$MYOBJ_DIR"
mkdir "../$MYOBJ_DIR" && cd "../$MYOBJ_DIR"
$ICEWEASEL_TREE/configure --enable-profile-generate=cross
$MAKE -j4
if [ "$?" != "0" ]; then
echo First compilation failed. > error.log
exit 1;
fi
$MAKE package
if [ "$?" != "0" ]; then
echo First package failed. > error.log
exit 1;
fi
if [ -n "$LOCAL_WITH_VC15" ]; then
echo LOCAL_WITH_VC15=$LOCAL_WITH_VC15
JARLOG_FILE=jarlog/en-US.log $PYTHON_SCRIPT/python $ICEWEASEL_TREE/build/pgo/profileserver.py
else
MOZ_HEADLESS=1 DISPLAY=22 JARLOG_FILE=jarlog/en-US.log $PYTHON_SCRIPT/python $ICEWEASEL_TREE/build/pgo/profileserver.py
fi
ls *.profraw >/dev/null 2>&1
if [ "$?" != "0" ]; then
echo profileserver.py failed. >> error.log
exit 1;
fi
$MAKE maybe_clobber_profiledbuild
if [ "$?" != "0" ]; then
echo make maybe_clobber_profiledbuild failed. > error.log
exit 1;
fi
$ICEWEASEL_TREE/configure --enable-profile-use=cross --enable-lto=cross
$MAKE -j4
if [ "$?" != "0" ]; then
echo Second compilation failed. >> error.log
exit 1;
fi
$MAKE package
echo Compile completed!
rm -f $FIND_FILE