summaryrefslogtreecommitdiff
path: root/configure
diff options
context:
space:
mode:
authorRonald S. Bultje <rsbultje@gmail.com>2012-06-22 12:24:59 +0300
committerMartin Storsjö <martin@martin.st>2012-09-05 17:07:40 +0300
commitdfa559bcbd41397b3408c59d016631c7c65e320f (patch)
tree077c4f9fddb40f27174b05ebbdd930e50da7a157 /configure
parent4fa661a857f16d4afd322920442b075c2a84ec4c (diff)
downloadffmpeg-dfa559bcbd41397b3408c59d016631c7c65e320f.tar.gz
configure: Add support for MSVC cl.exe/link.exe
Signed-off-by: Martin Storsjö <martin@martin.st>
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure42
1 files changed, 42 insertions, 0 deletions
diff --git a/configure b/configure
index a11b9a10a2..ca6fd60e49 100755
--- a/configure
+++ b/configure
@@ -2097,6 +2097,25 @@ EOF
die "Sanity test failed."
fi
+msvc_flags(){
+ for flag; do
+ case $flag in
+ -fomit-frame-pointer) echo -Oy ;;
+ -g) echo -Z7 ;;
+ -Wall) echo -W4 -wd4244 -wd4127 -wd4018 -wd4389 \
+ -wd4146 -wd4057 -wd4204 -wd4706 -wd4305 \
+ -wd4152 -wd4324 -we4013 ;;
+ -std=c99) ;;
+ -fno-math-errno) ;;
+ -fno-common) ;;
+ -fno-signed-zeros) ;;
+ -lz) echo zlib.lib ;;
+ -l*) echo ${flag#-l}.lib ;;
+ *) echo $flag ;;
+ esac
+ done
+}
+
pgi_flags(){
for flag; do
case $flag in
@@ -2283,6 +2302,29 @@ probe_cc(){
_cflags_size="-O2 -Munroll=c:1 $opt_common"
_cflags_noopt="-O1"
_flags_filter=pgi_flags
+ elif $_cc 2>&1 | grep -q Microsoft; then
+ _type=msvc
+ _ident=$($cc 2>&1 | head -n1)
+ _DEPCMD='$(DEP$(1)) $(DEP$(1)FLAGS) $($(1)DEP_FLAGS) $< 2>&1 | awk '\''/including/ { sub(/^.*file: */, ""); gsub(/\\/, "/"); if (!match($$0, / /)) print "$@:", $$0 }'\'' > $(@:.o=.d)'
+ _DEPFLAGS='$(CPPFLAGS) $(CFLAGS) -showIncludes -Zs'
+ _cflags_speed="-O2"
+ _cflags_size="-O1"
+ # Nonstandard output options, to avoid msys path conversion issues, relies on wrapper to remap it
+ if $_cc 2>&1 | grep -q Linker; then
+ _ld_o='-out $@'
+ else
+ _ld_o='-Fe$@'
+ fi
+ _cc_o='-Fo $@'
+ _flags_filter=msvc_flags
+ _ld_lib='lib%.a'
+ _ld_path='-libpath:'
+ _flags='-nologo'
+ _cflags='-D_USE_MATH_DEFINES -Dinline=__inline -FIstdlib.h -Dstrtoll=_strtoi64'
+ if [ $pfx = hostcc ]; then
+ _cflags="$cflags -Dsnprintf=_snprintf"
+ fi
+ disable aligned_stack
fi
eval ${pfx}_type=\$_type