Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(247)

Side by Side Diff: generate_gypi.sh

Issue 1124333011: libvpx: Pull from upstream (Closed) Base URL: https://chromium.googlesource.com/chromium/deps/libvpx.git@master
Patch Set: only update to last nights LKGR Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « README.chromium ('k') | libvpx_srcs.gni » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 .gypi, .gni files and files in the 7 # This script is used to generate .gypi, .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 208 matching lines...) Expand 10 before | Expand all | Expand 10 after
219 local source_list=$(grep -E '(\.c|\.h|\.S|\.s|\.asm)$' $1) 219 local source_list=$(grep -E '(\.c|\.h|\.S|\.s|\.asm)$' $1)
220 220
221 # Not sure why vpx_config is not included. 221 # Not sure why vpx_config is not included.
222 source_list=$(echo "$source_list" | grep -v 'vpx_config\.c') 222 source_list=$(echo "$source_list" | grep -v 'vpx_config\.c')
223 223
224 # The actual ARM files end in .asm. We have rules to translate them to .S 224 # The actual ARM files end in .asm. We have rules to translate them to .S
225 source_list=$(echo "$source_list" | sed s/\.asm\.s$/.asm/) 225 source_list=$(echo "$source_list" | sed s/\.asm\.s$/.asm/)
226 226
227 # Select all x86 files ending with .c 227 # Select all x86 files ending with .c
228 local intrinsic_list=$(echo "$source_list" | \ 228 local intrinsic_list=$(echo "$source_list" | \
229 egrep 'vp[89]/(encoder|decoder|common)/x86/' | \
230 egrep '(mmx|sse2|sse3|ssse3|sse4|avx|avx2).c$') 229 egrep '(mmx|sse2|sse3|ssse3|sse4|avx|avx2).c$')
231 230
232 # Select all neon files ending in C but only when building in RTCD mode 231 # Select all neon files ending in C but only when building in RTCD mode
233 if [ "libvpx_srcs_arm_neon_cpu_detect" == "$2" ]; then 232 if [ "libvpx_srcs_arm_neon_cpu_detect" == "$2" ]; then
234 # Select all arm neon files ending in _neon.c and all asm files. 233 # Select all arm neon files ending in _neon.c and all asm files.
235 # The asm files need to be included in the intrinsics target because 234 # The asm files need to be included in the intrinsics target because
236 # they need the -mfpu=neon flag. 235 # they need the -mfpu=neon flag.
237 # the pattern may need to be updated if vpx_scale gets intrinics 236 # the pattern may need to be updated if vpx_scale gets intrinics
238 local intrinsic_list=$(echo "$source_list" | \ 237 local intrinsic_list=$(echo "$source_list" | \
239 egrep 'vp[89]/(encoder|decoder|common)/arm/neon/.*(_neon\.c|\.asm)$') 238 egrep 'neon.*(\.c|\.asm)$')
240 fi 239 fi
241 240
242 # Remove these files from the main list. 241 # Remove these files from the main list.
243 source_list=$(comm -23 <(echo "$source_list") <(echo "$intrinsic_list")) 242 source_list=$(comm -23 <(echo "$source_list") <(echo "$intrinsic_list"))
244 243
245 local x86_list=$(echo "$source_list" | egrep '/x86/') 244 local x86_list=$(echo "$source_list" | egrep '/x86/')
246 245
247 write_gypi source_list "$BASE_DIR/$2.gypi" 246 write_gypi source_list "$BASE_DIR/$2.gypi"
248 247
249 # All the files are in a single "element." Check if the first element has 248 # All the files are in a single "element." Check if the first element has
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
357 $BASE_DIR/$LIBVPX_SRC_DIR/vp9/common/vp9_rtcd_defs.pl \ 356 $BASE_DIR/$LIBVPX_SRC_DIR/vp9/common/vp9_rtcd_defs.pl \
358 > $BASE_DIR/$LIBVPX_CONFIG_DIR/$1/vp9_rtcd.h 357 > $BASE_DIR/$LIBVPX_CONFIG_DIR/$1/vp9_rtcd.h
359 358
360 $BASE_DIR/$LIBVPX_SRC_DIR/build/make/rtcd.pl \ 359 $BASE_DIR/$LIBVPX_SRC_DIR/build/make/rtcd.pl \
361 --arch=$2 \ 360 --arch=$2 \
362 --sym=vpx_scale_rtcd \ 361 --sym=vpx_scale_rtcd \
363 --config=$BASE_DIR/$TEMP_DIR/libvpx.config \ 362 --config=$BASE_DIR/$TEMP_DIR/libvpx.config \
364 $BASE_DIR/$LIBVPX_SRC_DIR/vpx_scale/vpx_scale_rtcd.pl \ 363 $BASE_DIR/$LIBVPX_SRC_DIR/vpx_scale/vpx_scale_rtcd.pl \
365 > $BASE_DIR/$LIBVPX_CONFIG_DIR/$1/vpx_scale_rtcd.h 364 > $BASE_DIR/$LIBVPX_CONFIG_DIR/$1/vpx_scale_rtcd.h
366 365
366 $BASE_DIR/$LIBVPX_SRC_DIR/build/make/rtcd.pl \
367 --arch=$2 \
368 --sym=vpx_dsp_rtcd \
369 --config=$BASE_DIR/$TEMP_DIR/libvpx.config \
370 $BASE_DIR/$LIBVPX_SRC_DIR/vpx_dsp/vpx_dsp_rtcd_defs.pl \
371 > $BASE_DIR/$LIBVPX_CONFIG_DIR/$1/vpx_dsp_rtcd.h
372
367 rm -rf $BASE_DIR/$TEMP_DIR/libvpx.config 373 rm -rf $BASE_DIR/$TEMP_DIR/libvpx.config
368 } 374 }
369 375
370 # Generate Config files. "--enable-external-build" must be set to skip 376 # Generate Config files. "--enable-external-build" must be set to skip
371 # detection of capabilities on specific targets. 377 # detection of capabilities on specific targets.
372 # $1 - Header file directory. 378 # $1 - Header file directory.
373 # $2 - Config command line. 379 # $2 - Config command line.
374 function gen_config_files { 380 function gen_config_files {
375 ./configure $2 > /dev/null 381 ./configure $2 > /dev/null
376 382
377 # Disable HAVE_UNISTD_H as it causes vp8 to try to detect how many cpus 383 # Disable HAVE_UNISTD_H as it causes vp8 to try to detect how many cpus
378 # available, which doesn't work from iniside a sandbox on linux. 384 # available, which doesn't work from iniside a sandbox on linux.
379 ( echo '/HAVE_UNISTD_H/s/[01]/0/' ; echo 'w' ; echo 'q' ) | ed -s vpx_config.h 385 ( echo '/HAVE_UNISTD_H/s/[01]/0/' ; echo 'w' ; echo 'q' ) | ed -s vpx_config.h
380 386
381 # Generate vpx_config.asm. Do not create one for mips. 387 # Generate vpx_config.asm. Do not create one for mips.
382 if [[ "$1" != *mipsel && "$1" != *mips64el ]]; then 388 if [[ "$1" != *mipsel && "$1" != *mips64el ]]; then
383 if [[ "$1" == *x64* ]] || [[ "$1" == *ia32* ]]; then 389 if [[ "$1" == *x64* ]] || [[ "$1" == *ia32* ]]; then
384 egrep "#define [A-Z0-9_]+ [01]" vpx_config.h | awk '{print "%define " $2 " " $3}' > vpx_config.asm 390 egrep "#define [A-Z0-9_]+ [01]" vpx_config.h | awk '{print "%define " $2 " " $3}' > vpx_config.asm
385 else 391 else
(...skipping 13 matching lines...) Expand all
399 cd $TEMP_DIR 405 cd $TEMP_DIR
400 406
401 echo "Generate config files." 407 echo "Generate config files."
402 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" 408 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"
403 gen_config_files linux/ia32 "--target=x86-linux-gcc --disable-ccache --enable-pi c --enable-realtime-only ${all_platforms}" 409 gen_config_files linux/ia32 "--target=x86-linux-gcc --disable-ccache --enable-pi c --enable-realtime-only ${all_platforms}"
404 gen_config_files linux/x64 "--target=x86_64-linux-gcc --disable-ccache --enable- pic --enable-realtime-only ${all_platforms}" 410 gen_config_files linux/x64 "--target=x86_64-linux-gcc --disable-ccache --enable- pic --enable-realtime-only ${all_platforms}"
405 gen_config_files linux/arm "--target=armv6-linux-gcc --enable-pic --enable-realt ime-only --disable-install-bins --disable-install-libs --disable-edsp ${all_plat forms}" 411 gen_config_files linux/arm "--target=armv6-linux-gcc --enable-pic --enable-realt ime-only --disable-install-bins --disable-install-libs --disable-edsp ${all_plat forms}"
406 gen_config_files linux/arm-neon "--target=armv7-linux-gcc --enable-pic --enable- realtime-only --disable-edsp ${all_platforms}" 412 gen_config_files linux/arm-neon "--target=armv7-linux-gcc --enable-pic --enable- realtime-only --disable-edsp ${all_platforms}"
407 gen_config_files linux/arm-neon-cpu-detect "--target=armv7-linux-gcc --enable-pi c --enable-realtime-only --enable-runtime-cpu-detect --disable-edsp ${all_platfo rms}" 413 gen_config_files linux/arm-neon-cpu-detect "--target=armv7-linux-gcc --enable-pi c --enable-realtime-only --enable-runtime-cpu-detect --disable-edsp ${all_platfo rms}"
408 gen_config_files linux/arm64 "--force-target=armv8-linux-gcc --enable-pic --enab le-realtime-only --disable-edsp ${all_platforms}" 414 gen_config_files linux/arm64 "--force-target=armv8-linux-gcc --enable-pic --enab le-realtime-only --disable-edsp ${all_platforms}"
409 gen_config_files linux/mipsel "--target=mips32-linux-gcc --disable-fast-unaligne d ${all_platforms}" 415 gen_config_files linux/mipsel "--target=mips32-linux-gcc ${all_platforms}"
410 gen_config_files linux/mips64el "--target=mips64-linux-gcc --disable-fast-unalig ned ${all_platforms}" 416 gen_config_files linux/mips64el "--target=mips64-linux-gcc ${all_platforms}"
411 gen_config_files linux/generic "--target=generic-gnu --enable-pic --enable-realt ime-only ${all_platforms}" 417 gen_config_files linux/generic "--target=generic-gnu --enable-pic --enable-realt ime-only ${all_platforms}"
412 gen_config_files win/ia32 "--target=x86-win32-vs12 --enable-realtime-only ${all_ platforms}" 418 gen_config_files win/ia32 "--target=x86-win32-vs12 --enable-realtime-only ${all_ platforms}"
413 gen_config_files win/x64 "--target=x86_64-win64-vs12 --enable-realtime-only ${al l_platforms}" 419 gen_config_files win/x64 "--target=x86_64-win64-vs12 --enable-realtime-only ${al l_platforms}"
414 gen_config_files mac/ia32 "--target=x86-darwin9-gcc --enable-pic --enable-realti me-only ${all_platforms}" 420 gen_config_files mac/ia32 "--target=x86-darwin9-gcc --enable-pic --enable-realti me-only ${all_platforms}"
415 gen_config_files mac/x64 "--target=x86_64-darwin9-gcc --enable-pic --enable-real time-only ${all_platforms}" 421 gen_config_files mac/x64 "--target=x86_64-darwin9-gcc --enable-pic --enable-real time-only ${all_platforms}"
416 gen_config_files nacl "--target=generic-gnu --enable-pic --enable-realtime-only ${all_platforms}" 422 gen_config_files nacl "--target=generic-gnu --enable-pic --enable-realtime-only ${all_platforms}"
417 423
418 echo "Remove temporary directory." 424 echo "Remove temporary directory."
419 cd $BASE_DIR 425 cd $BASE_DIR
420 rm -rf $TEMP_DIR 426 rm -rf $TEMP_DIR
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
520 echo "Generate GENERIC source list." 526 echo "Generate GENERIC source list."
521 config=$(print_config_basic linux/generic) 527 config=$(print_config_basic linux/generic)
522 make_clean 528 make_clean
523 make libvpx_srcs.txt target=libs $config > /dev/null 529 make libvpx_srcs.txt target=libs $config > /dev/null
524 convert_srcs_to_project_files libvpx_srcs.txt libvpx_srcs_generic 530 convert_srcs_to_project_files libvpx_srcs.txt libvpx_srcs_generic
525 531
526 echo "Remove temporary directory." 532 echo "Remove temporary directory."
527 cd $BASE_DIR 533 cd $BASE_DIR
528 rm -rf $TEMP_DIR 534 rm -rf $TEMP_DIR
529 535
530 # TODO(fgalligan): Is "--disable-fast-unaligned" needed on mipsel?
531 # TODO(fgalligan): Can we turn on "--enable-realtime-only" for mipsel? 536 # TODO(fgalligan): Can we turn on "--enable-realtime-only" for mipsel?
OLDNEW
« no previous file with comments | « README.chromium ('k') | libvpx_srcs.gni » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698