X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=configure;h=49e9ecf0403c09e3a9915afaafb4f883a0f63fcc;hb=01fc5d6609e31539684785295d6c10b84d70b215;hp=7f95acf5720609e5555a9cee06d8b6a32feec0a8;hpb=a3222470de7b1440534a98d32e425ef9ea6e5384;p=ffmpeg diff --git a/configure b/configure index 7f95acf5720..49e9ecf0403 100755 --- a/configure +++ b/configure @@ -55,7 +55,7 @@ if test "$E1" != 0 || test "$E2" = 0; then fi show_help(){ -cat <&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 $@' + _cc_e='-P -Fi $@' + _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 + append _cflags -Dsnprintf=_snprintf + fi fi eval ${pfx}_type=\$_type @@ -2350,6 +2416,17 @@ if [ -z "$CC_DEPFLAGS" ] && [ "$dep_cc" != "$cc" ]; then DEPCCFLAGS=$_flags fi +if $ar 2>&1 | grep -q Microsoft; then + arflags="-nologo" + ar_o='-out:$@' +elif $ar 2>&1 | grep -q 'Texas Instruments'; then + arflags="rq" + ar_o='$@' +else + arflags="rc" + ar_o='$@' +fi + add_cflags $extra_cflags add_asflags $extra_cflags @@ -2638,7 +2715,7 @@ case $target_os in # guards for processor-specific code, instead suppress # generation of the HWCAPS ELF section on Solaris x86 only. enabled_all suncc x86 && echo "hwcap_1 = OVERRIDE;" > mapfile && add_ldflags -Wl,-M,mapfile - nm_opts='-P -g' + nm_default='nm -P -g' ;; netbsd) disable symver @@ -2710,9 +2787,6 @@ case $target_os in ranlib=: enable dos_paths check_cflags -fno-common - check_cpp_condition _mingw.h "defined (__MINGW64_VERSION_MAJOR) || (__MINGW32_MAJOR_VERSION > 3) \ - || (__MINGW32_MAJOR_VERSION == 3 && __MINGW32_MINOR_VERSION >= 15)" || - die "ERROR: MinGW runtime version must be >= 3.15." add_cppflags -U__STRICT_ANSI__ ;; cygwin*) @@ -2758,13 +2832,13 @@ case $target_os in SLIBNAME_WITH_VERSION='$(SLIBPREF)$(NAME)-$(LIBVERSION)$(SLIBSUF)' SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(shell echo $(NAME) | cut -c1-6)$(LIBMAJOR)$(SLIBSUF)' SLIB_CREATE_DEF_CMD='echo LIBRARY $(SLIBNAME_WITH_MAJOR) INITINSTANCE TERMINSTANCE > $(SUBDIR)$(NAME).def; \ - echo PROTMODE >> $(SUBDIR)$(NAME).def; \ - echo CODE PRELOAD MOVEABLE DISCARDABLE >> $(SUBDIR)$(NAME).def; \ - echo DATA PRELOAD MOVEABLE MULTIPLE NONSHARED >> $(SUBDIR)$(NAME).def; \ - echo EXPORTS >> $(SUBDIR)$(NAME).def; \ - emxexp -o $(OBJS) >> $(SUBDIR)$(NAME).def' + echo PROTMODE >> $(SUBDIR)$(NAME).def; \ + echo CODE PRELOAD MOVEABLE DISCARDABLE >> $(SUBDIR)$(NAME).def; \ + echo DATA PRELOAD MOVEABLE MULTIPLE NONSHARED >> $(SUBDIR)$(NAME).def; \ + echo EXPORTS >> $(SUBDIR)$(NAME).def; \ + emxexp -o $(OBJS) >> $(SUBDIR)$(NAME).def' SLIB_EXTRA_CMD='emximp -o $(SUBDIR)$(LIBPREF)$(NAME)_dll.a $(SUBDIR)$(NAME).def; \ - emximp -o $(SUBDIR)$(LIBPREF)$(NAME)_dll.lib $(SUBDIR)$(NAME).def;' + emximp -o $(SUBDIR)$(LIBPREF)$(NAME)_dll.lib $(SUBDIR)$(NAME).def;' SLIB_INSTALL_EXTRA_LIB='$(LIBPREF)$(NAME)_dll.a $(LIBPREF)$(NAME)_dll.lib' enable dos_paths ;; @@ -2797,6 +2871,32 @@ case $target_os in ;; esac +# determine libc flavour + +if check_cpp_condition features.h "defined __UCLIBC__"; then + libc_type=uclibc +elif check_cpp_condition features.h "defined __GLIBC__"; then + libc_type=glibc +elif check_header _mingw.h; then + libc_type=mingw + check_cpp_condition _mingw.h \ + "defined (__MINGW64_VERSION_MAJOR) || (__MINGW32_MAJOR_VERSION > 3) || \ + (__MINGW32_MAJOR_VERSION == 3 && __MINGW32_MINOR_VERSION >= 15)" || + die "ERROR: MinGW runtime version must be >= 3.15." +elif check_cpp_condition newlib.h "defined _NEWLIB_VERSION"; then + libc_type=newlib +elif check_func_headers stdlib.h _get_doserrno; then + libc_type=msvcrt + add_cflags -Dstrtod=avpriv_strtod + add_cflags -Dsnprintf=avpriv_snprintf \ + -D_snprintf=avpriv_snprintf \ + -Dvsnprintf=avpriv_vsnprintf +elif check_cpp_condition stddef.h "defined __KLIBC__"; then + libc_type=klibc +fi + +test -n "$libc_type" && enable $libc_type + esc(){ echo "$*" | sed 's/%/%25/g;s/:/%3a/g' } @@ -2806,6 +2906,7 @@ echo "config:$arch:$subarch:$cpu:$target_os:$(esc $cc_ident):$(esc $LIBAV_CONFIG check_cpp_condition stdlib.h "defined(__PIC__) || defined(__pic__) || defined(PIC)" && enable pic set_default $PATHS_LIST +set_default nm # we need to build at least one lib type if ! enabled_any static shared; then @@ -2853,10 +2954,10 @@ enabled pic && enable_pic check_cc <= 0.2 if you would like vdpau support." && - disable vdpau; } + check_cpp_condition vdpau/vdpau.h "defined VDP_DECODER_PROFILE_MPEG4_PART2_ASP" || + { echolog "Please upgrade to libvdpau >= 0.2 if you would like vdpau support." && disable vdpau; } fi enabled debug && add_cflags -g"$debuglevel" && add_asflags -g"$debuglevel" @@ -3402,6 +3500,8 @@ elif enabled tms470; then add_cflags -pds=824 -pds=837 elif enabled pathscale; then add_cflags -fstrict-overflow -OPT:wrap_around_unsafe_opt=OFF +elif enabled msvc; then + enabled x86_32 && disable aligned_stack fi enabled_any $THREADS_LIST && enable threads @@ -3557,6 +3657,8 @@ DEPASFLAGS=$DEPASFLAGS \$(CPPFLAGS) YASM=$yasmexe DEPYASM=$yasmexe AR=$ar +ARFLAGS=$arflags +AR_O=$ar_o RANLIB=$ranlib LN_S=$ln_s CPPFLAGS=$CPPFLAGS @@ -3701,15 +3803,15 @@ test -n "$WARNINGS" && printf "\n$WARNINGS" # build pkg-config files pkgconfig_generate(){ -name=$1 -shortname=${name#lib}${build_suffix} -comment=$2 -version=$3 -libs=$4 -requires=$5 -enabled ${name#lib} || return 0 -mkdir -p $name -cat < $name/$name.pc + name=$1 + shortname=${name#lib}${build_suffix} + comment=$2 + version=$3 + libs=$4 + requires=$5 + enabled ${name#lib} || return 0 + mkdir -p $name + cat < $name/$name.pc prefix=$prefix exec_prefix=\${prefix} libdir=$libdir @@ -3725,7 +3827,7 @@ Libs: -L\${libdir} -l${shortname} $(enabled shared || echo $libs) Libs.private: $(enabled shared && echo $libs) Cflags: -I\${includedir} EOF -cat < $name/$name-uninstalled.pc + cat < $name/$name-uninstalled.pc prefix= exec_prefix= libdir=\${pcfiledir}