From deeea06da209ee10c0d37cb37a8a24d54a3f7758 Mon Sep 17 00:00:00 2001 From: John Preston Date: Tue, 11 Aug 2020 13:48:57 +0400 Subject: [PATCH] Add webrtc build scripts. --- webrtc.gclient => webrtc/.gclient | 0 webrtc_build.diff => webrtc/build.diff | 0 webrtc/configure.bat | 64 +++++++++ webrtc/configure.sh | 135 ++++++++++++++++++ webrtc_libsrtp.diff => webrtc/libsrtp.diff | 0 webrtc_src.diff => webrtc/src.diff | 0 .../third_party.diff | 0 7 files changed, 199 insertions(+) rename webrtc.gclient => webrtc/.gclient (100%) rename webrtc_build.diff => webrtc/build.diff (100%) create mode 100644 webrtc/configure.bat create mode 100755 webrtc/configure.sh rename webrtc_libsrtp.diff => webrtc/libsrtp.diff (100%) rename webrtc_src.diff => webrtc/src.diff (100%) rename webrtc_third_party.diff => webrtc/third_party.diff (100%) diff --git a/webrtc.gclient b/webrtc/.gclient similarity index 100% rename from webrtc.gclient rename to webrtc/.gclient diff --git a/webrtc_build.diff b/webrtc/build.diff similarity index 100% rename from webrtc_build.diff rename to webrtc/build.diff diff --git a/webrtc/configure.bat b/webrtc/configure.bat new file mode 100644 index 0000000..c3b661c --- /dev/null +++ b/webrtc/configure.bat @@ -0,0 +1,64 @@ +@echo off +setlocal EnableDelayedExpansion +set DEPOT_TOOLS_WIN_TOOLCHAIN=0 + +echo Configuring "out/Debug" build... + +call gn gen out/Debug --ide=vs --args="!="!^ + host_cpu=\"x86\" !="^"!^ + target_os=\"win\" !="^"!^ + is_clang=false !="^"!^ + is_component_build=false !="^"!^ + is_debug=true !="^"!^ + symbol_level=2 !="^"!^ + proprietary_codecs=true !="^"!^ + use_custom_libcxx=false !="^"!^ + use_system_libjpeg=true !="^"!^ + system_libjpeg_root=\"../../../qt_5_12_8/qtbase/src/3rdparty/libjpeg\" !="^"!^ + enable_iterator_debugging=true !="^"!^ + rtc_include_tests=false !="^"!^ + rtc_build_examples=false !="^"!^ + rtc_build_tools=false !="^"!^ + rtc_build_opus=false !="^"!^ + rtc_build_ssl=false !="^"!^ + rtc_ssl_root=\"../../../openssl_1_1_1/include\" !="^"!^ + rtc_ssl_libs=[\"../../../openssl_1_1_1/out32.dbg/libssl.lib\",\"../../../openssl_1_1_1/out32.dbg/libcrypto.lib\"] !="^"!^ + rtc_builtin_ssl_root_certificates=true !="^"!^ + rtc_build_ffmpeg=false !="^"!^ + rtc_ffmpeg_root=\"../../../ffmpeg\" !="^"!^ + rtc_ffmpeg_libs=[\"../../../ffmpeg/libavutil/libavutil.a\",\"../../../ffmpeg/libavcodec/libavcodec.a\",\"../../../ffmpeg/libswscale/libswscale.a\",\"../../../ffmpeg/libswresample/libswresample.a\"] !="^"!^ + rtc_opus_root=\"../../../opus/include\" !="^"!^ + rtc_enable_protobuf=false !="^"!^ +" + +echo Configuring "out/Release" build... + +call gn gen out/Release --ide=vs --args="!="!^ + host_cpu=\"x86\" !="^"!^ + target_os=\"win\" !="^"!^ + is_clang=false !="^"!^ + is_component_build=false !="^"!^ + is_debug=false !="^"!^ + symbol_level=1 !="^"!^ + proprietary_codecs=true !="^"!^ + use_custom_libcxx=false !="^"!^ + use_system_libjpeg=true !="^"!^ + system_libjpeg_root=\"../../../qt_5_12_8/qtbase/src/3rdparty/libjpeg\" !="^"!^ + enable_iterator_debugging=false !="^"!^ + rtc_include_tests=false !="^"!^ + rtc_build_examples=false !="^"!^ + rtc_build_tools=false !="^"!^ + rtc_build_opus=false !="^"!^ + rtc_build_ssl=false !="^"!^ + rtc_ssl_root=\"../../../openssl_1_1_1/include\" !="^"!^ + rtc_ssl_libs=[\"../../../openssl_1_1_1/out32/libssl.lib\",\"../../../openssl_1_1_1/out32/libcrypto.lib\"] !="^"!^ + rtc_builtin_ssl_root_certificates=true !="^"!^ + rtc_build_ffmpeg=false !="^"!^ + rtc_ffmpeg_root=\"../../../ffmpeg\" !="^"!^ + rtc_ffmpeg_libs=[\"../../../ffmpeg/libavutil/libavutil.a\",\"../../../ffmpeg/libavcodec/libavcodec.a\",\"../../../ffmpeg/libswscale/libswscale.a\",\"../../../ffmpeg/libswresample/libswresample.a\"] !="^"!^ + rtc_opus_root=\"../../../opus/include\" !="^"!^ + rtc_enable_protobuf=false !="^"!^ +" + +echo. +echo Configuration done, now run "ninja -C out/Debug webrtc" and "ninja -C out/Release webrtc". diff --git a/webrtc/configure.sh b/webrtc/configure.sh new file mode 100755 index 0000000..b731091 --- /dev/null +++ b/webrtc/configure.sh @@ -0,0 +1,135 @@ +echo Configuring "out/Debug" build... + +if [[ "$OSTYPE" == "darwin"* ]]; then + ArgumentsList=`echo \ + host_cpu=\"x64\" \ + target_os=\"mac\" \ + is_component_build=false \ + is_debug=true \ + symbol_level=2 \ + proprietary_codecs=true \ + use_custom_libcxx=false \ + use_system_libjpeg=true \ + system_libjpeg_root=\"../../../qt_5_12_8/qtbase/src/3rdparty/libjpeg\" \ + use_xcode_clang=true \ + use_rtti=true \ + enable_iterator_debugging=true \ + enable_dsyms=true \ + mac_deployment_target=\"10.12.0\" \ + rtc_include_tests=false \ + rtc_build_examples=false \ + rtc_build_tools=false \ + rtc_build_opus=false \ + rtc_build_ssl=false \ + rtc_ssl_root=\"../../../openssl_1_1_1/include\" \ + rtc_ssl_libs=[\"../../../openssl_1_1_1/libssl.a\",\"../../../openssl_1_1_1/libcrypto.a\"] \ + rtc_builtin_ssl_root_certificates=true \ + rtc_build_ffmpeg=false \ + rtc_ffmpeg_root=\"../../../ffmpeg\" \ + rtc_ffmpeg_libs=[\"../../../ffmpeg/libavcodec/libavcodec.a\",\"../../../ffmpeg/libswscale/libswscale.a\",\"../../../ffmpeg/libswresample/libswresample.a\",\"../../../ffmpeg/libavutil/libavutil.a\",\"/usr/local/macos/lib/libiconv.a\",\"CoreVideo.framework\"] \ + rtc_opus_root=\"../../../opus/include\" \ + rtc_enable_protobuf=false` + + gn gen out/Debug --ide=xcode --args="$ArgumentsList" +else + ArgumentsList=`echo \ + host_cpu=\"x64\" \ + target_os=\"linux\" \ + is_component_build=false \ + is_debug=true \ + is_clang=false \ + symbol_level=2 \ + proprietary_codecs=true \ + use_custom_libcxx=false \ + use_system_libjpeg=true \ + system_libjpeg_root=\"../../../qt_5_12_8/qtbase/src/3rdparty/libjpeg\" \ + use_rtti=true \ + use_gold=false \ + use_sysroot=false \ + linux_use_bundled_binutils=false \ + enable_dsyms=true \ + rtc_include_tests=false \ + rtc_build_examples=false \ + rtc_build_tools=false \ + rtc_build_opus=false \ + rtc_build_ssl=false \ + rtc_ssl_root=\"../../../openssl_1_1_1/include\" \ + rtc_ssl_libs=[\"../../../openssl_1_1_1/libssl.a\",\"../../../openssl_1_1_1/libcrypto.a\",\"/lib/x86_64-linux-gnu/libdl.so.2\",\"/usr/lib/x86_64-linux-gnu/libpthread.so\"] \ + rtc_builtin_ssl_root_certificates=true \ + rtc_build_ffmpeg=false \ + rtc_ffmpeg_root=\"../../../ffmpeg\" \ + rtc_ffmpeg_libs=[\"../../../ffmpeg/libavcodec/libavcodec.a\",\"../../../ffmpeg/libswscale/libswscale.a\",\"../../../ffmpeg/libswresample/libswresample.a\",\"../../../ffmpeg/libavutil/libavutil.a\",\"/usr/local/lib/libva-x11.a\",\"/usr/local/lib/libva-drm.a\",\"/usr/local/lib/libva.a\",\"/usr/local/lib/libvdpau.a\",\"/usr/lib/x86_64-linux-gnu/libdrm.a\",\"/usr/lib/x86_64-linux-gnu/libXfixes.a\",\"/usr/lib/x86_64-linux-gnu/libXext.a\",\"/usr/lib/x86_64-linux-gnu/libX11.a\",\"/usr/lib/x86_64-linux-gnu/libxcb.a\",\"/usr/lib/x86_64-linux-gnu/libXau.a\",\"/usr/lib/x86_64-linux-gnu/libXdmcp.a\",\"/usr/lib/x86_64-linux-gnu/libdbus-1.a\"] \ + rtc_opus_root=\"../../../opus/include\" \ + rtc_enable_protobuf=false` + + gn gen out/Debug --args="$ArgumentsList" +fi + +echo Configuring "out/Release" build... + +if [[ "$OSTYPE" == "darwin"* ]]; then + ArgumentsList=`echo \ + host_cpu=\"x64\" \ + target_os=\"mac\" \ + is_component_build=false \ + is_debug=false \ + symbol_level=2 \ + proprietary_codecs=true \ + use_custom_libcxx=false \ + use_system_libjpeg=true \ + system_libjpeg_root=\"../../../qt_5_12_8/qtbase/src/3rdparty/libjpeg\" \ + use_xcode_clang=true \ + use_rtti=true \ + enable_iterator_debugging=false \ + enable_dsyms=true \ + mac_deployment_target=\"10.12.0\" \ + rtc_include_tests=false \ + rtc_build_examples=false \ + rtc_build_tools=false \ + rtc_build_opus=false \ + rtc_build_ssl=false \ + rtc_ssl_root=\"../../../openssl_1_1_1/include\" \ + rtc_ssl_libs=[\"../../../openssl_1_1_1/libssl.a\",\"../../../openssl_1_1_1/libcrypto.a\"] \ + rtc_builtin_ssl_root_certificates=true \ + rtc_build_ffmpeg=false \ + rtc_ffmpeg_root=\"../../../ffmpeg\" \ + rtc_ffmpeg_libs=[\"../../../ffmpeg/libavcodec/libavcodec.a\",\"../../../ffmpeg/libswscale/libswscale.a\",\"../../../ffmpeg/libswresample/libswresample.a\",\"../../../ffmpeg/libavutil/libavutil.a\",\"/usr/local/macos/lib/libiconv.a\",\"CoreVideo.framework\"] \ + rtc_opus_root=\"../../../opus/include\" \ + rtc_enable_protobuf=false` + + gn gen out/Release --ide=xcode --args="$ArgumentsList" +else + ArgumentsList=`echo \ + host_cpu=\"x64\" \ + target_os=\"linux\" \ + is_component_build=false \ + is_debug=false \ + is_clang=false \ + symbol_level=2 \ + proprietary_codecs=true \ + use_custom_libcxx=false \ + use_system_libjpeg=true \ + system_libjpeg_root=\"../../../qt_5_12_8/qtbase/src/3rdparty/libjpeg\" \ + use_rtti=true \ + use_gold=false \ + use_sysroot=false \ + linux_use_bundled_binutils=false \ + enable_dsyms=true \ + rtc_include_tests=false \ + rtc_build_examples=false \ + rtc_build_tools=false \ + rtc_build_opus=false \ + rtc_build_ssl=false \ + rtc_ssl_root=\"../../../openssl_1_1_1/include\" \ + rtc_ssl_libs=[\"../../../openssl_1_1_1/libssl.a\",\"../../../openssl_1_1_1/libcrypto.a\",\"/lib/x86_64-linux-gnu/libdl.so.2\",\"/usr/lib/x86_64-linux-gnu/libpthread.so\"] \ + rtc_builtin_ssl_root_certificates=true \ + rtc_build_ffmpeg=false \ + rtc_ffmpeg_root=\"../../../ffmpeg\" \ + rtc_ffmpeg_libs=[\"../../../ffmpeg/libavcodec/libavcodec.a\",\"../../../ffmpeg/libswscale/libswscale.a\",\"../../../ffmpeg/libswresample/libswresample.a\",\"../../../ffmpeg/libavutil/libavutil.a\",\"/usr/local/lib/libva-x11.a\",\"/usr/local/lib/libva-drm.a\",\"/usr/local/lib/libva.a\",\"/usr/local/lib/libvdpau.a\",\"/usr/lib/x86_64-linux-gnu/libdrm.a\",\"/usr/lib/x86_64-linux-gnu/libXfixes.a\",\"/usr/lib/x86_64-linux-gnu/libXext.a\",\"/usr/lib/x86_64-linux-gnu/libX11.a\",\"/usr/lib/x86_64-linux-gnu/libxcb.a\",\"/usr/lib/x86_64-linux-gnu/libXau.a\",\"/usr/lib/x86_64-linux-gnu/libXdmcp.a\",\"/usr/lib/x86_64-linux-gnu/libdbus-1.a\"] \ + rtc_opus_root=\"../../../opus/include\" \ + rtc_enable_protobuf=false` + + gn gen out/Release --args="$ArgumentsList" +fi + +echo Configuration done, now run \"ninja -C out/Debug webrtc\" and \"ninja -C out/Release webrtc\". diff --git a/webrtc_libsrtp.diff b/webrtc/libsrtp.diff similarity index 100% rename from webrtc_libsrtp.diff rename to webrtc/libsrtp.diff diff --git a/webrtc_src.diff b/webrtc/src.diff similarity index 100% rename from webrtc_src.diff rename to webrtc/src.diff diff --git a/webrtc_third_party.diff b/webrtc/third_party.diff similarity index 100% rename from webrtc_third_party.diff rename to webrtc/third_party.diff