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 .gypi files and files in the config/platform | 7 # This script is used to generate .gypi files and files in the config/platform |
8 # directories needed to build libvpx. | 8 # 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 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
232 function make_clean { | 232 function make_clean { |
233 make clean > /dev/null | 233 make clean > /dev/null |
234 rm -f libvpx_srcs.txt | 234 rm -f libvpx_srcs.txt |
235 } | 235 } |
236 | 236 |
237 # Lint a pair of vpx_config.h and vpx_config.asm to make sure they match. | 237 # Lint a pair of vpx_config.h and vpx_config.asm to make sure they match. |
238 # $1 - Header file directory. | 238 # $1 - Header file directory. |
239 function lint_config { | 239 function lint_config { |
240 # mips does not contain any assembly so the header does not need to be | 240 # mips does not contain any assembly so the header does not need to be |
241 # compared to the asm. | 241 # compared to the asm. |
242 if [[ "$1" != *mipsel ]]; then | 242 if [[ "$1" != *mipsel && "$1" != *mips64el ]]; then |
243 $BASE_DIR/lint_config.sh \ | 243 $BASE_DIR/lint_config.sh \ |
244 -h $BASE_DIR/$LIBVPX_CONFIG_DIR/$1/vpx_config.h \ | 244 -h $BASE_DIR/$LIBVPX_CONFIG_DIR/$1/vpx_config.h \ |
245 -a $BASE_DIR/$LIBVPX_CONFIG_DIR/$1/vpx_config.asm | 245 -a $BASE_DIR/$LIBVPX_CONFIG_DIR/$1/vpx_config.asm |
246 fi | 246 fi |
247 } | 247 } |
248 | 248 |
249 # Print the configuration. | 249 # Print the configuration. |
250 # $1 - Header file directory. | 250 # $1 - Header file directory. |
251 function print_config { | 251 function print_config { |
252 $BASE_DIR/lint_config.sh -p \ | 252 $BASE_DIR/lint_config.sh -p \ |
(...skipping 16 matching lines...) Expand all Loading... |
269 echo "$combined_config" | sort | uniq | 269 echo "$combined_config" | sort | uniq |
270 } | 270 } |
271 | 271 |
272 # Generate *_rtcd.h files. | 272 # Generate *_rtcd.h files. |
273 # $1 - Header file directory. | 273 # $1 - Header file directory. |
274 # $2 - Architecture. | 274 # $2 - Architecture. |
275 function gen_rtcd_header { | 275 function gen_rtcd_header { |
276 echo "Generate $LIBVPX_CONFIG_DIR/$1/*_rtcd.h files." | 276 echo "Generate $LIBVPX_CONFIG_DIR/$1/*_rtcd.h files." |
277 | 277 |
278 rm -rf $BASE_DIR/$TEMP_DIR/libvpx.config | 278 rm -rf $BASE_DIR/$TEMP_DIR/libvpx.config |
279 if [ "$2" = "mipsel" ]; then | 279 if [[ "$2" == "mipsel" || "$2" == "mips64el" ]]; then |
280 print_config_basic $1 > $BASE_DIR/$TEMP_DIR/libvpx.config | 280 print_config_basic $1 > $BASE_DIR/$TEMP_DIR/libvpx.config |
281 else | 281 else |
282 $BASE_DIR/lint_config.sh -p \ | 282 $BASE_DIR/lint_config.sh -p \ |
283 -h $BASE_DIR/$LIBVPX_CONFIG_DIR/$1/vpx_config.h \ | 283 -h $BASE_DIR/$LIBVPX_CONFIG_DIR/$1/vpx_config.h \ |
284 -a $BASE_DIR/$LIBVPX_CONFIG_DIR/$1/vpx_config.asm \ | 284 -a $BASE_DIR/$LIBVPX_CONFIG_DIR/$1/vpx_config.asm \ |
285 -o $BASE_DIR/$TEMP_DIR/libvpx.config | 285 -o $BASE_DIR/$TEMP_DIR/libvpx.config |
286 fi | 286 fi |
287 | 287 |
288 $BASE_DIR/$LIBVPX_SRC_DIR/build/make/rtcd.pl \ | 288 $BASE_DIR/$LIBVPX_SRC_DIR/build/make/rtcd.pl \ |
289 --arch=$2 \ | 289 --arch=$2 \ |
(...skipping 23 matching lines...) Expand all Loading... |
313 } | 313 } |
314 | 314 |
315 # Generate Config files. "--enable-external-build" must be set to skip | 315 # Generate Config files. "--enable-external-build" must be set to skip |
316 # detection of capabilities on specific targets. | 316 # detection of capabilities on specific targets. |
317 # $1 - Header file directory. | 317 # $1 - Header file directory. |
318 # $2 - Config command line. | 318 # $2 - Config command line. |
319 function gen_config_files { | 319 function gen_config_files { |
320 ./configure $2 > /dev/null | 320 ./configure $2 > /dev/null |
321 | 321 |
322 # Generate vpx_config.asm. Do not create one for mips. | 322 # Generate vpx_config.asm. Do not create one for mips. |
323 if [[ "$1" != *mipsel ]]; then | 323 if [[ "$1" != *mipsel && "$1" != *mips64el ]]; then |
324 if [[ "$1" == *x64* ]] || [[ "$1" == *ia32* ]]; then | 324 if [[ "$1" == *x64* ]] || [[ "$1" == *ia32* ]]; then |
325 egrep "#define [A-Z0-9_]+ [01]" vpx_config.h | awk '{print $2 " equ " $3}'
> vpx_config.asm | 325 egrep "#define [A-Z0-9_]+ [01]" vpx_config.h | awk '{print $2 " equ " $3}'
> vpx_config.asm |
326 else | 326 else |
327 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 | 327 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 |
328 fi | 328 fi |
329 fi | 329 fi |
330 | 330 |
331 cp vpx_config.* $BASE_DIR/$LIBVPX_CONFIG_DIR/$1 | 331 cp vpx_config.* $BASE_DIR/$LIBVPX_CONFIG_DIR/$1 |
332 make_clean | 332 make_clean |
333 rm -rf vpx_config.* | 333 rm -rf vpx_config.* |
334 } | 334 } |
335 | 335 |
336 echo "Create temporary directory." | 336 echo "Create temporary directory." |
337 TEMP_DIR="$LIBVPX_SRC_DIR.temp" | 337 TEMP_DIR="$LIBVPX_SRC_DIR.temp" |
338 rm -rf $TEMP_DIR | 338 rm -rf $TEMP_DIR |
339 cp -R $LIBVPX_SRC_DIR $TEMP_DIR | 339 cp -R $LIBVPX_SRC_DIR $TEMP_DIR |
340 cd $TEMP_DIR | 340 cd $TEMP_DIR |
341 | 341 |
342 echo "Generate Config Files" | 342 echo "Generate Config Files" |
343 # TODO(joeyparrish) Enable AVX2 when broader VS2013 support is available | 343 # TODO(joeyparrish) Enable AVX2 when broader VS2013 support is available |
344 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 --disable-avx2" | 344 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 --disable-avx2" |
345 gen_config_files linux/ia32 "--target=x86-linux-gcc --disable-ccache --enable-pi
c --enable-realtime-only ${all_platforms}" | 345 gen_config_files linux/ia32 "--target=x86-linux-gcc --disable-ccache --enable-pi
c --enable-realtime-only ${all_platforms}" |
346 gen_config_files linux/x64 "--target=x86_64-linux-gcc --disable-ccache --enable-
pic --enable-realtime-only ${all_platforms}" | 346 gen_config_files linux/x64 "--target=x86_64-linux-gcc --disable-ccache --enable-
pic --enable-realtime-only ${all_platforms}" |
347 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}" | 347 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}" |
348 gen_config_files linux/arm-neon "--target=armv7-linux-gcc --enable-pic --enable-
realtime-only --disable-edsp ${all_platforms}" | 348 gen_config_files linux/arm-neon "--target=armv7-linux-gcc --enable-pic --enable-
realtime-only --disable-edsp ${all_platforms}" |
349 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}" | 349 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}" |
350 gen_config_files linux/arm64 "--force-target=armv8-linux-gcc --enable-pic --enab
le-realtime-only --disable-edsp ${all_platforms}" | 350 gen_config_files linux/arm64 "--force-target=armv8-linux-gcc --enable-pic --enab
le-realtime-only --disable-edsp ${all_platforms}" |
351 gen_config_files linux/mipsel "--target=mips32-linux-gcc --disable-fast-unaligne
d ${all_platforms}" | 351 gen_config_files linux/mipsel "--target=mips32-linux-gcc --disable-fast-unaligne
d ${all_platforms}" |
| 352 gen_config_files linux/mips64el "--target=mips64-linux-gcc --disable-fast-unalig
ned ${all_platforms}" |
352 gen_config_files linux/generic "--target=generic-gnu --enable-pic --enable-realt
ime-only ${all_platforms}" | 353 gen_config_files linux/generic "--target=generic-gnu --enable-pic --enable-realt
ime-only ${all_platforms}" |
353 gen_config_files win/ia32 "--target=x86-win32-vs12 --enable-realtime-only ${all_
platforms}" | 354 gen_config_files win/ia32 "--target=x86-win32-vs12 --enable-realtime-only ${all_
platforms}" |
354 gen_config_files win/x64 "--target=x86_64-win64-vs12 --enable-realtime-only ${al
l_platforms}" | 355 gen_config_files win/x64 "--target=x86_64-win64-vs12 --enable-realtime-only ${al
l_platforms}" |
355 gen_config_files mac/ia32 "--target=x86-darwin9-gcc --enable-pic --enable-realti
me-only ${all_platforms}" | 356 gen_config_files mac/ia32 "--target=x86-darwin9-gcc --enable-pic --enable-realti
me-only ${all_platforms}" |
356 gen_config_files mac/x64 "--target=x86_64-darwin9-gcc --enable-pic --enable-real
time-only ${all_platforms}" | 357 gen_config_files mac/x64 "--target=x86_64-darwin9-gcc --enable-pic --enable-real
time-only ${all_platforms}" |
357 gen_config_files nacl "--target=generic-gnu --enable-pic --enable-realtime-only
${all_platforms}" | 358 gen_config_files nacl "--target=generic-gnu --enable-pic --enable-realtime-only
${all_platforms}" |
358 | 359 |
359 echo "Remove temporary directory." | 360 echo "Remove temporary directory." |
360 cd $BASE_DIR | 361 cd $BASE_DIR |
361 rm -rf $TEMP_DIR | 362 rm -rf $TEMP_DIR |
362 | 363 |
363 echo "Lint libvpx configuration." | 364 echo "Lint libvpx configuration." |
364 lint_config linux/ia32 | 365 lint_config linux/ia32 |
365 lint_config linux/x64 | 366 lint_config linux/x64 |
366 lint_config linux/arm | 367 lint_config linux/arm |
367 lint_config linux/arm-neon | 368 lint_config linux/arm-neon |
368 lint_config linux/arm-neon-cpu-detect | 369 lint_config linux/arm-neon-cpu-detect |
369 lint_config linux/arm64 | 370 lint_config linux/arm64 |
370 lint_config linux/mipsel | 371 lint_config linux/mipsel |
| 372 lint_config linux/mips64el |
371 lint_config linux/generic | 373 lint_config linux/generic |
372 lint_config win/ia32 | 374 lint_config win/ia32 |
373 lint_config win/x64 | 375 lint_config win/x64 |
374 lint_config mac/ia32 | 376 lint_config mac/ia32 |
375 lint_config mac/x64 | 377 lint_config mac/x64 |
376 lint_config nacl | 378 lint_config nacl |
377 | 379 |
378 echo "Create temporary directory." | 380 echo "Create temporary directory." |
379 TEMP_DIR="$LIBVPX_SRC_DIR.temp" | 381 TEMP_DIR="$LIBVPX_SRC_DIR.temp" |
380 rm -rf $TEMP_DIR | 382 rm -rf $TEMP_DIR |
381 cp -R $LIBVPX_SRC_DIR $TEMP_DIR | 383 cp -R $LIBVPX_SRC_DIR $TEMP_DIR |
382 cd $TEMP_DIR | 384 cd $TEMP_DIR |
383 | 385 |
384 gen_rtcd_header linux/ia32 x86 | 386 gen_rtcd_header linux/ia32 x86 |
385 gen_rtcd_header linux/x64 x86_64 | 387 gen_rtcd_header linux/x64 x86_64 |
386 gen_rtcd_header linux/arm armv6 | 388 gen_rtcd_header linux/arm armv6 |
387 gen_rtcd_header linux/arm-neon armv7 | 389 gen_rtcd_header linux/arm-neon armv7 |
388 gen_rtcd_header linux/arm-neon-cpu-detect armv7 | 390 gen_rtcd_header linux/arm-neon-cpu-detect armv7 |
389 gen_rtcd_header linux/arm64 armv8 | 391 gen_rtcd_header linux/arm64 armv8 |
390 gen_rtcd_header linux/mipsel mipsel | 392 gen_rtcd_header linux/mipsel mipsel |
| 393 gen_rtcd_header linux/mips64el mips64el |
391 gen_rtcd_header linux/generic generic | 394 gen_rtcd_header linux/generic generic |
392 gen_rtcd_header win/ia32 x86 | 395 gen_rtcd_header win/ia32 x86 |
393 gen_rtcd_header win/x64 x86_64 | 396 gen_rtcd_header win/x64 x86_64 |
394 gen_rtcd_header mac/ia32 x86 | 397 gen_rtcd_header mac/ia32 x86 |
395 gen_rtcd_header mac/x64 x86_64 | 398 gen_rtcd_header mac/x64 x86_64 |
396 gen_rtcd_header nacl nacl | 399 gen_rtcd_header nacl nacl |
397 | 400 |
398 echo "Prepare Makefile." | 401 echo "Prepare Makefile." |
399 ./configure --target=generic-gnu > /dev/null | 402 ./configure --target=generic-gnu > /dev/null |
400 make_clean | 403 make_clean |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
437 make_clean | 440 make_clean |
438 make libvpx_srcs.txt target=libs $config > /dev/null | 441 make libvpx_srcs.txt target=libs $config > /dev/null |
439 convert_srcs_to_gypi libvpx_srcs.txt libvpx_srcs_arm64 | 442 convert_srcs_to_gypi libvpx_srcs.txt libvpx_srcs_arm64 |
440 | 443 |
441 echo "Generate MIPS source list." | 444 echo "Generate MIPS source list." |
442 config=$(print_config_basic linux/mipsel) | 445 config=$(print_config_basic linux/mipsel) |
443 make_clean | 446 make_clean |
444 make libvpx_srcs.txt target=libs $config > /dev/null | 447 make libvpx_srcs.txt target=libs $config > /dev/null |
445 convert_srcs_to_gypi libvpx_srcs.txt libvpx_srcs_mips | 448 convert_srcs_to_gypi libvpx_srcs.txt libvpx_srcs_mips |
446 | 449 |
| 450 echo "MIPS64 source list is identical to MIPS source list. No need to generate i
t." |
| 451 |
447 echo "Generate NaCl source list." | 452 echo "Generate NaCl source list." |
448 config=$(print_config_basic nacl) | 453 config=$(print_config_basic nacl) |
449 make_clean | 454 make_clean |
450 make libvpx_srcs.txt target=libs $config > /dev/null | 455 make libvpx_srcs.txt target=libs $config > /dev/null |
451 convert_srcs_to_gypi libvpx_srcs.txt libvpx_srcs_nacl | 456 convert_srcs_to_gypi libvpx_srcs.txt libvpx_srcs_nacl |
452 | 457 |
453 echo "Generate GENERIC source list." | 458 echo "Generate GENERIC source list." |
454 config=$(print_config_basic linux/generic) | 459 config=$(print_config_basic linux/generic) |
455 make_clean | 460 make_clean |
456 make libvpx_srcs.txt target=libs $config > /dev/null | 461 make libvpx_srcs.txt target=libs $config > /dev/null |
457 convert_srcs_to_gypi libvpx_srcs.txt libvpx_srcs_generic | 462 convert_srcs_to_gypi libvpx_srcs.txt libvpx_srcs_generic |
458 | 463 |
459 echo "Remove temporary directory." | 464 echo "Remove temporary directory." |
460 cd $BASE_DIR | 465 cd $BASE_DIR |
461 rm -rf $TEMP_DIR | 466 rm -rf $TEMP_DIR |
462 | 467 |
463 # TODO(fgalligan): Is "--disable-fast-unaligned" needed on mipsel? | 468 # TODO(fgalligan): Is "--disable-fast-unaligned" needed on mipsel? |
464 # TODO(fgalligan): Can we turn on "--enable-realtime-only" for mipsel? | 469 # TODO(fgalligan): Can we turn on "--enable-realtime-only" for mipsel? |
OLD | NEW |