summaryrefslogtreecommitdiff
path: root/build
diff options
context:
space:
mode:
authorJohn Koleszar <jkoleszar@google.com>2011-03-11 00:05:09 -0500
committerJohn Koleszar <jkoleszar@google.com>2011-03-11 00:05:09 -0500
commit314631ca6142a38507ee683ed03be1a504a03753 (patch)
treeb2f48cf23caec2efa40ba701eea52f54485a77b1 /build
parentdc29ed27bd298eb84767941f0f13b731395720e6 (diff)
parent128d2c23b34dce3c24daeee5dc619f6cda93cc5c (diff)
downloadlibvpx-314631ca6142a38507ee683ed03be1a504a03753.tar
libvpx-314631ca6142a38507ee683ed03be1a504a03753.tar.gz
libvpx-314631ca6142a38507ee683ed03be1a504a03753.tar.bz2
libvpx-314631ca6142a38507ee683ed03be1a504a03753.zip
Merge remote branch 'origin/master' into experimental
Change-Id: Ibc4a75dbbc8b35ce298477e055e5a88df080d4b3
Diffstat (limited to 'build')
-rwxr-xr-xbuild/make/gen_msvs_proj.sh72
-rw-r--r--build/make/obj_int_extract.c21
-rw-r--r--build/x86-msvs/obj_int_extract.bat15
3 files changed, 106 insertions, 2 deletions
diff --git a/build/make/gen_msvs_proj.sh b/build/make/gen_msvs_proj.sh
index becd95827..c2ef44a9b 100755
--- a/build/make/gen_msvs_proj.sh
+++ b/build/make/gen_msvs_proj.sh
@@ -33,6 +33,7 @@ Options:
--proj-guid=GUID GUID to use for the project
--module-def=filename File containing export definitions (for DLLs)
--ver=version Version (7,8,9) of visual studio to generate for
+ --src-path-bare=dir Path to root of source tree
-Ipath/to/include Additional include directories
-DFLAG[=value] Preprocessor macros to define
-Lpath/to/lib Additional library search paths
@@ -191,6 +192,8 @@ for opt in "$@"; do
;;
--lib) proj_kind="lib"
;;
+ --src-path-bare=*) src_path_bare="$optval"
+ ;;
--static-crt) use_static_runtime=true
;;
--ver=*)
@@ -335,6 +338,35 @@ generate_vcproj() {
case "$target" in
x86*)
case "$name" in
+ obj_int_extract)
+ tag Tool \
+ Name="VCCLCompilerTool" \
+ Optimization="0" \
+ AdditionalIncludeDirectories="$incs" \
+ PreprocessorDefinitions="WIN32;DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE" \
+ RuntimeLibrary="$debug_runtime" \
+ WarningLevel="3" \
+ Detect64BitPortabilityProblems="true" \
+ DebugInformationFormat="1" \
+ ;;
+ vpx)
+ tag Tool \
+ Name="VCPreBuildEventTool" \
+ CommandLine="call obj_int_extract.bat $src_path_bare" \
+
+ tag Tool \
+ Name="VCCLCompilerTool" \
+ Optimization="0" \
+ AdditionalIncludeDirectories="$incs" \
+ PreprocessorDefinitions="WIN32;_DEBUG;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE;$defines" \
+ RuntimeLibrary="$debug_runtime" \
+ UsePrecompiledHeader="0" \
+ WarningLevel="3" \
+ DebugInformationFormat="1" \
+ Detect64BitPortabilityProblems="true" \
+
+ $uses_asm && tag Tool Name="YASM" IncludePaths="$incs" Debug="1"
+ ;;
*)
tag Tool \
Name="VCCLCompilerTool" \
@@ -358,6 +390,12 @@ generate_vcproj() {
case "$target" in
x86*)
case "$name" in
+ obj_int_extract)
+ tag Tool \
+ Name="VCLinkerTool" \
+ OutputFile="${name}.exe" \
+ GenerateDebugInformation="true" \
+ ;;
*)
tag Tool \
Name="VCLinkerTool" \
@@ -406,6 +444,34 @@ generate_vcproj() {
case "$target" in
x86*)
case "$name" in
+ obj_int_extract)
+ tag Tool \
+ Name="VCCLCompilerTool" \
+ AdditionalIncludeDirectories="$incs" \
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE" \
+ RuntimeLibrary="$release_runtime" \
+ UsePrecompiledHeader="0" \
+ WarningLevel="3" \
+ Detect64BitPortabilityProblems="true" \
+ DebugInformationFormat="0" \
+ ;;
+ vpx)
+ tag Tool \
+ Name="VCPreBuildEventTool" \
+ CommandLine="call obj_int_extract.bat $src_path_bare" \
+
+ tag Tool \
+ Name="VCCLCompilerTool" \
+ AdditionalIncludeDirectories="$incs" \
+ PreprocessorDefinitions="WIN32;NDEBUG;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE;$defines" \
+ RuntimeLibrary="$release_runtime" \
+ UsePrecompiledHeader="0" \
+ WarningLevel="3" \
+ DebugInformationFormat="0" \
+ Detect64BitPortabilityProblems="true" \
+
+ $uses_asm && tag Tool Name="YASM" IncludePaths="$incs"
+ ;;
*)
tag Tool \
Name="VCCLCompilerTool" \
@@ -428,6 +494,12 @@ generate_vcproj() {
case "$target" in
x86*)
case "$name" in
+ obj_int_extract)
+ tag Tool \
+ Name="VCLinkerTool" \
+ OutputFile="${name}.exe" \
+ GenerateDebugInformation="true" \
+ ;;
*)
tag Tool \
Name="VCLinkerTool" \
diff --git a/build/make/obj_int_extract.c b/build/make/obj_int_extract.c
index 22c5cf2ab..01b3129d7 100644
--- a/build/make/obj_int_extract.c
+++ b/build/make/obj_int_extract.c
@@ -840,9 +840,18 @@ int parse_coff(unsigned __int8 *buf, size_t sz)
strtab_ptr = symtab_ptr + symtab_sz * 18;
if (nsections > 96)
- goto bail;
+ {
+ log_msg("Too many sections\n");
+ return 1;
+ }
- sectionlist = malloc(nsections * sizeof * sectionlist);
+ sectionlist = malloc(nsections * sizeof(sectionlist));
+
+ if (sectionlist == NULL)
+ {
+ log_msg("Allocating first level of section list failed\n");
+ return 1;
+ }
//log_msg("COFF: Found %u symbols in %u sections.\n", symtab_sz, nsections);
@@ -860,6 +869,12 @@ int parse_coff(unsigned __int8 *buf, size_t sz)
//log_msg("COFF: Parsing section %s\n",sectionname);
sectionlist[i] = malloc(strlen(sectionname) + 1);
+
+ if (sectionlist[i] == NULL)
+ {
+ log_msg("Allocating storage for %s failed\n", sectionname);
+ goto bail;
+ }
strcpy(sectionlist[i], sectionname);
if (!strcmp(sectionname, ".data")) sectionrawdata_ptr = get_le32(ptr + 20);
@@ -903,12 +918,14 @@ int parse_coff(unsigned __int8 *buf, size_t sz)
char name[9] = {0, 0, 0, 0, 0, 0, 0, 0, 0};
strncpy(name, ptr, 8);
//log_msg("COFF: Parsing symbol %s\n",name);
+ /* +1 to avoid printing leading underscore */
printf("%-40s EQU ", name + 1);
}
else
{
//log_msg("COFF: Parsing symbol %s\n",
// buf + strtab_ptr + get_le32(ptr+4));
+ /* +1 to avoid printing leading underscore */
printf("%-40s EQU ", buf + strtab_ptr + get_le32(ptr + 4) + 1);
}
diff --git a/build/x86-msvs/obj_int_extract.bat b/build/x86-msvs/obj_int_extract.bat
new file mode 100644
index 000000000..1bb865331
--- /dev/null
+++ b/build/x86-msvs/obj_int_extract.bat
@@ -0,0 +1,15 @@
+REM Copyright (c) 2011 The WebM project authors. All Rights Reserved.
+REM
+REM Use of this source code is governed by a BSD-style license
+REM that can be found in the LICENSE file in the root of the source
+REM tree. An additional intellectual property rights grant can be found
+REM in the file PATENTS. All contributing project authors may
+REM be found in the AUTHORS file in the root of the source tree.
+echo on
+
+cl /I "./" /I "%1" /nologo /c "%1/vp8/common/asm_com_offsets.c"
+cl /I "./" /I "%1" /nologo /c "%1/vp8/decoder/asm_dec_offsets.c"
+cl /I "./" /I "%1" /nologo /c "%1/vp8/encoder/asm_enc_offsets.c"
+obj_int_extract.exe rvds "asm_com_offsets.obj" > "asm_com_offsets.asm"
+obj_int_extract.exe rvds "asm_dec_offsets.obj" > "asm_dec_offsets.asm"
+obj_int_extract.exe rvds "asm_enc_offsets.obj" > "asm_enc_offsets.asm"