1 | ### |
---|
2 | #This shell must be executed on a valid firefox src dir |
---|
3 | #Shell designed by "The other side" |
---|
4 | ### |
---|
5 | |
---|
6 | APPNAME=firefoxESR |
---|
7 | BASEDIR=$PWD |
---|
8 | |
---|
9 | function run_tests() |
---|
10 | { |
---|
11 | cd $BASEDIR |
---|
12 | if [[ -f mozconfig || -f .mozconfig ]] |
---|
13 | then |
---|
14 | MOZCONFIG=1 |
---|
15 | fi |
---|
16 | |
---|
17 | if [ -d browser/branding/unofficial ] |
---|
18 | then |
---|
19 | cd browser/branding/unofficial/locales |
---|
20 | if [ -d ca ] |
---|
21 | then |
---|
22 | CA=1 |
---|
23 | fi |
---|
24 | |
---|
25 | if [ -d es-ES ] |
---|
26 | then |
---|
27 | ES=1 |
---|
28 | fi |
---|
29 | else |
---|
30 | UNOFFICIAL=1 |
---|
31 | fi |
---|
32 | cd $BASEDIR |
---|
33 | |
---|
34 | } |
---|
35 | |
---|
36 | |
---|
37 | function generate_mozconfig() |
---|
38 | { |
---|
39 | cd $BASEDIR |
---|
40 | echo "#autogenerated mozconfig for Lliurex |
---|
41 | ac_add_options --with-pthreads |
---|
42 | ac_add_options --with-ccache |
---|
43 | ac_add_options \"--enable-optimize=-O3 -msse2 -mfpmath=sse\" |
---|
44 | ac_add_options --enable-application=browser |
---|
45 | ac_add_options --with-branding=browser/branding/unofficial |
---|
46 | ## |
---|
47 | ac_add_options --enable-startup-notification |
---|
48 | ac_add_options --enable-official-branding |
---|
49 | ac_add_options --enable-strip |
---|
50 | ac_add_options --enable-js-shell |
---|
51 | ac_add_options --enable-profiling |
---|
52 | ac_add_options --enable-default-toolkit=cairo-gtk3 |
---|
53 | ## |
---|
54 | ac_add_options --disable-debug-symbols |
---|
55 | ac_add_options --disable-tests |
---|
56 | ac_add_options --disable-ipdl-tests |
---|
57 | ac_add_options --disable-maintenance-service |
---|
58 | ac_add_options --disable-updater |
---|
59 | ac_add_options --disable-tests |
---|
60 | ac_add_options --disable-debug |
---|
61 | ac_add_options --disable-crashreporter |
---|
62 | ac_add_options --disable-calendar |
---|
63 | export MOZ_APP_NAME=${APPNAME} |
---|
64 | export MOZ_APP_DISPLAYNAME=${APPNAME} |
---|
65 | |
---|
66 | mk_add_options MOZ_CO_PROJECT=browser |
---|
67 | #mk_add_options MOZILLA_OFFICIAL=1 |
---|
68 | mk_add_options MOZ_MAKE_FLAGS=-j5 |
---|
69 | mk_add_options AUTOCLOBBER=1 |
---|
70 | mk_add_options MOZ_APP_NAME=${APPNAME} |
---|
71 | mk_add_options MOZ_APP_DISPLAYNAME=${APPNAME} |
---|
72 | " > mozconfig |
---|
73 | if [[ $BUILD_686 == 1 ]] |
---|
74 | then |
---|
75 | echo "##i686 build### |
---|
76 | export PKG_CONFIG_PATH="/var/chroot/linux32/usr/lib/i386-linux-gnu/pkgconfig:/var/chroot/linux32/usr/share/pkgconfig" |
---|
77 | export MOZ_LINUX_32_SSE2_STARTUP_ERROR=1 |
---|
78 | CFLAGS=\"$CFLAGS -msse -msse2 -mfpmath=sse\" |
---|
79 | CXXFLAGS=\"$CXXFLAGS -msse -msse2 -mfpmath=sse\" |
---|
80 | #LDFLAGS='-L/var/chroot/linux32/usr/lib/i386-linux-gnu/ -L/var/chroot/linux32/lib/i386-linux-gnu/' |
---|
81 | if test `uname -m` = \"x86_64\"; then |
---|
82 | CFLAGS=\"$CFLAGS -m32 -march=pentium-m\" |
---|
83 | CXXFLAGS=\"$CXXFLAGS -m32 -march=pentium-m\" |
---|
84 | ac_add_options --target=i686-pc-linux |
---|
85 | ac_add_options --host=i686-pc-linux |
---|
86 | ac_add_options --x-libraries=/usr/lib |
---|
87 | fi |
---|
88 | " >> mozconfig |
---|
89 | fi |
---|
90 | } |
---|
91 | |
---|
92 | function modify_confvars() |
---|
93 | { |
---|
94 | cd ${BASEDIR}/browser |
---|
95 | sed -i "s/MOZ_APP_BASENAME=.*/MOZ_APP_BASENAME=$APPNAME/" confvars.sh |
---|
96 | cd $BASEDIR |
---|
97 | } |
---|
98 | |
---|
99 | function set_branding() |
---|
100 | { |
---|
101 | cd ${BASEDIR}/browser/branding/unofficial |
---|
102 | cp ../aurora/*png . |
---|
103 | cp ../aurora/*bmp . |
---|
104 | cp ../aurora/*ico . |
---|
105 | echo "# This Source Code Form is subject to the terms of the Mozilla Public |
---|
106 | # License, v. 2.0. If a copy of the MPL was not distributed with this |
---|
107 | # file, You can obtain one at http://mozilla.org/MPL/2.0/. |
---|
108 | MOZ_APP_BASENAME=\"${APPNAME}\" |
---|
109 | MOZ_APP_VENDOR=\"Mozilla\" |
---|
110 | MOZ_APP_PROFILE=mozilla/${APPNAME,,} |
---|
111 | MOZ_APP_NAME=firefoxESR" > configure.sh |
---|
112 | cd locales/en-US |
---|
113 | sed -i "s/Nightly/${APPNAME}/" brand.* |
---|
114 | cd .. |
---|
115 | rm -fr ca es-ES |
---|
116 | cp en-US ca -R |
---|
117 | cp en-US es-ES -R |
---|
118 | cd $BASEDIR |
---|
119 | } |
---|
120 | |
---|
121 | function help() |
---|
122 | { |
---|
123 | printf "Usage: $0 [OPTION]\n\n" |
---|
124 | echo " amd64" |
---|
125 | printf "\tGenerates amd64 build\n" |
---|
126 | echo " i686" |
---|
127 | printf "\tGenerates i686 build\n" |
---|
128 | exit 0 |
---|
129 | } |
---|
130 | |
---|
131 | #### MAIN #### |
---|
132 | |
---|
133 | [ $# -eq 0 ] && help |
---|
134 | |
---|
135 | if [[ $1 == "i686" ]] |
---|
136 | then |
---|
137 | BUILD_686=1 |
---|
138 | elif [[ $1 != "amd64" ]] |
---|
139 | then |
---|
140 | help |
---|
141 | fi |
---|
142 | |
---|
143 | run_tests |
---|
144 | if [ $MOZCONFIG$CA$ES$UNOFFICIAL ] |
---|
145 | then |
---|
146 | echo "Seems that this sources are modified." |
---|
147 | echo "Report:" |
---|
148 | echo "A mozconfig or .mozconfig is present:" $([ -z $MOZCONFIG ] && echo False || echo True) |
---|
149 | echo "There's a ca dir in browser/branding/unofficial/locales:" $([ -z $CA ] && echo False || echo True) |
---|
150 | echo "There's an es-ES dir in browser/branding/unofficial/locales:" $([ -z $ES ] && echo False || echo True) |
---|
151 | echo "There's not an unofficial dir:" $([ -z $UNOFFICIAL ] && echo False || echo True) |
---|
152 | |
---|
153 | exit 1 |
---|
154 | fi |
---|
155 | |
---|
156 | generate_mozconfig |
---|
157 | modify_confvars |
---|
158 | set_branding |
---|
159 | echo "Firefox sources are now configured" |
---|
160 | echo "You could start the build by typing" |
---|
161 | echo "./mach build &6 ./mach-package" |
---|
162 | arch='x86_64' |
---|
163 | if [[ $1 == 'i686' ]] |
---|
164 | then |
---|
165 | arch='i686' |
---|
166 | fi |
---|
167 | echo "When finished you must copy the content of \$BUILDDIR/obj-${arch}-pc-linux-gnu/dist/firefoxESR to the firefox-esr-${arch} folder of the svn" |
---|