X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=configure;h=6aa61775464cd3a55f8899786213ac2484841b7e;hb=c64c0a9b76d583be8d6f9d5c40a84fed8d62f707;hp=3b3a6c01cb84e6972f55fc4561c595f163f6c6fc;hpb=fa0912fe50e59df72b7bf81f8838d2c6d9780343;p=ffmpeg diff --git a/configure b/configure index 3b3a6c01cb8..6aa61775464 100755 --- a/configure +++ b/configure @@ -221,6 +221,7 @@ show_help(){ echo " --disable-neon disable neon optimizations" echo " --disable-vis disable VIS optimizations" echo " --disable-yasm disable use of yasm assembler" + echo " --enable-pic build position-independent code" echo echo "Developer options (useful when working on FFmpeg itself):" echo " --disable-debug disable debugging symbols" @@ -290,6 +291,14 @@ sh_quote(){ echo "$v" } +filter(){ + pat=$1 + shift + for v; do + eval "case $v in $pat) echo $v ;; esac" + done +} + set_all(){ value=$1 shift @@ -832,6 +841,7 @@ CONFIG_LIST=" mpegaudio_hp network nonfree + pic postproc powerpc_perf rdft @@ -857,6 +867,9 @@ THREADS_LIST=' ARCH_LIST=' alpha arm + avr32 + avr32_ap + avr32_uc bfin ia64 m68k @@ -925,6 +938,7 @@ HAVE_LIST=" getrusage inet_aton inline_asm + isatty ldbrx libdc1394_1 libdc1394_2 @@ -1049,6 +1063,7 @@ inline_asm_deps="!tms470" # decoders / encoders / hardware accelerators aac_decoder_select="fft mdct" +aac_encoder_select="fft mdct" ac3_decoder_select="fft mdct" atrac3_decoder_select="fft mdct" cavs_decoder_select="golomb" @@ -1058,6 +1073,7 @@ dca_decoder_select="fft mdct" dnxhd_encoder_select="aandct" dxa_decoder_select="zlib" eac3_decoder_select="ac3_decoder" +eamad_decoder_select="aandct" eatgq_decoder_select="aandct" eatqi_decoder_select="aandct" ffv1_decoder_select="golomb" @@ -1065,12 +1081,12 @@ flac_decoder_select="golomb" flac_encoder_select="golomb" flashsv_decoder_select="zlib" flashsv_encoder_select="zlib" -flv_encoder_select="aandct" +flv_encoder_select="h263_encoder" h261_encoder_select="aandct" h263_encoder_select="aandct" h263_vaapi_hwaccel_deps="va_va_h" h263_vaapi_hwaccel_select="vaapi h263_decoder" -h263p_encoder_select="aandct" +h263p_encoder_select="h263_encoder" h264_decoder_select="golomb" h264_vaapi_hwaccel_deps="va_va_h" h264_vaapi_hwaccel_select="vaapi" @@ -1084,7 +1100,7 @@ loco_decoder_select="golomb" mjpeg_encoder_select="aandct" mpeg1video_encoder_select="aandct" mpeg2video_encoder_select="aandct" -mpeg4_encoder_select="aandct" +mpeg4_encoder_select="h263_encoder" mpeg_vdpau_decoder_deps="vdpau_vdpau_h vdpau_vdpau_x11_h" mpeg_vdpau_decoder_select="vdpau mpegvideo_decoder" mpeg1_vdpau_decoder_deps="vdpau_vdpau_h vdpau_vdpau_x11_h" @@ -1094,16 +1110,17 @@ mpeg2_vaapi_hwaccel_select="vaapi mpeg2video_decoder" mpeg4_vaapi_hwaccel_deps="va_va_h" mpeg4_vaapi_hwaccel_select="vaapi mpeg4_decoder" mpeg_xvmc_decoder_deps="X11_extensions_XvMClib_h" -msmpeg4v1_encoder_select="aandct" -msmpeg4v2_encoder_select="aandct" -msmpeg4v3_encoder_select="aandct" +mpeg_xvmc_decoder_select="mpegvideo_decoder" +msmpeg4v1_encoder_select="h263_encoder" +msmpeg4v2_encoder_select="h263_encoder" +msmpeg4v3_encoder_select="h263_encoder" nellymoser_decoder_select="fft mdct" nellymoser_encoder_select="fft mdct" png_decoder_select="zlib" png_encoder_select="zlib" qdm2_decoder_select="fft mdct rdft" -rv10_encoder_select="aandct" -rv20_encoder_select="aandct" +rv10_encoder_select="h263_encoder" +rv20_encoder_select="h263_encoder" rv30_decoder_select="golomb" rv40_decoder_select="golomb" shorten_decoder_select="golomb" @@ -1112,6 +1129,7 @@ sonic_encoder_select="golomb" sonic_ls_encoder_select="golomb" svq3_decoder_select="golomb" svq3_decoder_suggest="zlib" +theora_decoder_select="vp3_decoder" tiff_decoder_suggest="zlib" tiff_encoder_suggest="zlib" tscc_decoder_select="zlib" @@ -1127,8 +1145,8 @@ wmav1_decoder_select="fft mdct" wmav1_encoder_select="fft mdct" wmav2_decoder_select="fft mdct" wmav2_encoder_select="fft mdct" -wmv1_encoder_select="aandct" -wmv2_encoder_select="aandct" +wmv1_encoder_select="h263_encoder" +wmv2_encoder_select="h263_encoder" wmv3_decoder_select="vc1_decoder" wmv3_vaapi_hwaccel_select="vc1_vaapi_hwaccel" wmv3_vdpau_decoder_select="vc1_vdpau_decoder" @@ -1212,6 +1230,7 @@ x11_grab_device_indev_extralibs="-lX11 -lXext" # protocols gopher_protocol_deps="network" http_protocol_deps="network" +rtmp_protocol_deps="tcp_protocol" rtp_protocol_deps="udp_protocol" tcp_protocol_deps="network" udp_protocol_deps="network" @@ -1295,7 +1314,7 @@ target_path='.' # gcc stupidly only outputs the basename of targets with -MM, but we need the # full relative path for objects in subdirectories for non-recursive Make. -DEPEND_CMD='$(DEPCC) $(DEPFLAGS) $< | sed -e "/^\#.*/d" -e "s,^[[:space:]]*$(*F)\\.o,$(@D)/$(*F).o,"' +DEPEND_CMD='$(DEPCC) $(DEPFLAGS) $< | sed -e "/^\#.*/d" -e "s,^[[:space:]]*$(*F)\\.o,$(@D)/$(*F).o," > $(@:.o=.d)' DEPFLAGS='$(CPPFLAGS) $(CFLAGS) -MM' # find source path @@ -1376,11 +1395,11 @@ for opt do --enable-debug=*) debuglevel="$optval" ;; --enable-*=*|--disable-*=*) - eval $(echo "$opt" | sed 's/=/-/;s/--/action=/;s/-/ thing=/;s/-/ name=/') - case "$thing" in - encoder|decoder|hwaccel|muxer|demuxer|indev|outdev|parser|bsf|protocol|filter) $action ${optval}_${thing} ;; - *) die_unknown "$opt" ;; - esac + eval $(echo "${opt%%=*}" | sed 's/--/action=/;s/-/ thing=/') + is_in "${thing}s" $COMPONENT_LIST || die_unknown "$opt" + eval list=\$$(toupper $thing)_LIST + name=$(echo "${optval}" | sed "s/,/_${thing}|/g")_${thing} + $action $(filter "$name" $list) ;; --enable-?*|--disable-?*) eval $(echo "$opt" | sed 's/--/action=/;s/-/ option=/;s/-/_/g') @@ -1460,7 +1479,7 @@ fi tmpfile(){ tmp=$(mktemp -u "${TMPDIR}/ffconf.XXXXXXXX")$2 && (set -C; exec > $tmp) 2>/dev/null || - die "Unable to create temoporary file in $TMPDIR." + die "Unable to create temporary file in $TMPDIR." append TMPFILES $tmp eval $1=$tmp } @@ -1494,10 +1513,16 @@ filter_cflags=echo filter_cppflags=echo filter_asflags=echo -if $cc --version 2>/dev/null | grep -qi gcc; then +if $cc -v 2>&1 | grep -qi ^gcc; then cc_type=gcc + if ! $cc -dumpversion | grep -q '^2\.'; then + CC_DEPFLAGS='-MMD -MF $(@:.o=.d) -MT $@' + AS_DEPFLAGS='-MMD -MF $(@:.o=.d) -MT $@' + fi elif $cc --version 2>/dev/null | grep -q Intel; then cc_type=icc + CC_DEPFLAGS='-MMD' + AS_DEPFLAGS='-MMD' elif $cc -v 2>&1 | grep -q xlc; then cc_type=xlc elif $cc -V 2>/dev/null | grep -q Compaq; then @@ -1516,17 +1541,19 @@ elif $cc --vsn 2>/dev/null | grep -q RVCT; then die "Error creating armcc configuration file." cc="$cc --arm_linux_config_file=$armcc_conf --translate_gcc" as_default="${cross_prefix}gcc" + CC_DEPFLAGS='-MMD' + AS_DEPFLAGS='-MMD' elif $cc -version 2>/dev/null | grep -q TMS470; then cc_type=tms470 cc="$cc --gcc --abi=eabi -eo=.o -mc -me" CC_O='-fr=$(@D)' as_default="${cross_prefix}gcc" ld_default="${cross_prefix}gcc" - dep_cc_default="${cross_prefix}gcc" TMPO=$(basename $TMPC .c).o append TMPFILES $TMPO add_cflags -D__gnuc_va_list=va_list -D__USER_LABEL_PREFIX__= - DEPFLAGS='$(CPPFLAGS) -MM' + CC_DEPFLAGS='-ppa -ppd=$(@:.o=.d)' + AS_DEPFLAGS='-MMD' filter_cflags=tms470_flags tms470_flags(){ for flag; do @@ -1560,6 +1587,9 @@ test -n "$cc_type" && enable $cc_type || echolog "Unknown C compiler $cc" : ${ld_default:=$cc} set_default as dep_cc ld +test -n "$CC_DEPFLAGS" || CCDEP=$DEPEND_CMD +test -n "$AS_DEPFLAGS" || ASDEP=$DEPEND_CMD + add_cflags $extra_cflags add_asflags $extra_cflags @@ -1576,6 +1606,22 @@ if test -n "$sysroot"; then esac fi +if test "$cpu" = host; then + enabled cross_compile && die "--cpu=host makes no sense when cross-compiling." + + case "$cc_type" in + gcc) + check_native(){ + $cc $1=native -v -c -o $TMPO $TMPC >$TMPE 2>&1 || return + awk "/$1=/{ match(\$0, /$1=(\\w+)/, a);print a[1];exit }" $TMPE + } + cpu=$(check_native -march || check_native -mcpu) + ;; + esac + + test "${cpu:-host}" = host && die "--cpu=host not supported with compiler $cc" +fi + # Add processor-specific flags case $cpu in 601|ppc601|PowerPC601) @@ -1646,6 +1692,22 @@ case $cpu in mips*|[45]k*|[237]4k*|m4k|r*000|loongson2[ef]) cpuflags="-march=$cpu" ;; + ap7[02]0[0-2]) + subarch="avr32_ap" + cpuflags="-mpart=$cpu" + ;; + ap) + subarch="avr32_ap" + cpuflags="-march=$cpu" + ;; + uc3[ab]*) + subarch="avr32_uc" + cpuflags="-mcpu=$cpu" + ;; + uc) + subarch="avr32_uc" + cpuflags="-march=$cpu" + ;; generic) ;; *) @@ -1683,6 +1745,7 @@ case "$arch" in arch="alpha" enable fast_64bit check_cflags -mieee + spic=$shared ;; arm|armv[4567]*l) arch="arm" @@ -1695,24 +1758,29 @@ case "$arch" in ia64) arch="ia64" enable fast_64bit + spic=$shared ;; m68k) arch="m68k" ;; mips|mipsel|IP*) arch="mips" + spic=$shared ;; mips64) arch="mips" subarch="mips64" enable fast_64bit + spic=$shared ;; parisc|hppa) arch="parisc" + spic=$shared ;; parisc64|hppa64) arch="parisc" enable fast_64bit + spic=$shared ;; "Power Macintosh"|ppc|powerpc) arch="ppc" @@ -1732,11 +1800,13 @@ case "$arch" in ;; sparc) arch="sparc" + spic=$shared ;; sun4u|sparc64) arch="sparc" subarch="sparc64" enable fast_64bit + spic=$shared ;; i386|i486|i586|i686|i86pc|BePC) arch="x86" @@ -1749,7 +1819,7 @@ case "$arch" in enable cmov enable fast_cmov enable fast_unaligned - check_cc <= 65" || die "ERROR: libx264 version must be >= 0.65."; } enabled libxvid && require libxvid xvid.h xvid_global -lxvidcore @@ -2205,18 +2298,6 @@ if enabled libdc1394; then die "ERROR: No version of libdc1394 found " fi - -_restrict= -for restrict_keyword in restrict __restrict__ __restrict; do - check_cc < #include #include @@ -2293,7 +2374,7 @@ check_header dev/ic/bt8xx.h check_header sys/soundcard.h check_header soundcard.h -enabled alsa_indev || enabled alsa_outdev && check_lib2 alsa/asoundlib.h snd_pcm_htimestamp -lasound +enabled_any alsa_indev alsa_outdev && check_lib2 alsa/asoundlib.h snd_pcm_htimestamp -lasound enabled jack_indev && check_lib2 jack/jack.h jack_client_open -ljack @@ -2303,7 +2384,7 @@ check_header X11/extensions/XShm.h && check_func XOpenDisplay -lX11 && check_func XShmCreateImage -lX11 -lXext -enabled debug && add_cflags -g"$debuglevel" +enabled debug && add_cflags -g"$debuglevel" && add_asflags -g"$debuglevel" # add some useful compiler flags if supported check_cflags -Wdeclaration-after-statement @@ -2368,16 +2449,6 @@ elif enabled gcc; then check_cflags -fno-tree-vectorize fi -# PIC flags for shared library objects where they are needed -if enabled shared; then - # LIBOBJFLAGS may have already been set in the OS configuration - if test -z "$LIBOBJFLAGS" ; then - case "${subarch-$arch}" in - x86_64|ia64|alpha|sparc*|power*|parisc*|mips*) LIBOBJFLAGS='$(PIC)' ;; - esac - fi -fi - if enabled gprof; then add_cflags -p add_ldflags -p @@ -2567,8 +2638,6 @@ echo "LDFLAGS=$LDFLAGS" >> config.mak echo "FFSERVERLDFLAGS=$FFSERVERLDFLAGS" >> config.mak echo "SHFLAGS=$SHFLAGS" >> config.mak echo "YASMFLAGS=$YASMFLAGS" >> config.mak -echo "LIBOBJFLAGS=$LIBOBJFLAGS" >> config.mak -echo "BUILD_STATIC=$static" >> config.mak echo "BUILDSUF=$build_suffix" >> config.mak echo "FULLNAME=$FULLNAME" >> config.mak echo "LIBPREF=$LIBPREF" >> config.mak @@ -2578,8 +2647,11 @@ echo "SLIBPREF=$SLIBPREF" >> config.mak echo "SLIBSUF=$SLIBSUF" >> config.mak echo "EXESUF=$EXESUF" >> config.mak echo "EXTRA_VERSION=$extra_version" >> config.mak -echo "DEPEND_CMD=$DEPEND_CMD" >> config.mak echo "DEPFLAGS=$DEPFLAGS" >> config.mak +echo "CCDEP=$CCDEP" >> config.mak +echo "ASDEP=$ASDEP" >> config.mak +echo "CC_DEPFLAGS=$CC_DEPFLAGS" >> config.mak +echo "AS_DEPFLAGS=$AS_DEPFLAGS" >> config.mak echo "HOSTCC=$host_cc" >> config.mak echo "HOSTCFLAGS=$host_cflags" >> config.mak echo "HOSTEXESUF=$HOSTEXESUF" >> config.mak @@ -2588,11 +2660,6 @@ echo "HOSTLIBS=$host_libs" >> config.mak echo "TARGET_EXEC=$target_exec" >> config.mak echo "TARGET_PATH=$target_path" >> config.mak -if enabled bigendian; then - echo "WORDS_BIGENDIAN=yes" >> config.mak - echo "#define WORDS_BIGENDIAN 1" >> $TMPH -fi - if enabled sdl; then echo "SDL_LIBS=$("${SDL_CONFIG}" --libs)" >> config.mak echo "SDL_CFLAGS=$("${SDL_CONFIG}" --cflags)" >> config.mak @@ -2620,8 +2687,6 @@ get_version LIBAVUTIL libavutil/avutil.h get_version LIBAVFILTER libavfilter/avfilter.h if enabled shared; then - echo "BUILD_SHARED=yes" >> config.mak - echo "PIC=-fPIC -DPIC" >> config.mak echo "LIBTARGET=${LIBTARGET}" >> config.mak echo "SLIBNAME=${SLIBNAME}" >> config.mak echo "SLIBNAME_WITH_VERSION=${SLIBNAME_WITH_VERSION}" >> config.mak @@ -2654,7 +2719,7 @@ print_config CONFIG_ $TMPH config.mak $CONFIG_LIST \ echo "#define restrict $_restrict" >> $TMPH -if enabled small; then +if enabled small || disabled optimizations; then echo "#define av_always_inline" >> $TMPH fi @@ -2679,25 +2744,15 @@ if enabled source_path_used; then DIRS="\ doc \ libavcodec \ - libavcodec/alpha \ - libavcodec/arm \ - libavcodec/bfin \ - libavcodec/mlib \ - libavcodec/ppc \ - libavcodec/sh4 \ - libavcodec/sparc \ - libavcodec/x86 \ + libavcodec/$arch \ libavdevice \ libavfilter \ libavformat \ libavutil \ + libavutil/$arch \ libpostproc \ libswscale \ - libswscale/bfin \ - libswscale/mlib \ - libswscale/ppc \ - libswscale/sparc \ - libswscale/x86 \ + libswscale/$arch \ tests \ tools \ "