# Below are the changes needed for generate-gn-build-files.sh # except for depot_tools # https://bugzilla.mozilla.org/show_bug.cgi?id=1654448 diff --git dom/media/webrtc/third_party_build/gn-configs/arm64_False_arm64_freebsd.mozconfig dom/media/webrtc/third_party_build/gn-configs/arm64_False_arm64_freebsd.mozconfig new file mode 100644 index 0000000000..7c76576969 --- /dev/null +++ dom/media/webrtc/third_party_build/gn-configs/arm64_False_arm64_freebsd.mozconfig @@ -0,0 +1,12 @@ +export M4=/usr/local/bin/gm4 +export CC=/usr/local/bin/clang13 +export CXX=/usr/local/bin/clang++13 +export CPP=/usr/local/bin/clang-cpp13 +ac_add_options --prefix="/usr/local" +ac_add_options --with-libclang-path="/usr/local/llvm13/lib" +ac_add_options --with-wasi-sysroot="/usr/local/share/wasi-sysroot" + +ac_add_options --target=aarch64 +ac_add_options --enable-bootstrap + +mk_add_options MOZ_OBJDIR=obj-arm64_False_arm64_freebsd diff --git dom/media/webrtc/third_party_build/gn-configs/arm64_True_arm64_freebsd.mozconfig dom/media/webrtc/third_party_build/gn-configs/arm64_True_arm64_freebsd.mozconfig new file mode 100644 index 0000000000..d056686355 --- /dev/null +++ dom/media/webrtc/third_party_build/gn-configs/arm64_True_arm64_freebsd.mozconfig @@ -0,0 +1,13 @@ +export M4=/usr/local/bin/gm4 +export CC=/usr/local/bin/clang13 +export CXX=/usr/local/bin/clang++13 +export CPP=/usr/local/bin/clang-cpp13 +ac_add_options --prefix="/usr/local" +ac_add_options --with-libclang-path="/usr/local/llvm13/lib" +ac_add_options --with-wasi-sysroot="/usr/local/share/wasi-sysroot" + +ac_add_options --target=aarch64 +ac_add_options --enable-debug +ac_add_options --enable-bootstrap + +mk_add_options MOZ_OBJDIR=obj-arm64_True_arm64_freebsd diff --git dom/media/webrtc/third_party_build/gn-configs/generate-gn-build-files.sh dom/media/webrtc/third_party_build/gn-configs/generate-gn-build-files.sh index 4452b0ce76..34a8ddf28e 100755 --- dom/media/webrtc/third_party_build/gn-configs/generate-gn-build-files.sh +++ dom/media/webrtc/third_party_build/gn-configs/generate-gn-build-files.sh @@ -57,17 +57,6 @@ set -eEuo pipefail SYS_NAME=`uname` -# Check for modified files and abort if present. -MODIFIED_FILES=`hg status --modified --added --exclude "**/moz.build" --exclude "dom/media/webrtc/third_party_build/**.json"` -if [ "x$MODIFIED_FILES" = "x" ]; then - # Completely clean the mercurial checkout before proceeding - hg update -C -r . - hg purge -else - echo "There are modified files in the checkout. Cowardly aborting!" - echo "$MODIFIED_FILES" - exit 1 -fi IS_WIN=0 IS_DARWIN=0 @@ -94,6 +83,10 @@ elif [ "x$SYS_NAME" = "xMINGW32_NT-6.2" ]; then IS_WIN=1 elif [ "x$SYS_NAME" = "xOpenBSD" ]; then CONFIGS="x64_False_x64_openbsd x64_True_x64_openbsd" +elif [ "x$SYS_NAME" = "xFreeBSD" ]; then + CONFIGS="x64_False_x64_freebsd x64_True_x64_freebsd" + CONFIGS="$CONFIGS x64_False_x86_freebsd x64_True_x86_freebsd" + #CONFIGS="arm64_False_arm64_freebsd arm64_True_arm64_freebsd" else # Ensure rust has the correct targets for building x86 and arm64. These # operations succeed quickly if previously completed. diff --git dom/media/webrtc/third_party_build/gn-configs/x64_False_x64_freebsd.mozconfig dom/media/webrtc/third_party_build/gn-configs/x64_False_x64_freebsd.mozconfig new file mode 100644 index 0000000000..37319939ba --- /dev/null +++ dom/media/webrtc/third_party_build/gn-configs/x64_False_x64_freebsd.mozconfig @@ -0,0 +1,11 @@ +export M4=/usr/local/bin/gm4 +export CC=/usr/local/bin/clang13 +export CXX=/usr/local/bin/clang++13 +export CPP=/usr/local/bin/clang-cpp13 +ac_add_options --prefix="/usr/local" +ac_add_options --with-libclang-path="/usr/local/llvm13/lib" +ac_add_options --with-wasi-sysroot="/usr/local/share/wasi-sysroot" + +ac_add_options --enable-bootstrap + +mk_add_options MOZ_OBJDIR=obj-x64_False_x64_freebsd diff --git dom/media/webrtc/third_party_build/gn-configs/x64_False_x86_freebsd.mozconfig dom/media/webrtc/third_party_build/gn-configs/x64_False_x86_freebsd.mozconfig new file mode 100644 index 0000000000..4bcac5d797 --- /dev/null +++ dom/media/webrtc/third_party_build/gn-configs/x64_False_x86_freebsd.mozconfig @@ -0,0 +1,12 @@ +export M4=/usr/local/bin/gm4 +export CC=/usr/local/bin/clang13 +export CXX=/usr/local/bin/clang++13 +export CPP=/usr/local/bin/clang-cpp13 +ac_add_options --prefix="/usr/local" +ac_add_options --with-libclang-path="/usr/local/llvm13/lib" +ac_add_options --with-wasi-sysroot="/usr/local/share/wasi-sysroot" + +ac_add_options --target=i686 +ac_add_options --enable-bootstrap + +mk_add_options MOZ_OBJDIR=obj-x64_False_x86_freebsd diff --git dom/media/webrtc/third_party_build/gn-configs/x64_True_x64_freebsd.mozconfig dom/media/webrtc/third_party_build/gn-configs/x64_True_x64_freebsd.mozconfig new file mode 100644 index 0000000000..7c5ae25d67 --- /dev/null +++ dom/media/webrtc/third_party_build/gn-configs/x64_True_x64_freebsd.mozconfig @@ -0,0 +1,12 @@ +export M4=/usr/local/bin/gm4 +export CC=/usr/local/bin/clang13 +export CXX=/usr/local/bin/clang++13 +export CPP=/usr/local/bin/clang-cpp13 +ac_add_options --prefix="/usr/local" +ac_add_options --with-libclang-path="/usr/local/llvm13/lib" +ac_add_options --with-wasi-sysroot="/usr/local/share/wasi-sysroot" + +ac_add_options --enable-debug +ac_add_options --enable-bootstrap + +mk_add_options MOZ_OBJDIR=obj-x64_True_x64_freebsd diff --git dom/media/webrtc/third_party_build/gn-configs/x64_True_x86_freebsd.mozconfig dom/media/webrtc/third_party_build/gn-configs/x64_True_x86_freebsd.mozconfig new file mode 100644 index 0000000000..ee95c64a23 --- /dev/null +++ dom/media/webrtc/third_party_build/gn-configs/x64_True_x86_freebsd.mozconfig @@ -0,0 +1,13 @@ +export M4=/usr/local/bin/gm4 +export CC=/usr/local/bin/clang13 +export CXX=/usr/local/bin/clang++13 +export CPP=/usr/local/bin/clang-cpp13 +ac_add_options --prefix="/usr/local" +ac_add_options --with-libclang-path="/usr/local/llvm13/lib" +ac_add_options --with-wasi-sysroot="/usr/local/share/wasi-sysroot" + +ac_add_options --target=i686 +ac_add_options --enable-debug +ac_add_options --enable-bootstrap + +mk_add_options MOZ_OBJDIR=obj-x64_True_x86_freebsd diff --git third_party/libwebrtc/build/config/BUILDCONFIG.gn third_party/libwebrtc/build/config/BUILDCONFIG.gn index fe6f5b7d2a..1092f99c65 100644 --- third_party/libwebrtc/build/config/BUILDCONFIG.gn +++ third_party/libwebrtc/build/config/BUILDCONFIG.gn @@ -131,10 +131,12 @@ declare_args() { is_official_build = false # Whether we're a traditional desktop unix. - is_desktop_linux = current_os == "linux" || current_os == "openbsd" + is_desktop_linux = current_os == "linux" || current_os == "openbsd" || + current_os == "freebsd" # Set to true when compiling with the Clang compiler. is_clang = current_os != "linux" || current_os == "openbsd" || + current_os == "freebsd" || (current_cpu != "s390x" && current_cpu != "s390" && current_cpu != "ppc64" && current_cpu != "ppc" && current_cpu != "mips" && current_cpu != "mips64") @@ -186,7 +188,7 @@ if (host_toolchain == "") { # TODO(dpranke): Add some sort of assert here that verifies that # no toolchain omitted host_toolchain from its toolchain_args(). - if (host_os == "linux" || host_os == "openbsd") { + if (host_os == "linux" || host_os == "openbsd" || host_os == "freebsd" ) { if (target_os != "linux") { host_toolchain = "//build/toolchain/linux:clang_$host_cpu" } else if (is_clang) { @@ -224,7 +226,8 @@ if (target_os == "android") { assert(host_os == "linux" || host_os == "mac", "Android builds are only supported on Linux and Mac hosts.") _default_toolchain = "//build/toolchain/android:android_clang_$target_cpu" -} else if (target_os == "chromeos" || target_os == "linux" || target_os == "openbsd") { +} else if (target_os == "chromeos" || target_os == "linux" || + target_os == "openbsd" || target_os == "freebsd") { # See comments in build/toolchain/cros/BUILD.gn about board compiles. if (is_clang) { _default_toolchain = "//build/toolchain/linux:clang_$target_cpu" @@ -289,7 +292,7 @@ is_chromeos = current_os == "chromeos" is_fuchsia = current_os == "fuchsia" is_ios = current_os == "ios" is_linux = current_os == "chromeos" || current_os == "linux" -is_bsd = current_os == "openbsd" +is_bsd = current_os == "openbsd" || current_os == "freebsd" is_mac = current_os == "mac" is_nacl = current_os == "nacl" is_win = current_os == "win" || current_os == "winuwp"