Platform/Platform-specific build defines: Difference between revisions

Added XP_SOLARIS
(→‎Prefs files: Firefox.js might be used on mulet)
(Added XP_SOLARIS)
 
(25 intermediate revisions by 4 users not shown)
Line 1: Line 1:
In the Gecko code we have a bunch of preprocessor conditions that help us conditionally compile code for specific platforms. These can get confusing so here is a handy-dandy table to help you keep them straight.
In the Gecko code we have a bunch of preprocessor conditions that help us conditionally compile code for specific platforms. These can get confusing so here is a handy-dandy table to help you keep them straight.


{|border="1" style="text-align: center;"
{|border="1" style="text-align: center; width: 100%"
!OS
!OS
!colspan="2"|Windows
!colspan="1"|Windows
!colspan="2"|OS X
!colspan="1"|OS X
!colspan="3"|Linux-gtk
!colspan="1"|Linux-gtk
!colspan="2"|Android
!colspan="2"|Android
!colspan="1"|*BSD
!colspan="1"|Solaris
!iOS
!iOS
|-
|-
!Product
!Product
!Desktop
!Desktop
!B2G
!Desktop
!Desktop
!B2G
!Desktop
!Desktop
!B2G
!Mulet
!Fennec
!Fennec
!B2G
!GeckoView
!Desktop
!Desktop
!iOS
!iOS
|-
|-
!XP_WIN
!XP_WIN
|style="background: green; color: white"|✓
  <!-- Windows: Desktop -->
|style="background: green; color: white"|✓
| style="background: green; color: white"|✓
|&nbsp;||&nbsp;
  <!-- OS X: Desktop -->
|&nbsp;||&nbsp;||&nbsp;
| &nbsp;
|&nbsp;||&nbsp;
  <!-- Linux-gtk: Desktop -->
|&nbsp;
| &nbsp;
  <!-- Android: Fennec, GeckoView -->
| &nbsp;
| &nbsp;
  <!-- BSD, Solaris -->
| &nbsp;
| &nbsp;
  <!-- iOS -->
| &nbsp;
|-
|-
!XP_DARWIN
!XP_DARWIN
|&nbsp;||&nbsp;
  <!-- Windows: Desktop -->
|style="background: green; color: white"|✓
| &nbsp;
|style="background: green; color: white"|✓
  <!-- OS X: Desktop -->
|&nbsp;||&nbsp;||&nbsp;
| style="background: green; color: white"|✓
|&nbsp;||&nbsp;
  <!-- Linux-gtk: Desktop -->
|style="background: green; color: white"|✓
| &nbsp;
  <!-- Android: Fennec, GeckoView -->
| &nbsp;
| &nbsp;
  <!-- BSD, Solaris -->
| &nbsp;
| &nbsp;
  <!-- iOS -->
| style="background: green; color: white"|✓
|-
|-
!XP_MACOSX
!XP_MACOSX
|&nbsp;||&nbsp;
  <!-- Windows: Desktop -->
|style="background: green; color: white"|✓
| &nbsp;
|style="background: green; color: white"|✓
  <!-- OS X: Desktop -->
|&nbsp;||&nbsp;||&nbsp;
| style="background: green; color: white"|✓
|&nbsp;||&nbsp;
  <!-- Linux-gtk: Desktop -->
|&nbsp;
| &nbsp;
  <!-- Android: Fennec, GeckoView -->
| &nbsp;
| &nbsp;
  <!-- BSD, Solaris -->
| &nbsp;
| &nbsp;
  <!-- iOS -->
| &nbsp;
|-
|-
!XP_IOS
!XP_IOS
|&nbsp;||&nbsp;
  <!-- Windows: Desktop -->
|&nbsp;||&nbsp;
| &nbsp;
|&nbsp;||&nbsp;||&nbsp;
  <!-- OS X: Desktop -->
|&nbsp;||&nbsp;
| &nbsp;
|style="background: green; color: white"|✓
  <!-- Linux-gtk: Desktop -->
| &nbsp;
  <!-- Android: Fennec, GeckoView -->
| &nbsp;
| &nbsp;
  <!-- BSD, Solaris -->
| &nbsp;
| &nbsp;
  <!-- iOS -->
| style="background: green; color: white"|✓
|-
|-
!XP_UNIX
!XP_UNIX
|&nbsp;||&nbsp;
  <!-- Windows: Desktop -->
|style="background: green; color: white"|✓
| &nbsp;
|style="background: green; color: white"|✓
  <!-- OS X: Desktop -->
|style="background: green; color: white"|✓
| style="background: green; color: white"|✓
|style="background: green; color: white"|✓
  <!-- Linux-gtk: Desktop -->
|style="background: green; color: white"|✓
| style="background: green; color: white"|✓
|style="background: green; color: white"|✓
  <!-- Android: Fennec, GeckoView -->
|style="background: green; color: white"|✓
| style="background: green; color: white"|✓
|style="background: green; color: white"|✓
| style="background: green; color: white"|✓
  <!-- BSD, Solaris -->
| style="background: green; color: white"|✓
| style="background: green; color: white"|✓
  <!-- iOS -->
| style="background: green; color: white"|✓
|-
|-
!XP_LINUX
!XP_LINUX
|&nbsp;||&nbsp;
  <!-- Windows: Desktop -->
|&nbsp;||&nbsp;
| &nbsp;
|style="background: green; color: white"|✓
  <!-- OS X: Desktop -->
|style="background: green; color: white"|✓
| &nbsp;
|style="background: green; color: white"|✓
  <!-- Linux-gtk: Desktop -->
|style="background: green; color: white"|
| style="background: green; color: white"|✓
|style="background: green; color: white"|✓
  <!-- Android: Fennec, GeckoView -->
|&nbsp;
| style="background: green; color: white"|✓
| style="background: green; color: white"|✓
  <!-- BSD, Solaris -->
| &nbsp;
| &nbsp;
  <!-- iOS -->
|  &nbsp;
|-
!XP_SOLARIS
  <!-- Windows: Desktop -->
|  &nbsp;
  <!-- OS X: Desktop -->
|  &nbsp;
  <!-- Linux-gtk: Desktop -->
|  &nbsp;
  <!-- Android: Fennec, GeckoView -->
|  &nbsp;
|  &nbsp;
  <!-- BSD, Solaris -->
| &nbsp;
| style="background: green; color: white"|✓
  <!-- iOS -->
| &nbsp;
|-
|-
!ANDROID
!ANDROID
|&nbsp;||&nbsp;
  <!-- Windows: Desktop -->
|&nbsp;||&nbsp;
| &nbsp;
|&nbsp;||&nbsp;||&nbsp;
  <!-- OS X: Desktop -->
|style="background: green; color: white"|✓
| &nbsp;
|style="background: green; color: white"|✓
  <!-- Linux-gtk: Desktop -->
|&nbsp;
| &nbsp;
|-
  <!-- Android: Fennec, GeckoView -->
!MOZ_B2G
| style="background: green; color: white"|✓
|&nbsp;
| style="background: green; color: white"|✓
|style="background: green; color: white"|✓
  <!-- BSD, Solaris -->
|&nbsp;
| &nbsp;
|style="background: green; color: white"|✓
| &nbsp;
|&nbsp;
  <!-- iOS -->
|style="background: green; color: white"|✓
| &nbsp;
|style="background: green; color: white"|✓
|&nbsp;
|style="background: green; color: white"|✓
|&nbsp;
|-
|-
!MOZ_WIDGET_GTK
!MOZ_WIDGET_GTK
|&nbsp;||&nbsp;
  <!-- Windows: Desktop -->
|&nbsp;||&nbsp;
| &nbsp;
|style="background: green; color: white"|✓
  <!-- OS X: Desktop -->
|style="background: green; color: white"|✓
| &nbsp;
|style="background: green; color: white"|✓
  <!-- Linux-gtk: Desktop -->
|&nbsp;||&nbsp;
| style="background: green; color: white"|✓
|&nbsp;
  <!-- Android: Fennec, GeckoView -->
|  &nbsp;
|  &nbsp;
  <!-- BSD, Solaris -->
| style="background: green; color: white"|✓
| style="background: green; color: white"|✓
  <!-- iOS -->
| &nbsp;
|-
|-
!MOZ_WIDGET_ANDROID
!MOZ_WIDGET_ANDROID
|&nbsp;||&nbsp;
  <!-- Windows: Desktop -->
|&nbsp;||&nbsp;
| &nbsp;
|&nbsp;||&nbsp;||&nbsp;
  <!-- OS X: Desktop -->
|style="background: green; color: white"|✓
| &nbsp;
|&nbsp;
  <!-- Linux-gtk: Desktop -->
|&nbsp;
| &nbsp;
|-
  <!-- Android: Fennec, GeckoView -->
!MOZ_WIDGET_GONK
| style="background: green; color: white"|✓
|&nbsp;||&nbsp;
| style="background: green; color: white"|
|&nbsp;||&nbsp;
  <!-- BSD, Solaris -->
|&nbsp;||&nbsp;||&nbsp;
| &nbsp;
|&nbsp;
| &nbsp;
|style="background: green; color: white"|✓
  <!-- iOS -->
|&nbsp;
| &nbsp;
|-
|-
!MOZ_WIDGET_UIKIT
!MOZ_WIDGET_UIKIT
|&nbsp;||&nbsp;
  <!-- Windows: Desktop -->
|&nbsp;||&nbsp;
| &nbsp;
|&nbsp;||&nbsp;||&nbsp;
  <!-- OS X: Desktop -->
|&nbsp;||&nbsp;
| &nbsp;
|style="background: green; color: white"|✓
  <!-- Linux-gtk: Desktop -->
| &nbsp;
  <!-- Android: Fennec, GeckoView -->
| &nbsp;
| &nbsp;
  <!-- BSD, Solaris -->
| &nbsp;
| &nbsp;
  <!-- iOS -->
| style="background: green; color: white"|✓
|}
|}


Line 130: Line 202:
Here is a similar table, but to see which prefs get used in which product:
Here is a similar table, but to see which prefs get used in which product:


{|border="1" style="text-align: center;"
{|border="1" style="text-align: center; width: 100%"
!OS
!OS
!colspan="2"|Windows
!colspan="1"|Windows
!colspan="2"|OS X
!colspan="1"|OS X
!colspan="3"|Linux-gtk
!colspan="1"|Linux-gtk
!colspan="2"|Android
!colspan="2"|Android
!iOS
!iOS
Line 140: Line 212:
!Product
!Product
!Desktop
!Desktop
!B2G
!Desktop
!Desktop
!B2G
!Desktop
!Desktop
!B2G
!Mulet
!Fennec
!Fennec
!B2G
!GeckoView
!iOS
!iOS
|-
|-
|[https://hg.mozilla.org/mozilla-central/file/tip/modules/libpref/init/all.js all.js]
|[https://hg.mozilla.org/mozilla-central/file/tip/modules/libpref/init/all.js all.js]
|style="background: green; color: white"|✓
  <!-- Windows: Desktop -->
|style="background: green; color: white"|✓
| style="background: green; color: white"|✓
|style="background: green; color: white"|✓
  <!-- OS X: Desktop -->
|style="background: green; color: white"|✓
| style="background: green; color: white"|✓
|style="background: green; color: white"|✓
  <!-- Linux-gtk: Desktop -->
|style="background: green; color: white"|✓
| style="background: green; color: white"|✓
|style="background: green; color: white"|✓
  <!-- Android: Fennec, GeckoView -->
|style="background: green; color: white"|✓
| style="background: green; color: white"|✓
|style="background: green; color: white"|✓
| style="background: green; color: white"|✓
|style="background: green; color: white"|✓
  <!-- iOS -->
| style="background: green; color: white"|✓
|-
|-
|[https://hg.mozilla.org/mozilla-central/file/tip/browser/app/profile/firefox.js firefox.js]
|[https://hg.mozilla.org/mozilla-central/file/tip/browser/app/profile/firefox.js firefox.js]
|style="background: green; color: white"|✓
  <!-- Windows: Desktop -->
|&nbsp;
| style="background: green; color: white"|✓
|style="background: green; color: white"|✓
  <!-- OS X: Desktop -->
|&nbsp;
| style="background: green; color: white"|✓
|style="background: green; color: white"|✓
  <!-- Linux-gtk: Desktop -->
|&nbsp;
| style="background: green; color: white"|✓
|?
  <!-- Android: Fennec, GeckoView -->
|&nbsp;
| &nbsp;
|&nbsp;
| &nbsp;
|&nbsp;
  <!-- iOS -->
| &nbsp;
|-
|-
|[https://hg.mozilla.org/mozilla-central/file/tip/mobile/android/app/mobile.js mobile.js]
|[https://hg.mozilla.org/mozilla-central/file/tip/mobile/android/app/mobile.js mobile.js]
|&nbsp;||&nbsp;
  <!-- Windows: Desktop -->
|&nbsp;||&nbsp;
|  &nbsp;
|&nbsp;||&nbsp;||&nbsp;
  <!-- OS X: Desktop -->
|style="background: green; color: white"|✓
|  &nbsp;
|&nbsp;
  <!-- Linux-gtk: Desktop -->
|&nbsp;
|  &nbsp;
  <!-- Android: Fennec, GeckoView -->
|  style="background: green; color: white"|✓
|  ??
  <!-- iOS -->
| &nbsp;
|-
|[https://hg.mozilla.org/mozilla-central/file/tip/mobile/android/app/geckoview-prefs.js geckoview-prefs.js]
  <!-- Windows: Desktop -->
| &nbsp;
  <!-- OS X: Desktop -->
| &nbsp;
  <!-- Linux-gtk: Desktop -->
| &nbsp;
  <!-- Android: Fennec, GeckoView -->
| &nbsp;
| style="background: green; color: white"|✓
  <!-- iOS -->
&nbsp;
|}
 
== Reftest conditions ==
 
Here is another table that tells you what conditions are true on various platforms for use in reftest.list conditions.
 
{|border="1" style="text-align: center; width: 100%"
!OS
!colspan="1"|Windows
!colspan="1"|OS X
!colspan="1"|Linux-gtk
!colspan="2"|Android
!iOS
|-
!Product
!Desktop
!Desktop
!Desktop
!Fennec
!GeckoView
!iOS
|-
!Android
  <!-- Windows: Desktop -->
| &nbsp;
  <!-- OS X: Desktop -->
| &nbsp;
  <!-- Linux-gtk: Desktop -->
| &nbsp;
  <!-- Android: Fennec, GeckoView -->
| style="background: green; color: white"|✓
| style="background: green; color: white"|✓
  <!-- iOS -->
| &nbsp;
|-
|-
|[https://hg.mozilla.org/mozilla-central/file/tip/b2g/app/b2g.js b2g.js]
!geckoview
|&nbsp;
  <!-- Windows: Desktop -->
|style="background: green; color: white"|✓
| &nbsp;
|&nbsp;
  <!-- OS X: Desktop -->
|style="background: green; color: white"|✓
| &nbsp;
|&nbsp;
  <!-- Linux-gtk: Desktop -->
|style="background: green; color: white"|✓
| &nbsp;
|style="background: green; color: white"|✓
  <!-- Android: Fennec, GeckoView -->
|&nbsp;
| &nbsp;
|style="background: green; color: white"|✓
| style="background: green; color: white"|✓
|&nbsp;
  <!-- iOS -->
| &nbsp;
|-
|-
|[https://hg.mozilla.org/mozilla-central/file/tip/b2g/dev/app/mulet.js mulet.js]
!cocoaWidget
|&nbsp;
  <!-- Windows: Desktop -->
|&nbsp;
| &nbsp;
|&nbsp;
  <!-- OS X: Desktop -->
|&nbsp;
| style="background: green; color: white"|✓
|&nbsp;
  <!-- Linux-gtk: Desktop -->
|&nbsp;
&nbsp;
|style="background: green; color: white"|✓
  <!-- Android: Fennec, GeckoView -->
|&nbsp;
| &nbsp;
|&nbsp;
| &nbsp;
|&nbsp;
  <!-- iOS -->
| &nbsp;
|-
!gtkWidget
  <!-- Windows: Desktop -->
&nbsp;
  <!-- OS X: Desktop -->
| &nbsp;
  <!-- Linux-gtk: Desktop -->
| style="background: green; color: white"|✓
  <!-- Android: Fennec, GeckoView -->
| &nbsp;
| &nbsp;
  <!-- iOS -->
|  &nbsp;
|-
!qtWidget
  <!-- Windows: Desktop -->
|  &nbsp;
  <!-- OS X: Desktop -->
|  &nbsp;
  <!-- Linux-gtk: Desktop -->
|  &nbsp;
  <!-- Android: Fennec, GeckoView -->
|  &nbsp;
|  &nbsp;
  <!-- iOS -->
|  &nbsp;
|-
!winWidget
  <!-- Windows: Desktop -->
|  style="background: green; color: white"|✓
  <!-- OS X: Desktop -->
|  &nbsp;
  <!-- Linux-gtk: Desktop -->
|  &nbsp;
  <!-- Android: Fennec, GeckoView -->
|  &nbsp;
|  &nbsp;
  <!-- iOS -->
| &nbsp;
|}
|}


== Mochitest conditions ==
Here is another table that tells you what different condition values are on various platforms for use in mochitest.ini/a11y.ini/chrome.ini/browser.ini conditions.
{|border="1" style="text-align: center; width: 100%"
!OS
!colspan="1"|Windows
!colspan="1"|OS X
!colspan="1"|Linux-gtk
!colspan="2"|Android
!iOS
|-
!Product
!Desktop
!Desktop
!Desktop
!Fennec
!GeckoView
!iOS
|-
!os
  <!-- Windows: Desktop -->
|  win
  <!-- OS X: Desktop -->
|  mac
  <!-- Linux-gtk: Desktop -->
|  linux
  <!-- Android: Fennec, GeckoView -->
|  android
|  android
  <!-- iOS -->
|  ??
|-
!toolkit
  <!-- Windows: Desktop -->
|  windows
  <!-- OS X: Desktop -->
|  cocoa
  <!-- Linux-gtk: Desktop -->
|  gtk2 or gtk3
  <!-- Android: Fennec, GeckoView -->
|  android
|  android
  <!-- iOS -->
|  ??
|-
!buildapp
  <!-- Windows: Desktop -->
|  ??
  <!-- OS X: Desktop -->
|  ??
  <!-- Linux-gtk: Desktop -->
|  ??
  <!-- Android: Fennec, GeckoView -->
|  mobile/android
|  ??
  <!-- iOS -->
|  ??
|}
You may also be interested in [[Platform/Channel-specific_build_defines]]
You may also be interested in [[Platform/Channel-specific_build_defines]]
1

edit