ch0wned – Building your own Firefox on EL4 for X86_64 in your homedir

Written by max on 2010-04-06

ch0wned. adj. This is the state when you are a Linux user and don't have root access.

Intro

So you want Firefox 3.new on your EL4 workstation and don’t have root access? Worse off it’s an x86_64 machine? This is not for the faint of heart, and you will run into some snags, but hopefully with my help you can make it work.

This guide assumes you’re leaving off from my previous post : http://warped.org/blog/2009/03/04/chown3d-part-2-gtk-and-glib-in-your-own-home-directory/ where you’ve setup a script called config_gapp.

Prerequisites

Building

  1. SQL Lite

    Make sure you get the “amalgamation” package.

    config_gapp
    make
    make install

  2. NSPR

    Cheers to the Linux from Scratch gurus. See above link.
    Apply this patch using “patch -p1 < file.patch" . You might have to change 1 to another number. I did this on the above newer version of NSPR/NSS w/out a problem.

    Submitted By: DJ Lucas (dj at linuxfromscratch dot org)
    Date: 2009-08-28
    Initial Package Version: 4.8
    Upstream Status: not applicable
    Origin: self
    Description: Adds pkg-config file for nspr.
     
    diff -Naur nspr-4.8-orig/mozilla/nsprpub/config/config.mk nspr-4.8/mozilla/nsprpub/config/config.mk
    --- nspr-4.8-orig/mozilla/nsprpub/config/config.mk	2005-04-29 16:02:53.000000000 -0500
    +++ nspr-4.8/mozilla/nsprpub/config/config.mk	2009-08-28 15:42:46.000000000 -0500
    @@ -162,3 +162,4 @@
     RELEASE_INCLUDE_DIR = $(RELEASE_DIR)/$(BUILD_NUMBER)/$(OBJDIR_NAME)/include
     RELEASE_BIN_DIR = $(RELEASE_DIR)/$(BUILD_NUMBER)/$(OBJDIR_NAME)/bin
     RELEASE_LIB_DIR = $(RELEASE_DIR)/$(BUILD_NUMBER)/$(OBJDIR_NAME)/lib
    +RELEASE_PC_DIR = $(RELEASE_LIB_DIR)/pkgconfig
    diff -Naur nspr-4.8-orig/mozilla/nsprpub/config/Makefile.in nspr-4.8/mozilla/nsprpub/config/Makefile.in
    --- nspr-4.8-orig/mozilla/nsprpub/config/Makefile.in	2009-03-03 16:04:23.000000000 -0600
    +++ nspr-4.8/mozilla/nsprpub/config/Makefile.in	2009-08-28 15:42:46.000000000 -0500
    @@ -52,9 +52,10 @@
     
     # autoconf.mk must be deleted last (from the top-level directory)
     # because it is included by every makefile.
    -DIST_GARBAGE	= nsprincl.mk nsprincl.sh nspr-config
    +DIST_GARBAGE	= nsprincl.mk nsprincl.sh nspr-config nspr.pc
     
     RELEASE_BINS	= nspr-config
    +RELEASE_PC	= nspr.pc
     
     include $(topsrcdir)/config/config.mk
     
    diff -Naur nspr-4.8-orig/mozilla/nsprpub/config/nspr.pc.in nspr-4.8/mozilla/nsprpub/config/nspr.pc.in
    --- nspr-4.8-orig/mozilla/nsprpub/config/nspr.pc.in	1969-12-31 18:00:00.000000000 -0600
    +++ nspr-4.8/mozilla/nsprpub/config/nspr.pc.in	2009-08-28 15:43:13.000000000 -0500
    @@ -0,0 +1,11 @@
    +prefix=@prefix@
    +exec_prefix=@exec_prefix@
    +libdir=@libdir@
    +includedir=@includedir@
    +
    +Name: NSPR
    +Description: The Netscape Portable Runtime
    +Version: @MOD_MAJOR_VERSION@.@MOD_MINOR_VERSION@.@MOD_PATCH_VERSION@
    +Libs: -L${libdir} -lplds@MOD_MAJOR_VERSION@ -lplc@MOD_MAJOR_VERSION@ -lnspr@MOD_MAJOR_VERSION@ -lpthread 
    +Cflags: -I${includedir}
    +
    diff -Naur nspr-4.8-orig/mozilla/nsprpub/config/rules.mk nspr-4.8/mozilla/nsprpub/config/rules.mk
    --- nspr-4.8-orig/mozilla/nsprpub/config/rules.mk	2009-05-01 18:08:01.000000000 -0500
    +++ nspr-4.8/mozilla/nsprpub/config/rules.mk	2009-08-28 15:42:46.000000000 -0500
    @@ -211,7 +211,7 @@
     	rm -rf $(wildcard *.OBJ *.OBJD) dist $(ALL_TRASH) $(DIST_GARBAGE)
     	+$(LOOP_OVER_DIRS)
     
    -install:: $(RELEASE_BINS) $(RELEASE_HEADERS) $(RELEASE_LIBS)
    +install:: $(RELEASE_BINS) $(RELEASE_HEADERS) $(RELEASE_LIBS) $(RELEASE_PC)
     ifdef RELEASE_BINS
     	$(NSINSTALL) -t -m 0755 $(RELEASE_BINS) $(DESTDIR)$(bindir)
     endif
    @@ -221,6 +221,9 @@
     ifdef RELEASE_LIBS
     	$(NSINSTALL) -t -m 0755 $(RELEASE_LIBS) $(DESTDIR)$(libdir)/$(lib_subdir)
     endif
    +ifdef RELEASE_PC
    +	$(NSINSTALL) -t -m 0644 $(RELEASE_PC) $(DESTDIR)$(libdir)/pkgconfig/
    +endif
     	+$(LOOP_OVER_DIRS)
     
     release:: export
    @@ -272,6 +275,23 @@
     	fi
     	cp $(RELEASE_HEADERS) $(RELEASE_HEADERS_DEST)
     endif
    +ifdef RELEASE_PC
    +	@echo "Copying pkg-config files to release directory"
    +	@if test -z "$(BUILD_NUMBER)"; then \
    +		echo "BUILD_NUMBER must be defined"; \
    +		false; \
    +	else \
    +		true; \
    +	fi
    +	@if test ! -d $(RELEASE_PC_DEST); then \
    +		rm -rf $(RELEASE_PC_DEST); \
    +		$(NSINSTALL) -D $(RELEASE_PC_DEST);\
    +	else \
    +		true; \
    +	fi
    +	cp $(RELEASE_PC) $(RELEASE_PC_DEST)
    +endif
    +
     	+$(LOOP_OVER_DIRS)
     
     alltags:
    diff -Naur nspr-4.8-orig/mozilla/nsprpub/configure nspr-4.8/mozilla/nsprpub/configure
    --- nspr-4.8-orig/mozilla/nsprpub/configure	2009-05-08 08:12:31.000000000 -0500
    +++ nspr-4.8/mozilla/nsprpub/configure	2009-08-28 15:42:46.000000000 -0500
    @@ -6037,6 +6037,7 @@
     config/nsprincl.mk
     config/nsprincl.sh
     config/nspr-config
    +config/nspr.pc
     lib/Makefile 
     lib/ds/Makefile 
     lib/libc/Makefile 
    diff -Naur nspr-4.8-orig/mozilla/nsprpub/configure.in nspr-4.8/mozilla/nsprpub/configure.in
    --- nspr-4.8-orig/mozilla/nsprpub/configure.in	2009-05-01 18:08:00.000000000 -0500
    +++ nspr-4.8/mozilla/nsprpub/configure.in	2009-08-28 15:42:46.000000000 -0500
    @@ -2871,6 +2871,7 @@
     config/nsprincl.mk
     config/nsprincl.sh
     config/nspr-config
    +config/nspr.pc
     lib/Makefile 
     lib/ds/Makefile 
     lib/libc/Makefile

    Once patched, run this script to configure and build NSPR

    #!/bin/sh 
     
    cd mozilla/nsprpub
    config_gapp \
                --with-mozilla \
                --with-pthreads \
                --enable-64bit \
                --disable-debug \
                --enable-optimize="-O2"
     
    run_gapp make -j4
     
    run_gapp make install
    cp -v -f -LR dist/include/nspr $HOME/include
  3. NSS

    Again cheers to DJ for this gem. Apply it.

    Submitted By: DJ Lucas (dj at linuxfromscratch dot org)
    Date: 2009-09-05
    Initial Package Version: 3.12.4
    Upstream Status: not applicable
    Origin: self
    Description: Adds auto-generated nss.pc and nss-config script, and allows
                 building without nspr in the source tree.
     
    diff -Naur nss-3.12.4-orig/mozilla/security/nss/config/Makefile nss-3.12.4/mozilla/security/nss/config/Makefile
    --- nss-3.12.4-orig/mozilla/security/nss/config/Makefile	1969-12-31 18:00:00.000000000 -0600
    +++ nss-3.12.4/mozilla/security/nss/config/Makefile	2009-08-31 19:15:20.000000000 -0500
    @@ -0,0 +1,40 @@
    +CORE_DEPTH = ../..
    +DEPTH      = ../..
    +
    +include $(CORE_DEPTH)/coreconf/config.mk
    +
    +NSS_MAJOR_VERSION = `grep "NSS_VMAJOR" ../lib/nss/nss.h | awk '{print $$3}'`
    +NSS_MINOR_VERSION = `grep "NSS_VMINOR" ../lib/nss/nss.h | awk '{print $$3}'`
    +NSS_PATCH_VERSION = `grep "NSS_VPATCH" ../lib/nss/nss.h | awk '{print $$3}'`
    +PREFIX = /usr
    +
    +all: export libs
    +
    +export:
    +	# Create the nss.pc file
    +	mkdir -p $(DIST)/lib/pkgconfig
    +	sed -e "s,@prefix@,$(PREFIX)," \
    +	    -e "s,@exec_prefix@,\$${prefix}," \
    +	    -e "s,@libdir@,\$${prefix}/lib," \
    +	    -e "s,@includedir@,\$${prefix}/include/nss," \
    +	    -e "s,@NSS_MAJOR_VERSION@,$(NSS_MAJOR_VERSION),g" \
    +	    -e "s,@NSS_MINOR_VERSION@,$(NSS_MINOR_VERSION)," \
    +	    -e "s,@NSS_PATCH_VERSION@,$(NSS_PATCH_VERSION)," \
    +	    nss.pc.in > nss.pc
    +	chmod 0644 nss.pc
    +	ln -sf ../../../../security/nss/config/nss.pc $(DIST)/lib/pkgconfig
    +
    +	# Create the nss-config script
    +	mkdir -p $(DIST)/bin
    +	sed -e "s,@prefix@,$(PREFIX)," \
    +	    -e "s,@NSS_MAJOR_VERSION@,$(NSS_MAJOR_VERSION)," \
    +	    -e "s,@NSS_MINOR_VERSION@,$(NSS_MINOR_VERSION)," \
    +	    -e "s,@NSS_PATCH_VERSION@,$(NSS_PATCH_VERSION)," \
    +	    nss-config.in > nss-config
    +	chmod 0755 nss-config
    +	ln -sf ../../../security/nss/config/nss-config $(DIST)/bin
    +
    +libs:
    +
    +dummy: all export libs
    +
    diff -Naur nss-3.12.4-orig/mozilla/security/nss/config/nss-config.in nss-3.12.4/mozilla/security/nss/config/nss-config.in
    --- nss-3.12.4-orig/mozilla/security/nss/config/nss-config.in	1969-12-31 18:00:00.000000000 -0600
    +++ nss-3.12.4/mozilla/security/nss/config/nss-config.in	2009-08-31 19:16:56.000000000 -0500
    @@ -0,0 +1,153 @@
    +#!/bin/sh
    +
    +prefix=@prefix@
    +
    +major_version=@NSS_MAJOR_VERSION@
    +minor_version=@NSS_MINOR_VERSION@
    +patch_version=@NSS_PATCH_VERSION@
    +
    +usage()
    +{
    +	cat < <EOF
    +Usage: nss-config [OPTIONS] [LIBRARIES]
    +Options:
    +	[--prefix[=DIR]]
    +	[--exec-prefix[=DIR]]
    +	[--includedir[=DIR]]
    +	[--libdir[=DIR]]
    +	[--version]
    +	[--libs]
    +	[--cflags]
    +Dynamic Libraries:
    +	nss
    +	nssutil
    +	smime
    +	ssl
    +	softokn
    +EOF
    +	exit $1
    +}
    +
    +if test $# -eq 0; then
    +	usage 1 1>&2
    +fi
    +
    +lib_nss=yes
    +lib_nssutil=yes
    +lib_smime=yes
    +lib_ssl=yes
    +lib_softokn=yes
    +
    +while test $# -gt 0; do
    +  case "$1" in
    +  -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
    +  *) optarg= ;;
    +  esac
    +
    +  case $1 in
    +    --prefix=*)
    +      prefix=$optarg
    +      ;;
    +    --prefix)
    +      echo_prefix=yes
    +      ;;
    +    --exec-prefix=*)
    +      exec_prefix=$optarg
    +      ;;
    +    --exec-prefix)
    +      echo_exec_prefix=yes
    +      ;;
    +    --includedir=*)
    +      includedir=$optarg
    +      ;;
    +    --includedir)
    +      echo_includedir=yes
    +      ;;
    +    --libdir=*)
    +      libdir=$optarg
    +      ;;
    +    --libdir)
    +      echo_libdir=yes
    +      ;;
    +    --version)
    +      echo ${major_version}.${minor_version}.${patch_version}
    +      ;;
    +    --cflags)
    +      echo_cflags=yes
    +      ;;
    +    --libs)
    +      echo_libs=yes
    +      ;;
    +    nss)
    +      lib_nss=yes
    +      ;;
    +    nssutil)
    +      lib_nssutil=yes
    +      ;;
    +    smime)
    +      lib_smime=yes
    +      ;;
    +    ssl)
    +      lib_ssl=yes
    +      ;;
    +    softokn)
    +      lib_softokn=yes
    +      ;;
    +    *)
    +      usage 1 1>&2
    +      ;;
    +  esac
    +  shift
    +done
    +
    +# Set variables that may be dependent upon other variables
    +if test -z "$exec_prefix"; then
    +    exec_prefix=`pkg-config --variable=exec_prefix nss`
    +fi
    +if test -z "$includedir"; then
    +    includedir=`pkg-config --variable=includedir nss`
    +fi
    +if test -z "$libdir"; then
    +    libdir=`pkg-config --variable=libdir nss`
    +fi
    +
    +if test "$echo_prefix" = "yes"; then
    +    echo $prefix
    +fi
    +
    +if test "$echo_exec_prefix" = "yes"; then
    +    echo $exec_prefix
    +fi
    +
    +if test "$echo_includedir" = "yes"; then
    +    echo $includedir
    +fi
    +
    +if test "$echo_libdir" = "yes"; then
    +    echo $libdir
    +fi
    +
    +if test "$echo_cflags" = "yes"; then
    +    echo -I$includedir
    +fi
    +
    +if test "$echo_libs" = "yes"; then
    +      libdirs="-L$libdir"
    +      if test -n "$lib_nss"; then
    +	libdirs="$libdirs -lnss${major_version}"
    +      fi
    +      if test -n "$lib_nssutil"; then
    +        libdirs="$libdirs -lnssutil${major_version}"
    +      fi
    +      if test -n "$lib_smime"; then
    +	libdirs="$libdirs -lsmime${major_version}"
    +      fi
    +      if test -n "$lib_ssl"; then
    +	libdirs="$libdirs -lssl${major_version}"
    +      fi
    +      if test -n "$lib_softokn"; then
    +        libdirs="$libdirs -lsoftokn${major_version}"
    +      fi
    +      echo $libdirs
    +fi      
    +
    diff -Naur nss-3.12.4-orig/mozilla/security/nss/config/nss.pc.in nss-3.12.4/mozilla/security/nss/config/nss.pc.in
    --- nss-3.12.4-orig/mozilla/security/nss/config/nss.pc.in	1969-12-31 18:00:00.000000000 -0600
    +++ nss-3.12.4/mozilla/security/nss/config/nss.pc.in	2009-08-31 19:15:20.000000000 -0500
    @@ -0,0 +1,12 @@
    +prefix=@prefix@
    +exec_prefix=@exec_prefix@
    +libdir=@libdir@
    +includedir=@includedir@
    +
    +Name: NSS
    +Description: Network Security Services
    +Version: @NSS_MAJOR_VERSION@.@NSS_MINOR_VERSION@.@NSS_PATCH_VERSION@
    +Requires: nspr >= 4.8
    +Libs: -L@libdir@ -lnss@NSS_MAJOR_VERSION@ -lnssutil@NSS_MAJOR_VERSION@ -lsmime@NSS_MAJOR_VERSION@ -lssl@NSS_MAJOR_VERSION@ -lsoftokn@NSS_MAJOR_VERSION@
    +Cflags: -I${includedir}
    +
    diff -Naur nss-3.12.4-orig/mozilla/security/nss/Makefile nss-3.12.4/mozilla/security/nss/Makefile
    --- nss-3.12.4-orig/mozilla/security/nss/Makefile	2008-12-02 17:24:39.000000000 -0600
    +++ nss-3.12.4/mozilla/security/nss/Makefile	2009-08-31 19:15:20.000000000 -0500
    @@ -78,7 +78,7 @@
     # (7) Execute "local" rules. (OPTIONAL).                              #
     #######################################################################
     
    -nss_build_all: build_coreconf build_nspr build_dbm all
    +nss_build_all: build_coreconf build_dbm all
     
     nss_clean_all: clobber_coreconf clobber_nspr clobber_dbm clobber
     
    @@ -140,12 +140,6 @@
     	--with-dist-prefix='$(NSPR_PREFIX)' \
     	--with-dist-includedir='$(NSPR_PREFIX)/include'
     
    -build_nspr: $(NSPR_CONFIG_STATUS)
    -	cd $(CORE_DEPTH)/../nsprpub/$(OBJDIR_NAME) ; $(MAKE)
    -
    -clobber_nspr: $(NSPR_CONFIG_STATUS)
    -	cd $(CORE_DEPTH)/../nsprpub/$(OBJDIR_NAME) ; $(MAKE) clobber
    -
     build_dbm:
     ifndef NSS_DISABLE_DBM
     	cd $(CORE_DEPTH)/dbm ; $(MAKE) export libs
    diff -Naur nss-3.12.4-orig/mozilla/security/nss/manifest.mn nss-3.12.4/mozilla/security/nss/manifest.mn
    --- nss-3.12.4-orig/mozilla/security/nss/manifest.mn	2008-04-04 15:36:59.000000000 -0500
    +++ nss-3.12.4/mozilla/security/nss/manifest.mn	2009-08-31 19:15:20.000000000 -0500
    @@ -42,6 +42,6 @@
     
     RELEASE = nss
     
    -DIRS = lib cmd
    +DIRS = lib cmd config

    I had to add the following line to nss-3.12.6/mozilla/security/coreconf/location.mk to get it to find the newly installed NSPR.

    INCLUDES += -I$HOME/include

    Then run this:

    #!/bin/sh
     
    export BUILD_OPT=1 
    export NSS_USE_SYSTEM_SQLITE=1 
    export NSPR_INCLUDE_DIR=/home/$USER/include/nspr 
    export USE_SYSTEM_ZLIB=1 
    export ZLIB_LIBS=-lz 
    export USE_64=1
     
    #patch -Np1 -i ../nss-3.12.5-standalone-1.patch 
     
    run_gapp \
        make -C mozilla/security/nss nss_build_all

    Then run this to install it :

    #!/bin/sh
     
    LOC_HOME=/home/$USER
     
    export NSS_LINUXDIR=$(basename `ls -d $PWD/mozilla/dist/Linux*`)
     
    echo "NSS_LINUXDIR=$NSS_LINUXDIR"
     
    cd mozilla/dist
    install -v -m755 $NSS_LINUXDIR/lib/*.so $LOC_HOME/lib 
    install -v -m644 $NSS_LINUXDIR/lib/{*.chk,libcrmf.a} $LOC_HOME/lib 
    install -v -m755 -d $LOC_HOME/include/nss 
    install -v -m755 $NSS_LINUXDIR/bin/{certutil,nss-config,pk12util} $LOC_HOME/bin 
    install -v -m644 $NSS_LINUXDIR/lib/pkgconfig/nss.pc $LOC_HOME/lib/pkgconfig 
    cp -v -RL {public,private}/nss/* $LOC_HOME/include/nss 
    chmod 644 $LOC_HOME/include/nss/*

  4. Python

    See my other post here : http://warped.org/blog/2010/04/02/ch0wned-installing-taskcoach-and-all-its-depenencies-in-home-for-el4/

Firefox

Configuring

Make a file called mozconfig-firefox or some such.

export BUILD_OFFICIAL=1
mk_add_options BUILD_OFFICIAL=1
mk_add_options MOZ_CO_PROJECT=browser
# the following line uses 4 CPUs to build
#mk_add_options MOZ_MAKE_FLAGS="-j4"
 
ac_add_options --enable-application=browser
ac_add_options --enable-official-branding
ac_add_options --prefix=/home/$USER/share/firefox
 
# Optimization
ac_add_options --disable-tests
ac_add_options --disable-debug
ac_add_options --enable-optimize="-O2 -funroll-loops -fexpensive-optimizations"
ac_add_options --enable-strip
 
# Features
ac_add_options --disable-accessibility
ac_add_options --disable-updater
ac_add_options --disable-installer
ac_add_options --enable-safe-browsing
ac_add_options --enable-xinerama
 
# Libraries / Dependencies
ac_add_options --disable-libnotify
ac_add_options --disable-gnomevfs
ac_add_options --enable-default-toolkit=cairo-gtk2
ac_add_options --enable-system-cairo
ac_add_options --with-system-nss
ac_add_options --with-nss-prefix=/home/$USER
ac_add_options --with-system-nspr
ac_add_options --with-nspr-prefix=/home/$USER
ac_add_options --enable-system-sqlite

Building

I had to patch firefox to use OSS instead of ALSA because EL4 doesn’t have a working ALSA by default. If you have ALSA working, you may not have to do this step. I got the guts of this patch from somewhere, but I can’t find it now, thanks whoever you are!

diff -ur firefox-3.6.2-orig/media/libsydneyaudio/src/Makefile.in firefox-3.6.2/media/libsydneyaudio/src/Makefile.in
--- firefox-3.6.2-orig/media/libsydneyaudio/src/Makefile.in	2010-03-16 02:56:36.000000000 -0700
+++ firefox-3.6.2/media/libsydneyaudio/src/Makefile.in	2010-04-01 10:13:27.000000000 -0700
@@ -47,7 +47,7 @@
 
 ifeq ($(OS_ARCH),Linux)
 CSRCS		= \
-		sydney_audio_alsa.c \
+		sydney_audio_oss.c \
 		$(NULL)
 endif
 
diff -ur firefox-3.6.2-orig/media/libsydneyaudio/src/sydney_audio_oss.c firefox-3.6.2/media/libsydneyaudio/src/sydney_audio_oss.c
--- firefox-3.6.2-orig/media/libsydneyaudio/src/sydney_audio_oss.c	2010-03-16 02:56:36.000000000 -0700
+++ firefox-3.6.2/media/libsydneyaudio/src/sydney_audio_oss.c	2010-04-01 10:15:40.000000000 -0700
@@ -47,11 +47,11 @@
 #include "sydney_audio.h"
 
 // for versions newer than 3.6.1
-#define OSS_VERSION(x, y, z) (x < < 16 | y << 8 | z)
+#define OSS_VERSION_(x, y, z) (x << 16 | y << 8 | z)
 // support only versions newer than 3.6.1
-#define SUPP_OSS_VERSION OSS_VERSION(3,6,1)
+#define SUPP_OSS_VERSION OSS_VERSION_(3,6,1)
 
-#if (SOUND_VERSION < SUPP_OSS_VERSION)
+#if (SOUND_VERSION < SUPP_OSS_VERSION_)
 #error Unsupported OSS Version
 #else
 
@@ -127,7 +127,7 @@
         case SA_PCM_FORMAT_S16_BE:
             *fmt = AFMT_S16_BE;
             break;
-#if SOUND_VERSION >= OSS_VERSION(4,0,0)
+#if SOUND_VERSION >= OSS_VERSION_(4,0,0)
         /* 24-bit formats (LSB aligned in 32 bit word) */
         case SA_PCM_FORMAT_S24_LE:
             *fmt = AFMT_S24_LE;
@@ -563,6 +563,8 @@
 #if 0 /* TODO */
   AudioOutputUnitStop(s->output_unit);
 #endif
+  close(s->output_fd);
+  s->output_fd = -1;
   pthread_mutex_unlock(&s->mutex);
   return SA_SUCCESS;
 }
@@ -581,10 +583,11 @@
    * The audio device resets its mSampleTime counter after pausing,
    * so we need to clear our tracking value to keep that in sync.
    */
-  s->bytes_played = 0;
+  //s->bytes_played = 0;
 #if 0 /* TODO */
   AudioOutputUnitStart(s->output_unit);
 #endif
+  sa_stream_open(s);
   pthread_mutex_unlock(&s->mutex);
   return SA_SUCCESS;
 }
@@ -615,7 +618,7 @@
   if (s == NULL || s->output_fd == -1) {
     return SA_ERROR_NO_INIT;
   }
-#if SOUND_VERSION >= OSS_VERSION(4,0,0)
+#if SOUND_VERSION >= OSS_VERSION_(4,0,0)
   int mvol = ((int)(100*vol)) | ((int)(100*vol) < < 8);
   if (ioctl(s->output_fd, SNDCTL_DSP_SETPLAYVOL, &mvol) < 0){
     return SA_ERROR_SYSTEM;
@@ -637,7 +640,7 @@
   if (s == NULL || s->output_fd == -1) {
     return SA_ERROR_NO_INIT;
   }
-#if SOUND_VERSION >= OSS_VERSION(4,0,0)
+#if SOUND_VERSION >= OSS_VERSION_(4,0,0)
   int mvol;
   if (ioctl(s->output_fd, SNDCTL_DSP_SETPLAYVOL, &mvol) < 0){
     return SA_ERROR_SYSTEM;

The following is a fork of my config_gapp script. There are some tricky bits because I’ve left off some -L’s to avoid the NSS and NSPR libs that are installed in /usr/lib64.

#!/bin/sh
 
LOCAL_HOME=/home/$USER
export PATH=$LOCAL_HOME/bin:$PATH
 
export CPPFLAGS="-I$LOCAL_HOME/include -I$LOCAL_HOME/include/nss -I/usr/X11R6/include $CPPFLAGS"
export CFLAGS="-I$LOCAL_HOME/include -I$LOCAL_HOME/include/nss -I/usr/X11R6/include $CFLAGS"
export CXXFLAGS="-I$LOCAL_HOME/include -I$LOCAL_HOME/include/nss  -I/usr/X11R6/include  $CXXFLAGS"
#export LDFLAGS="-L$LOCAL_HOME/lib -L/usr/lib64 -L/usr/X11R6/lib64 $LDFLAGS"
export LDFLAGS="-L$LOCAL_HOME/lib -L/usr/X11R6/lib64 $LDFLAGS"
export PKG_CONFIG=$LOCAL_HOME/bin/pkg-config
export PKG_CONFIG_PATH="$LOCAL_HOME/lib/pkgconfig:/usr/lib64/pkgconfig:$PKG_CONFIG_PATH"
#export LD_LIBRARY_PATH="$LOCAL_HOME/lib:/usr/X11R6/lib64:/usr/lib64"
export LD_LIBRARY_PATH="$LOCAL_HOME/lib:/usr/X11R6/lib64"
 
export MOZCONFIG=../mozconfig-firefox
 
make -j 4 -f client.mk build

Installing

First you make a .tar.bz2, then you go install it.

make package
cp dist/*.tar.bz2 /somewhere
cd $HOME/share
tar xvfj /path/to/that/*.tar.bz2

Now make a wrapper script $HOME/bin/firefox :

#!/bin/sh
 
exec run_gapp /home/$USER/share/firefox/firefox "$@"

Errors

Here are some of the error messages I encountered along the way that were solved w/ the prerequisites and patch. Hopefully this helps future googlers.

../../staticlib/components/libpipnss.a(nsNSSCallbacks.o)(.text+0x150a): In function `RegisterMyOCSPAIAInfoCallback()':
: undefined reference to `CERT_RegisterAlternateOCSPAIAInfoCallBack'
../../staticlib/components/libpipnss.a(nsNSSCallbacks.o)(.text+0x154d): In function `UnregisterMyOCSPAIAInfoCallback()':
: undefined reference to `CERT_RegisterAlternateOCSPAIAInfoCallBack'
../../staticlib/components/libpipnss.a(nsNSSCallbacks.o)(.text+0x2aa9): In function `HandshakeCallback(PRFileDesc*, void*)':
: undefined reference to `SSL_HandshakeNegotiatedExtension'
collect2: ld returned 1 exit status
make[4]: *** [libxul.so] Error 1
make[4]: Leaving directory `/opt/local/mbaker/firefox-3.6.2/toolkit/library'
make[3]: *** [libs_tier_toolkit] Error 2
make[3]: Leaving directory `/opt/local/mbaker/firefox-3.6.2'
make[2]: *** [tier_toolkit] Error 2
make[2]: Leaving directory `/opt/local/mbaker/firefox-3.6.2'
make[1]: *** [default] Error 2
make[1]: Leaving directory `/opt/local/mbaker/firefox-3.6.2'
make: *** [build] Error 2

That one was solved by installing NSS and NSPR separately with the linux-from-scratch patches.

error: system NSPR does not support PR_STATIC_ASSERT

Look in config.log and then fix your permissions in $HOME/include/nss.