X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=configure;h=b3d99a135bf037301e882da2367cbb0b04784c9e;hb=51135d1d8e113aef5dbafd578460daeb92972c7f;hp=77e148cad37ea36e0957365c192ea12d6771b52c;hpb=647c2356a603c12a8cf54a63a121e29ef68e3b53;p=ffmpeg diff --git a/configure b/configure index 77e148cad37..b3d99a135bf 100755 --- a/configure +++ b/configure @@ -99,6 +99,7 @@ show_help(){ echo " --disable-aandct disable AAN DCT code" echo " --disable-fft disable FFT code" echo " --disable-golomb disable Golomb code" + echo " --disable-lpc disable LPC code" echo " --disable-mdct disable MDCT code" echo " --disable-rdft disable RDFT code" echo " --disable-vaapi disable VAAPI code" @@ -221,6 +222,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 +292,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 @@ -513,15 +523,15 @@ append(){ } add_cppflags(){ - append CPPFLAGS "$@" + append CPPFLAGS $($filter_cppflags "$@") } add_cflags(){ - append CFLAGS "$@" + append CFLAGS $($filter_cflags "$@") } add_asflags(){ - append ASFLAGS "$@" + append ASFLAGS $($filter_asflags "$@") } add_ldflags(){ @@ -563,7 +573,8 @@ check_asm(){ name="$1" asm="$2" shift 2 - check_as "$@" < $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 } @@ -1476,20 +1514,35 @@ EOF die "Sanity test failed." fi -if $cc --version 2>/dev/null | grep -qi gcc; then +filter_cflags=echo +filter_cppflags=echo +filter_asflags=echo + +if $cc -v 2>&1 | grep -qi ^gcc; then cc_type=gcc + cc_version=__VERSION__ + 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_version="AV_STRINGIFY(__INTEL_COMPILER)" + CC_DEPFLAGS='-MMD' + AS_DEPFLAGS='-MMD' elif $cc -v 2>&1 | grep -q xlc; then cc_type=xlc + cc_version="AV_STRINGIFY(__IBMC__)" elif $cc -V 2>/dev/null | grep -q Compaq; then cc_type=ccc + cc_version="AV_STRINGIFY(__DECC_VER)" DEPFLAGS='$(CPPFLAGS) $(CFLAGS) -M' debuglevel=3 add_ldflags -Wl,-z,now # calls to libots crash without this -elif $cc --vsn 2>/dev/null | grep -q RVCT; then +elif $cc --vsn 2>/dev/null | grep -q "ARM C/C++ Compiler"; then test -d "$sysroot" || die "No valid sysroot specified." cc_type=armcc + cc_version="AV_STRINGIFY(__ARMCC_VERSION)" armcc_conf="$PWD/armcc.conf" $cc --arm_linux_configure \ --arm_linux_config_file="$armcc_conf" \ @@ -1498,6 +1551,49 @@ 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_version="AV_STRINGIFY(__TI_COMPILER_VERSION__)" + cc="$cc --gcc --abi=eabi -eo=.o -mc -me" + CC_O='-fr=$(@D)' + as_default="${cross_prefix}gcc" + ld_default="${cross_prefix}gcc" + TMPO=$(basename $TMPC .c).o + append TMPFILES $TMPO + add_cflags -D__gnuc_va_list=va_list -D__USER_LABEL_PREFIX__= + CC_DEPFLAGS='-ppa -ppd=$(@:.o=.d)' + AS_DEPFLAGS='-MMD' + filter_cflags=tms470_flags + tms470_flags(){ + for flag; do + case $flag in + -march=*|-mcpu=*) + case "${flag#*=}" in + armv7-a|cortex-a*) echo -mv=7a8 ;; + armv7-r|cortex-r*) echo -mv=7r4 ;; + armv7-m|cortex-m*) echo -mv=7m3 ;; + armv6*|arm11*) echo -mv=6 ;; + armv5*e|arm[79]*e*|arm9[24]6*|arm96*|arm102[26]) + echo -mv=5e ;; + armv4*|arm7*|arm9[24]*) echo -mv=4 ;; + esac + ;; + -mfpu=neon) echo --float_support=vfpv3 --neon ;; + -mfpu=vfp) echo --float_support=vfpv2 ;; + -msoft-float) echo --float_support=vfplib ;; + -Os) echo -O3 -mf=2 ;; + -O[0-3]) echo $flag -mf=5 ;; + -g) echo -g -mn ;; + esac + done + } +elif $cc -v 2>&1 | grep -q clang; then + cc_type=clang + cc_version=__VERSION__ + CC_DEPFLAGS='-MMD' + AS_DEPFLAGS='-MMD' fi test -n "$cc_type" && enable $cc_type || echolog "Unknown C compiler $cc" @@ -1507,6 +1603,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 @@ -1516,9 +1615,129 @@ if test -n "$sysroot"; then add_cppflags --sysroot="$sysroot" add_ldflags --sysroot="$sysroot" ;; + tms470) + add_cppflags -I"$sysinclude" + add_ldflags --sysroot="$sysroot" + ;; + clang) + add_cppflags -isysroot="$sysroot" + add_ldflags -isysroot="$sysroot" + ;; 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) + cpuflags="-mcpu=601" + ;; + 603*|ppc603*|PowerPC603*) + cpuflags="-mcpu=603" + ;; + 604*|ppc604*|PowerPC604*) + cpuflags="-mcpu=604" + ;; + G3|g3|75*|ppc75*|PowerPC75*) + cpuflags="-mcpu=750 -mpowerpc-gfxopt" + ;; + G4|g4|745*|ppc745*|PowerPC745*) + cpuflags="-mcpu=7450 -mpowerpc-gfxopt" + ;; + 74*|ppc74*|PowerPC74*) + cpuflags="-mcpu=7400 -mpowerpc-gfxopt" + ;; + G5|g5|970|ppc970|PowerPC970|power4*|Power4*) + cpuflags="-mcpu=970 -mpowerpc-gfxopt -mpowerpc64" + ;; + Cell|CELL|cell) + cpuflags="-mcpu=cell" + enable ldbrx + ;; + # targets that do NOT support conditional mov (cmov) + i[345]86|pentium|pentium-mmx|k6|k6-[23]|winchip-c6|winchip2|c3) + cpuflags="-march=$cpu" + disable cmov + ;; + # targets that do support conditional mov (cmov) + i686|pentiumpro|pentium[23]|pentium-m|athlon|athlon-tbird|athlon-4|athlon-[mx]p|athlon64|k8|opteron|athlon-fx|core2|amdfam10) + cpuflags="-march=$cpu" + enable cmov + enable fast_cmov + ;; + # targets that do support conditional mov but on which it's slow + pentium4|pentium4m|prescott|nocona) + cpuflags="-march=$cpu" + enable cmov + disable fast_cmov + ;; + sparc64) + cpuflags="-mcpu=v9" + ;; + arm11*|cortex*) + cpuflags="-mcpu=$cpu" + enable fast_unaligned + ;; + armv[67]*) + cpuflags="-march=$cpu" + enable fast_unaligned + ;; + armv*) + cpuflags="-march=$cpu" + ;; + arm*) + cpuflags="-mcpu=$cpu" + ;; + ev4|ev45|ev5|ev56|pca56|ev6|ev67) + enabled ccc && cpuflags="-arch $cpu" || cpuflags="-mcpu=$cpu" + ;; + bf*) + cpuflags="-mcpu=$cpu" + ;; + 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) + ;; + *) + echo "WARNING: Unknown CPU \"$cpu\", ignored." + ;; +esac + +add_cflags $cpuflags +add_asflags $cpuflags + # compiler sanity check check_exec < @@ -1545,6 +1765,7 @@ case "$arch" in arch="alpha" enable fast_64bit check_cflags -mieee + spic=$shared ;; arm|armv[4567]*l) arch="arm" @@ -1557,24 +1778,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" @@ -1594,26 +1820,25 @@ 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" - subarch="x86_32" - enable fast_unaligned - ;; - x86_64|amd64) + i386|i486|i586|i686|i86pc|BePC|x86_64|amd64) arch="x86" subarch="x86_32" - enable cmov - enable fast_cmov enable fast_unaligned - check_cc < 3) || (__MINGW32_MAJOR_VERSION == 3 && __MINGW32_MINOR_VERSION >= 15)" || die "ERROR: MinGW runtime version must be >= 3.15." - enabled_any avisynth vfwcap_demuxer && + enabled_any avisynth vfwcap_indev && { check_cpp_condition w32api.h "(__W32API_MAJOR_VERSION > 3) || (__W32API_MAJOR_VERSION == 3 && __W32API_MINOR_VERSION >= 13)" || - die "ERROR: avisynth and vfwcap_demuxer require w32api version 3.13 or later."; } + die "ERROR: avisynth and vfwcap_indev require w32api version 3.13 or later."; } fi ;; cygwin*) @@ -1830,112 +2067,16 @@ enabled version3 && { enabled gpl && enable gplv3 || enable lgplv3; } check_deps $ARCH_EXT_LIST -test -z "$need_memalign" && need_memalign="$mmx" - -#Darwin CC versions -if test $target_os = darwin; then - if enabled xlc; then - add_cflags -qpdf2 -qlanglvl=extc99 -qmaxmem=-1 -qarch=auto -qtune=auto - else - add_cflags -pipe - check_cflags -force_cpusubtype_ALL - check_cflags -Wno-sign-compare - enabled shared || check_cflags -mdynamic-no-pic - fi -fi - disabled optimizations || check_cflags -fomit-frame-pointer -# Add processor-specific flags -if test $cpu != "generic"; then - warn_altivec(){ - $1 altivec && echo "WARNING: Tuning for $2 but AltiVec $1."; - } - case $cpu in - 601|ppc601|PowerPC601) - cpuflags="-mcpu=601" - warn_altivec enabled PPC601 - ;; - 603*|ppc603*|PowerPC603*) - cpuflags="-mcpu=603" - warn_altivec enabled PPC603 - ;; - 604*|ppc604*|PowerPC604*) - cpuflags="-mcpu=604" - warn_altivec enabled PPC604 - ;; - G3|g3|75*|ppc75*|PowerPC75*) - cpuflags="-mcpu=750 -mpowerpc-gfxopt" - warn_altivec enabled PPC75x - ;; - G4|g4|745*|ppc745*|PowerPC745*) - cpuflags="-mcpu=7450 -mpowerpc-gfxopt" - warn_altivec disabled PPC745x - ;; - 74*|ppc74*|PowerPC74*) - cpuflags="-mcpu=7400 -mpowerpc-gfxopt" - warn_altivec disabled PPC74xx - ;; - G5|g5|970|ppc970|PowerPC970|power4*|Power4*) - cpuflags="-mcpu=970 -mpowerpc-gfxopt -mpowerpc64" - warn_altivec disabled PPC970 - ;; - Cell|CELL|cell) - cpuflags="-mcpu=cell" - warn_altivec disabled Cell - enable ldbrx - ;; - # targets that do NOT support conditional mov (cmov) - i[345]86|pentium|pentium-mmx|k6|k6-[23]|winchip-c6|winchip2|c3) - cpuflags="-march=$cpu" - disable cmov - ;; - # targets that do support conditional mov (cmov) - i686|pentiumpro|pentium[23]|pentium-m|athlon|athlon-tbird|athlon-4|athlon-[mx]p|athlon64|k8|opteron|athlon-fx|core2) - cpuflags="-march=$cpu" - enable cmov - enable fast_cmov - ;; - # targets that do support conditional mov but on which it's slow - pentium4|pentium4m|prescott|nocona) - cpuflags="-march=$cpu" - enable cmov - disable fast_cmov - ;; - sparc64) - cpuflags="-mcpu=v9" - ;; - arm11*|cortex*) - cpuflags="-mcpu=$cpu" - enable fast_unaligned - ;; - armv[67]*) - cpuflags="-march=$cpu" - enable fast_unaligned - ;; - armv*) - cpuflags="-march=$cpu" - ;; - arm*) - cpuflags="-mcpu=$cpu" - ;; - ev4|ev45|ev5|ev56|pca56|ev6|ev67) - enabled ccc && cpuflags="-arch $cpu" || cpuflags="-mcpu=$cpu" - ;; - bf*) - cpuflags="-mcpu=$cpu" - ;; - mips*|[45]k*|[237]4k*|m4k|r*000|loongson2[ef]) - cpuflags="-march=$cpu" - ;; - *) - echo "WARNING: Unknown CPU \"$cpu\", ignored." - ;; - esac -fi +enable_pic() { + enable pic + add_cppflags -DPIC + add_cflags -fPIC + add_asflags -fPIC +} -add_cflags $cpuflags -add_asflags $cpuflags +enabled pic && enable_pic check_cc < -int main(void) { return ($func(3.999f) > 0)?0:1; } -EOF -done +check_func llrint +check_func log2 +check_func lrint +check_func lrintf +check_func round +check_func roundf +check_func truncf # these are off by default, so fail if requested and not available enabled avisynth && require2 vfw32 "windows.h vfw.h" AVIFileInit -lvfw32 enabled libdirac && add_cflags $(pkg-config --cflags dirac) && - require libdirac libdirac_decoder/dirac_parser.h dirac_decoder_init -ldirac_decoder && - require libdirac libdirac_encoder/dirac_encoder.h dirac_encoder_init -ldirac_encoder + require libdirac libdirac_decoder/dirac_parser.h dirac_decoder_init $(pkg-config --libs dirac) && + require libdirac libdirac_encoder/dirac_encoder.h dirac_encoder_init $(pkg-config --libs dirac) enabled libfaac && require2 libfaac "stdint.h faac.h" faacEncGetVersion -lfaac enabled libfaad && require2 libfaad faad.h faacDecOpen -lfaad enabled libgsm && require libgsm gsm.h gsm_create -lgsm @@ -2143,9 +2309,9 @@ enabled libschroedinger && add_cflags $(pkg-config --cflags schroedinger-1.0) && enabled libspeex && require libspeex speex/speex.h speex_decoder_init -lspeex enabled libtheora && require libtheora theora/theora.h theora_info_init -ltheora -logg enabled libvorbis && require libvorbis vorbis/vorbisenc.h vorbis_info_init -lvorbisenc -lvorbis -logg -enabled libx264 && require libx264 x264.h x264_encoder_open -lx264 -lm && - { check_cpp_condition x264.h "X264_BUILD >= 65" || - die "ERROR: libx264 version must be >= 0.65."; } +enabled libx264 && require libx264 x264.h x264_encoder_encode -lx264 -lm && + { check_cpp_condition x264.h "X264_BUILD >= 78" || + die "ERROR: libx264 version must be >= 0.78."; } enabled libxvid && require libxvid xvid.h xvid_global -lxvidcore enabled mlib && require mediaLib mlib_types.h mlib_VectorSub_S16_U8_Mod -lmlib @@ -2158,17 +2324,6 @@ if enabled libdc1394; then die "ERROR: No version of libdc1394 found " fi - -_restrict= -for restrict_keyword in restrict __restrict__ __restrict; do - check_cc < /dev/null 2>&1 && enable texi2html || disable texi2html -########################################## -# Network check - if enabled network; then check_type "sys/types.h sys/socket.h" socklen_t # Prefer arpa/inet.h over winsock2 if check_header arpa/inet.h ; then check_func closesocket elif check_header winsock2.h ; then - network_extralibs="-lws2_32" + check_func_headers winsock2.h closesocket -lws2 && \ + network_extralibs="-lws2" || \ + { check_func_headers winsock2.h closesocket -lws2_32 && \ + network_extralibs="-lws2_32"; } check_type ws2tcpip.h socklen_t - check_func_headers winsock2.h closesocket else disable network fi fi -########################################## -# IPv6 check - -enabled network && enabled ipv6 && check_ld < #include #include @@ -2249,18 +2400,17 @@ check_header dev/ic/bt8xx.h check_header sys/soundcard.h check_header soundcard.h -enabled alsa_demuxer || enabled alsa_muxer && 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_demuxer && check_lib2 jack/jack.h jack_client_open -ljack +enabled jack_indev && check_lib2 jack/jack.h jack_client_open -ljack -# deal with the X11 frame grabber enabled x11grab && check_header X11/Xlib.h && 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 @@ -2298,7 +2448,6 @@ fi check_cflags -fno-math-errno check_cflags -fno-signed-zeros -# add some flags for Intel C Compiler if enabled icc; then # Just warnings, no remarks check_cflags -w1 @@ -2322,16 +2471,10 @@ elif enabled ccc; then 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 -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 +elif enabled gcc; then + check_cflags -fno-tree-vectorize +elif enabled clang; then + check_cflags -Qunused-arguments fi if enabled gprof; then @@ -2349,8 +2492,8 @@ enabled_any $BSF_LIST && enable bsfs enabled_any $DEMUXER_LIST && enable demuxers enabled_any $MUXER_LIST && enable muxers enabled_any $FILTER_LIST && enable filters -enabled_any $INDEV_LIST && enable demuxers -enabled_any $OUTDEV_LIST && enable muxers +enabled_any $INDEV_LIST && enable indevs +enabled_any $OUTDEV_LIST && enable outdevs enabled_any $PROTOCOL_LIST && enable protocols enabled_any $THREADS_LIST && enable threads @@ -2483,12 +2626,6 @@ echo "License: $license" echo "Creating config.mak and config.h..." echo "# Automatically generated by configure - do not modify!" > config.mak -echo "/* Automatically generated by configure - do not modify! */" > $TMPH -echo "#ifndef FFMPEG_CONFIG_H" >> $TMPH -echo "#define FFMPEG_CONFIG_H" >> $TMPH -echo "#define FFMPEG_CONFIGURATION \"$(c_escape $FFMPEG_CONFIGURATION)\"" >> $TMPH -echo "#define FFMPEG_DATADIR \"$(eval c_escape $datadir)\"" >> $TMPH - echo "ifndef FFMPEG_CONFIG_MAK" >> config.mak echo "FFMPEG_CONFIG_MAK=1" >> config.mak @@ -2523,8 +2660,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 @@ -2534,8 +2669,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 @@ -2544,11 +2682,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 @@ -2576,8 +2709,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 @@ -2592,6 +2723,30 @@ echo "EXTRALIBS=$extralibs" >> config.mak echo "ARCH=$arch" >> config.mak + +echo "/* Automatically generated by configure - do not modify! */" > $TMPH +echo "#ifndef FFMPEG_CONFIG_H" >> $TMPH +echo "#define FFMPEG_CONFIG_H" >> $TMPH +echo "#define FFMPEG_CONFIGURATION \"$(c_escape $FFMPEG_CONFIGURATION)\"" >> $TMPH +echo "#define FFMPEG_DATADIR \"$(eval c_escape $datadir)\"" >> $TMPH + +echo "#define CC_TYPE \"$cc_type\"" >> $TMPH +echo "#define CC_VERSION $cc_version" >> $TMPH +echo "#define restrict $_restrict" >> $TMPH + +if enabled small || disabled optimizations; then + echo "#define av_always_inline" >> $TMPH +fi + + +# Apparently it's not possible to portably echo a backslash. +enabled asmalign_pot && + printf '#define ASMALIGN(ZEROBITS) ".align " #ZEROBITS "\\n\\t"\n' >> $TMPH || + printf '#define ASMALIGN(ZEROBITS) ".align 1 << " #ZEROBITS "\\n\\t"\n' >> $TMPH + +echo "#define EXTERN_PREFIX \"${extern_prefix}\"" >> $TMPH +echo "#define EXTERN_ASM ${extern_prefix}" >> $TMPH + print_config ARCH_ $TMPH config.mak $ARCH_LIST print_config HAVE_ $TMPH config.mak $HAVE_LIST print_config CONFIG_ $TMPH config.mak $CONFIG_LIST \ @@ -2608,20 +2763,6 @@ print_config CONFIG_ $TMPH config.mak $CONFIG_LIST \ $INDEV_LIST \ $OUTDEV_LIST \ -echo "#define restrict $_restrict" >> $TMPH - -if enabled small; then - echo "#define av_always_inline" >> $TMPH -fi - - -# Apparently it's not possible to portably echo a backslash. -enabled asmalign_pot && - printf '#define ASMALIGN(ZEROBITS) ".align " #ZEROBITS "\\n\\t"\n' >> $TMPH || - printf '#define ASMALIGN(ZEROBITS) ".align 1 << " #ZEROBITS "\\n\\t"\n' >> $TMPH - -echo "#define EXTERN_PREFIX \"${extern_prefix}\"" >> $TMPH - echo "#endif /* FFMPEG_CONFIG_H */" >> $TMPH echo "endif # FFMPEG_CONFIG_MAK" >> config.mak @@ -2632,44 +2773,34 @@ cmp -s $TMPH config.h && # build tree in object directory if source path is different from current one 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 \ - libavdevice \ - libavfilter \ - libavformat \ - libavutil \ - libpostproc \ - libswscale \ - libswscale/bfin \ - libswscale/mlib \ - libswscale/ppc \ - libswscale/sparc \ - libswscale/x86 \ - tests \ - tools \ - " - FILES="\ - Makefile \ - common.mak \ - subdir.mak \ - doc/texi2pod.pl \ - libavcodec/Makefile \ - libavdevice/Makefile \ - libavfilter/Makefile \ - libavformat/Makefile \ - libavutil/Makefile \ - libpostproc/Makefile \ - libswscale/Makefile \ - " + DIRS=" + doc + libavcodec + libavcodec/$arch + libavdevice + libavfilter + libavformat + libavutil + libavutil/$arch + libpostproc + libswscale + libswscale/$arch + tests + tools + " + FILES=" + Makefile + common.mak + subdir.mak + doc/texi2pod.pl + libavcodec/Makefile + libavdevice/Makefile + libavfilter/Makefile + libavformat/Makefile + libavutil/Makefile + libpostproc/Makefile + libswscale/Makefile + " for dir in $DIRS ; do mkdir -p $dir done @@ -2697,10 +2828,10 @@ includedir=$incdir Name: $name Description: $comment Version: $version -Requires: $(disabled shared && echo $requires) +Requires: $(enabled shared || echo $requires) Requires.private: $(enabled shared && echo $requires) Conflicts: -Libs: -L\${libdir} -l${shortname} $(disabled shared && echo $libs) +Libs: -L\${libdir} -l${shortname} $(enabled shared || echo $libs) Libs.private: $(enabled shared && echo $libs) Cflags: -I\${includedir} EOF