update to libvpx b46243d from repo https://chromium.googlesource.com/webm/libvpx
parent
2b1f0da5c4
commit
8c5f0301f3
|
@ -24,6 +24,7 @@ changjun.yang <changjun.yang@intel.com>
|
|||
Charles 'Buck' Krasic <ckrasic@google.com>
|
||||
chm <chm@rock-chips.com>
|
||||
Christian Duvivier <cduvivier@google.com>
|
||||
Daniele Castagna <dcastagna@chromium.org>
|
||||
Daniel Kang <ddkang@google.com>
|
||||
Deb Mukherjee <debargha@google.com>
|
||||
Dim Temp <dimtemp0@gmail.com>
|
||||
|
@ -56,10 +57,12 @@ James Zern <jzern@google.com>
|
|||
Jan Gerber <j@mailb.org>
|
||||
Jan Kratochvil <jan.kratochvil@redhat.com>
|
||||
Janne Salonen <jsalonen@google.com>
|
||||
Jean-Yves Avenard <jyavenard@mozilla.com>
|
||||
Jeff Faust <jfaust@google.com>
|
||||
Jeff Muizelaar <jmuizelaar@mozilla.com>
|
||||
Jeff Petkau <jpet@chromium.org>
|
||||
Jia Jia <jia.jia@linaro.org>
|
||||
Jian Zhou <zhoujian@google.com>
|
||||
Jim Bankoski <jimbankoski@google.com>
|
||||
Jingning Han <jingning@google.com>
|
||||
Joey Parrish <joeyparrish@google.com>
|
||||
|
@ -74,6 +77,7 @@ Justin Clift <justin@salasaga.org>
|
|||
Justin Lebar <justin.lebar@gmail.com>
|
||||
KO Myung-Hun <komh@chollian.net>
|
||||
Lawrence Velázquez <larryv@macports.org>
|
||||
Linfeng Zhang <linfengz@google.com>
|
||||
Lou Quillio <louquillio@google.com>
|
||||
Luca Barbato <lu_zero@gentoo.org>
|
||||
Makoto Kato <makoto.kt@gmail.com>
|
||||
|
@ -107,9 +111,11 @@ Rob Bradford <rob@linux.intel.com>
|
|||
Ronald S. Bultje <rsbultje@gmail.com>
|
||||
Rui Ueyama <ruiu@google.com>
|
||||
Sami Pietilä <samipietila@google.com>
|
||||
Sasi Inguva <isasi@google.com>
|
||||
Scott Graham <scottmg@chromium.org>
|
||||
Scott LaVarnway <slavarnway@google.com>
|
||||
Sean McGovern <gseanmcg@gmail.com>
|
||||
Sergey Kolomenkin <kolomenkin@gmail.com>
|
||||
Sergey Ulanov <sergeyu@chromium.org>
|
||||
Shimon Doodkin <helpmepro1@gmail.com>
|
||||
Shunyao Li <shunyaoli@google.com>
|
||||
|
@ -126,8 +132,10 @@ Timothy B. Terriberry <tterribe@xiph.org>
|
|||
Tom Finegan <tomfinegan@google.com>
|
||||
Vignesh Venkatasubramanian <vigneshv@google.com>
|
||||
Yaowu Xu <yaowu@google.com>
|
||||
Yi Luo <luoyi@google.com>
|
||||
Yongzhe Wang <yongzhe@google.com>
|
||||
Yunqing Wang <yunqingwang@google.com>
|
||||
Yury Gitman <yuryg@google.com>
|
||||
Zoe Liu <zoeliu@google.com>
|
||||
Google Inc.
|
||||
The Mozilla Foundation
|
||||
|
|
|
@ -1,3 +1,33 @@
|
|||
2016-07-20 v1.6.0 "Khaki Campbell Duck"
|
||||
This release improves upon the VP9 encoder and speeds up the encoding and
|
||||
decoding processes.
|
||||
|
||||
- Upgrading:
|
||||
This release is ABI incompatible with 1.5.0 due to a new 'color_range' enum
|
||||
in vpx_image and some minor changes to the VP8_COMP structure.
|
||||
|
||||
The default key frame interval for VP9 has changed from 128 to 9999.
|
||||
|
||||
- Enhancement:
|
||||
A core focus has been performance for low end Intel processors. SSSE3
|
||||
instructions such as 'pshufb' have been avoided and instructions have been
|
||||
reordered to better accommodate the more constrained pipelines.
|
||||
|
||||
As a result, devices based on Celeron processors have seen substantial
|
||||
decoding improvements. From Indian Runner Duck to Javan Whistling Duck,
|
||||
decoding speed improved between 10 and 30%. Between Javan Whistling Duck
|
||||
and Khaki Campbell Duck, it improved another 10 to 15%.
|
||||
|
||||
While Celeron benefited most, Core-i5 also improved 5% and 10% between the
|
||||
respective releases.
|
||||
|
||||
Realtime performance for WebRTC for both speed and quality has received a
|
||||
lot of attention.
|
||||
|
||||
- Bug Fixes:
|
||||
A number of fuzzing issues, found variously by Mozilla, Chromium and others,
|
||||
have been fixed and we strongly recommend updating.
|
||||
|
||||
2015-11-09 v1.5.0 "Javan Whistling Duck"
|
||||
This release improves upon the VP9 encoder and speeds up the encoding and
|
||||
decoding processes.
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
README - 23 March 2015
|
||||
README - 20 July 2016
|
||||
|
||||
Welcome to the WebM VP8/VP9 Codec SDK!
|
||||
|
||||
|
@ -47,11 +47,8 @@ COMPILING THE APPLICATIONS/LIBRARIES:
|
|||
--help output of the configure script. As of this writing, the list of
|
||||
available targets is:
|
||||
|
||||
armv6-darwin-gcc
|
||||
armv6-linux-rvct
|
||||
armv6-linux-gcc
|
||||
armv6-none-rvct
|
||||
arm64-darwin-gcc
|
||||
arm64-linux-gcc
|
||||
armv7-android-gcc
|
||||
armv7-darwin-gcc
|
||||
armv7-linux-rvct
|
||||
|
@ -61,6 +58,7 @@ COMPILING THE APPLICATIONS/LIBRARIES:
|
|||
armv7-win32-vs12
|
||||
armv7-win32-vs14
|
||||
armv7s-darwin-gcc
|
||||
armv8-linux-gcc
|
||||
mips32-linux-gcc
|
||||
mips64-linux-gcc
|
||||
sparc-solaris-gcc
|
||||
|
@ -74,15 +72,13 @@ COMPILING THE APPLICATIONS/LIBRARIES:
|
|||
x86-darwin12-gcc
|
||||
x86-darwin13-gcc
|
||||
x86-darwin14-gcc
|
||||
x86-darwin15-gcc
|
||||
x86-iphonesimulator-gcc
|
||||
x86-linux-gcc
|
||||
x86-linux-icc
|
||||
x86-os2-gcc
|
||||
x86-solaris-gcc
|
||||
x86-win32-gcc
|
||||
x86-win32-vs7
|
||||
x86-win32-vs8
|
||||
x86-win32-vs9
|
||||
x86-win32-vs10
|
||||
x86-win32-vs11
|
||||
x86-win32-vs12
|
||||
|
@ -94,13 +90,12 @@ COMPILING THE APPLICATIONS/LIBRARIES:
|
|||
x86_64-darwin12-gcc
|
||||
x86_64-darwin13-gcc
|
||||
x86_64-darwin14-gcc
|
||||
x86_64-darwin15-gcc
|
||||
x86_64-iphonesimulator-gcc
|
||||
x86_64-linux-gcc
|
||||
x86_64-linux-icc
|
||||
x86_64-solaris-gcc
|
||||
x86_64-win64-gcc
|
||||
x86_64-win64-vs8
|
||||
x86_64-win64-vs9
|
||||
x86_64-win64-vs10
|
||||
x86_64-win64-vs11
|
||||
x86_64-win64-vs12
|
||||
|
@ -133,7 +128,22 @@ VP8/VP9 TEST VECTORS:
|
|||
$ ./configure --enable-unit-tests
|
||||
$ LIBVPX_TEST_DATA_PATH=../libvpx-test-data make testdata
|
||||
|
||||
CODE STYLE:
|
||||
The coding style used by this project is enforced with clang-format using the
|
||||
configuration contained in the .clang-format file in the root of the
|
||||
repository.
|
||||
|
||||
Before pushing changes for review you can format your code with:
|
||||
# Apply clang-format to modified .c, .h and .cc files
|
||||
$ clang-format -i --style=file \
|
||||
$(git diff --name-only --diff-filter=ACMR '*.[hc]' '*.cc')
|
||||
|
||||
Check the .clang-format file for the version used to generate it if there is
|
||||
any difference between your local formatting and the review system.
|
||||
|
||||
See also: http://clang.llvm.org/docs/ClangFormat.html
|
||||
|
||||
SUPPORT
|
||||
This library is an open source project supported by its community. Please
|
||||
please email webm-discuss@webmproject.org for help.
|
||||
email webm-discuss@webmproject.org for help.
|
||||
|
||||
|
|
|
@ -8,7 +8,6 @@
|
|||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <limits.h>
|
||||
|
@ -22,42 +21,36 @@ extern void die(const char *fmt, ...) __attribute__((noreturn));
|
|||
extern void die(const char *fmt, ...);
|
||||
#endif
|
||||
|
||||
|
||||
struct arg arg_init(char **argv) {
|
||||
struct arg a;
|
||||
|
||||
a.argv = argv;
|
||||
a.argv = argv;
|
||||
a.argv_step = 1;
|
||||
a.name = NULL;
|
||||
a.val = NULL;
|
||||
a.def = NULL;
|
||||
a.name = NULL;
|
||||
a.val = NULL;
|
||||
a.def = NULL;
|
||||
return a;
|
||||
}
|
||||
|
||||
int arg_match(struct arg *arg_, const struct arg_def *def, char **argv) {
|
||||
struct arg arg;
|
||||
|
||||
if (!argv[0] || argv[0][0] != '-')
|
||||
return 0;
|
||||
if (!argv[0] || argv[0][0] != '-') return 0;
|
||||
|
||||
arg = arg_init(argv);
|
||||
|
||||
if (def->short_name
|
||||
&& strlen(arg.argv[0]) == strlen(def->short_name) + 1
|
||||
&& !strcmp(arg.argv[0] + 1, def->short_name)) {
|
||||
|
||||
if (def->short_name && strlen(arg.argv[0]) == strlen(def->short_name) + 1 &&
|
||||
!strcmp(arg.argv[0] + 1, def->short_name)) {
|
||||
arg.name = arg.argv[0] + 1;
|
||||
arg.val = def->has_val ? arg.argv[1] : NULL;
|
||||
arg.argv_step = def->has_val ? 2 : 1;
|
||||
} else if (def->long_name) {
|
||||
const size_t name_len = strlen(def->long_name);
|
||||
|
||||
if (strlen(arg.argv[0]) >= name_len + 2
|
||||
&& arg.argv[0][1] == '-'
|
||||
&& !strncmp(arg.argv[0] + 2, def->long_name, name_len)
|
||||
&& (arg.argv[0][name_len + 2] == '='
|
||||
|| arg.argv[0][name_len + 2] == '\0')) {
|
||||
|
||||
if (strlen(arg.argv[0]) >= name_len + 2 && arg.argv[0][1] == '-' &&
|
||||
!strncmp(arg.argv[0] + 2, def->long_name, name_len) &&
|
||||
(arg.argv[0][name_len + 2] == '=' ||
|
||||
arg.argv[0][name_len + 2] == '\0')) {
|
||||
arg.name = arg.argv[0] + 2;
|
||||
arg.val = arg.name[name_len] == '=' ? arg.name + name_len + 1 : NULL;
|
||||
arg.argv_step = 1;
|
||||
|
@ -70,8 +63,7 @@ int arg_match(struct arg *arg_, const struct arg_def *def, char **argv) {
|
|||
if (arg.name && arg.val && !def->has_val)
|
||||
die("Error: option %s requires no argument.\n", arg.name);
|
||||
|
||||
if (arg.name
|
||||
&& (arg.val || !def->has_val)) {
|
||||
if (arg.name && (arg.val || !def->has_val)) {
|
||||
arg.def = def;
|
||||
*arg_ = arg;
|
||||
return 1;
|
||||
|
@ -80,15 +72,12 @@ int arg_match(struct arg *arg_, const struct arg_def *def, char **argv) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
|
||||
const char *arg_next(struct arg *arg) {
|
||||
if (arg->argv[0])
|
||||
arg->argv += arg->argv_step;
|
||||
if (arg->argv[0]) arg->argv += arg->argv_step;
|
||||
|
||||
return *arg->argv;
|
||||
}
|
||||
|
||||
|
||||
char **argv_dup(int argc, const char **argv) {
|
||||
char **new_argv = malloc((argc + 1) * sizeof(*argv));
|
||||
|
||||
|
@ -97,9 +86,8 @@ char **argv_dup(int argc, const char **argv) {
|
|||
return new_argv;
|
||||
}
|
||||
|
||||
|
||||
void arg_show_usage(FILE *fp, const struct arg_def *const *defs) {
|
||||
char option_text[40] = {0};
|
||||
char option_text[40] = { 0 };
|
||||
|
||||
for (; *defs; defs++) {
|
||||
const struct arg_def *def = *defs;
|
||||
|
@ -109,15 +97,12 @@ void arg_show_usage(FILE *fp, const struct arg_def *const *defs) {
|
|||
if (def->short_name && def->long_name) {
|
||||
char *comma = def->has_val ? "," : ", ";
|
||||
|
||||
snprintf(option_text, 37, "-%s%s%s --%s%6s",
|
||||
def->short_name, short_val, comma,
|
||||
def->long_name, long_val);
|
||||
snprintf(option_text, 37, "-%s%s%s --%s%6s", def->short_name, short_val,
|
||||
comma, def->long_name, long_val);
|
||||
} else if (def->short_name)
|
||||
snprintf(option_text, 37, "-%s%s",
|
||||
def->short_name, short_val);
|
||||
snprintf(option_text, 37, "-%s%s", def->short_name, short_val);
|
||||
else if (def->long_name)
|
||||
snprintf(option_text, 37, " --%s%s",
|
||||
def->long_name, long_val);
|
||||
snprintf(option_text, 37, " --%s%s", def->long_name, long_val);
|
||||
|
||||
fprintf(fp, " %-37s\t%s\n", option_text, def->desc);
|
||||
|
||||
|
@ -127,110 +112,103 @@ void arg_show_usage(FILE *fp, const struct arg_def *const *defs) {
|
|||
fprintf(fp, " %-37s\t ", "");
|
||||
|
||||
for (listptr = def->enums; listptr->name; listptr++)
|
||||
fprintf(fp, "%s%s", listptr->name,
|
||||
listptr[1].name ? ", " : "\n");
|
||||
fprintf(fp, "%s%s", listptr->name, listptr[1].name ? ", " : "\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
unsigned int arg_parse_uint(const struct arg *arg) {
|
||||
long int rawval;
|
||||
char *endptr;
|
||||
long int rawval;
|
||||
char *endptr;
|
||||
|
||||
rawval = strtol(arg->val, &endptr, 10);
|
||||
|
||||
if (arg->val[0] != '\0' && endptr[0] == '\0') {
|
||||
if (rawval >= 0 && rawval <= UINT_MAX)
|
||||
return rawval;
|
||||
if (rawval >= 0 && rawval <= UINT_MAX) return (unsigned int)rawval;
|
||||
|
||||
die("Option %s: Value %ld out of range for unsigned int\n",
|
||||
arg->name, rawval);
|
||||
die("Option %s: Value %ld out of range for unsigned int\n", arg->name,
|
||||
rawval);
|
||||
}
|
||||
|
||||
die("Option %s: Invalid character '%c'\n", arg->name, *endptr);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
int arg_parse_int(const struct arg *arg) {
|
||||
long int rawval;
|
||||
char *endptr;
|
||||
long int rawval;
|
||||
char *endptr;
|
||||
|
||||
rawval = strtol(arg->val, &endptr, 10);
|
||||
|
||||
if (arg->val[0] != '\0' && endptr[0] == '\0') {
|
||||
if (rawval >= INT_MIN && rawval <= INT_MAX)
|
||||
return rawval;
|
||||
if (rawval >= INT_MIN && rawval <= INT_MAX) return (int)rawval;
|
||||
|
||||
die("Option %s: Value %ld out of range for signed int\n",
|
||||
arg->name, rawval);
|
||||
die("Option %s: Value %ld out of range for signed int\n", arg->name,
|
||||
rawval);
|
||||
}
|
||||
|
||||
die("Option %s: Invalid character '%c'\n", arg->name, *endptr);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
struct vpx_rational {
|
||||
int num; /**< fraction numerator */
|
||||
int den; /**< fraction denominator */
|
||||
};
|
||||
struct vpx_rational arg_parse_rational(const struct arg *arg) {
|
||||
long int rawval;
|
||||
char *endptr;
|
||||
struct vpx_rational rat;
|
||||
long int rawval;
|
||||
char *endptr;
|
||||
struct vpx_rational rat;
|
||||
|
||||
/* parse numerator */
|
||||
rawval = strtol(arg->val, &endptr, 10);
|
||||
|
||||
if (arg->val[0] != '\0' && endptr[0] == '/') {
|
||||
if (rawval >= INT_MIN && rawval <= INT_MAX)
|
||||
rat.num = rawval;
|
||||
else die("Option %s: Value %ld out of range for signed int\n",
|
||||
arg->name, rawval);
|
||||
} else die("Option %s: Expected / at '%c'\n", arg->name, *endptr);
|
||||
rat.num = (int)rawval;
|
||||
else
|
||||
die("Option %s: Value %ld out of range for signed int\n", arg->name,
|
||||
rawval);
|
||||
} else
|
||||
die("Option %s: Expected / at '%c'\n", arg->name, *endptr);
|
||||
|
||||
/* parse denominator */
|
||||
rawval = strtol(endptr + 1, &endptr, 10);
|
||||
|
||||
if (arg->val[0] != '\0' && endptr[0] == '\0') {
|
||||
if (rawval >= INT_MIN && rawval <= INT_MAX)
|
||||
rat.den = rawval;
|
||||
else die("Option %s: Value %ld out of range for signed int\n",
|
||||
arg->name, rawval);
|
||||
} else die("Option %s: Invalid character '%c'\n", arg->name, *endptr);
|
||||
rat.den = (int)rawval;
|
||||
else
|
||||
die("Option %s: Value %ld out of range for signed int\n", arg->name,
|
||||
rawval);
|
||||
} else
|
||||
die("Option %s: Invalid character '%c'\n", arg->name, *endptr);
|
||||
|
||||
return rat;
|
||||
}
|
||||
|
||||
|
||||
int arg_parse_enum(const struct arg *arg) {
|
||||
const struct arg_enum_list *listptr;
|
||||
long int rawval;
|
||||
char *endptr;
|
||||
long int rawval;
|
||||
char *endptr;
|
||||
|
||||
/* First see if the value can be parsed as a raw value */
|
||||
rawval = strtol(arg->val, &endptr, 10);
|
||||
if (arg->val[0] != '\0' && endptr[0] == '\0') {
|
||||
/* Got a raw value, make sure it's valid */
|
||||
for (listptr = arg->def->enums; listptr->name; listptr++)
|
||||
if (listptr->val == rawval)
|
||||
return rawval;
|
||||
if (listptr->val == rawval) return (int)rawval;
|
||||
}
|
||||
|
||||
/* Next see if it can be parsed as a string */
|
||||
for (listptr = arg->def->enums; listptr->name; listptr++)
|
||||
if (!strcmp(arg->val, listptr->name))
|
||||
return listptr->val;
|
||||
if (!strcmp(arg->val, listptr->name)) return listptr->val;
|
||||
|
||||
die("Option %s: Invalid value '%s'\n", arg->name, arg->val);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
int arg_parse_enum_or_int(const struct arg *arg) {
|
||||
if (arg->def->enums)
|
||||
return arg_parse_enum(arg);
|
||||
if (arg->def->enums) return arg_parse_enum(arg);
|
||||
return arg_parse_int(arg);
|
||||
}
|
||||
|
|
|
@ -8,7 +8,6 @@
|
|||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
|
||||
#ifndef ARGS_H_
|
||||
#define ARGS_H_
|
||||
#include <stdio.h>
|
||||
|
@ -18,29 +17,33 @@ extern "C" {
|
|||
#endif
|
||||
|
||||
struct arg {
|
||||
char **argv;
|
||||
const char *name;
|
||||
const char *val;
|
||||
unsigned int argv_step;
|
||||
const struct arg_def *def;
|
||||
char **argv;
|
||||
const char *name;
|
||||
const char *val;
|
||||
unsigned int argv_step;
|
||||
const struct arg_def *def;
|
||||
};
|
||||
|
||||
struct arg_enum_list {
|
||||
const char *name;
|
||||
int val;
|
||||
int val;
|
||||
};
|
||||
#define ARG_ENUM_LIST_END {0}
|
||||
#define ARG_ENUM_LIST_END \
|
||||
{ 0 }
|
||||
|
||||
typedef struct arg_def {
|
||||
const char *short_name;
|
||||
const char *long_name;
|
||||
int has_val;
|
||||
int has_val;
|
||||
const char *desc;
|
||||
const struct arg_enum_list *enums;
|
||||
} arg_def_t;
|
||||
#define ARG_DEF(s,l,v,d) {s,l,v,d, NULL}
|
||||
#define ARG_DEF_ENUM(s,l,v,d,e) {s,l,v,d,e}
|
||||
#define ARG_DEF_LIST_END {0}
|
||||
#define ARG_DEF(s, l, v, d) \
|
||||
{ s, l, v, d, NULL }
|
||||
#define ARG_DEF_ENUM(s, l, v, d, e) \
|
||||
{ s, l, v, d, e }
|
||||
#define ARG_DEF_LIST_END \
|
||||
{ 0 }
|
||||
|
||||
struct arg arg_init(char **argv);
|
||||
int arg_match(struct arg *arg_, const struct arg_def *def, char **argv);
|
||||
|
|
|
@ -29,11 +29,6 @@
|
|||
# include $(CLEAR_VARS)
|
||||
# include jni/libvpx/build/make/Android.mk
|
||||
#
|
||||
# There are currently two TARGET_ARCH_ABI targets for ARM.
|
||||
# armeabi and armeabi-v7a. armeabi-v7a is selected by creating an
|
||||
# Application.mk in the jni directory that contains:
|
||||
# APP_ABI := armeabi-v7a
|
||||
#
|
||||
# By default libvpx will detect at runtime the existance of NEON extension.
|
||||
# For this we import the 'cpufeatures' module from the NDK sources.
|
||||
# libvpx can also be configured without this runtime detection method.
|
||||
|
@ -42,13 +37,29 @@
|
|||
# --disable-neon-asm
|
||||
# will remove any NEON dependency.
|
||||
|
||||
# To change to building armeabi, run ./libvpx/configure again, but with
|
||||
# --target=armv6-android-gcc and modify the Application.mk file to
|
||||
# set APP_ABI := armeabi
|
||||
#
|
||||
# Running ndk-build will build libvpx and include it in your project.
|
||||
#
|
||||
|
||||
# Alternatively, building the examples and unit tests can be accomplished in the
|
||||
# following way:
|
||||
#
|
||||
# Create a standalone toolchain from the NDK:
|
||||
# https://developer.android.com/ndk/guides/standalone_toolchain.html
|
||||
#
|
||||
# For example - to test on arm64 devices with clang:
|
||||
# $NDK/build/tools/make_standalone_toolchain.py \
|
||||
# --arch arm64 --install-dir=/tmp/my-android-toolchain
|
||||
# export PATH=/tmp/my-android-toolchain/bin:$PATH
|
||||
# CROSS=aarch64-linux-android- CC=clang CXX=clang++ /path/to/libvpx/configure \
|
||||
# --target=arm64-android-gcc
|
||||
#
|
||||
# Push the resulting binaries to a device and run them:
|
||||
# adb push test_libvpx /data/tmp/test_libvpx
|
||||
# adb shell /data/tmp/test_libvpx --gtest_filter=\*Sixtap\*
|
||||
#
|
||||
# Make sure to push the test data as well and set LIBVPX_TEST_DATA
|
||||
|
||||
CONFIG_DIR := $(LOCAL_PATH)/
|
||||
LIBVPX_PATH := $(LOCAL_PATH)/libvpx
|
||||
ASM_CNV_PATH_LOCAL := $(TARGET_ARCH_ABI)/ads2gas
|
||||
|
@ -59,9 +70,6 @@ ASM_CNV_PATH := $(LOCAL_PATH)/$(ASM_CNV_PATH_LOCAL)
|
|||
ifeq ($(TARGET_ARCH_ABI),armeabi-v7a)
|
||||
include $(CONFIG_DIR)libs-armv7-android-gcc.mk
|
||||
LOCAL_ARM_MODE := arm
|
||||
else ifeq ($(TARGET_ARCH_ABI),armeabi)
|
||||
include $(CONFIG_DIR)libs-armv6-android-gcc.mk
|
||||
LOCAL_ARM_MODE := arm
|
||||
else ifeq ($(TARGET_ARCH_ABI),arm64-v8a)
|
||||
include $(CONFIG_DIR)libs-armv8-android-gcc.mk
|
||||
LOCAL_ARM_MODE := arm
|
||||
|
@ -174,9 +182,6 @@ endif
|
|||
ifeq ($(CONFIG_VP9), yes)
|
||||
$$(rtcd_dep_template_SRCS): vp9_rtcd.h
|
||||
endif
|
||||
ifeq ($(CONFIG_VP10), yes)
|
||||
$$(rtcd_dep_template_SRCS): vp10_rtcd.h
|
||||
endif
|
||||
$$(rtcd_dep_template_SRCS): vpx_scale_rtcd.h
|
||||
$$(rtcd_dep_template_SRCS): vpx_dsp_rtcd.h
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@ test-no-data-check:: .DEFAULT
|
|||
testdata:: .DEFAULT
|
||||
utiltest: .DEFAULT
|
||||
exampletest-no-data-check utiltest-no-data-check: .DEFAULT
|
||||
|
||||
test_%: .DEFAULT ;
|
||||
|
||||
# Note: md5sum is not installed on OS X, but openssl is. Openssl may not be
|
||||
# installed on cygwin, so we need to autodetect here.
|
||||
|
@ -119,29 +119,25 @@ utiltest:
|
|||
test-no-data-check::
|
||||
exampletest-no-data-check utiltest-no-data-check:
|
||||
|
||||
# Add compiler flags for intrinsic files
|
||||
# Force to realign stack always on OS/2
|
||||
ifeq ($(TOOLCHAIN), x86-os2-gcc)
|
||||
STACKREALIGN=-mstackrealign
|
||||
else
|
||||
STACKREALIGN=
|
||||
CFLAGS += -mstackrealign
|
||||
endif
|
||||
|
||||
$(BUILD_PFX)%_mmx.c.d: CFLAGS += -mmmx
|
||||
$(BUILD_PFX)%_mmx.c.o: CFLAGS += -mmmx
|
||||
$(BUILD_PFX)%_sse2.c.d: CFLAGS += -msse2 $(STACKREALIGN)
|
||||
$(BUILD_PFX)%_sse2.c.o: CFLAGS += -msse2 $(STACKREALIGN)
|
||||
$(BUILD_PFX)%_sse3.c.d: CFLAGS += -msse3 $(STACKREALIGN)
|
||||
$(BUILD_PFX)%_sse3.c.o: CFLAGS += -msse3 $(STACKREALIGN)
|
||||
$(BUILD_PFX)%_ssse3.c.d: CFLAGS += -mssse3 $(STACKREALIGN)
|
||||
$(BUILD_PFX)%_ssse3.c.o: CFLAGS += -mssse3 $(STACKREALIGN)
|
||||
$(BUILD_PFX)%_sse4.c.d: CFLAGS += -msse4.1 $(STACKREALIGN)
|
||||
$(BUILD_PFX)%_sse4.c.o: CFLAGS += -msse4.1 $(STACKREALIGN)
|
||||
$(BUILD_PFX)%_avx.c.d: CFLAGS += -mavx $(STACKREALIGN)
|
||||
$(BUILD_PFX)%_avx.c.o: CFLAGS += -mavx $(STACKREALIGN)
|
||||
$(BUILD_PFX)%_avx2.c.d: CFLAGS += -mavx2 $(STACKREALIGN)
|
||||
$(BUILD_PFX)%_avx2.c.o: CFLAGS += -mavx2 $(STACKREALIGN)
|
||||
$(BUILD_PFX)%vp9_reconintra.c.d: CFLAGS += $(STACKREALIGN)
|
||||
$(BUILD_PFX)%vp9_reconintra.c.o: CFLAGS += $(STACKREALIGN)
|
||||
$(BUILD_PFX)%_sse2.c.d: CFLAGS += -msse2
|
||||
$(BUILD_PFX)%_sse2.c.o: CFLAGS += -msse2
|
||||
$(BUILD_PFX)%_sse3.c.d: CFLAGS += -msse3
|
||||
$(BUILD_PFX)%_sse3.c.o: CFLAGS += -msse3
|
||||
$(BUILD_PFX)%_ssse3.c.d: CFLAGS += -mssse3
|
||||
$(BUILD_PFX)%_ssse3.c.o: CFLAGS += -mssse3
|
||||
$(BUILD_PFX)%_sse4.c.d: CFLAGS += -msse4.1
|
||||
$(BUILD_PFX)%_sse4.c.o: CFLAGS += -msse4.1
|
||||
$(BUILD_PFX)%_avx.c.d: CFLAGS += -mavx
|
||||
$(BUILD_PFX)%_avx.c.o: CFLAGS += -mavx
|
||||
$(BUILD_PFX)%_avx2.c.d: CFLAGS += -mavx2
|
||||
$(BUILD_PFX)%_avx2.c.o: CFLAGS += -mavx2
|
||||
|
||||
$(BUILD_PFX)%.c.d: %.c
|
||||
$(if $(quiet),@echo " [DEP] $@")
|
||||
|
@ -422,7 +418,6 @@ ifneq ($(call enabled,DIST-SRCS),)
|
|||
DIST-SRCS-yes += build/make/gen_asm_deps.sh
|
||||
DIST-SRCS-yes += build/make/Makefile
|
||||
DIST-SRCS-$(CONFIG_MSVS) += build/make/gen_msvs_def.sh
|
||||
DIST-SRCS-$(CONFIG_MSVS) += build/make/gen_msvs_proj.sh
|
||||
DIST-SRCS-$(CONFIG_MSVS) += build/make/gen_msvs_sln.sh
|
||||
DIST-SRCS-$(CONFIG_MSVS) += build/make/gen_msvs_vcxproj.sh
|
||||
DIST-SRCS-$(CONFIG_MSVS) += build/make/msvs_common.sh
|
||||
|
@ -453,3 +448,5 @@ all: $(BUILD_TARGETS)
|
|||
install:: $(INSTALL_TARGETS)
|
||||
dist: $(INSTALL_TARGETS)
|
||||
test::
|
||||
|
||||
.SUFFIXES: # Delete default suffix rules
|
||||
|
|
|
@ -18,12 +18,6 @@
|
|||
# Usage: cat inputfile | perl ads2gas_apple.pl > outputfile
|
||||
#
|
||||
|
||||
my $chromium = 0;
|
||||
|
||||
foreach my $arg (@ARGV) {
|
||||
$chromium = 1 if ($arg eq "-chromium");
|
||||
}
|
||||
|
||||
print "@ This file was created from a .asm file\n";
|
||||
print "@ using the ads2gas_apple.pl script.\n\n";
|
||||
print "\t.set WIDE_REFERENCE, 0\n";
|
||||
|
@ -218,18 +212,5 @@ while (<STDIN>)
|
|||
s/\bMEND\b/.endm/; # No need to tell it where to stop assembling
|
||||
next if /^\s*END\s*$/;
|
||||
|
||||
# Clang used by Chromium differs slightly from clang in XCode in what it
|
||||
# will accept in the assembly.
|
||||
if ($chromium) {
|
||||
s/qsubaddx/qsax/i;
|
||||
s/qaddsubx/qasx/i;
|
||||
s/ldrneb/ldrbne/i;
|
||||
s/ldrneh/ldrhne/i;
|
||||
s/(vqshrun\.s16 .*, \#)0$/${1}8/i;
|
||||
|
||||
# http://llvm.org/bugs/show_bug.cgi?id=16022
|
||||
s/\.include/#include/;
|
||||
}
|
||||
|
||||
print;
|
||||
}
|
||||
|
|
|
@ -185,6 +185,7 @@ add_extralibs() {
|
|||
#
|
||||
# Boolean Manipulation Functions
|
||||
#
|
||||
|
||||
enable_feature(){
|
||||
set_all yes $*
|
||||
}
|
||||
|
@ -201,6 +202,20 @@ disabled(){
|
|||
eval test "x\$$1" = "xno"
|
||||
}
|
||||
|
||||
enable_codec(){
|
||||
enabled "${1}" || echo " enabling ${1}"
|
||||
enable_feature "${1}"
|
||||
|
||||
is_in "${1}" vp8 vp9 && enable_feature "${1}_encoder" "${1}_decoder"
|
||||
}
|
||||
|
||||
disable_codec(){
|
||||
disabled "${1}" || echo " disabling ${1}"
|
||||
disable_feature "${1}"
|
||||
|
||||
is_in "${1}" vp8 vp9 && disable_feature "${1}_encoder" "${1}_decoder"
|
||||
}
|
||||
|
||||
# Iterates through positional parameters, checks to confirm the parameter has
|
||||
# not been explicitly (force) disabled, and enables the setting controlled by
|
||||
# the parameter when the setting is not disabled.
|
||||
|
@ -317,20 +332,10 @@ EOF
|
|||
}
|
||||
|
||||
check_cflags() {
|
||||
log check_cflags "$@"
|
||||
|
||||
case "$CC" in
|
||||
*gcc*|*clang)
|
||||
check_cc -Werror "$@" <<EOF
|
||||
log check_cflags "$@"
|
||||
check_cc -Werror "$@" <<EOF
|
||||
int x;
|
||||
EOF
|
||||
;;
|
||||
*)
|
||||
check_cc "$@" <<EOF
|
||||
int x;
|
||||
EOF
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
check_cxxflags() {
|
||||
|
@ -531,22 +536,20 @@ process_common_cmdline() {
|
|||
;;
|
||||
--enable-?*|--disable-?*)
|
||||
eval `echo "$opt" | sed 's/--/action=/;s/-/ option=/;s/-/_/g'`
|
||||
if echo "${ARCH_EXT_LIST}" | grep "^ *$option\$" >/dev/null; then
|
||||
if is_in ${option} ${ARCH_EXT_LIST}; then
|
||||
[ $action = "disable" ] && RTCD_OPTIONS="${RTCD_OPTIONS}--disable-${option} "
|
||||
elif [ $action = "disable" ] && ! disabled $option ; then
|
||||
echo "${CMDLINE_SELECT}" | grep "^ *$option\$" >/dev/null ||
|
||||
die_unknown $opt
|
||||
is_in ${option} ${CMDLINE_SELECT} || die_unknown $opt
|
||||
log_echo " disabling $option"
|
||||
elif [ $action = "enable" ] && ! enabled $option ; then
|
||||
echo "${CMDLINE_SELECT}" | grep "^ *$option\$" >/dev/null ||
|
||||
die_unknown $opt
|
||||
is_in ${option} ${CMDLINE_SELECT} || die_unknown $opt
|
||||
log_echo " enabling $option"
|
||||
fi
|
||||
${action}_feature $option
|
||||
;;
|
||||
--require-?*)
|
||||
eval `echo "$opt" | sed 's/--/action=/;s/-/ option=/;s/-/_/g'`
|
||||
if echo "${ARCH_EXT_LIST}" none | grep "^ *$option\$" >/dev/null; then
|
||||
if is_in ${option} ${ARCH_EXT_LIST}; then
|
||||
RTCD_OPTIONS="${RTCD_OPTIONS}${opt} "
|
||||
else
|
||||
die_unknown $opt
|
||||
|
@ -648,14 +651,34 @@ show_darwin_sdk_major_version() {
|
|||
xcrun --sdk $1 --show-sdk-version 2>/dev/null | cut -d. -f1
|
||||
}
|
||||
|
||||
# Print the Xcode version.
|
||||
show_xcode_version() {
|
||||
xcodebuild -version | head -n1 | cut -d' ' -f2
|
||||
}
|
||||
|
||||
# Fails when Xcode version is less than 6.3.
|
||||
check_xcode_minimum_version() {
|
||||
xcode_major=$(show_xcode_version | cut -f1 -d.)
|
||||
xcode_minor=$(show_xcode_version | cut -f2 -d.)
|
||||
xcode_min_major=6
|
||||
xcode_min_minor=3
|
||||
if [ ${xcode_major} -lt ${xcode_min_major} ]; then
|
||||
return 1
|
||||
fi
|
||||
if [ ${xcode_major} -eq ${xcode_min_major} ] \
|
||||
&& [ ${xcode_minor} -lt ${xcode_min_minor} ]; then
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
process_common_toolchain() {
|
||||
if [ -z "$toolchain" ]; then
|
||||
gcctarget="${CHOST:-$(gcc -dumpmachine 2> /dev/null)}"
|
||||
|
||||
# detect tgt_isa
|
||||
case "$gcctarget" in
|
||||
armv6*)
|
||||
tgt_isa=armv6
|
||||
aarch64*)
|
||||
tgt_isa=arm64
|
||||
;;
|
||||
armv7*-hardfloat* | armv7*-gnueabihf | arm-*-gnueabihf)
|
||||
tgt_isa=armv7
|
||||
|
@ -758,7 +781,14 @@ process_common_toolchain() {
|
|||
enabled shared && soft_enable pic
|
||||
|
||||
# Minimum iOS version for all target platforms (darwin and iphonesimulator).
|
||||
IOS_VERSION_MIN="6.0"
|
||||
# Shared library framework builds are only possible on iOS 8 and later.
|
||||
if enabled shared; then
|
||||
IOS_VERSION_OPTIONS="--enable-shared"
|
||||
IOS_VERSION_MIN="8.0"
|
||||
else
|
||||
IOS_VERSION_OPTIONS=""
|
||||
IOS_VERSION_MIN="6.0"
|
||||
fi
|
||||
|
||||
# Handle darwin variants. Newer SDKs allow targeting older
|
||||
# platforms, so use the newest one available.
|
||||
|
@ -850,36 +880,6 @@ process_common_toolchain() {
|
|||
if disabled neon && enabled neon_asm; then
|
||||
die "Disabling neon while keeping neon-asm is not supported"
|
||||
fi
|
||||
case ${toolchain} in
|
||||
# Apple iOS SDKs no longer support armv6 as of the version 9
|
||||
# release (coincides with release of Xcode 7). Only enable media
|
||||
# when using earlier SDK releases.
|
||||
*-darwin*)
|
||||
if [ "$(show_darwin_sdk_major_version iphoneos)" -lt 9 ]; then
|
||||
soft_enable media
|
||||
else
|
||||
soft_disable media
|
||||
RTCD_OPTIONS="${RTCD_OPTIONS}--disable-media "
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
soft_enable media
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
armv6)
|
||||
case ${toolchain} in
|
||||
*-darwin*)
|
||||
if [ "$(show_darwin_sdk_major_version iphoneos)" -lt 9 ]; then
|
||||
soft_enable media
|
||||
else
|
||||
die "Your iOS SDK does not support armv6."
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
soft_enable media
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
|
||||
|
@ -908,6 +908,9 @@ EOF
|
|||
check_add_cflags -mfpu=neon #-ftree-vectorize
|
||||
check_add_asflags -mfpu=neon
|
||||
fi
|
||||
elif [ ${tgt_isa} = "arm64" ] || [ ${tgt_isa} = "armv8" ]; then
|
||||
check_add_cflags -march=armv8-a
|
||||
check_add_asflags -march=armv8-a
|
||||
else
|
||||
check_add_cflags -march=${tgt_isa}
|
||||
check_add_asflags -march=${tgt_isa}
|
||||
|
@ -975,43 +978,50 @@ EOF
|
|||
;;
|
||||
|
||||
android*)
|
||||
SDK_PATH=${sdk_path}
|
||||
COMPILER_LOCATION=`find "${SDK_PATH}" \
|
||||
-name "arm-linux-androideabi-gcc*" -print -quit`
|
||||
TOOLCHAIN_PATH=${COMPILER_LOCATION%/*}/arm-linux-androideabi-
|
||||
CC=${TOOLCHAIN_PATH}gcc
|
||||
CXX=${TOOLCHAIN_PATH}g++
|
||||
AR=${TOOLCHAIN_PATH}ar
|
||||
LD=${TOOLCHAIN_PATH}gcc
|
||||
AS=${TOOLCHAIN_PATH}as
|
||||
STRIP=${TOOLCHAIN_PATH}strip
|
||||
NM=${TOOLCHAIN_PATH}nm
|
||||
if [ -n "${sdk_path}" ]; then
|
||||
SDK_PATH=${sdk_path}
|
||||
COMPILER_LOCATION=`find "${SDK_PATH}" \
|
||||
-name "arm-linux-androideabi-gcc*" -print -quit`
|
||||
TOOLCHAIN_PATH=${COMPILER_LOCATION%/*}/arm-linux-androideabi-
|
||||
CC=${TOOLCHAIN_PATH}gcc
|
||||
CXX=${TOOLCHAIN_PATH}g++
|
||||
AR=${TOOLCHAIN_PATH}ar
|
||||
LD=${TOOLCHAIN_PATH}gcc
|
||||
AS=${TOOLCHAIN_PATH}as
|
||||
STRIP=${TOOLCHAIN_PATH}strip
|
||||
NM=${TOOLCHAIN_PATH}nm
|
||||
|
||||
if [ -z "${alt_libc}" ]; then
|
||||
alt_libc=`find "${SDK_PATH}" -name arch-arm -print | \
|
||||
awk '{n = split($0,a,"/"); \
|
||||
if [ -z "${alt_libc}" ]; then
|
||||
alt_libc=`find "${SDK_PATH}" -name arch-arm -print | \
|
||||
awk '{n = split($0,a,"/"); \
|
||||
split(a[n-1],b,"-"); \
|
||||
print $0 " " b[2]}' | \
|
||||
sort -g -k 2 | \
|
||||
awk '{ print $1 }' | tail -1`
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -d "${alt_libc}" ]; then
|
||||
add_cflags "--sysroot=${alt_libc}"
|
||||
add_ldflags "--sysroot=${alt_libc}"
|
||||
fi
|
||||
if [ -d "${alt_libc}" ]; then
|
||||
add_cflags "--sysroot=${alt_libc}"
|
||||
add_ldflags "--sysroot=${alt_libc}"
|
||||
fi
|
||||
|
||||
# linker flag that routes around a CPU bug in some
|
||||
# Cortex-A8 implementations (NDK Dev Guide)
|
||||
add_ldflags "-Wl,--fix-cortex-a8"
|
||||
# linker flag that routes around a CPU bug in some
|
||||
# Cortex-A8 implementations (NDK Dev Guide)
|
||||
add_ldflags "-Wl,--fix-cortex-a8"
|
||||
|
||||
enable_feature pic
|
||||
soft_enable realtime_only
|
||||
if [ ${tgt_isa} = "armv7" ]; then
|
||||
soft_enable runtime_cpu_detect
|
||||
fi
|
||||
if enabled runtime_cpu_detect; then
|
||||
add_cflags "-I${SDK_PATH}/sources/android/cpufeatures"
|
||||
enable_feature pic
|
||||
soft_enable realtime_only
|
||||
if [ ${tgt_isa} = "armv7" ]; then
|
||||
soft_enable runtime_cpu_detect
|
||||
fi
|
||||
if enabled runtime_cpu_detect; then
|
||||
add_cflags "-I${SDK_PATH}/sources/android/cpufeatures"
|
||||
fi
|
||||
else
|
||||
echo "Assuming standalone build with NDK toolchain."
|
||||
echo "See build/make/Android.mk for details."
|
||||
check_add_ldflags -static
|
||||
soft_enable unit_tests
|
||||
fi
|
||||
;;
|
||||
|
||||
|
@ -1025,18 +1035,7 @@ EOF
|
|||
NM="$(${XCRUN_FIND} nm)"
|
||||
RANLIB="$(${XCRUN_FIND} ranlib)"
|
||||
AS_SFX=.s
|
||||
|
||||
# Special handling of ld for armv6 because libclang_rt.ios.a does
|
||||
# not contain armv6 support in Apple's clang package:
|
||||
# Apple LLVM version 5.1 (clang-503.0.40) (based on LLVM 3.4svn).
|
||||
# TODO(tomfinegan): Remove this. Our minimum iOS version (6.0)
|
||||
# renders support for armv6 unnecessary because the 3GS and up
|
||||
# support neon.
|
||||
if [ "${tgt_isa}" = "armv6" ]; then
|
||||
LD="$(${XCRUN_FIND} ld)"
|
||||
else
|
||||
LD="${CXX:-$(${XCRUN_FIND} ld)}"
|
||||
fi
|
||||
LD="${CXX:-$(${XCRUN_FIND} ld)}"
|
||||
|
||||
# ASFLAGS is written here instead of using check_add_asflags
|
||||
# because we need to overwrite all of ASFLAGS and purge the
|
||||
|
@ -1062,6 +1061,19 @@ EOF
|
|||
[ -d "${try_dir}" ] && add_ldflags -L"${try_dir}"
|
||||
done
|
||||
|
||||
case ${tgt_isa} in
|
||||
armv7|armv7s|armv8|arm64)
|
||||
if enabled neon && ! check_xcode_minimum_version; then
|
||||
soft_disable neon
|
||||
log_echo " neon disabled: upgrade Xcode (need v6.3+)."
|
||||
if enabled neon_asm; then
|
||||
soft_disable neon_asm
|
||||
log_echo " neon_asm disabled: upgrade Xcode (need v6.3+)."
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
asm_conversion_cmd="${source_path}/build/make/ads2gas_apple.pl"
|
||||
|
||||
if [ "$(show_darwin_sdk_major_version iphoneos)" -gt 8 ]; then
|
||||
|
@ -1076,7 +1088,7 @@ EOF
|
|||
if enabled rvct; then
|
||||
# Check if we have CodeSourcery GCC in PATH. Needed for
|
||||
# libraries
|
||||
hash arm-none-linux-gnueabi-gcc 2>&- || \
|
||||
which arm-none-linux-gnueabi-gcc 2>&- || \
|
||||
die "Couldn't find CodeSourcery GCC from PATH"
|
||||
|
||||
# Use armcc as a linker to enable translation of
|
||||
|
@ -1111,13 +1123,13 @@ EOF
|
|||
if [ -n "${tune_cpu}" ]; then
|
||||
case ${tune_cpu} in
|
||||
p5600)
|
||||
check_add_cflags -mips32r5 -funroll-loops -mload-store-pairs
|
||||
check_add_cflags -mips32r5 -mload-store-pairs
|
||||
check_add_cflags -msched-weight -mhard-float -mfp64
|
||||
check_add_asflags -mips32r5 -mhard-float -mfp64
|
||||
check_add_ldflags -mfp64
|
||||
;;
|
||||
i6400)
|
||||
check_add_cflags -mips64r6 -mabi=64 -funroll-loops -msched-weight
|
||||
i6400|p6600)
|
||||
check_add_cflags -mips64r6 -mabi=64 -msched-weight
|
||||
check_add_cflags -mload-store-pairs -mhard-float -mfp64
|
||||
check_add_asflags -mips64r6 -mabi=64 -mhard-float -mfp64
|
||||
check_add_ldflags -mips64r6 -mabi=64 -mfp64
|
||||
|
@ -1197,6 +1209,12 @@ EOF
|
|||
soft_disable avx2
|
||||
;;
|
||||
esac
|
||||
case $vc_version in
|
||||
7|8|9)
|
||||
echo "${tgt_cc} omits stdint.h, disabling webm-io..."
|
||||
soft_disable webm_io
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
|
||||
|
@ -1348,10 +1366,6 @@ EOF
|
|||
fi
|
||||
fi
|
||||
|
||||
if [ "${tgt_isa}" = "x86_64" ] || [ "${tgt_isa}" = "x86" ]; then
|
||||
soft_enable use_x86inc
|
||||
fi
|
||||
|
||||
# Position Independent Code (PIC) support, for building relocatable
|
||||
# shared objects
|
||||
enabled gcc && enabled pic && check_add_cflags -fPIC
|
||||
|
@ -1381,6 +1395,7 @@ EOF
|
|||
*-win*-vs*)
|
||||
;;
|
||||
*-android-gcc)
|
||||
# bionic includes basic pthread functionality, obviating -lpthread.
|
||||
;;
|
||||
*)
|
||||
check_header pthread.h && add_extralibs -lpthread
|
||||
|
|
|
@ -1,490 +0,0 @@
|
|||
#!/bin/bash
|
||||
##
|
||||
## Copyright (c) 2010 The WebM project authors. All Rights Reserved.
|
||||
##
|
||||
## Use of this source code is governed by a BSD-style license
|
||||
## that can be found in the LICENSE file in the root of the source
|
||||
## tree. An additional intellectual property rights grant can be found
|
||||
## in the file PATENTS. All contributing project authors may
|
||||
## be found in the AUTHORS file in the root of the source tree.
|
||||
##
|
||||
|
||||
self=$0
|
||||
self_basename=${self##*/}
|
||||
self_dirname=$(dirname "$0")
|
||||
|
||||
. "$self_dirname/msvs_common.sh"|| exit 127
|
||||
|
||||
show_help() {
|
||||
cat <<EOF
|
||||
Usage: ${self_basename} --name=projname [options] file1 [file2 ...]
|
||||
|
||||
This script generates a Visual Studio project file from a list of source
|
||||
code files.
|
||||
|
||||
Options:
|
||||
--help Print this message
|
||||
--exe Generate a project for building an Application
|
||||
--lib Generate a project for creating a static library
|
||||
--dll Generate a project for creating a dll
|
||||
--static-crt Use the static C runtime (/MT)
|
||||
--target=isa-os-cc Target specifier (required)
|
||||
--out=filename Write output to a file [stdout]
|
||||
--name=project_name Name of the project (required)
|
||||
--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
|
||||
-llibname Library to link against
|
||||
EOF
|
||||
exit 1
|
||||
}
|
||||
|
||||
generate_filter() {
|
||||
local var=$1
|
||||
local name=$2
|
||||
local pats=$3
|
||||
local file_list_sz
|
||||
local i
|
||||
local f
|
||||
local saveIFS="$IFS"
|
||||
local pack
|
||||
echo "generating filter '$name' from ${#file_list[@]} files" >&2
|
||||
IFS=*
|
||||
|
||||
open_tag Filter \
|
||||
Name=$name \
|
||||
Filter=$pats \
|
||||
UniqueIdentifier=`generate_uuid` \
|
||||
|
||||
file_list_sz=${#file_list[@]}
|
||||
for i in ${!file_list[@]}; do
|
||||
f=${file_list[i]}
|
||||
for pat in ${pats//;/$IFS}; do
|
||||
if [ "${f##*.}" == "$pat" ]; then
|
||||
unset file_list[i]
|
||||
|
||||
objf=$(echo ${f%.*}.obj \
|
||||
| sed -e "s,$src_path_bare,," \
|
||||
-e 's/^[\./]\+//g' -e 's,[:/ ],_,g')
|
||||
open_tag File RelativePath="$f"
|
||||
|
||||
if [ "$pat" == "asm" ] && $asm_use_custom_step; then
|
||||
# Avoid object file name collisions, i.e. vpx_config.c and
|
||||
# vpx_config.asm produce the same object file without
|
||||
# this additional suffix.
|
||||
objf=${objf%.obj}_asm.obj
|
||||
for plat in "${platforms[@]}"; do
|
||||
for cfg in Debug Release; do
|
||||
open_tag FileConfiguration \
|
||||
Name="${cfg}|${plat}" \
|
||||
|
||||
tag Tool \
|
||||
Name="VCCustomBuildTool" \
|
||||
Description="Assembling \$(InputFileName)" \
|
||||
CommandLine="$(eval echo \$asm_${cfg}_cmdline) -o \$(IntDir)\\$objf" \
|
||||
Outputs="\$(IntDir)\\$objf" \
|
||||
|
||||
close_tag FileConfiguration
|
||||
done
|
||||
done
|
||||
fi
|
||||
if [ "$pat" == "c" ] || \
|
||||
[ "$pat" == "cc" ] || [ "$pat" == "cpp" ]; then
|
||||
for plat in "${platforms[@]}"; do
|
||||
for cfg in Debug Release; do
|
||||
open_tag FileConfiguration \
|
||||
Name="${cfg}|${plat}" \
|
||||
|
||||
tag Tool \
|
||||
Name="VCCLCompilerTool" \
|
||||
ObjectFile="\$(IntDir)\\$objf" \
|
||||
|
||||
close_tag FileConfiguration
|
||||
done
|
||||
done
|
||||
fi
|
||||
close_tag File
|
||||
|
||||
break
|
||||
fi
|
||||
done
|
||||
done
|
||||
|
||||
close_tag Filter
|
||||
IFS="$saveIFS"
|
||||
}
|
||||
|
||||
# Process command line
|
||||
unset target
|
||||
for opt in "$@"; do
|
||||
optval="${opt#*=}"
|
||||
case "$opt" in
|
||||
--help|-h) show_help
|
||||
;;
|
||||
--target=*) target="${optval}"
|
||||
;;
|
||||
--out=*) outfile="$optval"
|
||||
;;
|
||||
--name=*) name="${optval}"
|
||||
;;
|
||||
--proj-guid=*) guid="${optval}"
|
||||
;;
|
||||
--module-def=*) link_opts="${link_opts} ModuleDefinitionFile=${optval}"
|
||||
;;
|
||||
--exe) proj_kind="exe"
|
||||
;;
|
||||
--dll) proj_kind="dll"
|
||||
;;
|
||||
--lib) proj_kind="lib"
|
||||
;;
|
||||
--src-path-bare=*)
|
||||
src_path_bare=$(fix_path "$optval")
|
||||
src_path_bare=${src_path_bare%/}
|
||||
;;
|
||||
--static-crt) use_static_runtime=true
|
||||
;;
|
||||
--ver=*)
|
||||
vs_ver="$optval"
|
||||
case "$optval" in
|
||||
[789])
|
||||
;;
|
||||
*) die Unrecognized Visual Studio Version in $opt
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
-I*)
|
||||
opt=${opt##-I}
|
||||
opt=$(fix_path "$opt")
|
||||
opt="${opt%/}"
|
||||
incs="${incs}${incs:+;}"${opt}""
|
||||
yasmincs="${yasmincs} -I"${opt}""
|
||||
;;
|
||||
-D*) defines="${defines}${defines:+;}${opt##-D}"
|
||||
;;
|
||||
-L*) # fudge . to $(OutDir)
|
||||
if [ "${opt##-L}" == "." ]; then
|
||||
libdirs="${libdirs}${libdirs:+;}"\$(OutDir)""
|
||||
else
|
||||
# Also try directories for this platform/configuration
|
||||
opt=${opt##-L}
|
||||
opt=$(fix_path "$opt")
|
||||
libdirs="${libdirs}${libdirs:+;}"${opt}""
|
||||
libdirs="${libdirs}${libdirs:+;}"${opt}/\$(PlatformName)/\$(ConfigurationName)""
|
||||
libdirs="${libdirs}${libdirs:+;}"${opt}/\$(PlatformName)""
|
||||
fi
|
||||
;;
|
||||
-l*) libs="${libs}${libs:+ }${opt##-l}.lib"
|
||||
;;
|
||||
-*) die_unknown $opt
|
||||
;;
|
||||
*)
|
||||
# The paths in file_list are fixed outside of the loop.
|
||||
file_list[${#file_list[@]}]="$opt"
|
||||
case "$opt" in
|
||||
*.asm) uses_asm=true
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
# Make one call to fix_path for file_list to improve performance.
|
||||
fix_file_list
|
||||
|
||||
outfile=${outfile:-/dev/stdout}
|
||||
guid=${guid:-`generate_uuid`}
|
||||
asm_use_custom_step=false
|
||||
uses_asm=${uses_asm:-false}
|
||||
case "${vs_ver:-8}" in
|
||||
7) vs_ver_id="7.10"
|
||||
asm_use_custom_step=$uses_asm
|
||||
warn_64bit='Detect64BitPortabilityProblems=true'
|
||||
;;
|
||||
8) vs_ver_id="8.00"
|
||||
asm_use_custom_step=$uses_asm
|
||||
warn_64bit='Detect64BitPortabilityProblems=true'
|
||||
;;
|
||||
9) vs_ver_id="9.00"
|
||||
asm_use_custom_step=$uses_asm
|
||||
warn_64bit='Detect64BitPortabilityProblems=false'
|
||||
;;
|
||||
esac
|
||||
|
||||
[ -n "$name" ] || die "Project name (--name) must be specified!"
|
||||
[ -n "$target" ] || die "Target (--target) must be specified!"
|
||||
|
||||
if ${use_static_runtime:-false}; then
|
||||
release_runtime=0
|
||||
debug_runtime=1
|
||||
lib_sfx=mt
|
||||
else
|
||||
release_runtime=2
|
||||
debug_runtime=3
|
||||
lib_sfx=md
|
||||
fi
|
||||
|
||||
# Calculate debug lib names: If a lib ends in ${lib_sfx}.lib, then rename
|
||||
# it to ${lib_sfx}d.lib. This precludes linking to release libs from a
|
||||
# debug exe, so this may need to be refactored later.
|
||||
for lib in ${libs}; do
|
||||
if [ "$lib" != "${lib%${lib_sfx}.lib}" ]; then
|
||||
lib=${lib%.lib}d.lib
|
||||
fi
|
||||
debug_libs="${debug_libs}${debug_libs:+ }${lib}"
|
||||
done
|
||||
|
||||
|
||||
# List Keyword for this target
|
||||
case "$target" in
|
||||
x86*) keyword="ManagedCProj"
|
||||
;;
|
||||
*) die "Unsupported target $target!"
|
||||
esac
|
||||
|
||||
# List of all platforms supported for this target
|
||||
case "$target" in
|
||||
x86_64*)
|
||||
platforms[0]="x64"
|
||||
asm_Debug_cmdline="yasm -Xvc -g cv8 -f win64 ${yasmincs} "\$(InputPath)""
|
||||
asm_Release_cmdline="yasm -Xvc -f win64 ${yasmincs} "\$(InputPath)""
|
||||
;;
|
||||
x86*)
|
||||
platforms[0]="Win32"
|
||||
asm_Debug_cmdline="yasm -Xvc -g cv8 -f win32 ${yasmincs} "\$(InputPath)""
|
||||
asm_Release_cmdline="yasm -Xvc -f win32 ${yasmincs} "\$(InputPath)""
|
||||
;;
|
||||
*) die "Unsupported target $target!"
|
||||
;;
|
||||
esac
|
||||
|
||||
generate_vcproj() {
|
||||
case "$proj_kind" in
|
||||
exe) vs_ConfigurationType=1
|
||||
;;
|
||||
dll) vs_ConfigurationType=2
|
||||
;;
|
||||
*) vs_ConfigurationType=4
|
||||
;;
|
||||
esac
|
||||
|
||||
echo "<?xml version=\"1.0\" encoding=\"Windows-1252\"?>"
|
||||
open_tag VisualStudioProject \
|
||||
ProjectType="Visual C++" \
|
||||
Version="${vs_ver_id}" \
|
||||
Name="${name}" \
|
||||
ProjectGUID="{${guid}}" \
|
||||
RootNamespace="${name}" \
|
||||
Keyword="${keyword}" \
|
||||
|
||||
open_tag Platforms
|
||||
for plat in "${platforms[@]}"; do
|
||||
tag Platform Name="$plat"
|
||||
done
|
||||
close_tag Platforms
|
||||
|
||||
open_tag Configurations
|
||||
for plat in "${platforms[@]}"; do
|
||||
plat_no_ws=`echo $plat | sed 's/[^A-Za-z0-9_]/_/g'`
|
||||
open_tag Configuration \
|
||||
Name="Debug|$plat" \
|
||||
OutputDirectory="\$(SolutionDir)$plat_no_ws/\$(ConfigurationName)" \
|
||||
IntermediateDirectory="$plat_no_ws/\$(ConfigurationName)/${name}" \
|
||||
ConfigurationType="$vs_ConfigurationType" \
|
||||
CharacterSet="1" \
|
||||
|
||||
case "$target" in
|
||||
x86*)
|
||||
case "$name" in
|
||||
vpx)
|
||||
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="2" \
|
||||
$warn_64bit \
|
||||
|
||||
$uses_asm && tag Tool Name="YASM" IncludePaths="$incs" Debug="true"
|
||||
;;
|
||||
*)
|
||||
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="2" \
|
||||
$warn_64bit \
|
||||
|
||||
$uses_asm && tag Tool Name="YASM" IncludePaths="$incs" Debug="true"
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
|
||||
case "$proj_kind" in
|
||||
exe)
|
||||
case "$target" in
|
||||
x86*)
|
||||
case "$name" in
|
||||
*)
|
||||
tag Tool \
|
||||
Name="VCLinkerTool" \
|
||||
AdditionalDependencies="$debug_libs \$(NoInherit)" \
|
||||
AdditionalLibraryDirectories="$libdirs" \
|
||||
GenerateDebugInformation="true" \
|
||||
ProgramDatabaseFile="\$(OutDir)/${name}.pdb" \
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
lib)
|
||||
case "$target" in
|
||||
x86*)
|
||||
tag Tool \
|
||||
Name="VCLibrarianTool" \
|
||||
OutputFile="\$(OutDir)/${name}${lib_sfx}d.lib" \
|
||||
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
dll)
|
||||
tag Tool \
|
||||
Name="VCLinkerTool" \
|
||||
AdditionalDependencies="\$(NoInherit)" \
|
||||
LinkIncremental="2" \
|
||||
GenerateDebugInformation="true" \
|
||||
AssemblyDebug="1" \
|
||||
TargetMachine="1" \
|
||||
$link_opts \
|
||||
|
||||
;;
|
||||
esac
|
||||
|
||||
close_tag Configuration
|
||||
|
||||
open_tag Configuration \
|
||||
Name="Release|$plat" \
|
||||
OutputDirectory="\$(SolutionDir)$plat_no_ws/\$(ConfigurationName)" \
|
||||
IntermediateDirectory="$plat_no_ws/\$(ConfigurationName)/${name}" \
|
||||
ConfigurationType="$vs_ConfigurationType" \
|
||||
CharacterSet="1" \
|
||||
WholeProgramOptimization="0" \
|
||||
|
||||
case "$target" in
|
||||
x86*)
|
||||
case "$name" in
|
||||
vpx)
|
||||
tag Tool \
|
||||
Name="VCCLCompilerTool" \
|
||||
Optimization="2" \
|
||||
FavorSizeorSpeed="1" \
|
||||
AdditionalIncludeDirectories="$incs" \
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE;$defines" \
|
||||
RuntimeLibrary="$release_runtime" \
|
||||
UsePrecompiledHeader="0" \
< |