X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=configure;h=847fd03828cc2c6cde5a05d42654da56416b8c92;hb=36a12218dbaa51acb246377433f4bfbb6a0c1cce;hp=ba5796eaf40b35f318aad6808502877605326b25;hpb=a1ef9f08ecc699c1feca71883ca48ecfc57b45b7;p=ffmpeg diff --git a/configure b/configure index ba5796eaf40..847fd03828c 100755 --- a/configure +++ b/configure @@ -81,21 +81,18 @@ show_help(){ echo " --disable-ffplay disable ffplay build" echo " --disable-ffserver disable ffserver build" echo " --enable-postproc enable GPLed postprocessing support [no]" - echo " --enable-swscale enable GPLed software scaler support [no]" - echo " --enable-avfilter video filter support (replaces vhook) [no]" + echo " --enable-avfilter video filter support [no]" echo " --enable-avfilter-lavf video filters dependent on avformat [no]" - echo " --disable-vhook disable video hooking support" echo " --enable-beosthreads use BeOS threads [no]" echo " --enable-os2threads use OS/2 threads [no]" echo " --enable-pthreads use pthreads [no]" echo " --enable-w32threads use Win32 threads [no]" echo " --enable-x11grab enable X11 grabbing [no]" - echo " --enable-vdpau enable VDPAU support [no]" echo " --disable-network disable network support [no]" echo " --disable-ipv6 disable IPv6 support [no]" echo " --disable-mpegaudio-hp faster (but less accurate) MPEG audio decoding [no]" echo " --enable-gray enable full grayscale support (slower color)" - echo " --enable-fastdiv enable table-based division" + echo " --disable-fastdiv disable table-based division" echo " --enable-small optimize for size instead of speed" echo " --disable-aandct disable AAN DCT code" echo " --disable-fft disable FFT code" @@ -174,10 +171,13 @@ show_help(){ echo " --source-path=PATH path to source code [$source_path]" echo " --cross-prefix=PREFIX use PREFIX for compilation tools [$cross_prefix]" echo " --enable-cross-compile assume a cross-compiler is used" + echo " --sysroot=PATH root of cross-build tree" + echo " --sysinclude=PATH location of cross-build system headers" echo " --target-os=OS compiler targets OS [$target_os]" echo " --target-exec=CMD command to run executables on target" echo " --target-path=DIR path to view of build directory on target" echo " --nm=NM use nm tool" + echo " --as=AS use assembler AS [$as_default]" echo " --cc=CC use C compiler CC [$cc_default]" echo " --host-cc=HOSTCC use host C compiler HOSTCC" echo " --host-cflags=HCFLAGS use HCFLAGS when compiling for host" @@ -255,7 +255,6 @@ Include the log file "$logfile" produced by configure as this will help solving the problem. EOF fi - rm -f $TMPC $TMPE $TMPH $TMPO $TMPS $TMPSH exit 1 } @@ -323,6 +322,14 @@ disable_weak(){ set_weak no $* } +enable_safe(){ + enable $(echo "$*" | sed 's/[^A-Za-z0-9_ ]/_/g') +} + +disable_safe(){ + disable $(echo "$*" | sed 's/[^A-Za-z0-9_ ]/_/g') +} + do_enable_deep(){ for var; do enabled $var && continue @@ -433,7 +440,7 @@ print_config(){ makefile=$3 shift 3 for cfg; do - ucname="`toupper $cfg`" + ucname="$(toupper $cfg)" if enabled $cfg; then echo "#define ${pfx}${ucname} 1" >> $header echo "${pfx}${ucname}=yes" >> $makefile @@ -517,12 +524,19 @@ check_cpp(){ check_cmd $cc $CFLAGS "$@" -E -o $TMPO $TMPC } +check_as(){ + log check_as "$@" + cat > $TMPC + log_file $TMPC + check_cmd $as $CFLAGS "$@" -c -o $TMPO $TMPC +} + check_asm(){ log check_asm "$@" name="$1" asm="$2" shift 2 - check_cc "$@" < int x; EOF @@ -594,7 +607,7 @@ check_func_headers(){ incs="$incs #include <$hdr>" done - check_ld "$@" < $tmp) 2>/dev/null || + die "Unable to create temoporary file in $TMPDIR." + append TMPFILES $tmp + eval $1=$tmp +} + +trap 'rm -f -- $TMPFILES' EXIT +trap exit HUP INT TERM + +tmpfile TMPC .c +tmpfile TMPE $EXESUF +tmpfile TMPH .h +tmpfile TMPO .o +tmpfile TMPS .S +tmpfile TMPSH .sh + +unset -f mktemp # make sure we can execute files in $TMPDIR cat > $TMPSH 2>> $logfile </dev/null | grep -qi gcc; then + cc_type=gcc +elif $cc --version 2>/dev/null | grep -q Intel; then + cc_type=icc +elif $cc -v 2>&1 | grep -q xlc; then + cc_type=xlc +elif $cc -V 2>/dev/null | grep -q Compaq; then + cc_type=ccc + DEPEND_CMD='$(CC) $(CFLAGS) -M $< | sed -e "/^\#.*/d" -e "s,^[[:space:]]*$(*F)\\.o,$(@D)/$(*F).o,"' + debuglevel=3 + add_ldflags -Wl,-z,now # calls to libots crash without this +elif $cc --vsn 2>/dev/null | grep -q RVCT; then + test -d "$sysroot" || die "No valid sysroot specified." + cc_type=armcc + armcc_conf="$PWD/armcc.conf" + $cc --arm_linux_configure \ + --arm_linux_config_file="$armcc_conf" \ + --configure_sysroot="$sysroot" \ + --configure_cpp_headers="$sysinclude" >>$logfile 2>&1 || + die "Error creating armcc configuration file." + cc="$cc --arm_linux_config_file=$armcc_conf --translate_gcc" + as_default="${cross_prefix}gcc" +fi + +test -n "$cc_type" && enable $cc_type || echolog "Unknown C compiler $cc" + +set_default as + +if test -n "$sysroot"; then + case "$cc_type" in + gcc) + add_cflags --sysroot="$sysroot" + add_ldflags --sysroot="$sysroot" + ;; + esac +fi # compiler sanity check check_exec < +EOF +check_cc -D_LARGEFILE_SOURCE < +EOF case "$arch" in - i386|i486|i586|i686|i86pc|BePC) - arch="x86" - subarch="x86_32" - enable fast_unaligned - ;; - x86_64|amd64) - arch="x86" - subarch="x86_32" - enable cmov - enable fast_cmov - enable fast_unaligned - check_cc <&1 | grep -q xlc; then + if enabled xlc; then add_cflags -qpdf2 -qlanglvl=extc99 -qmaxmem=-1 -qarch=auto -qtune=auto else add_cflags -pipe @@ -1749,7 +1808,7 @@ if test $cpu != "generic"; then add_cflags -mcpu=$cpu ;; ev4|ev45|ev5|ev56|pca56|ev6|ev67) - add_cflags -mcpu=$cpu + enabled ccc && add_cflags -arch $cpu || add_cflags -mcpu=$cpu ;; *) echo "WARNING: Unknown CPU \"$cpu\", ignored." @@ -1763,7 +1822,9 @@ EOF sym=$($nm -P -g $TMPO | grep ff_extern) extern_prefix=${sym%%ff_extern*} -check_asm inline_asm '""' +check_cc < /dev/null 2>&1; then - sdl_cflags=`"${SDL_CONFIG}" --cflags` + sdl_cflags=$("${SDL_CONFIG}" --cflags) temp_cflags $sdl_cflags - temp_extralibs `"${SDL_CONFIG}" --libs` + temp_extralibs $("${SDL_CONFIG}" --libs) if check_lib2 SDL.h SDL_Init; then - _sdlversion=`"${SDL_CONFIG}" --version | sed 's/[^0-9]//g'` + _sdlversion=$("${SDL_CONFIG}" --version | sed 's/[^0-9]//g') if test "$_sdlversion" -lt 121 ; then enable sdl_too_old else @@ -2074,7 +2120,6 @@ check_header dev/ic/bt8xx.h check_header sys/soundcard.h check_header soundcard.h -check_header alsa/asoundlib.h && check_lib2 alsa/asoundlib.h snd_pcm_htimestamp -lasound # deal with the X11 frame grabber @@ -2110,9 +2155,11 @@ if enabled small; then check_cflags -Os # not all compilers support -Os optimizations="small" elif enabled optimizations; then - if $cc -v 2>&1 | grep -q xlc; then + if enabled xlc; then add_cflags -O5 add_ldflags -O5 + elif enabled ccc; then + add_cflags -fast else add_cflags -O3 fi @@ -2121,19 +2168,27 @@ check_cflags -fno-math-errno check_cflags -fno-signed-zeros # add some flags for Intel C Compiler -if $cc --version 2> /dev/null | grep -q Intel; then - # Just warnings, no remarks - check_cflags -w1 - # -wd: Disable following warnings - # 144, 167, 556: -Wno-pointer-sign - # 10006: ignoring unknown option -fno-signed-zeros - # 10156: ignoring option '-W'; no argument required - check_cflags -wd144,167,556,10006,10156 - # 11030: Warning unknown option --as-needed - # 10156: ignoring option '-export'; no argument required - check_ldflags -wd10156,11030 - # Allow to compile with optimizations - check_ldflags -march=$cpu +if enabled icc; then + # Just warnings, no remarks + check_cflags -w1 + # -wd: Disable following warnings + # 144, 167, 556: -Wno-pointer-sign + # 10006: ignoring unknown option -fno-signed-zeros + # 10156: ignoring option '-W'; no argument required + check_cflags -wd144,167,556,10006,10156 + # 11030: Warning unknown option --as-needed + # 10156: ignoring option '-export'; no argument required + check_ldflags -wd10156,11030 + # Allow to compile with optimizations + check_ldflags -march=$cpu +elif enabled ccc; then + # disable some annoying warnings + add_cflags -msg_disable cvtu32to64 + add_cflags -msg_disable embedcomment + add_cflags -msg_disable needconstext + add_cflags -msg_disable nomainieee + add_cflags -msg_disable ptrmismatch1 + add_cflags -msg_disable unreachcode fi # PIC flags for shared library objects where they are needed @@ -2151,8 +2206,6 @@ if enabled gprof; then add_ldflags -p fi -VHOOKCFLAGS="-fPIC" - # Find out if the .align argument is a power of two or not. check_asm asmalign_pot '".align 3"' @@ -2235,14 +2288,8 @@ echo "optimizations ${optimizations-no}" echo "static ${static-no}" echo "shared ${shared-no}" echo "postprocessing support ${postproc-no}" -echo "software scaler enabled ${swscale-no}" echo "new filter support ${avfilter-no}" echo "filters using lavformat ${avfilter_lavf-no}" -echo "video hooking ${vhook-no}" -if enabled vhook; then - echo "Imlib2 support ${imlib2-no}" - echo "FreeType support ${freetype2-no}" -fi echo "network support ${network-no}" if enabled network; then echo "IPv6 support ${ipv6-no}" @@ -2271,7 +2318,6 @@ echo "libtheora enabled ${libtheora-no}" echo "libvorbis enabled ${libvorbis-no}" echo "libx264 enabled ${libx264-no}" echo "libxvid enabled ${libxvid-no}" -echo "vdpau enabled ${vdpau-no}" echo "zlib enabled ${zlib-no}" echo "bzlib enabled ${bzlib-no}" echo @@ -2312,6 +2358,7 @@ echo "BINDIR=\$(DESTDIR)$bindir" >> config.mak echo "DATADIR=\$(DESTDIR)$datadir" >> config.mak echo "MANDIR=\$(DESTDIR)$mandir" >> config.mak echo "CC=$cc" >> config.mak +echo "AS=$as" >> config.mak echo "YASM=$yasmexe" >> config.mak echo "AR=$ar" >> config.mak echo "RANLIB=$ranlib" >> config.mak @@ -2321,13 +2368,10 @@ enabled stripping && echo "STRIP=echo ignoring strip" >> config.mak echo "OPTFLAGS=$CFLAGS" >> config.mak -echo "VHOOKCFLAGS=$VHOOKCFLAGS" >> config.mak echo "LDFLAGS=$LDFLAGS" >> config.mak echo "FFSERVERLDFLAGS=$FFSERVERLDFLAGS" >> config.mak echo "SHFLAGS=$SHFLAGS" >> config.mak echo "YASMFLAGS=$YASMFLAGS" >> config.mak -echo "VHOOKSHFLAGS=$VHOOKSHFLAGS" >> config.mak -echo "VHOOKLIBS=$VHOOKLIBS" >> config.mak echo "LIBOBJFLAGS=$LIBOBJFLAGS" >> config.mak echo "BUILD_STATIC=$static" >> config.mak echo "BUILDSUF=$build_suffix" >> config.mak @@ -2342,6 +2386,7 @@ echo "EXTRA_VERSION=$extra_version" >> config.mak echo "DEPEND_CMD=$DEPEND_CMD" >> config.mak echo "HOSTCC=$host_cc" >> config.mak echo "HOSTCFLAGS=$host_cflags" >> config.mak +echo "HOSTEXESUF=$HOSTEXESUF" >> config.mak echo "HOSTLDFLAGS=$host_ldflags" >> config.mak echo "HOSTLIBS=$host_libs" >> config.mak echo "TARGET_EXEC=$target_exec" >> config.mak @@ -2353,8 +2398,8 @@ if enabled bigendian; then fi if enabled sdl; then - echo "SDL_LIBS=`"${SDL_CONFIG}" --libs`" >> config.mak - echo "SDL_CFLAGS=`"${SDL_CONFIG}" --cflags`" >> config.mak + echo "SDL_LIBS=$("${SDL_CONFIG}" --libs)" >> config.mak + echo "SDL_CFLAGS=$("${SDL_CONFIG}" --cflags)" >> config.mak fi if enabled texi2html; then echo "BUILD_DOC=yes" >> config.mak @@ -2434,8 +2479,6 @@ cmp -s $TMPH config.h && echo "config.h is unchanged" || mv -f $TMPH config.h -rm -f $TMPC $TMPE $TMPH $TMPO $TMPS $TMPSH - # build tree in object directory if source path is different from current one if enabled source_path_used; then DIRS="\ @@ -2457,7 +2500,6 @@ if enabled source_path_used; then libswscale \ tests \ tools \ - vhook \ " FILES="\ Makefile \ @@ -2530,9 +2572,4 @@ enabled avfilter && pkgconfig_generate libavfilter "FFmpeg video filtering library" "$LIBAVFILTER_VERSION" "$extralibs" "libavutil = $LIBAVUTIL_VERSION" enabled postproc && pkgconfig_generate libpostproc "FFmpeg post processing library" "$LIBPOSTPROC_VERSION" -if enabled swscale; then - pkgconfig_generate libswscale "FFmpeg image rescaling library" "$LIBSWSCALE_VERSION" "" "libavutil = $LIBAVUTIL_VERSION" -else - pkgconfig_generate libswscale "FFmpeg image rescaling library" "$LIBSWSCALE_VERSION" "" "libavcodec = $LIBAVCODEC_VERSION" - apply libswscale/libswscale.pc sed s/^Libs:.*$/Libs:/ -fi +pkgconfig_generate libswscale "FFmpeg image rescaling library" "$LIBSWSCALE_VERSION" "" "libavutil = $LIBAVUTIL_VERSION"