X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=configure;h=f6cb0e2558c985b83f78b9f8bd840fb63c084124;hb=fad729fa505c0450482028c4a55c29fdc503dad7;hp=596b6039e3ade1c451386099e0281b9f3ccdcc1c;hpb=6379900c533d1e556d484e57166873f3ab2505f5;p=ffmpeg diff --git a/configure b/configure index 596b6039e3a..f6cb0e2558c 100755 --- a/configure +++ b/configure @@ -59,59 +59,72 @@ cat <&1 | grep -q '^gcc.*LLVM'; then cc_type=llvm_gcc @@ -2014,6 +2088,7 @@ elif $cc -V 2>&1 | grep -q Sun; then cc_ident=$($cc -V 2>&1 | head -n1 | cut -d' ' -f 2-) DEPEND_CMD='$(DEPCC) $(DEPFLAGS) $< | sed -e "1s,^.*: ,$@: ," -e "\$$!s,\$$, \\\," -e "1!s,^.*: , ," > $(@:.o=.d)' DEPFLAGS='$(CPPFLAGS) $(CFLAGS) -xM1' + add_ldflags -xc99 speed_cflags='-O5' size_cflags='-O5 -xspace' filter_cflags=suncc_flags @@ -2068,6 +2143,24 @@ elif $cc -v 2>&1 | grep -q Open64; then speed_cflags='-O2' size_cflags='-Os' filter_cflags='filter_out -Wdisabled-optimization|-Wtype-limits|-fno-signed-zeros' +elif $cc -V 2>&1 | grep -q Portland; then + cc_type=pgi + cc_version='AV_STRINGIFY(__PGIC__.__PGIC_MINOR__.__PGIC_PATCHLEVEL__)' + cc_ident="PGI $($cc -V 2>&1 | awk '/^pgcc/ { print $2; exit }')" + opt_common='-alias=ansi -Mlre -Mpre' + speed_cflags="-O3 -Mautoinline -Munroll=c:4 $opt_common" + size_cflags="-O2 -Munroll=c:1 $opt_common" + noopt_cflags="-O1" + filter_cflags=pgi_flags + pgi_flags(){ + for flag; do + case $flag in + -fomit-frame-pointer) echo -Mnoframe ;; + -g) echo -gopt ;; + *) echo $flag ;; + esac + done + } fi test -n "$cc_type" && enable $cc_type || @@ -2189,9 +2282,12 @@ elif enabled ppc; then 74*|ppc74*|powerpc74*) cpuflags="-mcpu=7400 -mpowerpc-gfxopt" ;; - g5|970|ppc970|powerpc970|power4*) + g5|970|ppc970|powerpc970) cpuflags="-mcpu=970 -mpowerpc-gfxopt -mpowerpc64" ;; + power[3-7]*) + cpuflags="-mcpu=$cpu -mpowerpc-gfxopt -mpowerpc64" + ;; cell) cpuflags="-mcpu=cell" enable ldbrx @@ -2353,11 +2449,17 @@ case $target_os in host_libs= ;; sunos) - FFSERVERLDFLAGS="" + AVSERVERLDFLAGS="" SHFLAGS='-shared -Wl,-h,$$(@F)' enabled x86 && SHFLAGS="-mimpure-text $SHFLAGS" network_extralibs="-lsocket -lnsl" - add_cppflags -D__EXTENSIONS__ + add_cppflags -D__EXTENSIONS__ -D_XOPEN_SOURCE=600 + # When using suncc to build, the Solaris linker will mark + # an executable with each instruction set encountered by + # the Solaris assembler. As our libraries contain their own + # 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' ;; netbsd) @@ -2366,7 +2468,6 @@ case $target_os in oss_outdev_extralibs="-lossaudio" ;; openbsd) - enable malloc_aligned # On OpenBSD 4.5. the compiler does not use PIC unless # explicitly using -fPIC. Libav builds fine without PIC, # however the generated executable will not do anything @@ -2379,26 +2480,23 @@ case $target_os in oss_outdev_extralibs="-lossaudio" ;; dragonfly) - enable malloc_aligned disable symver ;; freebsd) - enable malloc_aligned ;; bsd/os) add_extralibs -lpoll -lgnugetopt ;; darwin) - enable malloc_aligned gas="gas-preprocessor.pl $cc" enabled ppc && add_asflags -force_cpusubtype_ALL - SHFLAGS='-dynamiclib -Wl,-single_module -Wl,-install_name,$(SHLIBDIR)/$(SLIBNAME),-current_version,$(LIBVERSION),-compatibility_version,$(LIBMAJOR)' + SHFLAGS='-dynamiclib -Wl,-single_module -Wl,-install_name,$(SHLIBDIR)/$(SLIBNAME_WITH_MAJOR),-current_version,$(LIBVERSION),-compatibility_version,$(LIBMAJOR)' enabled x86_32 && append SHFLAGS -Wl,-read_only_relocs,suppress add_ldflags -Wl,-dynamic,-search_paths_first SLIBSUF=".dylib" SLIBNAME_WITH_VERSION='$(SLIBPREF)$(FULLNAME).$(LIBVERSION)$(SLIBSUF)' SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(FULLNAME).$(LIBMAJOR)$(SLIBSUF)' - FFSERVERLDFLAGS=-Wl,-bind_at_load + AVSERVERLDFLAGS=-Wl,-bind_at_load objformat="macho" enabled x86_64 && objformat="macho64" enabled_any pic shared || @@ -2412,7 +2510,6 @@ case $target_os in fi LIBTARGET=i386 if enabled x86_64; then - enable malloc_aligned LIBTARGET="i386:x86-64" elif enabled arm; then LIBTARGET=arm-wince @@ -2470,7 +2567,7 @@ case $target_os in add_cppflags -D_GNU_SOURCE add_ldflags -Zomf -Zbin-files -Zargs-wild -Zmap SHFLAGS='$(SUBDIR)$(NAME).def -Zdll -Zomf' - FFSERVERLDFLAGS="" + AVSERVERLDFLAGS="" LIBSUF="_s.a" SLIBPREF="" SLIBSUF=".dll" @@ -2491,6 +2588,7 @@ case $target_os in add_cppflags -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 -D_BSD_SOURCE ;; gnu) + add_cppflags -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 ;; qnx) add_cppflags -D_QNX_SOURCE @@ -2499,7 +2597,14 @@ case $target_os in symbian) SLIBSUF=".dll" enable dos_paths - add_cflags --include=$sysinclude/gcce/gcce.h + add_cflags --include=$sysinclude/gcce/gcce.h -fvisibility=default + add_cppflags -D__GCCE__ -D__SYMBIAN32__ -DSYMBIAN_OE_POSIX_SIGNALS + add_ldflags -Wl,--target1-abs,--no-undefined \ + -Wl,-Ttext,0x80000,-Tdata,0x1000000 -shared \ + -Wl,--entry=_E32Startup -Wl,-u,_E32Startup + add_extralibs -l:eexe.lib -l:usrt2_2.lib -l:dfpaeabi.dso \ + -l:drtaeabi.dso -l:scppnwdl.dso -lsupc++ -lgcc \ + -l:libc.dso -l:libm.dso -l:euser.dso -l:libcrt0.lib ;; none) ;; @@ -2508,7 +2613,11 @@ case $target_os in ;; esac -echo "config:$arch:$subarch:$cpu:$target_os:$cc_ident:$LIBAV_CONFIGURATION" >config.fate +esc(){ + echo "$*" | sed 's/%/%25/g;s/:/%3a/g' +} + +echo "config:$arch:$subarch:$cpu:$target_os:$(esc $cc_ident):$(esc $LIBAV_CONFIGURATION)" >config.fate check_cpp_condition stdlib.h "defined(__PIC__) || defined(__pic__) || defined(PIC)" && enable pic @@ -2529,12 +2638,14 @@ die_license_disabled() { enabled $1 || { enabled $2 && die "$2 is $1 and --enable-$1 is not specified."; } } +die_license_disabled gpl libcdio die_license_disabled gpl libx264 die_license_disabled gpl libxavs die_license_disabled gpl libxvid die_license_disabled gpl x11grab die_license_disabled nonfree libfaac +die_license_disabled nonfree openssl die_license_disabled version3 libopencore_amrnb die_license_disabled version3 libopencore_amrwb @@ -2610,10 +2721,11 @@ EOF enabled armv6 && check_asm armv6 '"sadd16 r0, r0, r0"' enabled armv6t2 && check_asm armv6t2 '"movt r0, #0"' enabled armvfp && check_asm armvfp '"fadds s0, s0, s0"' - enabled iwmmxt && check_asm iwmmxt '"wunpckelub wr6, wr4"' enabled neon && check_asm neon '"vadd.i16 q0, q0, q0"' enabled vfpv3 && check_asm vfpv3 '"vmov.f32 s0, #1.0"' + check_asm asm_mod_y '"vmul.i32 d0, d0, %y0" :: "x"(0)' + enabled_all armv6t2 shared !pic && enable_pic elif enabled mips; then @@ -2686,8 +2798,6 @@ EOF enabled ssse3 && check_asm ssse3 '"pabsw %xmm0, %xmm0"' enabled mmx2 && check_asm mmx2 '"pmaxub %mm0, %mm1"' - check_asm bswap '"bswap %%eax" ::: "%eax"' - if ! disabled_any asm mmx yasm; then if check_cmd $yasmexe --version; then enabled x86_64 && yasm_extra="-m amd64" @@ -2739,6 +2849,7 @@ if enabled network; then check_type netinet/in.h "struct sockaddr_in6" check_type "sys/types.h sys/socket.h" "struct sockaddr_storage" check_struct "sys/types.h sys/socket.h" "struct sockaddr" sa_len + check_header netinet/sctp.h # Prefer arpa/inet.h over winsock2 if check_header arpa/inet.h ; then check_func closesocket @@ -2778,9 +2889,12 @@ check_func setrlimit check_func strerror_r check_func strptime check_func strtok_r +check_func sched_getaffinity +check_func sysconf +check_func sysctl check_func_headers io.h setmode -check_func_headers lzo/lzo1x.h lzo1x_999_compress check_lib2 "windows.h psapi.h" GetProcessMemoryInfo -lpsapi +check_func_headers windows.h GetProcessAffinityMask check_func_headers windows.h GetProcessTimes check_func_headers windows.h MapViewOfFile check_func_headers windows.h VirtualAlloc @@ -2790,17 +2904,20 @@ check_header dxva2api.h check_header malloc.h check_header poll.h check_header sys/mman.h +check_header sys/param.h check_header sys/resource.h check_header sys/select.h check_header vdpau/vdpau.h check_header vdpau/vdpau_x11.h check_header X11/extensions/XvMClib.h -check_struct dxva2api.h DXVA_PictureParameters wDecodedPictureIndex - disabled zlib || check_lib zlib.h zlibVersion -lz || disable zlib disabled bzlib || check_lib2 bzlib.h BZ2_bzlibVersion -lbz2 || disable bzlib +if ! disabled w32threads && ! enabled pthreads; then + check_func _beginthreadex && enable w32threads +fi + # check for some common methods of building with pthread support # do this before the optional library checks as some of them require pthreads if ! disabled pthreads && ! enabled w32threads; then @@ -2847,9 +2964,7 @@ check_mathfunc truncf # these are off by default, so fail if requested and not available enabled avisynth && require2 vfw32 "windows.h vfw.h" AVIFileInit -lavifil32 enabled frei0r && { check_header frei0r.h || die "ERROR: frei0r.h header not found"; } -enabled libdirac && require_pkg_config dirac \ - "libdirac_decoder/dirac_parser.h libdirac_encoder/dirac_encoder.h" \ - "dirac_decoder_init dirac_encoder_init" +enabled gnutls && require_pkg_config gnutls gnutls/gnutls.h gnutls_global_init enabled libfaac && require2 libfaac "stdint.h faac.h" faacEncGetVersion -lfaac enabled libfreetype && require_pkg_config freetype2 "ft2build.h freetype/freetype.h" FT_Init_FreeType enabled libgsm && require libgsm gsm/gsm.h gsm_create -lgsm @@ -2859,6 +2974,7 @@ enabled libopencore_amrnb && require libopencore_amrnb opencore-amrnb/interf_de enabled libopencore_amrwb && require libopencore_amrwb opencore-amrwb/dec_if.h D_IF_init -lopencore-amrwb enabled libopencv && require_pkg_config opencv opencv/cv.h cvCreateImageHeader enabled libopenjpeg && require libopenjpeg openjpeg.h opj_version -lopenjpeg +enabled libpulse && require_pkg_config libpulse-simple pulse/simple.h pa_simple_new enabled librtmp && require_pkg_config librtmp librtmp/rtmp.h RTMP_Socket enabled libschroedinger && require_pkg_config schroedinger-1.0 schroedinger/schro.h schro_init enabled libspeex && require libspeex speex/speex.h speex_decoder_init -lspeex @@ -2872,11 +2988,14 @@ enabled libvpx && { enabled libvpx_encoder && { check_lib2 "vpx/vpx_encoder.h vpx/vp8cx.h" vpx_codec_enc_init_ver -lvpx || die "ERROR: libvpx encoder version must be >=0.9.1"; } } enabled libx264 && require libx264 x264.h x264_encoder_encode -lx264 && - { check_cpp_condition x264.h "X264_BUILD >= 115" || - die "ERROR: libx264 version must be >= 0.115."; } + { check_cpp_condition x264.h "X264_BUILD >= 118" || + die "ERROR: libx264 version must be >= 0.118."; } enabled libxavs && require libxavs xavs.h xavs_encoder_encode -lxavs enabled libxvid && require libxvid xvid.h xvid_global -lxvidcore -enabled mlib && require mediaLib mlib_types.h mlib_VectorSub_S16_U8_Mod -lmlib +enabled openssl && { check_lib openssl/ssl.h SSL_library_init -lssl -lcrypto || + check_lib openssl/ssl.h SSL_library_init -lssl32 -leay32 || + check_lib openssl/ssl.h SSL_library_init -lssl -lcrypto -lws2_32 -lgdi32 || + die "ERROR: openssl not found"; } # libdc1394 check if enabled libdc1394; then @@ -2887,7 +3006,7 @@ if enabled libdc1394; then die "ERROR: No version of libdc1394 found " fi -if check_pkg_config sdl SDL_version.h SDL_Linked_Version; then +if check_pkg_config sdl SDL_events.h SDL_PollEvent; then check_cpp_condition SDL.h "(SDL_MAJOR_VERSION<<16 | SDL_MINOR_VERSION<<8 | SDL_PATCHLEVEL) >= 0x010201" $sdl_cflags && enable sdl && check_struct SDL.h SDL_VideoInfo current_w $sdl_cflags && enable sdl_video_size @@ -2896,8 +3015,9 @@ fi texi2html -version > /dev/null 2>&1 && enable texi2html || disable texi2html check_header linux/fb.h -check_header linux/videodev.h check_header linux/videodev2.h +check_struct linux/videodev2.h "struct v4l2_frmivalenum" discrete + check_header sys/videoio.h check_func_headers "windows.h vfw.h" capCreateCaptureWindow "$vfwcap_indev_extralibs" @@ -2924,13 +3044,18 @@ enabled jack_indev && check_lib2 jack/jack.h jack_client_open -ljack enabled_any sndio_indev sndio_outdev && check_lib2 sndio.h sio_open -lsndio -enabled x11grab && -check_header X11/Xlib.h && -check_header X11/extensions/XShm.h && -check_header X11/extensions/Xfixes.h && -check_func XOpenDisplay -lX11 && -check_func XShmCreateImage -lX11 -lXext && -check_func XFixesGetCursorImage -lX11 -lXext -lXfixes +enabled libcdio && + check_lib2 "cdio/cdda.h cdio/paranoia.h" cdio_cddap_open "-lcdio_paranoia -lcdio_cdda -lcdio" + +enabled x11grab && +require X11 X11/Xlib.h XOpenDisplay -lX11 && +require Xext X11/extensions/XShm.h XShmCreateImage -lXext && +require Xfixes X11/extensions/Xfixes.h XFixesGetCursorImage -lXfixes + +# check for VDA header +if ! disabled vda && check_header VideoDecodeAcceleration/VDADecoder.h; then + enable vda && add_extralibs -framework CoreFoundation -framework VideoDecodeAcceleration -framework QuartzCore +fi if ! disabled vdpau && enabled vdpau_vdpau_h; then check_cpp_condition \ @@ -2956,13 +3081,25 @@ check_cflags -Wwrite-strings check_cflags -Wtype-limits check_cflags -Wundef check_cflags -Wmissing-prototypes +check_cflags -Wstrict-prototypes enabled extra_warnings && check_cflags -Winline # add some linker flags check_ldflags -Wl,--warn-common -check_ldflags -Wl,-rpath-link=libpostproc:libswscale:libavfilter:libavdevice:libavformat:libavcodec:libavutil +check_ldflags -Wl,-rpath-link=libswscale:libavfilter:libavdevice:libavformat:libavcodec:libavutil:libavresample test_ldflags -Wl,-Bsymbolic && append SHFLAGS -Wl,-Bsymbolic +enabled xmm_clobber_test && \ + check_ldflags -Wl,--wrap,avcodec_open2 \ + -Wl,--wrap,avcodec_decode_audio4 \ + -Wl,--wrap,avcodec_decode_video2 \ + -Wl,--wrap,avcodec_decode_subtitle2 \ + -Wl,--wrap,avcodec_encode_audio2 \ + -Wl,--wrap,avcodec_encode_video \ + -Wl,--wrap,avcodec_encode_subtitle \ + -Wl,--wrap,sws_scale || \ + disable xmm_clobber_test + echo "X{};" > $TMPV if test_ldflags -Wl,--version-script,$TMPV; then append SHFLAGS '-Wl,--version-script,\$(SUBDIR)lib\$(NAME).ver' @@ -2994,10 +3131,11 @@ if enabled icc; then # -wd: Disable following warnings # 144, 167, 556: -Wno-pointer-sign # 1292: attribute "foo" ignored + # 1419: external declaration in primary source file # 10006: ignoring unknown option -fno-signed-zeros # 10148: ignoring unknown option -Wno-parentheses # 10156: ignoring option '-W'; no argument required - check_cflags -wd144,167,556,1292,10006,10148,10156 + check_cflags -wd144,167,556,1292,1419,10006,10148,10156 # 11030: Warning unknown option --as-needed # 10156: ignoring option '-export'; no argument required check_ldflags -wd10156,11030 @@ -3022,6 +3160,7 @@ elif enabled gcc; then check_cflags -fno-tree-vectorize check_cflags -Werror=implicit-function-declaration check_cflags -Werror=missing-prototypes + check_cflags -Werror=declaration-after-statement elif enabled llvm_gcc; then check_cflags -mllvm -stack-alignment=16 elif enabled clang; then @@ -3046,26 +3185,12 @@ enabled_any $THREADS_LIST && enable threads check_deps $CONFIG_LIST \ $CONFIG_EXTRA \ $HAVE_LIST \ - $DECODER_LIST \ - $ENCODER_LIST \ - $HWACCEL_LIST \ - $PARSER_LIST \ - $BSF_LIST \ - $DEMUXER_LIST \ - $MUXER_LIST \ - $FILTER_LIST \ - $INDEV_LIST \ - $OUTDEV_LIST \ - $PROTOCOL_LIST \ - $ACODEC_TESTS \ - $VCODEC_TESTS \ - $LAVF_TESTS \ - $LAVFI_TESTS \ - $SEEK_TESTS \ + $ALL_COMPONENTS \ + $ALL_TESTS \ enabled asm || { arch=c; disable $ARCH_LIST $ARCH_EXT_LIST; } -! enabled_any memalign posix_memalign malloc_aligned && +! enabled_any memalign posix_memalign && enabled_any $need_memalign && enable memalign_hack echo "install prefix $prefix" @@ -3099,7 +3224,6 @@ if enabled arm; then echo "ARMv6 enabled ${armv6-no}" echo "ARMv6T2 enabled ${armv6t2-no}" echo "ARM VFP enabled ${armvfp-no}" - echo "IWMMXT enabled ${iwmmxt-no}" echo "NEON enabled ${neon-no}" fi if enabled mips; then @@ -3118,19 +3242,19 @@ echo "optimize for size ${small-no}" echo "optimizations ${optimizations-no}" echo "static ${static-no}" echo "shared ${shared-no}" -echo "postprocessing support ${postproc-no}" echo "new filter support ${avfilter-no}" echo "network support ${network-no}" echo "threading support ${thread_type-no}" +echo "safe bitstream reader ${safe_bitstream_reader-no}" echo "SDL support ${sdl-no}" -echo "Sun medialib support ${mlib-no}" echo "libdxva2 enabled ${dxva2-no}" echo "libva enabled ${vaapi-no}" echo "libvdpau enabled ${vdpau-no}" echo "AVISynth enabled ${avisynth-no}" echo "frei0r enabled ${frei0r-no}" +echo "gnutls enabled ${gnutls-no}" +echo "libcdio support ${libcdio-no}" echo "libdc1394 support ${libdc1394-no}" -echo "libdirac enabled ${libdirac-no}" echo "libfaac enabled ${libfaac-no}" echo "libgsm enabled ${libgsm-no}" echo "libmp3lame enabled ${libmp3lame-no}" @@ -3139,6 +3263,7 @@ echo "libopencore-amrnb support ${libopencore_amrnb-no}" echo "libopencore-amrwb support ${libopencore_amrwb-no}" echo "libopencv support ${libopencv-no}" echo "libopenjpeg enabled ${libopenjpeg-no}" +echo "libpulse enabled ${libpulse-no}" echo "librtmp enabled ${librtmp-no}" echo "libschroedinger enabled ${libschroedinger-no}" echo "libspeex enabled ${libspeex-no}" @@ -3150,6 +3275,7 @@ echo "libvpx enabled ${libvpx-no}" echo "libx264 enabled ${libx264-no}" echo "libxavs enabled ${libxavs-no}" echo "libxvid enabled ${libxvid-no}" +echo "openssl enabled ${openssl-no}" echo "zlib enabled ${zlib-no}" echo "bzlib enabled ${bzlib-no}" echo @@ -3209,7 +3335,7 @@ AS_O=$CC_O CC_O=$CC_O DLLTOOL=$dlltool LDFLAGS=$LDFLAGS -FFSERVERLDFLAGS=$FFSERVERLDFLAGS +AVSERVERLDFLAGS=$AVSERVERLDFLAGS SHFLAGS=$SHFLAGS YASMFLAGS=$YASMFLAGS BUILDSUF=$build_suffix @@ -3261,13 +3387,13 @@ get_version(){ eval echo "${lcname}_VERSION_MAJOR=\$${name}_VERSION_MAJOR" >> config.mak } -get_version LIBSWSCALE libswscale/swscale.h -get_version LIBPOSTPROC libpostproc/postprocess.h get_version LIBAVCODEC libavcodec/version.h get_version LIBAVDEVICE libavdevice/avdevice.h +get_version LIBAVFILTER libavfilter/version.h get_version LIBAVFORMAT libavformat/version.h +get_version LIBAVRESAMPLE libavresample/version.h get_version LIBAVUTIL libavutil/avutil.h -get_version LIBAVFILTER libavfilter/avfilter.h +get_version LIBSWSCALE libswscale/swscale.h cat > $TMPH < $TMPH <>config.mak <