|
@@ -1,15 +1,56 @@
|
|
|
. $topsrcdir/mozconfig-[% IF c("var/osx"); GET 'macos-x86_64'; ELSE; GET c("var/osname"); END; %][% IF c("var/asan") %]-asan[% END %]
|
|
|
|
|
|
[% IF c("var/linux") -%]
|
|
|
- # We want to build with clang now and point to the GCC toolchain until #29041 is
|
|
|
- # fixed. We explicitly need to define the host compiler as well as for some
|
|
|
- # reason the gcc-toolchain argument does not get passed along otherwise.
|
|
|
- CC="clang --gcc-toolchain=/var/tmp/dist/gcc"
|
|
|
- CXX="clang++ --gcc-toolchain=/var/tmp/dist/gcc"
|
|
|
- HOST_CC=$CC
|
|
|
- HOST_CXX=$CXX
|
|
|
-
|
|
|
- export BINDGEN_CFLAGS='--gcc-toolchain=/var/tmp/dist/gcc'
|
|
|
+ [% IF c("var/linux-cross") %]
|
|
|
+ CROSS_COMPILE=1
|
|
|
+
|
|
|
+ CC="clang -B /var/tmp/dist/binutils/bin"
|
|
|
+ CXX="clang++ -B /var/tmp/dist/binutils/bin"
|
|
|
+ HOST_CC="clang"
|
|
|
+ HOST_CXX="clang++"
|
|
|
+
|
|
|
+ export LDFLAGS="-Wl,-rpath-link=/lib/[% c('var/crosstarget') %] -Wl,-rpath-link=/usr/lib/[% c('var/crosstarget') %]"
|
|
|
+
|
|
|
+ ac_add_options --target=[% c('var/crosstarget') %]
|
|
|
+ ac_add_options --with-toolchain-prefix=[% c('var/crosstarget') %]-
|
|
|
+ mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/obj-[% c("arch") %]
|
|
|
+
|
|
|
+ # From Mozilla MDN "Compiling 32-bit Firefox on a Linux 64-bit OS" docs
|
|
|
+ # Fixes "error: Can't find header fontconfig/fcfreetype.h"
|
|
|
+ mk_add_options MOZ_TREE_FREETYPE=1
|
|
|
+
|
|
|
+ # Bug 31448: ld.gold fails if we don't disable debug-symbols
|
|
|
+ ac_add_options --disable-debug-symbols
|
|
|
+
|
|
|
+ [% IF c("var/linux-arm") %]
|
|
|
+ # Architecture flags from Debian armhf compiler
|
|
|
+ ac_add_options --with-arch=armv7-a
|
|
|
+ # TODO: Consider enabling NEON here?
|
|
|
+ # Debian does not, but Arch Linux ARM does.
|
|
|
+ ac_add_options --with-fpu=vfpv3-d16
|
|
|
+ ac_add_options --with-float-abi=hard
|
|
|
+ ac_add_options --with-thumb=yes
|
|
|
+
|
|
|
+ # From Arch Linux ARM for ESR91
|
|
|
+ # https://github.com/archlinuxarm/PKGBUILDs/blob/2242af725c21a82a8e9ecc1d38f1b94cd6ea01ef/extra/firefox/PKGBUILD
|
|
|
+ ac_add_options --disable-elf-hack
|
|
|
+ ac_add_options --disable-av1
|
|
|
+ ac_add_options --enable-optimize="-g0 -O2"
|
|
|
+ # One of the following two lines (not sure which) prevents "read-only segment has dynamic relocations" linker error.
|
|
|
+ export MOZ_DEBUG_FLAGS=" "
|
|
|
+ export RUSTFLAGS="-Cdebuginfo=0"
|
|
|
+ [% END %]
|
|
|
+ [% ELSE %]
|
|
|
+ # We want to build with clang now and point to the GCC toolchain until #29041 is
|
|
|
+ # fixed. We explicitly need to define the host compiler as well as for some
|
|
|
+ # reason the gcc-toolchain argument does not get passed along otherwise.
|
|
|
+ CC="clang --gcc-toolchain=/var/tmp/dist/gcc"
|
|
|
+ CXX="clang++ --gcc-toolchain=/var/tmp/dist/gcc"
|
|
|
+ HOST_CC=$CC
|
|
|
+ HOST_CXX=$CXX
|
|
|
+
|
|
|
+ export BINDGEN_CFLAGS='--gcc-toolchain=/var/tmp/dist/gcc'
|
|
|
+ [% END %]
|
|
|
[% END -%]
|
|
|
|
|
|
[% IF c("var/windows") -%]
|
|
@@ -63,6 +104,31 @@
|
|
|
ac_add_options --enable-verify-mar
|
|
|
[% END -%]
|
|
|
|
|
|
+[% IF ! c("var/linux-cross") %]
|
|
|
+ # Let's make sure no preference is enabling either Adobe's or Google's CDM.
|
|
|
+ # TODO: Firefox ESR 91 has a stupid bug. The --enable-eme flag is defined
|
|
|
+ # with "when=eme_choices". eme_choices is defined as follows:
|
|
|
+ # def eme_choices(target):
|
|
|
+ # if (target.kernel in ('Darwin', 'WINNT', 'Linux') and
|
|
|
+ # target.os not in ('Android', 'iOS') and
|
|
|
+ # target.cpu in ('x86', 'x86_64')):
|
|
|
+ # return ('widevine',)
|
|
|
+ # if target.kernel == 'WINNT' and target.cpu == 'aarch64':
|
|
|
+ # return ('widevine',)
|
|
|
+ # Which excludes our linux-cross targets. When the "when" condition for
|
|
|
+ # --enable-foo isn't enabled, it's also not enabled for --disable-foo. So
|
|
|
+ # using --disable-eme on linux-cross results in the error
|
|
|
+ # "mozbuild.configure.options.InvalidOptionError: --disable-eme is not
|
|
|
+ # available in this configuration". This means we have to omit --disable-eme
|
|
|
+ # on linux-cross. Which means EME will stay disabled... UNTIL Mozilla
|
|
|
+ # implements EME for one of our linux-cross targets. At which point EME will
|
|
|
+ # silently enable itself in Tor Browser for that target unless the Tor devs
|
|
|
+ # carefully audit all merges from upstream to see if they implement EME for
|
|
|
+ # one of our linux-cross targets. Someone should report this to Mozilla and
|
|
|
+ # get it fixed upstream.
|
|
|
+ ac_add_options --disable-eme
|
|
|
+[% END %]
|
|
|
+
|
|
|
ac_add_options --with-relative-profile=[% c('var/ProjectName') %]/Data/Browser
|
|
|
mk_add_options MOZ_APP_DISPLAYNAME="[% c('var/Project_Name') %]"
|
|
|
|