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