# Psion's Firefox: 1.0, the version firefox_1.0.oe names, with all ten of # their patches and their own mozconfig -- a trimmed embedded build with no # mailnews, no composer, no MathML, no accessibility, no tests, and a minimal # set of protocol handlers and image decoders. The tree is already patched and # .mozconfig is already in place; this job does their do_compile and do_install. # # VersatilePB caps out at 256 MB of RAM and some of Mozilla's C++ files want # more than that to compile, so put swap on the disk first. set -x rm -rf /build/out; mkdir -p /build/out/bin if [ ! -f /swapfile ]; then dd if=/dev/zero of=/swapfile bs=1M count=1024 2>/dev/null mkswap /swapfile fi swapon /swapfile 2>/dev/null; free 2>/dev/null | head -4 export PKG_CONFIG_PATH=/usr/lib/pkgconfig export LC_ALL=C export HOST_LIBIDL_CONFIG=libIDL-config-2 # Build with gcc 3.4, not the chroot's default gcc 4.1. This is not a # preference, it is what the device needs: the card carries libstdc++.so.6.0.3, # which is gcc 3.4's C++ runtime, so a gcc 4 build would want a newer one than # the image has. It also removes a whole class of failure -- a 2004 Mozilla # tree trips gcc 4's stricter C++ repeatedly (a trailing `;` on an extern "C" # block, an extern array of an incomplete type in NSS), and each one costs a # build round. gcc 3.4 accepts all of it, as Psion's own toolchain did. # Exporting these is not enough on its own: NSS ships its own build system and # ignores them, so security/nss was still being compiled by plain `gcc` while # everything else honoured the export. /usr/bin/{gcc,g++,cpp} in the chroot now # point at the 3.4 versions (the 4.1 ones are kept as *.gcc4-orig), which is # what actually makes this stick. export CC=gcc-3.4 export CXX=g++-3.4 export HOST_CC=gcc-3.4 export HOST_CXX=g++-3.4 export MOZILLA_OFFICIAL=1 cd /build/mozilla # gcc 3.4 already rejects the trailing semicolon closing an `extern "C" { ... };` # block -- that leniency ended before 4.x, so switching compiler did not remove # the need for this. Seven files in the tree do it; these two are inside what # this mozconfig builds. By line number on purpose: a blanket s/^};$/}/ would # eat the legitimate `};` closing every struct and class in the file. sed -i '139s/^};$/}/' xpcom/reflect/xptcall/src/md/unix/xptcinvoke_arm.cpp sed -i '241s/^};$/}/' xpcom/ds/nsTimelineService.cpp # their do_compile make -f client.mk build_all > /build/out/build.log 2>&1 echo "RC_build=$?" tail -30 /build/out/build.log grep -cE 'Error [0-9]|error:' /build/out/build.log if [ -x dist/bin/firefox-bin ] || [ -x dist/bin/firefox ]; then echo GOT_firefox ls -l dist/bin/firefox* 2>/dev/null make DESTDIR=/build/out/inst destdir=/build/out/inst install > /build/out/install.log 2>&1 echo "RC_install=$?" find /build/out/inst -type f | sed 's|/build/out/inst||' | sort > /build/out/filelist.txt wc -l < /build/out/filelist.txt du -sh /build/out/inst 2>/dev/null else echo MISSING_firefox tail -40 /build/out/build.log fi