Friday 12 July 2019

Firefox build & compile in Ubuntu (Linux)


Firefox build:
  • Download
    • Using below Site:
    • Use python code to download
  • To build
    • Created new file ""mozconfig" with below content
                  # My first mozilla config
mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/obj-@CONFIG_GUESS@
ac_add_options --enable-application=browser
ac_add_options --enable-debug
  • To run:
    • export MOZCONFIG=/home/labuser/image/software/firefox-68.0/mozconfig
    • ./mach build

  • Dependencies
    • Python 3.5
    • GCC 6.1
      • To install Latest gcc, pull code using svn
        • To checkout:
        • Dependencies:
          • Run below command it will download:
            • ./contrib/download_prerequisites
        • Build:
          • ./configure --program-suffix=-9   -> This option create gcc as gcc9
          • Make  (It take 3hr to build, may be can use "make -j 2")
            • In this place not able found the gcc or gcc-9 image.
          • Make install
            • Now gcc-9 -v shows the version 9 gcc. Worked
        • Multiple gcc
          • After install still facing firefox not build, becase it uses /usr/bin/gcc
          • So gave below symbolic link & G++ also
            • ln -s /usr/local/bin/gcc-9 gcc
  • sudo apt-get install libpulse-dev
  • curl https://sh.rustup.rs -sSf | sh
  • To install cbindgen dependen rust.
    • cargo install --force cbindgen
  • How it checking the dependency in python
    • checking for rustc... not found
    • checking for libpulse... Yes  -> Need to investiage how they check.
      • pulseaudio = pkg_check_modules('MOZ_PULSEAUDIO', 'libpulse', when='--enable-pulseaudio')
        • build/moz.configure/pkg.configure has definition.
      • Calling place:
        • sys.exit(main(sys.argv))
        • sandbox.run(os.path.join(os.path.dirname(__file__), 'moz.configure'))
    • To check programs:
      • check_prog('TAR', ('gnutar', 'gtar', 'tar'))