Mobile/Build/Fennec: Difference between revisions

build non-XULRunner by default
(→‎Create a mozconfig: export MOZ_SERVICES_SYNC=1)
(build non-XULRunner by default)
Line 1: Line 1:
== Building [[Fennec]] and [[XULRunner]] ==
== Building [[Fennec]] ==


=== Install and run Scratchbox (Maemo only) ===
=== Install and run Scratchbox (Maemo only) ===
Line 25: Line 25:


<pre>
<pre>
# Options for client.mk.
mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/../objdir
mk_add_options MOZ_BUILD_PROJECTS="xulrunner mobile"
ac_add_options --enable-application=mobile
mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/../mobilebase


# XULRunner options
# For improved compile speeds, all optional.
ac_add_app_options xulrunner --enable-application=xulrunner
#mk_add_options MOZ_MAKE_FLAGS=-j4
ac_add_app_options xulrunner --disable-javaxpcom
#mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/../fennec-e10s
#export CCACHE_HARDLINK=1
#ac_add_options --with-ccache=ccache


export MOZ_SERVICES_SYNC=1 # Enable Firefox Sync in xulrunner
# Make a debug build, optional.
#export MOZ_DEBUG_SYMBOLS=1
#ac_add_options --enable-debug
#ac_add_options --disable-optimize


# mobile options
# Needed on Win32 to fix problem with Windows Vista SDK
ac_add_app_options mobile --enable-application=mobile
#ac_add_options --disable-accessibility
ac_add_app_options mobile --with-libxul-sdk=../xulrunner/dist


####################################################
####################################################
Line 47: Line 50:
# Enabling --with-arm-kuser implies Linux on ARM and enables kernel
# Enabling --with-arm-kuser implies Linux on ARM and enables kernel
# optimizations for that platform
# optimizations for that platform
ac_add_app_options xulrunner --with-arm-kuser
ac_add_options --with-arm-kuser


# cs2007q3 gcc 4.2 is busted, we think, and doesn't
# cs2007q3 gcc 4.2 is busted, we think, and doesn't
Line 57: Line 60:
See [https://developer.mozilla.org/en/Configuring_Build_Options Configuring Build Options] for more information about customizing your build settings.
See [https://developer.mozilla.org/en/Configuring_Build_Options Configuring Build Options] for more information about customizing your build settings.


=== Build Fennec and XULRunner ===
=== Build ===
In the mozilla-central directory:
In the mozilla-central directory:
<pre>
<pre>
make -f client.mk build
make -f client.mk build
</pre>
</pre>
The build will appear in ../mobilebase (or whatever MOZ_OBJDIR is set to in your mozconfig).
The build will appear in ../objdir (or whatever MOZ_OBJDIR is set to in your mozconfig).
 


== Running Fennec ==
== Running Fennec ==
Line 69: Line 71:
=== Desktop ===
=== Desktop ===


<pre>
cd ../objdir/dist/bin
cd ../mobilebase/mobile/dist/bin
./fennec
./fennec
 
</pre>
You may want to add the $MOZ_OBJDIR/dist/bin directory to your shell's $PATH so you can just type "fennec" anywhere.
You may want to add the $MOZ_OBJDIR/mobile/dist/bin directory to your shell's $PATH so you can just type "fennec" anywhere.


=== Maemo ===
=== Maemo ===
If you did the above in a [[Mobile/Build/cs2007q3|Maemo Scratchbox]] for the CHINOOK_ARMEL target, you can run the build on the N800/N810 device.
If you did the above in a [[Mobile/Build/cs2007q3|Maemo Scratchbox]] for the CHINOOK_ARMEL target, you can run the build on the N800/N810 device.


Create a Fennec tarball:
Create a Fennec tarball:


  cd ../mobilebase/mobile/
  cd ../objdir/mobile/
  make package
  make package


You'll now have a tarball in mobilebase/mobile/dist/ named fennec-1.1b2pre.en-US.linux-arm.tar.bz2.  (you'll probably want to run bunzip2 on it first, since Maemo doesn't include it):
You'll now have a tarball in objdir/dist/ named fennec-1.1b2pre.en-US.linux-arm.tar.bz2.  (you'll probably want to run bunzip2 on it first, since Maemo doesn't include it):


  cd dist
  cd dist
Line 99: Line 101:
  ./fennec/fennec
  ./fennec/fennec


==Building Fennec with the Gecko SDK==
== Building Fennec with XULRunner ==


===Download SDK===
Fennec is normally built as a standalone app, but it can also run under [[XULRunner]]. Note that this is not fully supported, and some things may work differently in XULRunner builds.
First download the appropriate Gecko SDK from [ftp://ftp.mozilla.org/pub/xulrunner/nightly/latest-trunk/ ftp.mozilla.org]


===Get the source===
===Get the source===
Follow the steps from [[#Pulling the code from hg]]
Follow the steps from [[#Pulling the code from hg]]


Line 111: Line 113:
# Options for client.mk.
# Options for client.mk.
mk_add_options MOZ_BUILD_PROJECTS="xulrunner mobile"
mk_add_options MOZ_BUILD_PROJECTS="xulrunner mobile"
mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/../mobilebase
mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/../objdir
 
# XULRunner options
ac_add_app_options xulrunner --enable-application=xulrunner
ac_add_app_options xulrunner --disable-javaxpcom
export MOZ_SERVICES_SYNC=1 # Enable Firefox Sync for XULRunner builds.
 
# mobile options
ac_add_app_options mobile --enable-application=mobile
ac_add_app_options mobile --with-libxul-sdk=../xulrunner/dist
 
# For improved compile speeds, all optional.
#mk_add_options MOZ_MAKE_FLAGS=-j4
#mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/../fennec-e10s
#export CCACHE_HARDLINK=1
#ac_add_options --with-ccache=ccache


ac_add_options --enable-application=mobile
# Make a debug build, optional.
ac_add_options --with-libxul-sdk=<path to the SDK you downloaded and extracted>
#export MOZ_DEBUG_SYMBOLS=1
#ac_add_options --enable-debug
#ac_add_options --disable-optimize
</pre>
</pre>


Note: if you are building for x86 ubuntu, you might want to add "ac_add_options --disable-dbus" to your mozconfig, or obtain the necessary dbus libraries.
Note: if you are building for x86 ubuntu, you might want to add "ac_add_options --disable-dbus" to your mozconfig, or obtain the necessary dbus libraries.


===Build===
=== Build ===
<pre>
 
make -f client.mk build
make -f client.mk build
</pre>
 
=== Run ===
 
cd ../objdir/mobile/dist/bin
./fennec


<b>Note</b>: At this point, you should be able to run and/or debug fennec, as your downloaded Gecko SDK is properly found by your app. However, since you're not using a xulrunner objdir, the package-related features will not work unless you inform the Mozilla build system of this SDK, by adding the following line to your mozconfig file :
=== Using the Gecko SDK===


<pre>
Rather than build XULRunner yourself, you can use the Gecko SDK.  First download and extract the SDK from http://ftp.mozilla.org/pub/xulrunner/nightly/latest-trunk/
ac_add_options  --with-system-libxul
</pre>


==Building Win32==
Use the following mozconfig file, using the correct path to the SDK you downloaded and extracted:
Start by setting up your system with the needed SDKs.  This means Visual Studio 2008 and the Vista SDK.  You can install the Windows Mobile 6 SDK also, but it's not needed for the Win32-only build.


Check out the hg repo listed aboveCreate a .mozconfig file in the mozilla-central directory. This looks similar to the above, but with some ARM/Linux specific lines removed:
# Options for client.mk.
  mk_add_options MOZ_BUILD_PROJECTS="xulrunner mobile"
mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/../mobilebase


<pre>
ac_add_options  --enable-application=mobile
# Options for client.mk.
ac_add_options  --with-libxul-sdk=/PATH/TO/SDK
mk_add_options MOZ_BUILD_PROJECTS="xulrunner mobile"
ac_add_options  --with-system-libxul
mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/../mobilebase


# XULRunner options
== Building Win32 ==
ac_add_app_options xulrunner --enable-application=xulrunner
ac_add_app_options xulrunner --disable-javaxpcom


# mobile options
Start by setting up your system with the needed SDKs. This means Visual Studio 2008 and the Vista SDK.
ac_add_app_options mobile --enable-application=mobile
ac_add_app_options mobile --with-libxul-sdk=../xulrunner/dist


# Global options -- uncomment these lines for debug version
Check out the source and create a mozconfig following the instructions above.  Be sure to add or uncomment this line:
#ac_add_options --enable-debug
#ac_add_options --disable-optimize


# needed to fix problem with Vista SDK
ac_add_options --disable-accessibility
ac_add_options --disable-accessibility
</pre>


Then use the commands
Then use the commands


<pre>
configure
configure
make -f client.mk build
make -f client.mk build
</pre>


Don't panic if configure fails; the make will rerun it with the right options to allow this to work.
Don't panic if configure fails; the make will rerun it with the right options to allow this to work.
canmove, Confirmed users
1,584

edits