blob: 84d57784005dde8764bfa03956689214bea41736 [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
bart7b7f3d42009-06-20 10:56:45 +000027if [ ! -e /usr/include/valgrind/valgrind.h ]; then
28 echo "Please install the valgrind-devel package first."
29 exit 1
30fi
31
bart6dab0772008-06-28 10:00:37 +000032rm -rf ${BUILD} || exit $?
33rm -rf ${PREFIX} || exit $?
34mkdir -p ${DOWNLOADS} || exit $?
35mkdir -p ${BUILD} || exit $?
36cd ${BUILD} || exit $?
37
38if [ ! -e $DOWNLOADS/$TAR ]; then
39 ( cd $DOWNLOADS && wget -q $SRCURL/$TAR )
40fi
41
42if [ ! -e $SRC ]; then
43 ( cd $SRCDIR && tar -xjf $DOWNLOADS/$TAR )
44fi
45
46cat <<EOF >$MOZCONFIG
47. $SRC/browser/config/mozconfig
48mk_add_options MOZ_OBJDIR="$BUILD"
49ac_add_app_options browser --enable-application=browser
50ac_add_options --disable-optimize
51ac_add_options --disable-tests
52ac_add_options --enable-debug
bart7b7f3d42009-06-20 10:56:45 +000053ac_add_options --enable-optimize="-O1 -g -pipe"
bart6dab0772008-06-28 10:00:37 +000054ac_add_options --enable-static
55ac_add_options --prefix $PREFIX
bart7b7f3d42009-06-20 10:56:45 +000056ac_add_options --with-valgrind
bart6dab0772008-06-28 10:00:37 +000057EOF
58
bart7b7f3d42009-06-20 10:56:45 +000059${SRC}/configure
bart6dab0772008-06-28 10:00:37 +000060
61make -s -j2 || exit $?
62# make -s install || exit $?