Home | History | Annotate | Download | only in scripts
      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 if [ ! -e /usr/include/valgrind/valgrind.h ]; then
     28   echo "Please install the valgrind-devel package first."
     29   exit 1
     30 fi
     31 
     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
     53 ac_add_options --enable-optimize="-O1 -g -pipe"
     54 ac_add_options --enable-static
     55 ac_add_options --prefix $PREFIX
     56 ac_add_options --with-valgrind
     57 EOF
     58 
     59 ${SRC}/configure
     60 
     61 make -s -j2     || exit $?
     62 # make -s install || exit $?
     63