OLD | NEW |
---|---|
1 #!/bin/bash -e | 1 #!/bin/bash -e |
2 # | 2 # |
3 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 3 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
6 | 6 |
7 # This script is used to generate .gni files and files in the | 7 # This script is used to generate .gni files and files in the |
8 # config/platform directories needed to build libvpx. | 8 # config/platform directories needed to build libvpx. |
9 # Every time libvpx source code is updated just run this script. | 9 # Every time libvpx source code is updated just run this script. |
10 # | 10 # |
11 # Usage: | 11 # Usage: |
12 # $ ./generate_gni.sh [--disable-avx] [--only-configs] | 12 # $ ./generate_gni.sh [--disable-avx] [--only-configs] |
13 # | 13 # |
14 # The following optional flags are supported: | 14 # The following optional flags are supported: |
15 # --disable-avx : AVX+AVX2 support is disabled. | 15 # --disable-avx : AVX+AVX2 support is disabled. |
16 # --only-configs: Excludes generation of GN and GYP files (i.e. only | 16 # --only-configs : Excludes generation of GN and GYP files (i.e. only |
17 # configuration headers are generated). | 17 # configuration headers are generated). |
18 # --enable-vp9-highbitdepth : Allow for high bit depth internal, 10 and 12 bit | |
19 # vp9 encode and decode. | |
18 | 20 |
19 export LC_ALL=C | 21 export LC_ALL=C |
20 BASE_DIR=$(pwd) | 22 BASE_DIR=$(pwd) |
21 LIBVPX_SRC_DIR="source/libvpx" | 23 LIBVPX_SRC_DIR="source/libvpx" |
22 LIBVPX_CONFIG_DIR="source/config" | 24 LIBVPX_CONFIG_DIR="source/config" |
23 unset DISABLE_AVX | 25 unset DISABLE_AVX |
24 | 26 |
25 for i in "$@" | 27 for i in "$@" |
26 do | 28 do |
27 case $i in | 29 case $i in |
28 --disable-avx) | 30 --disable-avx) |
29 DISABLE_AVX="--disable-avx --disable-avx2" | 31 DISABLE_AVX="--disable-avx --disable-avx2" |
30 shift | 32 shift |
31 ;; | 33 ;; |
32 --only-configs) | 34 --only-configs) |
33 ONLY_CONFIGS=true | 35 ONLY_CONFIGS=true |
34 shift | 36 shift |
35 ;; | 37 ;; |
38 --enable-vp9-highbitdepth) | |
39 HIGHBD="--enable-vp9-highbitdepth" | |
40 shift | |
41 ;; | |
36 *) | 42 *) |
37 echo "Unknown option: $i" | 43 echo "Unknown option: $i" |
38 exit 1 | 44 exit 1 |
39 ;; | 45 ;; |
40 esac | 46 esac |
41 done | 47 done |
42 | 48 |
43 # Print license header. | 49 # Print license header. |
44 # $1 - Output base name | 50 # $1 - Output base name |
45 function write_license { | 51 function write_license { |
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
299 | 305 |
300 find_duplicates | 306 find_duplicates |
301 | 307 |
302 echo "Create temporary directory." | 308 echo "Create temporary directory." |
303 TEMP_DIR="$LIBVPX_SRC_DIR.temp" | 309 TEMP_DIR="$LIBVPX_SRC_DIR.temp" |
304 rm -rf $TEMP_DIR | 310 rm -rf $TEMP_DIR |
305 cp -R $LIBVPX_SRC_DIR $TEMP_DIR | 311 cp -R $LIBVPX_SRC_DIR $TEMP_DIR |
306 cd $TEMP_DIR | 312 cd $TEMP_DIR |
307 | 313 |
308 echo "Generate config files." | 314 echo "Generate config files." |
309 all_platforms="--enable-external-build --enable-postproc --disable-install-srcs --enable-multi-res-encoding --enable-temporal-denoising --disable-unit-tests --d isable-install-docs --disable-examples --enable-vp9-temporal-denoising --enable- vp9-postproc --size-limit=16384x16384 $DISABLE_AVX --as=yasm" | 315 all_platforms="--enable-external-build --enable-postproc --disable-install-srcs --enable-multi-res-encoding --enable-temporal-denoising --disable-unit-tests --d isable-install-docs --disable-examples --enable-vp9-temporal-denoising --enable- vp9-postproc --size-limit=16384x16384 $DISABLE_AVX --as=yasm $HIGHBD" |
jzern
2016/09/07 23:27:37
for now we only want to do this for x86 where we h
| |
310 gen_config_files linux/ia32 "--target=x86-linux-gcc --disable-ccache --enable-pi c --enable-realtime-only ${all_platforms}" | 316 gen_config_files linux/ia32 "--target=x86-linux-gcc --disable-ccache --enable-pi c --enable-realtime-only ${all_platforms}" |
311 gen_config_files linux/x64 "--target=x86_64-linux-gcc --disable-ccache --enable- pic --enable-realtime-only ${all_platforms}" | 317 gen_config_files linux/x64 "--target=x86_64-linux-gcc --disable-ccache --enable- pic --enable-realtime-only ${all_platforms}" |
312 gen_config_files linux/arm "--target=armv7-linux-gcc --enable-pic --enable-realt ime-only --disable-install-bins --disable-install-libs --disable-neon ${all_plat forms}" | 318 gen_config_files linux/arm "--target=armv7-linux-gcc --enable-pic --enable-realt ime-only --disable-install-bins --disable-install-libs --disable-neon ${all_plat forms}" |
313 gen_config_files linux/arm-neon "--target=armv7-linux-gcc --enable-pic --enable- realtime-only ${all_platforms}" | 319 gen_config_files linux/arm-neon "--target=armv7-linux-gcc --enable-pic --enable- realtime-only ${all_platforms}" |
314 gen_config_files linux/arm-neon-cpu-detect "--target=armv7-linux-gcc --enable-pi c --enable-realtime-only --enable-runtime-cpu-detect ${all_platforms}" | 320 gen_config_files linux/arm-neon-cpu-detect "--target=armv7-linux-gcc --enable-pi c --enable-realtime-only --enable-runtime-cpu-detect ${all_platforms}" |
315 gen_config_files linux/arm64 "--force-target=armv8-linux-gcc --enable-pic --enab le-realtime-only ${all_platforms}" | 321 gen_config_files linux/arm64 "--force-target=armv8-linux-gcc --enable-pic --enab le-realtime-only ${all_platforms}" |
316 gen_config_files linux/mipsel "--target=mips32-linux-gcc ${all_platforms}" | 322 gen_config_files linux/mipsel "--target=mips32-linux-gcc ${all_platforms}" |
317 gen_config_files linux/mips64el "--target=mips64-linux-gcc ${all_platforms}" | 323 gen_config_files linux/mips64el "--target=mips64-linux-gcc ${all_platforms}" |
318 gen_config_files linux/generic "--target=generic-gnu --enable-pic --enable-realt ime-only ${all_platforms}" | 324 gen_config_files linux/generic "--target=generic-gnu --enable-pic --enable-realt ime-only ${all_platforms}" |
319 gen_config_files win/ia32 "--target=x86-win32-vs12 --enable-realtime-only ${all_ platforms}" | 325 gen_config_files win/ia32 "--target=x86-win32-vs12 --enable-realtime-only ${all_ platforms}" |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
438 | 444 |
439 gn format --in-place $BASE_DIR/BUILD.gn | 445 gn format --in-place $BASE_DIR/BUILD.gn |
440 gn format --in-place $BASE_DIR/libvpx_srcs.gni | 446 gn format --in-place $BASE_DIR/libvpx_srcs.gni |
441 | 447 |
442 cd $BASE_DIR/$LIBVPX_SRC_DIR | 448 cd $BASE_DIR/$LIBVPX_SRC_DIR |
443 update_readme | 449 update_readme |
444 | 450 |
445 cd $BASE_DIR | 451 cd $BASE_DIR |
446 | 452 |
447 # TODO(fgalligan): Can we turn on "--enable-realtime-only" for mipsel? | 453 # TODO(fgalligan): Can we turn on "--enable-realtime-only" for mipsel? |
OLD | NEW |