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

Side by Side Diff: generate_gypi.sh

Issue 13474006: libvpx: Pull from upstream (Closed) Base URL: https://src.chromium.org/chrome/trunk/deps/third_party/libvpx/
Patch Set: Created 7 years, 8 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.gyp » ('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 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 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 # $2 - Output file 97 # $2 - Output file
98 function write_special_flags { 98 function write_special_flags {
99 declare -a file_list=("${!1}") 99 declare -a file_list=("${!1}")
100 100
101 local mmx_sources=$(echo "$file_list" | grep '_mmx\.c$') 101 local mmx_sources=$(echo "$file_list" | grep '_mmx\.c$')
102 local sse2_sources=$(echo "$file_list" | grep '_sse2\.c$') 102 local sse2_sources=$(echo "$file_list" | grep '_sse2\.c$')
103 local sse3_sources=$(echo "$file_list" | grep '_sse3\.c$') 103 local sse3_sources=$(echo "$file_list" | grep '_sse3\.c$')
104 local ssse3_sources=$(echo "$file_list" | grep '_ssse3\.c$') 104 local ssse3_sources=$(echo "$file_list" | grep '_ssse3\.c$')
105 local sse4_1_sources=$(echo "$file_list" | grep '_sse4\.c$') 105 local sse4_1_sources=$(echo "$file_list" | grep '_sse4\.c$')
106 106
107 local extra_sources=$(comm -23 <(echo "$file_list") <(echo "$mmx_sources"))
108 extra_sources=$(comm -23 <(echo "$extra_sources") <(echo "$sse2_sources"))
109 extra_sources=$(comm -23 <(echo "$extra_sources") <(echo "$sse3_sources"))
110 extra_sources=$(comm -23 <(echo "$extra_sources") <(echo "$ssse3_sources"))
111 extra_sources=$(comm -23 <(echo "$extra_sources") <(echo "$sse4_1_sources"))
112
113 write_gypi_header $2 107 write_gypi_header $2
114 108
115 echo " 'targets': [" >> $2 109 echo " 'targets': [" >> $2
116 110
117 write_target_definition mmx_sources[@] $2 libvpx_intrinsics_mmx mmx 111 write_target_definition mmx_sources[@] $2 libvpx_intrinsics_mmx mmx
118 write_target_definition sse2_sources[@] $2 libvpx_intrinsics_sse2 sse2 112 write_target_definition sse2_sources[@] $2 libvpx_intrinsics_sse2 sse2
119 write_target_definition sse3_sources[@] $2 libvpx_intrinsics_sse3 sse3 113 write_target_definition sse3_sources[@] $2 libvpx_intrinsics_sse3 sse3
120 write_target_definition ssse3_sources[@] $2 libvpx_intrinsics_ssse3 ssse3 114 write_target_definition ssse3_sources[@] $2 libvpx_intrinsics_ssse3 ssse3
121 write_target_definition sse4_1_sources[@] $2 libvpx_intrinsics_sse4_1 sse4.1 115 write_target_definition sse4_1_sources[@] $2 libvpx_intrinsics_sse4_1 sse4.1
122 #CATCHALL
123 # Apply the highest level of optimization. These files need to be fixed
124 # upstream by having the different opt targets broken out.
125 write_target_definition extra_sources[@] $2 libvpx_intrinsics_extra sse4.1
126 116
127 echo " ]," >> $2 117 echo " ]," >> $2
128 118
129 write_gypi_footer $2 119 write_gypi_footer $2
130 } 120 }
131 121
132 # Convert a list of source files into gypi file. 122 # Convert a list of source files into gypi file.
133 # $1 - Input file. 123 # $1 - Input file.
134 # $2 - Output gypi file base. Will generate additional .gypi files when 124 # $2 - Output gypi file base. Will generate additional .gypi files when
135 # different compilation flags are required. 125 # different compilation flags are required.
(...skipping 12 matching lines...) Expand all
148 138
149 # Not sure why vpx_config is not included. 139 # Not sure why vpx_config is not included.
150 source_list=$(echo "$source_list" | grep -v 'vpx_config\.c') 140 source_list=$(echo "$source_list" | grep -v 'vpx_config\.c')
151 141
152 # The actual ARM files end in .asm. We have rules to translate them to .S 142 # The actual ARM files end in .asm. We have rules to translate them to .S
153 source_list=$(echo "$source_list" | sed s/\.asm\.s$/.asm/) 143 source_list=$(echo "$source_list" | sed s/\.asm\.s$/.asm/)
154 144
155 # Select all x86 files ending with .c 145 # Select all x86 files ending with .c
156 local x86_intrinsic_list=$(echo "$source_list" | \ 146 local x86_intrinsic_list=$(echo "$source_list" | \
157 egrep 'vp[89]/(encoder|decoder|common)/x86/' | \ 147 egrep 'vp[89]/(encoder|decoder|common)/x86/' | \
158 grep -e '.c$') 148 egrep '(mmx|sse2|sse3|ssse3|sse4).c$')
159 149
160 # Remove these files from the main list. 150 # Remove these files from the main list.
161 source_list=$(comm -23 <(echo "$source_list") <(echo "$x86_intrinsic_list")) 151 source_list=$(comm -23 <(echo "$source_list") <(echo "$x86_intrinsic_list"))
162 152
163 write_file_list source_list $BASE_DIR/$2.gypi 153 write_file_list source_list $BASE_DIR/$2.gypi
164 154
165 # All the files are in a single "element." Check if the first element has 155 # All the files are in a single "element." Check if the first element has
166 # length 0. 156 # length 0.
167 if [ 0 -ne ${#x86_intrinsic_list} ]; then 157 if [ 0 -ne ${#x86_intrinsic_list} ]; then
168 write_special_flags x86_intrinsic_list[@] $BASE_DIR/$2_intrinsics.gypi 158 write_special_flags x86_intrinsic_list[@] $BASE_DIR/$2_intrinsics.gypi
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
361 make_clean 351 make_clean
362 make libvpx_srcs.txt target=libs $config > /dev/null 352 make libvpx_srcs.txt target=libs $config > /dev/null
363 convert_srcs_to_gypi libvpx_srcs.txt libvpx_srcs_mips 353 convert_srcs_to_gypi libvpx_srcs.txt libvpx_srcs_mips
364 354
365 echo "Remove temporary directory." 355 echo "Remove temporary directory."
366 cd $BASE_DIR 356 cd $BASE_DIR
367 rm -rf $TEMP_DIR 357 rm -rf $TEMP_DIR
368 358
369 # TODO(fgalligan): Is "--disable-fast-unaligned" needed on mipsel? 359 # TODO(fgalligan): Is "--disable-fast-unaligned" needed on mipsel?
370 # TODO(fgalligan): Can we turn on "--enable-realtime-only" for mipsel? 360 # TODO(fgalligan): Can we turn on "--enable-realtime-only" for mipsel?
OLDNEW
« no previous file with comments | « README.chromium ('k') | libvpx.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698