| 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 | |
| 27 | rm -rf ${BUILD} || exit $? |
| 28 | rm -rf ${PREFIX} || exit $? |
| 29 | mkdir -p ${DOWNLOADS} || exit $? |
| 30 | mkdir -p ${BUILD} || exit $? |
| 31 | cd ${BUILD} || exit $? |
| 32 | |
| 33 | if [ ! -e $DOWNLOADS/$TAR ]; then |
| 34 | ( cd $DOWNLOADS && wget -q $SRCURL/$TAR ) |
| 35 | fi |
| 36 | |
| 37 | if [ ! -e $SRC ]; then |
| 38 | ( cd $SRCDIR && tar -xjf $DOWNLOADS/$TAR ) |
| 39 | fi |
| 40 | |
| 41 | cat <<EOF >$MOZCONFIG |
| 42 | . $SRC/browser/config/mozconfig |
| 43 | mk_add_options MOZ_OBJDIR="$BUILD" |
| 44 | ac_add_app_options browser --enable-application=browser |
| 45 | ac_add_options --disable-optimize |
| 46 | ac_add_options --disable-tests |
| 47 | ac_add_options --enable-debug |
| 48 | ac_add_options --enable-static |
| 49 | ac_add_options --prefix $PREFIX |
| 50 | ac_add_options --enable-optimize="-O1 -g -pipe" |
| 51 | EOF |
| 52 | |
| 53 | # Note: apparently Firefox 3.0 doesn't compile with gcc 4.3. |
| 54 | CC=~/gcc-4.2.4/bin/gcc CXX=~/gcc-4.2.4/bin/g++ ${SRC}/configure |
| 55 | |
| 56 | make -s -j2 || exit $? |
| 57 | # make -s install || exit $? |