| 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 # |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 | 117 |
| 118 # Select all x86 files ending with .c | 118 # Select all x86 files ending with .c |
| 119 local intrinsic_list=$(echo "$source_list" | \ | 119 local intrinsic_list=$(echo "$source_list" | \ |
| 120 egrep '(mmx|sse2|sse3|ssse3|sse4|avx|avx2).c$') | 120 egrep '(mmx|sse2|sse3|ssse3|sse4|avx|avx2).c$') |
| 121 | 121 |
| 122 # Select all neon files ending in C but only when building in RTCD mode | 122 # Select all neon files ending in C but only when building in RTCD mode |
| 123 if [ "libvpx_srcs_arm_neon_cpu_detect" == "$2" ]; then | 123 if [ "libvpx_srcs_arm_neon_cpu_detect" == "$2" ]; then |
| 124 # Select all arm neon files ending in _neon.c and all asm files. | 124 # Select all arm neon files ending in _neon.c and all asm files. |
| 125 # The asm files need to be included in the intrinsics target because | 125 # The asm files need to be included in the intrinsics target because |
| 126 # they need the -mfpu=neon flag. | 126 # they need the -mfpu=neon flag. |
| 127 # the pattern may need to be updated if vpx_scale gets intrinics | 127 # the pattern may need to be updated if vpx_scale gets intrinsics |
| 128 local intrinsic_list=$(echo "$source_list" | \ | 128 local intrinsic_list=$(echo "$source_list" | \ |
| 129 egrep 'neon.*(\.c|\.asm)$') | 129 egrep 'neon.*(\.c|\.asm)$') |
| 130 fi | 130 fi |
| 131 | 131 |
| 132 # Remove these files from the main list. | 132 # Remove these files from the main list. |
| 133 source_list=$(comm -23 <(echo "$source_list") <(echo "$intrinsic_list")) | 133 source_list=$(comm -23 <(echo "$source_list") <(echo "$intrinsic_list")) |
| 134 | 134 |
| 135 local x86_list=$(echo "$source_list" | egrep '/x86/') | 135 local x86_list=$(echo "$source_list" | egrep '/x86/') |
| 136 | 136 |
| 137 # Write a single .gni file that includes all source files for all archs. | 137 # Write a single .gni file that includes all source files for all archs. |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 260 } | 260 } |
| 261 | 261 |
| 262 # Generate Config files. "--enable-external-build" must be set to skip | 262 # Generate Config files. "--enable-external-build" must be set to skip |
| 263 # detection of capabilities on specific targets. | 263 # detection of capabilities on specific targets. |
| 264 # $1 - Header file directory. | 264 # $1 - Header file directory. |
| 265 # $2 - Config command line. | 265 # $2 - Config command line. |
| 266 function gen_config_files { | 266 function gen_config_files { |
| 267 ./configure $2 > /dev/null | 267 ./configure $2 > /dev/null |
| 268 | 268 |
| 269 # Disable HAVE_UNISTD_H as it causes vp8 to try to detect how many cpus | 269 # Disable HAVE_UNISTD_H as it causes vp8 to try to detect how many cpus |
| 270 # available, which doesn't work from iniside a sandbox on linux. | 270 # available, which doesn't work from inside a sandbox on linux. |
| 271 ( echo '/HAVE_UNISTD_H/s/[01]/0/' ; echo 'w' ; echo 'q' ) | ed -s vpx_config.h | 271 ( echo '/HAVE_UNISTD_H/s/[01]/0/' ; echo 'w' ; echo 'q' ) | ed -s vpx_config.h |
| 272 | 272 |
| 273 # Generate vpx_config.asm. Do not create one for mips. | 273 # Generate vpx_config.asm. Do not create one for mips. |
| 274 if [[ "$1" != *mipsel && "$1" != *mips64el ]]; then | 274 if [[ "$1" != *mipsel && "$1" != *mips64el ]]; then |
| 275 if [[ "$1" == *x64* ]] || [[ "$1" == *ia32* ]]; then | 275 if [[ "$1" == *x64* ]] || [[ "$1" == *ia32* ]]; then |
| 276 egrep "#define [A-Z0-9_]+ [01]" vpx_config.h | awk '{print "%define " $2 "
" $3}' > vpx_config.asm | 276 egrep "#define [A-Z0-9_]+ [01]" vpx_config.h | awk '{print "%define " $2 "
" $3}' > vpx_config.asm |
| 277 else | 277 else |
| 278 egrep "#define [A-Z0-9_]+ [01]" vpx_config.h | awk '{print $2 " EQU " $3}'
| perl $BASE_DIR/$LIBVPX_SRC_DIR/build/make/ads2gas.pl > vpx_config.asm | 278 egrep "#define [A-Z0-9_]+ [01]" vpx_config.h | awk '{print $2 " EQU " $3}'
| perl $BASE_DIR/$LIBVPX_SRC_DIR/build/make/ads2gas.pl > vpx_config.asm |
| 279 fi | 279 fi |
| 280 fi | 280 fi |
| (...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 445 cd $BASE_DIR | 445 cd $BASE_DIR |
| 446 rm -rf $TEMP_DIR | 446 rm -rf $TEMP_DIR |
| 447 | 447 |
| 448 gn format --in-place $BASE_DIR/BUILD.gn | 448 gn format --in-place $BASE_DIR/BUILD.gn |
| 449 gn format --in-place $BASE_DIR/libvpx_srcs.gni | 449 gn format --in-place $BASE_DIR/libvpx_srcs.gni |
| 450 | 450 |
| 451 cd $BASE_DIR/$LIBVPX_SRC_DIR | 451 cd $BASE_DIR/$LIBVPX_SRC_DIR |
| 452 update_readme | 452 update_readme |
| 453 | 453 |
| 454 cd $BASE_DIR | 454 cd $BASE_DIR |
| 455 | |
| 456 # TODO(fgalligan): Can we turn on "--enable-realtime-only" for mipsel? | |
| OLD | NEW |