mozconfig 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. . $topsrcdir/mozconfig-[% IF c("var/osx"); GET 'macos-x86_64'; ELSE; GET c("var/osname"); END; %][% IF c("var/asan") %]-asan[% END %]
  2. [% IF c("var/linux") -%]
  3. # We want to build with clang now and point to the GCC toolchain until #29041 is
  4. # fixed. We explicitly need to define the host compiler as well as for some
  5. # reason the gcc-toolchain argument does not get passed along otherwise.
  6. CC="clang --gcc-toolchain=/var/tmp/dist/gcc"
  7. CXX="clang++ --gcc-toolchain=/var/tmp/dist/gcc"
  8. HOST_CC=$CC
  9. HOST_CXX=$CXX
  10. export BINDGEN_CFLAGS='--gcc-toolchain=/var/tmp/dist/gcc'
  11. [% END -%]
  12. [% IF c("var/windows") -%]
  13. CROSS_COMPILE=1
  14. HOST_CC="clang"
  15. HOST_CXX="clang++"
  16. CC="[% c('arch') %]-w64-mingw32-clang"
  17. CXX="[% c('arch') %]-w64-mingw32-clang++"
  18. CXXFLAGS="-fms-extensions"
  19. AR=llvm-ar
  20. RANLIB=llvm-ranlib
  21. clang_path=/var/tmp/dist/mingw-w64-clang
  22. # For Stylo
  23. BINDGEN_CFLAGS="-I$clang_path/[% c('arch') %]-w64-mingw32/include/c++/v1 -I$clang_path/[% c('arch') %]-w64-mingw32/include"
  24. [% END -%]
  25. [% IF c("var/osx") -%]
  26. TOOLCHAIN_DIR=/var/tmp/dist/macosx-toolchain
  27. # ld needs libLTO.so from llvm
  28. mk_add_options "export LD_LIBRARY_PATH=$TOOLCHAIN_DIR/clang/lib"
  29. CROSS_CCTOOLS_PATH=$TOOLCHAIN_DIR/cctools
  30. CROSS_SYSROOT=$TOOLCHAIN_DIR/MacOSX10.12.sdk
  31. CROSS_PRIVATE_FRAMEWORKS=$CROSS_SYSROOT/System/Library/PrivateFrameworks
  32. HARDENING_FLAGS="-Werror=format -Werror=format-security -fstack-protector-strong -D_FORTIFY_SOURCE=2"
  33. FLAGS="-target x86_64-apple-darwin -B $CROSS_CCTOOLS_PATH/bin -isysroot $CROSS_SYSROOT $HARDENING_FLAGS"
  34. export CC="$TOOLCHAIN_DIR/clang/bin/clang $FLAGS"
  35. export CXX="$TOOLCHAIN_DIR/clang/bin/clang++ $FLAGS"
  36. export LLVMCONFIG=$TOOLCHAIN_DIR/clang/bin/llvm-config
  37. export LDFLAGS="-Wl,-syslibroot,$CROSS_SYSROOT -Wl,-pie"
  38. export BINDGEN_CFLAGS="$FLAGS"
  39. export TOOLCHAIN_PREFIX=$CROSS_CCTOOLS_PATH/bin/x86_64-apple-darwin-
  40. export DSYMUTIL="$TOOLCHAIN_DIR/clang/bin/dsymutil"
  41. export HOST_CFLAGS="-g"
  42. export HOST_CXXFLAGS="-g"
  43. export HOST_LDFLAGS="-g"
  44. ac_add_options --target=x86_64-apple-darwin
  45. export MACOS_SDK_DIR=$CROSS_SYSROOT
  46. export MACOS_PRIVATE_FRAMEWORKS_DIR=$CROSS_PRIVATE_FRAMEWORKS
  47. [% END -%]
  48. [% IF c("var/tor-browser") %]
  49. ac_add_options --enable-tor-browser-update
  50. ac_add_options --enable-verify-mar
  51. [% END -%]
  52. ac_add_options --with-relative-profile=[% c('var/ProjectName') %]/Data/Browser
  53. mk_add_options MOZ_APP_DISPLAYNAME="[% c('var/Project_Name') %]"