Eric Posted October 25, 2012 Report Posted October 25, 2012 Introduction to FirefoxFirefox is a stand-alone browser based on the Mozilla codebase.This package is known to build and work properly using an LFS-7.2 platform.Package InformationDownload (FTP): ftp://ftp.mozilla.org/pub/mozilla.org/firefox/releases/16.0.1/source/firefox-16.0.1.source.tar.bz2Download MD5 sum: 78e641c67dc4a40cb3f48fce3e782d41Download size: 85 MBEstimated disk space required: 994 MB (34 MB installed) (or 647 MB and 4.1 MB if using xulrunner)Estimated build time: 27 SBU (0.4 SBU if using xulrunner)Firefox DependenciesRequiredalsa-lib-1.0.26GTK+-2.24.13Zip-3.0UnZip-6.0Recommendedyasm-1.2.0libvpx-v1.1.0 (to allow Firefox to play webm videos).OptionalD-Bus Bindingsstartup-notification-0.12SQLite-3.7.14.1Hunspell: open source spell checking, stemming, morphological analysis and generation under GPL, LGPL or MPL licenseslibevent-2.0.20Doxygen-1.8.2gnome-vfs-2.24.4libgnomeui-2.24.5(for integration with the old version of Gnome)libnotify-0.7.5NSPR-4.9.2NSS-3.13.6Wireless Tools-29Valgrind Home(only for testing the jemalloc code)Wget-1.14Xulrunner-16.0.1User Notes: firefox – BLFS TracInstallation of FirefoxThere are two major methods for building Firefox. In the standard case, the entire suite of libraries is built and installed. In the other, most of the system is built using the procedures found in Xulrunner-16.0.1. This is advantageous if you are planning to build other related packages such as IcedTea-Web-1.3. With either build method, you need to run the main build procedure below with the appropriate options in the mozconfig file. Then use the appropriate install instructions depending on the chosen build method.The configuration of Firefox is accomplished by creating a mozconfig file containing the desired configuration options. A default mozconfig is created below. To see the entire list of available configuration options (and an abbreviated description of each one), issue ./configure --help. You may also wish to review the entire file and uncomment any other desired options. The commented line for --with-libxul-sdk has an escaped dollar sign - if you have chosed to paste the entries into a mozconfig file in your editor, you do not need the escape, it is only necessary when invoking a subshell in a HERE document. Create the file by issuing the following command:cat > mozconfig << EOF# If you have a multicore machine you can speed up the build by running# several jobs at once, but if you have a single core, delete this line:mk_add_options MOZ_MAKE_FLAGS="-j4"# If you have not installed Yasm, uncomment this option:# ac_add_options --disable-webm# If you have installed DBus-Glib delete this option:ac_add_options --disable-dbus# If you have installed wireless-tools delete this option:ac_add_options --disable-necko-wifi# If you have installed libnotify delete this option:ac_add_options --disable-libnotify# If you have installed xulrunner uncomment these two lines:# ac_add_options --with-system-libxul# ac_add_options --with-libxul-sdk=\$(pkg-config --variable=sdkdir libxul)# Note: The backslash above is to facilitate a paste operation. It# should not appear in the mozconfig file.# Uncomment these if you have installed them:# ac_add_options --enable-startup-notification# ac_add_options --enable-system-hunspell# ac_add_options --enable-system-sqlite# ac_add_options --with-system-libevent# ac_add_options --with-system-libvpx# ac_add_options --with-system-nspr# ac_add_options --with-system-nssmk_add_options MOZ_OBJDIR=@TOPSRCDIR@/firefox-build-dirac_add_options --enable-official-brandingac_add_options --prefix=/usr# The rest of these options have no effect if you're# building against an already installed xulrunner:ac_add_options --disable-crashreporterac_add_options --disable-debugac_add_options --disable-installerac_add_options --disable-staticac_add_options --disable-testsac_add_options --disable-updaterac_add_options --enable-sharedac_add_options --enable-system-cairoac_add_options --enable-system-ffiac_add_options --with-pthreadsac_add_options --with-system-jpegac_add_options --with-system-pngac_add_options --with-system-zlibEOFIf you are building a stand-alone firefox with system versions of nspr, nss, or sqlite issue the following command:sed -i 's/\(MOZ_PKG_FATAL_WARNINGS =\).*/\1 0/' \ browser/installer/Makefile.in &&Compile Firefox by issuing the following commands:sed -i 's# ""##' browser/base/Makefile.in &&make -f client.mkThis package does not come with a test suite.If you have not linked Firefox against an installed Xulrunner:make -C firefox-build-dir/browser/installerNow, as the root user, if you have not linked Firefox against an installed Xulrunner, install the package:rm -rf /usr/lib/firefox-16.0.1 &&mkdir /usr/lib/firefox-16.0.1 &&tar -xvf firefox-build-dir/dist/firefox-16.0.1.en-US.linux-$(uname -m).tar.bz2 \ -C /usr/lib/firefox-16.0.1 --strip-components=1 &&ln -sfv ../lib/firefox-16.0.1/firefox /usr/bin &&mkdir -pv /usr/lib/mozilla/plugins &&ln -sfv ../mozilla/plugins /usr/lib/firefox-16.0.1 &&chown -R -v root:root /usr/lib/firefox-16.0.1If you have linked against an already installed Xulrunner, as the root user:make -C firefox-build-dir install &&rm /usr/bin/firefox &&cat > /usr/bin/firefox << "HERE_DOC" &&#!/bin/bash/usr/lib/xulrunner-16.0.1/xulrunner /usr/lib/firefox-16.0.1/application.ini "${@}"HERE_DOCchmod 755 /usr/bin/firefox &&mkdir -pv /usr/lib/mozilla/plugins &&ln -sfv ../mozilla/plugins /usr/lib/firefox-16.0.1NPAPI HeadersThe above instructions just install the parts you need to run Firefox. If you want to compile gnash-0.8.10, the open source version of Flash, copy some headers that Gnash needs into /usr/include, as the root user:rm -rf /usr/include/npapi &&mkdir -v /usr/include/npapi &&cp -v dom/plugins/base/*.h /usr/include/npapiCommand Explanationssed -i 's/\(MOZ_PKG_FATAL_WARNINGS =\).*/\1 0/' ...: This sed fixes an error in the internal packaging check..sed -i 's# ""##' browser/base/Makefile.in: This sed removes an unprintable control character from the title bar.make -f client.mk ...: Mozilla products are packaged to allow the use of a configuration file which can be used to pass the configuration settings to the configure command. make uses the client.mk file to get initial configuration and setup parameters.make -C firefox-build-dir/browser/installer: this creates a Firefox tarball similar to the ones you can download from Mozilla.tar -xfv firefox-build-dir/dist ...: This untars Firefox in /usr/lib. The --strip-components=1 option removes the leading 'firefox' directory from the filenames, allowing us to untar it into a versioned directory.make -C firefox-build-dir install: This runs make install in firefox-build-dir.ln -sfv ... /usr/bin/firefox: this puts a symbolic link to the firefox executable in your ${PATH}.mkdir -p /usr/lib/mozilla/plugins: this checks that /usr/lib/mozilla/plugins exists.ln -sv ... /usr/lib/firefox-16.0.1: this makes a symbolic link to /usr/lib/mozilla/plugins. It's not really needed, Firefox checks /usr/lib/mozilla/plugins by default, we make the symbolic link to keep all the plugins installed in one folder.Configuring FirefoxIf you deleted the --disable-webm option from your mozconfig, your Firefox can play most YouTube videos without the need for the flash plugin. To enable this, go to YouTube and click on 'Join the HTML5 Trial' (needs cookies enabled).If you use a desktop environment like Gnome or KDE you may like to create a firefox.desktop file so that Firefox appears in the panel's menus. If you didn't enable startup-notification in your mozconfig change the StartupNotify line to false. As the root user:mkdir -pv /usr/share/applications &&cat > /usr/share/applications/firefox.desktop << "EOF" &&[Desktop Entry]Encoding=UTF-8Type=ApplicationName=FirefoxComment=Browse The WebIcon=firefoxExec=firefoxCategories=Network;GTK;Application;Browser;WebBrowser;StartupNotify=trueTerminal=falseEOFln -sfv /usr/lib/firefox-16.0.1/icons/mozicon128.png /usr/share/pixmaps/firefox.pngContentsInstalled Programs:firefoxInstalled Libraries:Numerous libraries, browser components, plugins, extensions, and helper modules installed in /usr/lib/firefox-16.0.1.Installed Directories:/usr/include/npapi and /usr/lib/firefox-16.0.1.sursa: Firefox-16.0.1 Quote