chrome-bot@google.com | b3c3acc | 2011-10-11 14:10:16 +0000 | [diff] [blame] | 1 | #!/bin/bash -e |
| 2 | # |
mcgrathr@chromium.org | f039974 | 2012-01-11 20:14:59 +0000 | [diff] [blame] | 3 | # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
chrome-bot@google.com | b3c3acc | 2011-10-11 14:10:16 +0000 | [diff] [blame] | 4 | # Use of this source code is governed by a BSD-style license that can be |
| 5 | # found in the LICENSE file. |
| 6 | |
hclam@chromium.org | bd09f76 | 2014-09-05 21:22:35 +0000 | [diff] [blame] | 7 | # This script is used to generate .gypi, .gni files and files in the |
| 8 | # config/platform directories needed to build libvpx. |
chrome-bot@google.com | b3c3acc | 2011-10-11 14:10:16 +0000 | [diff] [blame] | 9 | # Every time libvpx source code is updated just run this script. |
| 10 | # |
| 11 | # For example: |
| 12 | # $ ./generate_gypi.sh |
| 13 | # |
hclam@chromium.org | bd09f76 | 2014-09-05 21:22:35 +0000 | [diff] [blame] | 14 | # And this will update all the .gypi, .gni and config files needed. |
hclam@chromium.org | 29e0140 | 2012-05-30 20:41:48 +0000 | [diff] [blame] | 15 | # |
wjia@chromium.org | 1a56a96 | 2013-03-11 21:02:06 +0000 | [diff] [blame] | 16 | # !!! It's highly recommended to install yasm before running this script. |
chrome-bot@google.com | b3c3acc | 2011-10-11 14:10:16 +0000 | [diff] [blame] | 17 | |
tomfinegan@chromium.org | a7ffde1 | 2014-03-28 00:05:23 +0000 | [diff] [blame] | 18 | export LC_ALL=C |
hclam@chromium.org | bd09f76 | 2014-09-05 21:22:35 +0000 | [diff] [blame] | 19 | BASE_DIR=$(pwd) |
chrome-bot@google.com | b3c3acc | 2011-10-11 14:10:16 +0000 | [diff] [blame] | 20 | LIBVPX_SRC_DIR="source/libvpx" |
hclam@chromium.org | 29e0140 | 2012-05-30 20:41:48 +0000 | [diff] [blame] | 21 | LIBVPX_CONFIG_DIR="source/config" |
chrome-bot@google.com | b3c3acc | 2011-10-11 14:10:16 +0000 | [diff] [blame] | 22 | |
hclam@chromium.org | bd09f76 | 2014-09-05 21:22:35 +0000 | [diff] [blame] | 23 | # Print license header. |
johannkoenig@chromium.org | 61b5f71 | 2013-04-02 20:18:06 +0000 | [diff] [blame] | 24 | # $1 - Output base name |
hclam@chromium.org | bd09f76 | 2014-09-05 21:22:35 +0000 | [diff] [blame] | 25 | function write_license { |
| 26 | echo "# This file is generated. Do not edit." >> $1 |
| 27 | echo "# Copyright (c) 2014 The Chromium Authors. All rights reserved." >> $1 |
johannkoenig@chromium.org | 61b5f71 | 2013-04-02 20:18:06 +0000 | [diff] [blame] | 28 | echo "# Use of this source code is governed by a BSD-style license that can be" >> $1 |
| 29 | echo "# found in the LICENSE file." >> $1 |
| 30 | echo "" >> $1 |
hclam@chromium.org | bd09f76 | 2014-09-05 21:22:35 +0000 | [diff] [blame] | 31 | } |
| 32 | |
| 33 | # Print gypi boilerplate header. |
| 34 | # $1 - Output base name |
| 35 | function write_gypi_header { |
johannkoenig@chromium.org | 61b5f71 | 2013-04-02 20:18:06 +0000 | [diff] [blame] | 36 | echo "{" >> $1 |
| 37 | } |
| 38 | |
hclam@chromium.org | bd09f76 | 2014-09-05 21:22:35 +0000 | [diff] [blame] | 39 | # Print gypi boilerplate footer. |
johannkoenig@chromium.org | 61b5f71 | 2013-04-02 20:18:06 +0000 | [diff] [blame] | 40 | # $1 - Output base name |
| 41 | function write_gypi_footer { |
| 42 | echo "}" >> $1 |
| 43 | } |
| 44 | |
johannkoenig@google.com | 583e5bc | 2013-03-25 21:28:18 +0000 | [diff] [blame] | 45 | # Generate a gypi with a list of source files. |
| 46 | # $1 - Array name for file list. This is processed with 'declare' below to |
| 47 | # regenerate the array locally. |
| 48 | # $2 - Output file |
hclam@chromium.org | bd09f76 | 2014-09-05 21:22:35 +0000 | [diff] [blame] | 49 | function write_gypi { |
| 50 | # Convert the first argument back in to an array. |
| 51 | local readonly file_list=(${!1}) |
| 52 | |
| 53 | rm -rf "$2" |
| 54 | write_license "$2" |
| 55 | write_gypi_header "$2" |
| 56 | |
| 57 | echo " 'sources': [" >> "$2" |
| 58 | for f in ${file_list[@]} |
| 59 | do |
| 60 | echo " '<(libvpx_source)/$f'," >> "$2" |
| 61 | done |
| 62 | echo " ]," >> "$2" |
| 63 | |
| 64 | write_gypi_footer "$2" |
| 65 | } |
| 66 | |
| 67 | # Generate a gni with a list of source files. |
| 68 | # $1 - Array name for file list. This is processed with 'declare' below to |
| 69 | # regenerate the array locally. |
| 70 | # $2 - GN variable name. |
| 71 | # $3 - Output file. |
| 72 | function write_gni { |
johannkoenig@google.com | 583e5bc | 2013-03-25 21:28:18 +0000 | [diff] [blame] | 73 | # Convert the first argument back in to an array. |
| 74 | declare -a file_list=("${!1}") |
| 75 | |
hclam@chromium.org | bd09f76 | 2014-09-05 21:22:35 +0000 | [diff] [blame] | 76 | echo "$2 = [" >> "$3" |
johannkoenig@google.com | 583e5bc | 2013-03-25 21:28:18 +0000 | [diff] [blame] | 77 | for f in $file_list |
| 78 | do |
hclam@chromium.org | bd09f76 | 2014-09-05 21:22:35 +0000 | [diff] [blame] | 79 | echo " \"//third_party/libvpx/source/libvpx/$f\"," >> "$3" |
johannkoenig@google.com | 583e5bc | 2013-03-25 21:28:18 +0000 | [diff] [blame] | 80 | done |
hclam@chromium.org | bd09f76 | 2014-09-05 21:22:35 +0000 | [diff] [blame] | 81 | echo "]" >> "$3" |
johannkoenig@chromium.org | 61b5f71 | 2013-04-02 20:18:06 +0000 | [diff] [blame] | 82 | } |
| 83 | |
| 84 | # Target template function |
| 85 | # $1 - Array name for file list. |
| 86 | # $2 - Output file |
| 87 | # $3 - Target name |
| 88 | # $4 - Compiler flag |
| 89 | function write_target_definition { |
| 90 | declare -a sources_list=("${!1}") |
| 91 | |
hclam@chromium.org | bd09f76 | 2014-09-05 21:22:35 +0000 | [diff] [blame] | 92 | echo " {" >> "$2" |
| 93 | echo " 'target_name': '$3'," >> "$2" |
| 94 | echo " 'type': 'static_library'," >> "$2" |
| 95 | echo " 'include_dirs': [" >> "$2" |
| 96 | echo " 'source/config/<(OS_CATEGORY)/<(target_arch_full)'," >> "$2" |
| 97 | echo " '<(libvpx_source)'," >> "$2" |
| 98 | echo " ]," >> "$2" |
| 99 | echo " 'sources': [" >> "$2" |
johannkoenig@chromium.org | 61b5f71 | 2013-04-02 20:18:06 +0000 | [diff] [blame] | 100 | for f in $sources_list |
| 101 | do |
| 102 | echo " '<(libvpx_source)/$f'," >> $2 |
| 103 | done |
hclam@chromium.org | bd09f76 | 2014-09-05 21:22:35 +0000 | [diff] [blame] | 104 | echo " ]," >> "$2" |
thakis@chromium.org | f68663a | 2014-08-26 00:24:58 +0000 | [diff] [blame] | 105 | if [[ $4 == fpu=neon ]]; then |
hclam@chromium.org | bd09f76 | 2014-09-05 21:22:35 +0000 | [diff] [blame] | 106 | echo " 'cflags!': [ '-mfpu=vfpv3-d16' ]," >> "$2" |
thakis@chromium.org | 982d147 | 2014-08-29 15:23:06 +0000 | [diff] [blame] | 107 | echo " 'conditions': [" >> $2 |
hclam@chromium.org | bd09f76 | 2014-09-05 21:22:35 +0000 | [diff] [blame] | 108 | echo " # Disable LTO in neon targets due to compiler bug" >> "$2" |
| 109 | echo " # crbug.com/408997" >> "$2" |
| 110 | echo " ['use_lto==1', {" >> "$2" |
| 111 | echo " 'cflags!': [" >> "$2" |
| 112 | echo " '-flto'," >> "$2" |
| 113 | echo " '-ffat-lto-objects'," >> "$2" |
| 114 | echo " ]," >> "$2" |
| 115 | echo " }]," >> "$2" |
| 116 | echo " ]," >> "$2" |
johannkoenig@chromium.org | a4adce5 | 2014-04-15 23:01:37 +0000 | [diff] [blame] | 117 | fi |
hclam@chromium.org | bd09f76 | 2014-09-05 21:22:35 +0000 | [diff] [blame] | 118 | echo " 'cflags': [ '-m$4', ]," >> "$2" |
| 119 | echo " 'xcode_settings': { 'OTHER_CFLAGS': [ '-m$4' ] }," >> "$2" |
thakis@chromium.org | f68663a | 2014-08-26 00:24:58 +0000 | [diff] [blame] | 120 | if [[ $4 == avx* ]]; then |
hclam@chromium.org | bd09f76 | 2014-09-05 21:22:35 +0000 | [diff] [blame] | 121 | echo " 'msvs_settings': {" >> "$2" |
| 122 | echo " 'VCCLCompilerTool': {" >> "$2" |
| 123 | echo " 'EnableEnhancedInstructionSet': '3', # /arch:AVX" >> "$2" |
| 124 | echo " }," >> "$2" |
| 125 | echo " }," >> "$2" |
thakis@chromium.org | 563c46b | 2014-08-26 02:25:28 +0000 | [diff] [blame] | 126 | elif [[ $4 == ssse3 || $4 == sse4.1 ]]; then |
hclam@chromium.org | bd09f76 | 2014-09-05 21:22:35 +0000 | [diff] [blame] | 127 | echo " 'conditions': [" >> "$2" |
| 128 | echo " ['OS==\"win\" and clang==1', {" >> "$2" |
| 129 | echo " # cl.exe's /arch flag doesn't have a setting for SSSE3/4, and cl.exe" >> "$2" |
| 130 | echo " # doesn't need it for intrinsics. clang-cl does need it, though." >> "$2" |
| 131 | echo " 'msvs_settings': {" >> "$2" |
| 132 | echo " 'VCCLCompilerTool': { 'AdditionalOptions': [ '-m$4' ] }," >> "$2" |
| 133 | echo " }," >> "$2" |
| 134 | echo " }]," >> "$2" |
| 135 | echo " ]," >> "$2" |
thakis@chromium.org | f68663a | 2014-08-26 00:24:58 +0000 | [diff] [blame] | 136 | fi |
hclam@chromium.org | bd09f76 | 2014-09-05 21:22:35 +0000 | [diff] [blame] | 137 | echo " }," >> "$2" |
johannkoenig@chromium.org | 61b5f71 | 2013-04-02 20:18:06 +0000 | [diff] [blame] | 138 | } |
| 139 | |
| 140 | |
| 141 | # Generate a gypi which applies additional compiler flags based on the file |
| 142 | # name. |
| 143 | # $1 - Array name for file list. |
| 144 | # $2 - Output file |
hclam@chromium.org | bd09f76 | 2014-09-05 21:22:35 +0000 | [diff] [blame] | 145 | function write_intrinsics_gypi { |
johannkoenig@chromium.org | 61b5f71 | 2013-04-02 20:18:06 +0000 | [diff] [blame] | 146 | declare -a file_list=("${!1}") |
| 147 | |
| 148 | local mmx_sources=$(echo "$file_list" | grep '_mmx\.c$') |
| 149 | local sse2_sources=$(echo "$file_list" | grep '_sse2\.c$') |
| 150 | local sse3_sources=$(echo "$file_list" | grep '_sse3\.c$') |
| 151 | local ssse3_sources=$(echo "$file_list" | grep '_ssse3\.c$') |
| 152 | local sse4_1_sources=$(echo "$file_list" | grep '_sse4\.c$') |
johannkoenig@chromium.org | d851b91 | 2013-12-16 19:49:40 +0000 | [diff] [blame] | 153 | local avx_sources=$(echo "$file_list" | grep '_avx\.c$') |
| 154 | local avx2_sources=$(echo "$file_list" | grep '_avx2\.c$') |
johannkoenig@chromium.org | 46e7370 | 2014-01-29 05:35:19 +0000 | [diff] [blame] | 155 | local neon_sources=$(echo "$file_list" | grep '_neon\.c$') |
| 156 | |
johannkoenig@chromium.org | a9c9b43 | 2013-04-19 22:20:08 +0000 | [diff] [blame] | 157 | # Intrinsic functions and files are in flux. We can selectively generate them |
johannkoenig@chromium.org | 46e7370 | 2014-01-29 05:35:19 +0000 | [diff] [blame] | 158 | # but we can not selectively include them in libvpx.gyp. Throw some errors |
| 159 | # when new targets are needed. |
johannkoenig@chromium.org | 4e10229 | 2013-04-03 21:30:23 +0000 | [diff] [blame] | 160 | |
hclam@chromium.org | bd09f76 | 2014-09-05 21:22:35 +0000 | [diff] [blame] | 161 | rm -rf "$2" |
| 162 | write_license "$2" |
| 163 | write_gypi_header "$2" |
johannkoenig@chromium.org | 61b5f71 | 2013-04-02 20:18:06 +0000 | [diff] [blame] | 164 | |
hclam@chromium.org | bd09f76 | 2014-09-05 21:22:35 +0000 | [diff] [blame] | 165 | echo " 'targets': [" >> "$2" |
johannkoenig@chromium.org | 61b5f71 | 2013-04-02 20:18:06 +0000 | [diff] [blame] | 166 | |
johannkoenig@chromium.org | 46e7370 | 2014-01-29 05:35:19 +0000 | [diff] [blame] | 167 | # x86[_64] |
| 168 | if [ 0 -ne ${#mmx_sources} ]; then |
hclam@chromium.org | bd09f76 | 2014-09-05 21:22:35 +0000 | [diff] [blame] | 169 | write_target_definition mmx_sources[@] "$2" libvpx_intrinsics_mmx mmx |
johannkoenig@chromium.org | 46e7370 | 2014-01-29 05:35:19 +0000 | [diff] [blame] | 170 | fi |
| 171 | if [ 0 -ne ${#sse2_sources} ]; then |
hclam@chromium.org | bd09f76 | 2014-09-05 21:22:35 +0000 | [diff] [blame] | 172 | write_target_definition sse2_sources[@] "$2" libvpx_intrinsics_sse2 sse2 |
johannkoenig@chromium.org | 46e7370 | 2014-01-29 05:35:19 +0000 | [diff] [blame] | 173 | fi |
| 174 | if [ 0 -ne ${#sse3_sources} ]; then |
hclam@chromium.org | bd09f76 | 2014-09-05 21:22:35 +0000 | [diff] [blame] | 175 | #write_target_definition sse3_sources[@] "$2" libvpx_intrinsics_sse3 sse3 |
johannkoenig@chromium.org | 46e7370 | 2014-01-29 05:35:19 +0000 | [diff] [blame] | 176 | echo "ERROR: Uncomment sse3 sections in libvpx.gyp" |
| 177 | exit 1 |
| 178 | fi |
| 179 | if [ 0 -ne ${#ssse3_sources} ]; then |
hclam@chromium.org | bd09f76 | 2014-09-05 21:22:35 +0000 | [diff] [blame] | 180 | write_target_definition ssse3_sources[@] "$2" libvpx_intrinsics_ssse3 ssse3 |
johannkoenig@chromium.org | 46e7370 | 2014-01-29 05:35:19 +0000 | [diff] [blame] | 181 | fi |
| 182 | if [ 0 -ne ${#sse4_1_sources} ]; then |
hclam@chromium.org | bd09f76 | 2014-09-05 21:22:35 +0000 | [diff] [blame] | 183 | write_target_definition sse4_1_sources[@] "$2" libvpx_intrinsics_sse4_1 sse4.1 |
johannkoenig@chromium.org | 46e7370 | 2014-01-29 05:35:19 +0000 | [diff] [blame] | 184 | fi |
| 185 | if [ 0 -ne ${#avx_sources} ]; then |
hclam@chromium.org | bd09f76 | 2014-09-05 21:22:35 +0000 | [diff] [blame] | 186 | #write_target_definition avx_sources[@] "$2" libvpx_intrinsics_avx avx |
johannkoenig@chromium.org | 46e7370 | 2014-01-29 05:35:19 +0000 | [diff] [blame] | 187 | echo "ERROR: Uncomment avx sections in libvpx.gyp" |
| 188 | exit 1 |
| 189 | fi |
| 190 | if [ 0 -ne ${#avx2_sources} ]; then |
hclam@chromium.org | bd09f76 | 2014-09-05 21:22:35 +0000 | [diff] [blame] | 191 | #write_target_definition avx2_sources[@] "$2" libvpx_intrinsics_avx2 avx2 |
johannkoenig@chromium.org | d143273 | 2014-04-16 20:40:56 +0000 | [diff] [blame] | 192 | echo "ERROR: Uncomment avx2 sections in libvpx.gyp" |
| 193 | exit 1 |
johannkoenig@chromium.org | 46e7370 | 2014-01-29 05:35:19 +0000 | [diff] [blame] | 194 | fi |
| 195 | |
| 196 | # arm neon |
| 197 | if [ 0 -ne ${#neon_sources} ]; then |
hclam@chromium.org | bd09f76 | 2014-09-05 21:22:35 +0000 | [diff] [blame] | 198 | write_target_definition neon_sources[@] "$2" libvpx_intrinsics_neon fpu=neon |
johannkoenig@chromium.org | 46e7370 | 2014-01-29 05:35:19 +0000 | [diff] [blame] | 199 | fi |
johannkoenig@chromium.org | 61b5f71 | 2013-04-02 20:18:06 +0000 | [diff] [blame] | 200 | |
hclam@chromium.org | bd09f76 | 2014-09-05 21:22:35 +0000 | [diff] [blame] | 201 | echo " ]," >> "$2" |
johannkoenig@chromium.org | 61b5f71 | 2013-04-02 20:18:06 +0000 | [diff] [blame] | 202 | |
hclam@chromium.org | bd09f76 | 2014-09-05 21:22:35 +0000 | [diff] [blame] | 203 | write_gypi_footer "$2" |
johannkoenig@google.com | 583e5bc | 2013-03-25 21:28:18 +0000 | [diff] [blame] | 204 | } |
| 205 | |
hclam@chromium.org | bd09f76 | 2014-09-05 21:22:35 +0000 | [diff] [blame] | 206 | # Convert a list of source files into gypi and gni files. |
hclam@chromium.org | 29e0140 | 2012-05-30 20:41:48 +0000 | [diff] [blame] | 207 | # $1 - Input file. |
johannkoenig@google.com | 583e5bc | 2013-03-25 21:28:18 +0000 | [diff] [blame] | 208 | # $2 - Output gypi file base. Will generate additional .gypi files when |
| 209 | # different compilation flags are required. |
hclam@chromium.org | bd09f76 | 2014-09-05 21:22:35 +0000 | [diff] [blame] | 210 | function convert_srcs_to_project_files { |
chrome-bot@google.com | b3c3acc | 2011-10-11 14:10:16 +0000 | [diff] [blame] | 211 | # Do the following here: |
| 212 | # 1. Filter .c, .h, .s, .S and .asm files. |
johannkoenig@google.com | 583e5bc | 2013-03-25 21:28:18 +0000 | [diff] [blame] | 213 | # 2. Move certain files to a separate include to allow applying different |
| 214 | # compiler options. |
fgalligan@chromium.org | 6fefe53 | 2012-12-13 00:56:09 +0000 | [diff] [blame] | 215 | # 3. Replace .asm.s to .asm because gyp will do the conversion. |
johannkoenig@google.com | 583e5bc | 2013-03-25 21:28:18 +0000 | [diff] [blame] | 216 | |
fgalligan@chromium.org | 6fefe53 | 2012-12-13 00:56:09 +0000 | [diff] [blame] | 217 | local source_list=$(grep -E '(\.c|\.h|\.S|\.s|\.asm)$' $1) |
johannkoenig@google.com | 583e5bc | 2013-03-25 21:28:18 +0000 | [diff] [blame] | 218 | |
| 219 | # _offsets are used in pre-processing to generate files for assembly. They are |
| 220 | # not part of the compiled library. |
fgalligan@chromium.org | 6fefe53 | 2012-12-13 00:56:09 +0000 | [diff] [blame] | 221 | source_list=$(echo "$source_list" | grep -v '_offsets\.c') |
johannkoenig@google.com | 583e5bc | 2013-03-25 21:28:18 +0000 | [diff] [blame] | 222 | |
| 223 | # Not sure why vpx_config is not included. |
fgalligan@chromium.org | 6fefe53 | 2012-12-13 00:56:09 +0000 | [diff] [blame] | 224 | source_list=$(echo "$source_list" | grep -v 'vpx_config\.c') |
johannkoenig@google.com | 583e5bc | 2013-03-25 21:28:18 +0000 | [diff] [blame] | 225 | |
| 226 | # The actual ARM files end in .asm. We have rules to translate them to .S |
fgalligan@chromium.org | 6fefe53 | 2012-12-13 00:56:09 +0000 | [diff] [blame] | 227 | source_list=$(echo "$source_list" | sed s/\.asm\.s$/.asm/) |
chrome-bot@google.com | b3c3acc | 2011-10-11 14:10:16 +0000 | [diff] [blame] | 228 | |
johannkoenig@google.com | 583e5bc | 2013-03-25 21:28:18 +0000 | [diff] [blame] | 229 | # Select all x86 files ending with .c |
johannkoenig@chromium.org | 46e7370 | 2014-01-29 05:35:19 +0000 | [diff] [blame] | 230 | local intrinsic_list=$(echo "$source_list" | \ |
johannkoenig@google.com | 583e5bc | 2013-03-25 21:28:18 +0000 | [diff] [blame] | 231 | egrep 'vp[89]/(encoder|decoder|common)/x86/' | \ |
johannkoenig@chromium.org | d851b91 | 2013-12-16 19:49:40 +0000 | [diff] [blame] | 232 | egrep '(mmx|sse2|sse3|ssse3|sse4|avx|avx2).c$') |
johannkoenig@google.com | 583e5bc | 2013-03-25 21:28:18 +0000 | [diff] [blame] | 233 | |
johannkoenig@chromium.org | 46e7370 | 2014-01-29 05:35:19 +0000 | [diff] [blame] | 234 | # Select all neon files ending in C but only when building in RTCD mode |
| 235 | if [ "libvpx_srcs_arm_neon_cpu_detect" == "$2" ]; then |
| 236 | # Select all arm neon files ending in _neon.c |
| 237 | # the pattern may need to be updated if vpx_scale gets intrinics |
| 238 | local intrinsic_list=$(echo "$source_list" | \ |
| 239 | egrep 'vp[89]/(encoder|decoder|common)/arm/neon/' | \ |
| 240 | egrep '_neon.c$') |
| 241 | fi |
| 242 | |
johannkoenig@google.com | 583e5bc | 2013-03-25 21:28:18 +0000 | [diff] [blame] | 243 | # Remove these files from the main list. |
johannkoenig@chromium.org | 46e7370 | 2014-01-29 05:35:19 +0000 | [diff] [blame] | 244 | source_list=$(comm -23 <(echo "$source_list") <(echo "$intrinsic_list")) |
johannkoenig@google.com | 583e5bc | 2013-03-25 21:28:18 +0000 | [diff] [blame] | 245 | |
hclam@chromium.org | bd09f76 | 2014-09-05 21:22:35 +0000 | [diff] [blame] | 246 | local x86_list=$(echo "$source_list" | egrep '/x86/') |
| 247 | |
| 248 | write_gypi source_list "$BASE_DIR/$2.gypi" |
johannkoenig@google.com | 583e5bc | 2013-03-25 21:28:18 +0000 | [diff] [blame] | 249 | |
| 250 | # All the files are in a single "element." Check if the first element has |
| 251 | # length 0. |
johannkoenig@chromium.org | 46e7370 | 2014-01-29 05:35:19 +0000 | [diff] [blame] | 252 | if [ 0 -ne ${#intrinsic_list} ]; then |
hclam@chromium.org | bd09f76 | 2014-09-05 21:22:35 +0000 | [diff] [blame] | 253 | write_intrinsics_gypi intrinsic_list[@] "$BASE_DIR/$2_intrinsics.gypi" |
johannkoenig@google.com | 583e5bc | 2013-03-25 21:28:18 +0000 | [diff] [blame] | 254 | fi |
| 255 | |
hclam@chromium.org | bd09f76 | 2014-09-05 21:22:35 +0000 | [diff] [blame] | 256 | # Write a single .gni file that includes all source files for all archs. |
| 257 | if [ 0 -ne ${#x86_list} ]; then |
hclam@chromium.org | bd09f76 | 2014-09-05 21:22:35 +0000 | [diff] [blame] | 258 | local c_sources=$(echo "$source_list" | egrep '.(c|h)$') |
| 259 | local assembly_sources=$(echo "$source_list" | egrep '.asm$') |
| 260 | local mmx_sources=$(echo "$intrinsic_list" | grep '_mmx\.c$') |
| 261 | local sse2_sources=$(echo "$intrinsic_list" | grep '_sse2\.c$') |
| 262 | local sse3_sources=$(echo "$intrinsic_list" | grep '_sse3\.c$') |
| 263 | local ssse3_sources=$(echo "$intrinsic_list" | grep '_ssse3\.c$') |
| 264 | local sse4_1_sources=$(echo "$intrinsic_list" | grep '_sse4\.c$') |
| 265 | local avx_sources=$(echo "$intrinsic_list" | grep '_avx\.c$') |
| 266 | local avx2_sources=$(echo "$intrinsic_list" | grep '_avx2\.c$') |
| 267 | |
| 268 | write_gni c_sources $2 "$BASE_DIR/libvpx_srcs.gni" |
| 269 | write_gni assembly_sources $2_assembly "$BASE_DIR/libvpx_srcs.gni" |
| 270 | write_gni mmx_sources $2_mmx "$BASE_DIR/libvpx_srcs.gni" |
| 271 | write_gni sse2_sources $2_sse2 "$BASE_DIR/libvpx_srcs.gni" |
| 272 | write_gni sse3_sources $2_sse3 "$BASE_DIR/libvpx_srcs.gni" |
| 273 | write_gni ssse3_sources $2_ssse3 "$BASE_DIR/libvpx_srcs.gni" |
| 274 | write_gni sse4_1_sources $2_sse4_1 "$BASE_DIR/libvpx_srcs.gni" |
| 275 | write_gni avx_sources $2_avx "$BASE_DIR/libvpx_srcs.gni" |
| 276 | write_gni avx2_sources $2_avx2 "$BASE_DIR/libvpx_srcs.gni" |
| 277 | else |
hclam@chromium.org | 8064f37 | 2014-09-13 00:28:02 +0000 | [diff] [blame] | 278 | local c_sources=$(echo "$source_list" | egrep '.(c|h)$') |
| 279 | local assembly_sources=$(echo "$source_list" | egrep '.asm$') |
hclam@chromium.org | bd09f76 | 2014-09-05 21:22:35 +0000 | [diff] [blame] | 280 | local neon_sources=$(echo "$intrinsic_list" | grep '_neon\.c$') |
hclam@chromium.org | 8064f37 | 2014-09-13 00:28:02 +0000 | [diff] [blame] | 281 | write_gni c_sources $2 "$BASE_DIR/libvpx_srcs.gni" |
| 282 | write_gni assembly_sources $2_assembly "$BASE_DIR/libvpx_srcs.gni" |
hclam@chromium.org | bd09f76 | 2014-09-05 21:22:35 +0000 | [diff] [blame] | 283 | if [ 0 -ne ${#neon_sources} ]; then |
| 284 | write_gni neon_sources $2_neon "$BASE_DIR/libvpx_srcs.gni" |
| 285 | fi |
| 286 | fi |
chrome-bot@google.com | b3c3acc | 2011-10-11 14:10:16 +0000 | [diff] [blame] | 287 | } |
| 288 | |
hclam@chromium.org | 29e0140 | 2012-05-30 20:41:48 +0000 | [diff] [blame] | 289 | # Clean files from previous make. |
| 290 | function make_clean { |
| 291 | make clean > /dev/null |
| 292 | rm -f libvpx_srcs.txt |
| 293 | } |
| 294 | |
| 295 | # Lint a pair of vpx_config.h and vpx_config.asm to make sure they match. |
| 296 | # $1 - Header file directory. |
| 297 | function lint_config { |
johannkoenig@chromium.org | 7765c07 | 2014-05-16 15:51:21 +0000 | [diff] [blame] | 298 | # mips does not contain any assembly so the header does not need to be |
| 299 | # compared to the asm. |
johannkoenig@chromium.org | 796a08a | 2014-09-04 17:34:57 +0000 | [diff] [blame] | 300 | if [[ "$1" != *mipsel && "$1" != *mips64el ]]; then |
johannkoenig@chromium.org | 7765c07 | 2014-05-16 15:51:21 +0000 | [diff] [blame] | 301 | $BASE_DIR/lint_config.sh \ |
| 302 | -h $BASE_DIR/$LIBVPX_CONFIG_DIR/$1/vpx_config.h \ |
| 303 | -a $BASE_DIR/$LIBVPX_CONFIG_DIR/$1/vpx_config.asm |
| 304 | fi |
hclam@chromium.org | 29e0140 | 2012-05-30 20:41:48 +0000 | [diff] [blame] | 305 | } |
| 306 | |
| 307 | # Print the configuration. |
| 308 | # $1 - Header file directory. |
| 309 | function print_config { |
| 310 | $BASE_DIR/lint_config.sh -p \ |
| 311 | -h $BASE_DIR/$LIBVPX_CONFIG_DIR/$1/vpx_config.h \ |
| 312 | -a $BASE_DIR/$LIBVPX_CONFIG_DIR/$1/vpx_config.asm |
| 313 | } |
| 314 | |
petarj@mips.com | e1837fb | 2012-08-17 03:08:23 +0000 | [diff] [blame] | 315 | # Print the configuration from Header file. |
| 316 | # This function is an abridged version of print_config which does not use |
| 317 | # lint_config and it does not require existence of vpx_config.asm. |
| 318 | # $1 - Header file directory. |
| 319 | function print_config_basic { |
| 320 | combined_config="$(cat $BASE_DIR/$LIBVPX_CONFIG_DIR/$1/vpx_config.h \ |
| 321 | | grep -E ' +[01] *$')" |
| 322 | combined_config="$(echo "$combined_config" | grep -v DO1STROUNDING)" |
| 323 | combined_config="$(echo "$combined_config" | sed 's/[ \t]//g')" |
| 324 | combined_config="$(echo "$combined_config" | sed 's/.*define//')" |
| 325 | combined_config="$(echo "$combined_config" | sed 's/0$/=no/')" |
| 326 | combined_config="$(echo "$combined_config" | sed 's/1$/=yes/')" |
| 327 | echo "$combined_config" | sort | uniq |
| 328 | } |
| 329 | |
fgalligan@chromium.org | 6fefe53 | 2012-12-13 00:56:09 +0000 | [diff] [blame] | 330 | # Generate *_rtcd.h files. |
hclam@chromium.org | e028001 | 2012-05-31 01:37:32 +0000 | [diff] [blame] | 331 | # $1 - Header file directory. |
| 332 | # $2 - Architecture. |
| 333 | function gen_rtcd_header { |
fgalligan@chromium.org | 6fefe53 | 2012-12-13 00:56:09 +0000 | [diff] [blame] | 334 | echo "Generate $LIBVPX_CONFIG_DIR/$1/*_rtcd.h files." |
hclam@chromium.org | e028001 | 2012-05-31 01:37:32 +0000 | [diff] [blame] | 335 | |
| 336 | rm -rf $BASE_DIR/$TEMP_DIR/libvpx.config |
johannkoenig@chromium.org | 796a08a | 2014-09-04 17:34:57 +0000 | [diff] [blame] | 337 | if [[ "$2" == "mipsel" || "$2" == "mips64el" ]]; then |
petarj@mips.com | e1837fb | 2012-08-17 03:08:23 +0000 | [diff] [blame] | 338 | print_config_basic $1 > $BASE_DIR/$TEMP_DIR/libvpx.config |
| 339 | else |
| 340 | $BASE_DIR/lint_config.sh -p \ |
| 341 | -h $BASE_DIR/$LIBVPX_CONFIG_DIR/$1/vpx_config.h \ |
| 342 | -a $BASE_DIR/$LIBVPX_CONFIG_DIR/$1/vpx_config.asm \ |
| 343 | -o $BASE_DIR/$TEMP_DIR/libvpx.config |
| 344 | fi |
hclam@chromium.org | e028001 | 2012-05-31 01:37:32 +0000 | [diff] [blame] | 345 | |
johannkoenig@chromium.org | 93a7479 | 2014-04-10 17:14:25 +0000 | [diff] [blame] | 346 | $BASE_DIR/$LIBVPX_SRC_DIR/build/make/rtcd.pl \ |
hclam@chromium.org | e028001 | 2012-05-31 01:37:32 +0000 | [diff] [blame] | 347 | --arch=$2 \ |
fgalligan@chromium.org | 6fefe53 | 2012-12-13 00:56:09 +0000 | [diff] [blame] | 348 | --sym=vp8_rtcd \ |
hclam@chromium.org | e028001 | 2012-05-31 01:37:32 +0000 | [diff] [blame] | 349 | --config=$BASE_DIR/$TEMP_DIR/libvpx.config \ |
johannkoenig@chromium.org | 497a01b | 2014-04-16 22:02:25 +0000 | [diff] [blame] | 350 | --disable-avx2 \ |
johannkoenig@chromium.org | 93a7479 | 2014-04-10 17:14:25 +0000 | [diff] [blame] | 351 | $BASE_DIR/$LIBVPX_SRC_DIR/vp8/common/rtcd_defs.pl \ |
fgalligan@chromium.org | 6fefe53 | 2012-12-13 00:56:09 +0000 | [diff] [blame] | 352 | > $BASE_DIR/$LIBVPX_CONFIG_DIR/$1/vp8_rtcd.h |
| 353 | |
johannkoenig@chromium.org | 93a7479 | 2014-04-10 17:14:25 +0000 | [diff] [blame] | 354 | $BASE_DIR/$LIBVPX_SRC_DIR/build/make/rtcd.pl \ |
fgalligan@chromium.org | 6fefe53 | 2012-12-13 00:56:09 +0000 | [diff] [blame] | 355 | --arch=$2 \ |
| 356 | --sym=vp9_rtcd \ |
| 357 | --config=$BASE_DIR/$TEMP_DIR/libvpx.config \ |
johannkoenig@chromium.org | 497a01b | 2014-04-16 22:02:25 +0000 | [diff] [blame] | 358 | --disable-avx2 \ |
johannkoenig@chromium.org | 93a7479 | 2014-04-10 17:14:25 +0000 | [diff] [blame] | 359 | $BASE_DIR/$LIBVPX_SRC_DIR/vp9/common/vp9_rtcd_defs.pl \ |
fgalligan@chromium.org | 6fefe53 | 2012-12-13 00:56:09 +0000 | [diff] [blame] | 360 | > $BASE_DIR/$LIBVPX_CONFIG_DIR/$1/vp9_rtcd.h |
| 361 | |
johannkoenig@chromium.org | 93a7479 | 2014-04-10 17:14:25 +0000 | [diff] [blame] | 362 | $BASE_DIR/$LIBVPX_SRC_DIR/build/make/rtcd.pl \ |
fgalligan@chromium.org | 6fefe53 | 2012-12-13 00:56:09 +0000 | [diff] [blame] | 363 | --arch=$2 \ |
| 364 | --sym=vpx_scale_rtcd \ |
| 365 | --config=$BASE_DIR/$TEMP_DIR/libvpx.config \ |
johannkoenig@chromium.org | 497a01b | 2014-04-16 22:02:25 +0000 | [diff] [blame] | 366 | --disable-avx2 \ |
johannkoenig@chromium.org | 93a7479 | 2014-04-10 17:14:25 +0000 | [diff] [blame] | 367 | $BASE_DIR/$LIBVPX_SRC_DIR/vpx_scale/vpx_scale_rtcd.pl \ |
fgalligan@chromium.org | 6fefe53 | 2012-12-13 00:56:09 +0000 | [diff] [blame] | 368 | > $BASE_DIR/$LIBVPX_CONFIG_DIR/$1/vpx_scale_rtcd.h |
hclam@chromium.org | e028001 | 2012-05-31 01:37:32 +0000 | [diff] [blame] | 369 | |
| 370 | rm -rf $BASE_DIR/$TEMP_DIR/libvpx.config |
| 371 | } |
| 372 | |
fgalligan@chromium.org | 6fefe53 | 2012-12-13 00:56:09 +0000 | [diff] [blame] | 373 | # Generate Config files. "--enable-external-build" must be set to skip |
| 374 | # detection of capabilities on specific targets. |
| 375 | # $1 - Header file directory. |
| 376 | # $2 - Config command line. |
| 377 | function gen_config_files { |
| 378 | ./configure $2 > /dev/null |
| 379 | |
| 380 | # Generate vpx_config.asm. Do not create one for mips. |
johannkoenig@chromium.org | 796a08a | 2014-09-04 17:34:57 +0000 | [diff] [blame] | 381 | if [[ "$1" != *mipsel && "$1" != *mips64el ]]; then |
fgalligan@chromium.org | 6fefe53 | 2012-12-13 00:56:09 +0000 | [diff] [blame] | 382 | if [[ "$1" == *x64* ]] || [[ "$1" == *ia32* ]]; then |
hclam@chromium.org | bd09f76 | 2014-09-05 21:22:35 +0000 | [diff] [blame] | 383 | egrep "#define [A-Z0-9_]+ [01]" vpx_config.h | awk '{print "%define " $2 " " $3}' > vpx_config.asm |
fgalligan@chromium.org | 6fefe53 | 2012-12-13 00:56:09 +0000 | [diff] [blame] | 384 | else |
| 385 | 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 |
| 386 | fi |
| 387 | fi |
| 388 | |
| 389 | cp vpx_config.* $BASE_DIR/$LIBVPX_CONFIG_DIR/$1 |
| 390 | make_clean |
| 391 | rm -rf vpx_config.* |
| 392 | } |
| 393 | |
| 394 | echo "Create temporary directory." |
| 395 | TEMP_DIR="$LIBVPX_SRC_DIR.temp" |
| 396 | rm -rf $TEMP_DIR |
| 397 | cp -R $LIBVPX_SRC_DIR $TEMP_DIR |
| 398 | cd $TEMP_DIR |
| 399 | |
hclam@chromium.org | bd09f76 | 2014-09-05 21:22:35 +0000 | [diff] [blame] | 400 | echo "Generate config files." |
johannkoenig@chromium.org | d143273 | 2014-04-16 20:40:56 +0000 | [diff] [blame] | 401 | # TODO(joeyparrish) Enable AVX2 when broader VS2013 support is available |
| 402 | all_platforms="--enable-external-build --enable-postproc --disable-install-srcs --enable-multi-res-encoding --enable-temporal-denoising --disable-unit-tests --disable-install-docs --disable-examples --disable-avx2" |
fgalligan@chromium.org | 9c920af | 2013-09-18 23:03:43 +0000 | [diff] [blame] | 403 | gen_config_files linux/ia32 "--target=x86-linux-gcc --disable-ccache --enable-pic --enable-realtime-only ${all_platforms}" |
fgalligan@chromium.org | 6fefe53 | 2012-12-13 00:56:09 +0000 | [diff] [blame] | 404 | gen_config_files linux/x64 "--target=x86_64-linux-gcc --disable-ccache --enable-pic --enable-realtime-only ${all_platforms}" |
fgalligan@chromium.org | db9ac6c | 2014-06-19 21:41:26 +0000 | [diff] [blame] | 405 | gen_config_files linux/arm "--target=armv6-linux-gcc --enable-pic --enable-realtime-only --disable-install-bins --disable-install-libs --disable-edsp ${all_platforms}" |
| 406 | 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-pic --enable-realtime-only --enable-runtime-cpu-detect --disable-edsp ${all_platforms}" |
| 408 | gen_config_files linux/arm64 "--force-target=armv8-linux-gcc --enable-pic --enable-realtime-only --disable-edsp ${all_platforms}" |
fgalligan@chromium.org | 6fefe53 | 2012-12-13 00:56:09 +0000 | [diff] [blame] | 409 | gen_config_files linux/mipsel "--target=mips32-linux-gcc --disable-fast-unaligned ${all_platforms}" |
johannkoenig@chromium.org | 796a08a | 2014-09-04 17:34:57 +0000 | [diff] [blame] | 410 | gen_config_files linux/mips64el "--target=mips64-linux-gcc --disable-fast-unaligned ${all_platforms}" |
earthdok@chromium.org | 67a8416 | 2014-03-27 19:05:43 +0000 | [diff] [blame] | 411 | gen_config_files linux/generic "--target=generic-gnu --enable-pic --enable-realtime-only ${all_platforms}" |
johannkoenig@chromium.org | a4adce5 | 2014-04-15 23:01:37 +0000 | [diff] [blame] | 412 | 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 ${all_platforms}" |
fgalligan@chromium.org | 9c920af | 2013-09-18 23:03:43 +0000 | [diff] [blame] | 414 | gen_config_files mac/ia32 "--target=x86-darwin9-gcc --enable-pic --enable-realtime-only ${all_platforms}" |
fgalligan@chromium.org | 6fefe53 | 2012-12-13 00:56:09 +0000 | [diff] [blame] | 415 | gen_config_files mac/x64 "--target=x86_64-darwin9-gcc --enable-pic --enable-realtime-only ${all_platforms}" |
sergeyu@chromium.org | d5b5d74 | 2013-11-27 19:36:46 +0000 | [diff] [blame] | 416 | gen_config_files nacl "--target=generic-gnu --enable-pic --enable-realtime-only ${all_platforms}" |
fgalligan@chromium.org | 6fefe53 | 2012-12-13 00:56:09 +0000 | [diff] [blame] | 417 | |
| 418 | echo "Remove temporary directory." |
| 419 | cd $BASE_DIR |
| 420 | rm -rf $TEMP_DIR |
| 421 | |
hclam@chromium.org | 29e0140 | 2012-05-30 20:41:48 +0000 | [diff] [blame] | 422 | echo "Lint libvpx configuration." |
| 423 | lint_config linux/ia32 |
| 424 | lint_config linux/x64 |
| 425 | lint_config linux/arm |
| 426 | lint_config linux/arm-neon |
wjia@chromium.org | 1a56a96 | 2013-03-11 21:02:06 +0000 | [diff] [blame] | 427 | lint_config linux/arm-neon-cpu-detect |
johannkoenig@chromium.org | 7765c07 | 2014-05-16 15:51:21 +0000 | [diff] [blame] | 428 | lint_config linux/arm64 |
| 429 | lint_config linux/mipsel |
johannkoenig@chromium.org | 796a08a | 2014-09-04 17:34:57 +0000 | [diff] [blame] | 430 | lint_config linux/mips64el |
earthdok@chromium.org | 67a8416 | 2014-03-27 19:05:43 +0000 | [diff] [blame] | 431 | lint_config linux/generic |
hclam@chromium.org | 29e0140 | 2012-05-30 20:41:48 +0000 | [diff] [blame] | 432 | lint_config win/ia32 |
fgalligan@chromium.org | 8ae1e8e | 2013-01-26 07:22:44 +0000 | [diff] [blame] | 433 | lint_config win/x64 |
hclam@chromium.org | 29e0140 | 2012-05-30 20:41:48 +0000 | [diff] [blame] | 434 | lint_config mac/ia32 |
badea@adobe.com | 9cfd6fe | 2012-09-20 12:35:22 +0000 | [diff] [blame] | 435 | lint_config mac/x64 |
sergeyu@chromium.org | d5b5d74 | 2013-11-27 19:36:46 +0000 | [diff] [blame] | 436 | lint_config nacl |
hclam@chromium.org | 29e0140 | 2012-05-30 20:41:48 +0000 | [diff] [blame] | 437 | |
chrome-bot@google.com | b3c3acc | 2011-10-11 14:10:16 +0000 | [diff] [blame] | 438 | echo "Create temporary directory." |
chrome-bot@google.com | b3c3acc | 2011-10-11 14:10:16 +0000 | [diff] [blame] | 439 | TEMP_DIR="$LIBVPX_SRC_DIR.temp" |
hclam@chromium.org | 29e0140 | 2012-05-30 20:41:48 +0000 | [diff] [blame] | 440 | rm -rf $TEMP_DIR |
chrome-bot@google.com | b3c3acc | 2011-10-11 14:10:16 +0000 | [diff] [blame] | 441 | cp -R $LIBVPX_SRC_DIR $TEMP_DIR |
| 442 | cd $TEMP_DIR |
| 443 | |
hclam@chromium.org | e028001 | 2012-05-31 01:37:32 +0000 | [diff] [blame] | 444 | gen_rtcd_header linux/ia32 x86 |
| 445 | gen_rtcd_header linux/x64 x86_64 |
| 446 | gen_rtcd_header linux/arm armv6 |
| 447 | gen_rtcd_header linux/arm-neon armv7 |
wjia@chromium.org | 1a56a96 | 2013-03-11 21:02:06 +0000 | [diff] [blame] | 448 | gen_rtcd_header linux/arm-neon-cpu-detect armv7 |
johannkoenig@chromium.org | 7765c07 | 2014-05-16 15:51:21 +0000 | [diff] [blame] | 449 | gen_rtcd_header linux/arm64 armv8 |
petarj@mips.com | e1837fb | 2012-08-17 03:08:23 +0000 | [diff] [blame] | 450 | gen_rtcd_header linux/mipsel mipsel |
johannkoenig@chromium.org | 796a08a | 2014-09-04 17:34:57 +0000 | [diff] [blame] | 451 | gen_rtcd_header linux/mips64el mips64el |
earthdok@chromium.org | 67a8416 | 2014-03-27 19:05:43 +0000 | [diff] [blame] | 452 | gen_rtcd_header linux/generic generic |
hclam@chromium.org | e028001 | 2012-05-31 01:37:32 +0000 | [diff] [blame] | 453 | gen_rtcd_header win/ia32 x86 |
fgalligan@chromium.org | 8ae1e8e | 2013-01-26 07:22:44 +0000 | [diff] [blame] | 454 | gen_rtcd_header win/x64 x86_64 |
hclam@chromium.org | e028001 | 2012-05-31 01:37:32 +0000 | [diff] [blame] | 455 | gen_rtcd_header mac/ia32 x86 |
badea@adobe.com | 9cfd6fe | 2012-09-20 12:35:22 +0000 | [diff] [blame] | 456 | gen_rtcd_header mac/x64 x86_64 |
sergeyu@chromium.org | d5b5d74 | 2013-11-27 19:36:46 +0000 | [diff] [blame] | 457 | gen_rtcd_header nacl nacl |
hclam@chromium.org | e028001 | 2012-05-31 01:37:32 +0000 | [diff] [blame] | 458 | |
chrome-bot@google.com | b3c3acc | 2011-10-11 14:10:16 +0000 | [diff] [blame] | 459 | echo "Prepare Makefile." |
| 460 | ./configure --target=generic-gnu > /dev/null |
hclam@chromium.org | 29e0140 | 2012-05-30 20:41:48 +0000 | [diff] [blame] | 461 | make_clean |
chrome-bot@google.com | b3c3acc | 2011-10-11 14:10:16 +0000 | [diff] [blame] | 462 | |
hclam@chromium.org | bd09f76 | 2014-09-05 21:22:35 +0000 | [diff] [blame] | 463 | # Remove existing .gni file. |
| 464 | rm -rf $BASE_DIR/libvpx_srcs.gni |
| 465 | write_license $BASE_DIR/libvpx_srcs.gni |
| 466 | |
chrome-bot@google.com | b3c3acc | 2011-10-11 14:10:16 +0000 | [diff] [blame] | 467 | echo "Generate X86 source list." |
hclam@chromium.org | 29e0140 | 2012-05-30 20:41:48 +0000 | [diff] [blame] | 468 | config=$(print_config linux/ia32) |
| 469 | make_clean |
| 470 | make libvpx_srcs.txt target=libs $config > /dev/null |
hclam@chromium.org | bd09f76 | 2014-09-05 21:22:35 +0000 | [diff] [blame] | 471 | convert_srcs_to_project_files libvpx_srcs.txt libvpx_srcs_x86 |
chrome-bot@google.com | b3c3acc | 2011-10-11 14:10:16 +0000 | [diff] [blame] | 472 | |
fgalligan@chromium.org | 6fefe53 | 2012-12-13 00:56:09 +0000 | [diff] [blame] | 473 | # Copy vpx_version.h. The file should be the same for all platforms. |
| 474 | cp vpx_version.h $BASE_DIR/$LIBVPX_CONFIG_DIR |
| 475 | |
chrome-bot@google.com | b3c3acc | 2011-10-11 14:10:16 +0000 | [diff] [blame] | 476 | echo "Generate X86_64 source list." |
hclam@chromium.org | 29e0140 | 2012-05-30 20:41:48 +0000 | [diff] [blame] | 477 | config=$(print_config linux/x64) |
| 478 | make_clean |
| 479 | make libvpx_srcs.txt target=libs $config > /dev/null |
hclam@chromium.org | bd09f76 | 2014-09-05 21:22:35 +0000 | [diff] [blame] | 480 | convert_srcs_to_project_files libvpx_srcs.txt libvpx_srcs_x86_64 |
chrome-bot@google.com | b3c3acc | 2011-10-11 14:10:16 +0000 | [diff] [blame] | 481 | |
| 482 | echo "Generate ARM source list." |
hclam@chromium.org | 29e0140 | 2012-05-30 20:41:48 +0000 | [diff] [blame] | 483 | config=$(print_config linux/arm) |
| 484 | make_clean |
| 485 | make libvpx_srcs.txt target=libs $config > /dev/null |
hclam@chromium.org | bd09f76 | 2014-09-05 21:22:35 +0000 | [diff] [blame] | 486 | convert_srcs_to_project_files libvpx_srcs.txt libvpx_srcs_arm |
chrome-bot@google.com | b3c3acc | 2011-10-11 14:10:16 +0000 | [diff] [blame] | 487 | |
| 488 | echo "Generate ARM NEON source list." |
hclam@chromium.org | 29e0140 | 2012-05-30 20:41:48 +0000 | [diff] [blame] | 489 | config=$(print_config linux/arm-neon) |
| 490 | make_clean |
| 491 | make libvpx_srcs.txt target=libs $config > /dev/null |
hclam@chromium.org | bd09f76 | 2014-09-05 21:22:35 +0000 | [diff] [blame] | 492 | convert_srcs_to_project_files libvpx_srcs.txt libvpx_srcs_arm_neon |
chrome-bot@google.com | b3c3acc | 2011-10-11 14:10:16 +0000 | [diff] [blame] | 493 | |
wjia@chromium.org | 1a56a96 | 2013-03-11 21:02:06 +0000 | [diff] [blame] | 494 | echo "Generate ARM NEON CPU DETECT source list." |
| 495 | config=$(print_config linux/arm-neon-cpu-detect) |
| 496 | make_clean |
| 497 | make libvpx_srcs.txt target=libs $config > /dev/null |
hclam@chromium.org | bd09f76 | 2014-09-05 21:22:35 +0000 | [diff] [blame] | 498 | convert_srcs_to_project_files libvpx_srcs.txt libvpx_srcs_arm_neon_cpu_detect |
wjia@chromium.org | 1a56a96 | 2013-03-11 21:02:06 +0000 | [diff] [blame] | 499 | |
johannkoenig@chromium.org | 7765c07 | 2014-05-16 15:51:21 +0000 | [diff] [blame] | 500 | echo "Generate ARM64 source list." |
| 501 | config=$(print_config linux/arm64) |
| 502 | make_clean |
| 503 | make libvpx_srcs.txt target=libs $config > /dev/null |
hclam@chromium.org | bd09f76 | 2014-09-05 21:22:35 +0000 | [diff] [blame] | 504 | convert_srcs_to_project_files libvpx_srcs.txt libvpx_srcs_arm64 |
johannkoenig@chromium.org | 7765c07 | 2014-05-16 15:51:21 +0000 | [diff] [blame] | 505 | |
petarj@mips.com | e1837fb | 2012-08-17 03:08:23 +0000 | [diff] [blame] | 506 | echo "Generate MIPS source list." |
| 507 | config=$(print_config_basic linux/mipsel) |
| 508 | make_clean |
| 509 | make libvpx_srcs.txt target=libs $config > /dev/null |
hclam@chromium.org | bd09f76 | 2014-09-05 21:22:35 +0000 | [diff] [blame] | 510 | convert_srcs_to_project_files libvpx_srcs.txt libvpx_srcs_mips |
petarj@mips.com | e1837fb | 2012-08-17 03:08:23 +0000 | [diff] [blame] | 511 | |
johannkoenig@chromium.org | 796a08a | 2014-09-04 17:34:57 +0000 | [diff] [blame] | 512 | echo "MIPS64 source list is identical to MIPS source list. No need to generate it." |
| 513 | |
sergeyu@chromium.org | d5b5d74 | 2013-11-27 19:36:46 +0000 | [diff] [blame] | 514 | echo "Generate NaCl source list." |
| 515 | config=$(print_config_basic nacl) |
| 516 | make_clean |
| 517 | make libvpx_srcs.txt target=libs $config > /dev/null |
hclam@chromium.org | bd09f76 | 2014-09-05 21:22:35 +0000 | [diff] [blame] | 518 | convert_srcs_to_project_files libvpx_srcs.txt libvpx_srcs_nacl |
sergeyu@chromium.org | d5b5d74 | 2013-11-27 19:36:46 +0000 | [diff] [blame] | 519 | |
earthdok@chromium.org | 67a8416 | 2014-03-27 19:05:43 +0000 | [diff] [blame] | 520 | echo "Generate GENERIC source list." |
| 521 | config=$(print_config_basic linux/generic) |
| 522 | make_clean |
| 523 | make libvpx_srcs.txt target=libs $config > /dev/null |
hclam@chromium.org | bd09f76 | 2014-09-05 21:22:35 +0000 | [diff] [blame] | 524 | convert_srcs_to_project_files libvpx_srcs.txt libvpx_srcs_generic |
earthdok@chromium.org | 67a8416 | 2014-03-27 19:05:43 +0000 | [diff] [blame] | 525 | |
chrome-bot@google.com | b3c3acc | 2011-10-11 14:10:16 +0000 | [diff] [blame] | 526 | echo "Remove temporary directory." |
| 527 | cd $BASE_DIR |
| 528 | rm -rf $TEMP_DIR |
fgalligan@chromium.org | 6fefe53 | 2012-12-13 00:56:09 +0000 | [diff] [blame] | 529 | |
| 530 | # TODO(fgalligan): Is "--disable-fast-unaligned" needed on mipsel? |
| 531 | # TODO(fgalligan): Can we turn on "--enable-realtime-only" for mipsel? |