blob: 8eb2138793837145680d4b7bbb77910c981a41bf [file] [log] [blame]
bart6dab0772008-06-28 10:00:37 +00001#!/bin/bash
2
3# See also http://developer.mozilla.org/en/docs/Build_Documentation
4SRCURL="ftp://ftp.mozilla.org/pub/mozilla.org/firefox/releases/3.0/source"
5
6SRCDIR="$HOME/software"
7SRC="$SRCDIR/mozilla"
8DOWNLOADS="$SRCDIR/downloads"
9BUILD="${SRC}-build"
10TAR="firefox-3.0-source.tar.bz2"
11PREFIX="$HOME/firefox3"
12MOZCONFIG="$BUILD/mozconfig-firefox"
13export MOZCONFIG
14export LC_ALL=C
15export MAKEFLAGS="-j$(($(grep -c '^processor' /proc/cpuinfo) + 1))"
16
17if [ ! -e /usr/include/dbus-1.0/dbus/dbus-glib.h ]; then
18 echo "Please install the dbus-1-glib-devel package first."
19 exit 1
20fi
21
22if [ ! -e /usr/include/libIDL-2.0/libIDL/IDL.h ]; then
23 echo "Please install the libidl-devel package first."
24 exit 1
25fi
26
27rm -rf ${BUILD} || exit $?
28rm -rf ${PREFIX} || exit $?
29mkdir -p ${DOWNLOADS} || exit $?
30mkdir -p ${BUILD} || exit $?
31cd ${BUILD} || exit $?
32
33if [ ! -e $DOWNLOADS/$TAR ]; then
34 ( cd $DOWNLOADS && wget -q $SRCURL/$TAR )
35fi
36
37if [ ! -e $SRC ]; then
38 ( cd $SRCDIR && tar -xjf $DOWNLOADS/$TAR )
39fi
40
41cat <<EOF >$MOZCONFIG
42. $SRC/browser/config/mozconfig
43mk_add_options MOZ_OBJDIR="$BUILD"
44ac_add_app_options browser --enable-application=browser
45ac_add_options --disable-optimize
46ac_add_options --disable-tests
47ac_add_options --enable-debug
48ac_add_options --enable-static
49ac_add_options --prefix $PREFIX
50ac_add_options --enable-optimize="-O1 -g -pipe"
51EOF
52
53# Note: apparently Firefox 3.0 doesn't compile with gcc 4.3.
54CC=~/gcc-4.2.4/bin/gcc CXX=~/gcc-4.2.4/bin/g++ ${SRC}/configure
55
56make -s -j2 || exit $?
57# make -s install || exit $?