* commit '4db96649ca700db563d9da4ebe70bf9fc4c7a6ba':
avutil: Ensure that emms_c is always defined, even on non-x86
configure: Move MinGW CPPFLAGS setting to libc section, where it belongs
avutil: Move emms code to x86-specific header
Conflicts:
configure
libavutil/internal.h
Merged-by: Michael Niedermayer <michaelni@gmx.at>
* commit '56dea32f09e71460add14a1b6d0fbe6eb16f02a4':
doc: developer: Fix wording in "naming conventions" section
openbsd: Add minor number to shared library install name
Conflicts:
doc/developer.texi
Merged-by: Michael Niedermayer <michaelni@gmx.at>
* commit '304b806cb524fb040f8e09a241040f1af2cb820b':
build: Make library minor version visible in the Makefile
x86: mpeg4qpel: Make movsxifnidn do the right thing
Merged-by: Michael Niedermayer <michaelni@gmx.at>
* commit '620289a20e022b9c16c10d546ef86cc0bb77cc84':
sh4: Fix silly type vs. variable name search and replace typo
configure: Group all hwaccels together in a separate variable
Add av_cold attributes to arch-specific init functions
Conflicts:
configure
libavcodec/arm/mpegvideo_armv5te.c
libavcodec/x86/mlpdsp.c
libavcodec/x86/motion_est.c
libavcodec/x86/mpegvideoenc.c
libavcodec/x86/videodsp_init.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
* qatar/master:
x86: hpel: Move {avg,put}_pixels16_sse2 to hpeldsp
configure: Add a comment indicating why uclibc is checked before glibc
Merged-by: Michael Niedermayer <michaelni@gmx.at>
On Cygwin systems MinGW headers can be present if the corresponding
packages have been installed. Since the MinGW libc is checked for
first, this results in newlib getting misdetected as MinGW libc.
* commit '2c10e2a2f62477efaef5b641974594f7df4ca339':
build: Make the H.264 parser select h264qpel
x86: h264qpel: add cpu flag checks for init function
Conflicts:
libavcodec/x86/h264_qpel.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Previously PIC was enabled as a magic workaround for binaries that
built fine, but failed to function at all. This problem no longer
exists, possibly since the introduction of symbol versioning.
The function is known to be missing in at least one target (MSVC).
Signed-off-by: James Almer <jamrial@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Barcelona/amdfam10 does not support SSE4 instructions.
Also, Bulldozer supports AVX instructions, so use them instead.
Signed-off-by: James Almer <jamrial@gmail.com>
Reviewed-by: Carl Eugen Hoyos <cehoyos@ag.or.at>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* commit 'ef5d41a5534b65f03d02f2e11a503ab8416bfc3b':
x86inc: Rename "program_name" to "private_prefix"
configure: Run SHFLAGS through ldflags_filter()
Conflicts:
configure
Merged-by: Michael Niedermayer <michaelni@gmx.at>
These flags are as linker-specific as other LDFLAGS and thus
need to be translated to the correct linker syntax.
Signed-off-by: Diego Biurrun <diego@biurrun.de>
icc should not complain when 2 enum values are combined (for example when
used as flags)
Adding casts to suppress these would not help code quality
Reviewed-by: Carl Eugen Hoyos <cehoyos@ag.or.at>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* commit '0eecafc948b74c247ebbc59f18f508db5d590d0b':
configure: Make the new srtp protocol depend on the rtp protocol
lavf: Add a fate test for the SRTP functions
lavu: Add a fate test for the HMAC API
Merged-by: Michael Niedermayer <michaelni@gmx.at>
* commit 'd8c772de53d29afb1bada88afa859fce8489c668':
nutdec: Always return a value from nut_read_timestamp()
configure: Make warnings from -Wreturn-type fatal errors
x86: ABS2: port to cpuflags
vdpau: Remove av_unused attribute from function declaration
h264: fix ff_generate_sliding_window_mmcos() prototype.
Conflicts:
configure
libavformat/nutdec.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
* commit '5e753ed502d3597077d8675ca1438e1bcade1459':
suncc: Replace more GCC flags by their equivalents in suncc_flags()
libtheoraenc: fix granularity of video quality
oggparsetheora: fix comment header parsing
h264: don't clobber mmco opcode tables for non-first slice headers.
Conflicts:
libavcodec/h264_refs.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
* commit '3f111804eb5c603a344706b84b7164cbf7b4e0df':
libvpx: make vp8 and vp9 selectable
libvpx: support vp9
nut: support vp9 tag
mkv: support vp9 tag
rtpdec: Make variables that should wrap unsigned
Conflicts:
configure
libavcodec/Makefile
libavcodec/allcodecs.c
libavcodec/avcodec.h
Merged-by: Michael Niedermayer <michaelni@gmx.at>
* qatar/master:
configure: enable pic for shared libs on AArch64
zmbv: Reset the decoder on keyframe errors
Merged-by: Michael Niedermayer <michaelni@gmx.at>
This is a port of virtual dub's histogram equalization filter by Donald
A. Graft. Based on the work by Jérémy Tran <tran.jeremy.av@gmail.com>,
done for SOCIS 2012.
This is a port of the kerndeint filter (libmpcodecs/vf_kerndeint) by
Donal A. Graft (original avisynth plugin author), and is based on the
work by Jérémy Tran <tran.jeremy.av@gmail.com> done for SOCIS 2012.
Also fixes linking in various configs with only individual parts enabled
because the RTP muxer chaining code depends on the general RTP code,
which is now accounted for.
Ported from MPlayer. Original author is A'rpi, with various
contributions from Michael Niedermayer. The original documentation was
mostly written by Diego Biurrun. See the MPlayer history for full
credits.
The filter is under GPL like the original filter, even if it differs
quite a lot. There is not much point in making it LGPL since pp is under
GPL.
Beginning with version 1.5.1 openjpeg defaults to install its headers to
/usr/include/openjpeg-${major}.${minor} instead of /usr/include without
providing a compatibility symlink making the old test fail.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Move some functions from dsputil. The idea is that videodsp contains
functions that are useful for a large and varied set of video decoders.
Currently, it contains emulated_edge_mc() and prefetch().
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* qatar/master:
configure: formatting cosmetics
h264: use mbaff ref indices in fill_colmap() only for mbaff references
Conflicts:
libavcodec/h264_direct.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
* commit 'b8f3ab8e6a7ce3627764da53b809628c828d4047':
ac3dec: output planar float only
svq3: make slice type value unsigned to match svq3_get_ue_golomb return type
configure: Have protocols select network code instead of depending on it
Conflicts:
libavcodec/svq3.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
This fixes the automatic use of $foo_extralibs when feature foo
is enabled indirectly through a _select or _suggest.
Signed-off-by: Mans Rullgard <mans@mansr.com>
This fixes the automatic use of $foo_extralibs when feature foo
is enabled indirectly through a _select or _suggest.
Signed-off-by: Mans Rullgard <mans@mansr.com>
* commit '096abfa15052977eed93f0b5e01afd2d47c53c1f':
parser: fix large overreads
bitstream: add get_bits64() to support reading more than 32 bits at once
arm: detect cpu features at runtime on Linux
Conflicts:
libavcodec/parser.c
libavformat/mpegts.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
* commit '7f2b3dcabd108926bde819ad574017f4161d1546':
configure: arm: check inline and external asm support for extensions
Merged-by: Michael Niedermayer <michaelni@gmx.at>
* commit 'c6ebc9faa2210d7f36a3036c357f6f199520f575':
configure: add check_insn function
configure: clean up check_inline_asm and check_as functions
Merged-by: Michael Niedermayer <michaelni@gmx.at>
* commit 'f0fe245bc31cf4fa3b3ed0240cd1ab6f0d5043ea':
configure: arm: set fast_clz and fast_unaligned in cpuflags section
Merged-by: Michael Niedermayer <michaelni@gmx.at>
* commit '9ebd45c2d58ad9241ad09718679f0cf7fb57da52':
configure: do not bypass cpuflags section if --cpu not given
dct-test: arm: indicate required cpu features for optimised funcs
snow: fix build after 594d4d5df3
arm: fix use of uninitialised value in ff_fft_fixed_init_arm()
avpicture: Don't assume a valid pix fmt in avpicture_get_size
Conflicts:
libavcodec/avpicture.c
libavcodec/snow.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
This is consistent with usual ARM nomenclature as well as with the
VFPV3 and NEON symbols which both lack the ARM prefix.
Signed-off-by: Mans Rullgard <mans@mansr.com>
This allows compiling optimised functions for features not enabled
in the core build and selecting these at runtime if the system has
the necessary support.
Signed-off-by: Mans Rullgard <mans@mansr.com>
This tests instruction set support in both inline and external asm.
If both fail, the base config option is disabled.
Signed-off-by: Mans Rullgard <mans@mansr.com>
The check_insn function tests an instruction in both inline asm and
standalone assembly, and sets _external/_inline config properties
accordingly.
Signed-off-by: Mans Rullgard <mans@mansr.com>
These are properties of the targeted core and do not depend on
specific assembly support in the toolchain which if missing will
render the controlling options here disabled.
Signed-off-by: Mans Rullgard <mans@mansr.com>
Probe for the toolchain default architecture version if no --cpu flag
is present or an unknown cpu is specified. Works with gcc, clang and
armcc.
This allows configuring based on the arch version even if it is not
explicitly specified to configure. It also causes an explicit -march
flag to be added to CFLAGS and ASFLAGS, which in turn lets us do
proper instruction set tests with the assembler.
Signed-off-by: Mans Rullgard <mans@mansr.com>
This will allow arch-specific ways of determining the target
variant when none is specified on the command line.
Signed-off-by: Mans Rullgard <mans@mansr.com>
The check_inline_asm function should check the actual C compiler,
not the one used for assembly files. Usually these are the same,
but they might be different, typically when using a compiler other
than gcc.
The check_as should, as its name suggests, test the type of input
the AS command is used with, i.e. a standalond assembly (.S) file.
Finally, check for gnu assembler using the modified check_as as
this reflects actual usage.
Signed-off-by: Mans Rullgard <mans@mansr.com>
* qatar/master:
ppc: always use pic for shared libraries
build: cosmetics: Move CONFIG_RTPDEC entry to a more suitable place
fate: ea, h264: prettyprinting and ordering cosmetics
Conflicts:
tests/fate/ea.mak
tests/fate/h264.mak
Merged-by: Michael Niedermayer <michaelni@gmx.at>
The detection detects the default but not if it even works.
Check building a simple piece of code and disable thumb if it fails
This fixes a compile failure
If someone has a better idea, just replace this by it!
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* qatar/master:
configure: Strip ordinals from mingw generated def files
configure: arm: detect default thumb state of compiler
Conflicts:
configure
Merged-by: Michael Niedermayer <michaelni@gmx.at>
The def files are used for generating import libraries for
other toolchains (in particular, for generating import libraries
for MSVC for DLLs built with mingw).
The def files produced by mingw/gcc contains ordinals for each
exported function. When MSVC tools generate import libraries
from such a def file, MSVC links to the DLL by the ordinals
instead of linking by name.
Since the def files aren't maintained by hand, the ordinal
numbers are assigned (more or less) randomly and any caller
linking to the libs by ordinals will break as soon as the libraries
export more/fewer functions.
Therefore, strip out the ordinals from the generated def files,
to make users link to the libraries by name.
Callers linking to the DLLs using the gcc provided import library
link by name as they should.
Signed-off-by: Martin Storsjö <martin@martin.st>
* qatar/master:
fate: fft: Fix libavcodec dependency
build: Make the ISMV muxer select the MOV muxer
configure: move arm arch extensions to a separate variable
Conflicts:
configure
Merged-by: Michael Niedermayer <michaelni@gmx.at>
* qatar/master:
configure: Use headers in the check for _beginthreadex for w32threads
avutil: Use a configure check to enable windows console functions
avutil: Include io.h with a separate condition from windows console functions
Conflicts:
libavutil/log.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
When targeting the metro API subset, this function still exists in
the link libraries, but is excluded from the headers. This makes
sure w32threads is automatically disabled when targeting this API
subset (since not all the necessary functions for it are available).
Signed-off-by: Martin Storsjö <martin@martin.st>
* qatar/master:
avutil: Include io.h with a separate condition from MapViewOfFile
cmdutils: Use a configure check for enabling CommandLineToArgvW
Merged-by: Michael Niedermayer <michaelni@gmx.at>
This simplifies the condition to avoid hardcoding the systems
where the function exists. This also simplifies support for
newer Windows API subsets where this function doesn't exist,
such as Windows Phone 8 and the "metro" API subset of Windows 8.
Signed-off-by: Martin Storsjö <martin@martin.st>
This makes sure minimal configurations such as
"--disable-everything --enable-avconv" will enable the filters
necessary for running avconv, instead of just keeping avconv
disabled (even if the user specified "--enable-avconv").
Signed-off-by: Martin Storsjö <martin@martin.st>
* commit '3c370f5abc55739a261534b9f9bdc739cedbbbb9':
riff: only warn on a bad INFO chunk code size instead of failing
configure: Add separate list for libraries and use where appropriate
x86: float_dsp: add SSE version of vector_fmul_scalar()
Conflicts:
configure
libavformat/riff.c
libavutil/x86/float_dsp.asm
Merged-by: Michael Niedermayer <michaelni@gmx.at>
GCC does not appear to have a -march= string for Westmere, which is a
bit surprising as it has a few more instructions than a Nehalem, but
a few less than a Sandy Bridge.
Signed-off-by: Diego Biurrun <diego@biurrun.de>
This is useful for debugging. Dependencies for these files are not
generated due to limitations in many compilers.
Signed-off-by: Mans Rullgard <mans@mansr.com>
* commit '1c5805521c3e406886341d752ebf38f8d41e1d13':
PGS subtitles: Set AVSubtitle pts value
configure: Refactor CPPFLAGS settings for glibc/uclibc
configure: add basic support for ARM AArch64
build: set -U__STRICT_ANSI__ for newlib
Conflicts:
configure
libavcodec/pgssubdec.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
* qatar/master:
x86: lavr: fix stack allocation for 7 and 8 channel downmixing on x86-32
lavr: fix the decision for writing directly to the output buffer
parisc: work around bug in gcc 4.3 and later
Merged-by: Michael Niedermayer <michaelni@gmx.at>
This is (erroneously) required to enable various things in the
newlib headers. As cygwin uses newlib, it is covered by this.
Signed-off-by: Mans Rullgard <mans@mansr.com>
A bug in tail call optimisation in gcc 4.3 and later on parisc causes
numerous tests to fail. Disabling this optimisation gives a working
build. See http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55023
Signed-off-by: Mans Rullgard <mans@mansr.com>
* commit 'bf5f46b4cc47b7a4568119f224057d4ff91b6cdd':
APIChanges: add entry for av_read_packet deprecation
mxfdec: fix typo in mxf_read_seek()
avserver: use freopen to redirect stdin/out/err to /dev/null
avserver: remove daemon mode
configure: Check for -Werror parameters on clang
doxygen: remove obsolete options from Doxyfile
configure: Add option to disable all command line programs
Conflicts:
Changelog
configure
doc/APIchanges
doc/ffserver.conf
doc/ffserver.texi
ffserver.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
* commit '3b4296f41473a5b39e84d7a49d480624c9c60040':
avformat: clarify stream id for muxing
fate: Add dependencies for aac, alac, amrnb, amrwb, atrac tests
ppc: do not pass redundant compiler flags
avutil: change GET_UTF8 to not use av_log2()
segment: fix NULL pointer dereference in seg_write_header()
Conflicts:
tests/fate/aac.mak
Merged-by: Michael Niedermayer <michaelni@gmx.at>
The -mpowerpc64 and -mpowerpc-gfxopt flags are implicitly set by
-mcpu as needed. Passing them explicitly is redundant and can
conflict with user-supplied flags.
Signed-off-by: Mans Rullgard <mans@mansr.com>
* commit 'ef1b23ad21e3f12fc4ff2a73a6d4d4cd9d630c4b': (21 commits)
jvdec: set channel layout
iss: set channel layout
ipmovie: set channel layout
iff: set channel layout
idroqdec: set channel layout
gxfdec: set channel layout when applicable
gsmdec: set channel layout
flvdec: set channel layout
dv: set channel layout
dsicin: set channel layout
daud: set channel layout
cdxl: set channel layout
bmv: set channel layout
bink: set channel layout
bfi: set channel layout
bethsoftvid: set channel layout
apc: set channel layout
amr: set channel_layout
ppc: replace pointer casting with AV_COPY32
ppc: fix some unused variable warnings
...
Conflicts:
libavformat/amr.c
libavformat/iff.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
All modern assemblers have this capability. Older NASM versions
that lack the capability produce code that crashes at runtime,
so it's better to error out during the build process instead.
CC: libav-stable@libav.org
Do not quote second argument to filter{,_out} in check_ld. We want to keep/remove all the space-separated words matching the -l* pattern, not keep everything if the whole argument begins with -l and remove it otherwise.
This also fixes errors like:
./configure: eval: line 418: syntax error near unexpected token `-l*'
./configure: eval: line 418: `case in -l*) ;; *) echo ;; esac'
when run with ./configure --enable-openal
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Some awk versions do not treat the result of unary + on a (numeric)
string as numeric, giving wrong results when used in a boolean context
Using unary - instead is logically equivalent works as expected.
Signed-off-by: Mans Rullgard <mans@mansr.com>
* qatar/master:
pixfmt: support more yuva formats
swscale: support gray to 9bit and 10bit formats
configure: rewrite print_config() function using awk
FATE: fix (AD)PCM test dependencies broken in e519990
Use ptrdiff_t instead of int for intra pred "stride" function parameter.
x86: use PRED4x4/8x8/8x8L/16x16 macros to declare intrapred prototypes.
Conflicts:
libavcodec/h264pred.c
libavcodec/h264pred_template.c
libavutil/pixfmt.h
libswscale/swscale_unscaled.c
tests/ref/lavfi/pixdesc
tests/ref/lavfi/pixfmts_copy
tests/ref/lavfi/pixfmts_null
tests/ref/lavfi/pixfmts_scale
tests/ref/lavfi/pixfmts_vflip
Merged-by: Michael Niedermayer <michaelni@gmx.at>
* commit '14f031d7ecfabba0ef02776d4516aa3dcb7c40d8':
dv: use AVStream.index instead of abusing AVStream.id
lavfi: add ashowinfo filter
avcodec: Add a RFC 3389 comfort noise codec
lpc: Add a function for calculating reflection coefficients from samples
lpc: Add a function for calculating reflection coefficients from autocorrelation coefficients
lavr: document upper bound on number of output samples.
lavr: add general API usage doxy
indeo3: remove duplicate capabilities line.
fate: ac3: Add dependencies
Conflicts:
Changelog
doc/filters.texi
libavcodec/Makefile
libavcodec/allcodecs.c
libavcodec/avcodec.h
libavcodec/codec_desc.c
libavcodec/version.h
libavfilter/Makefile
libavfilter/af_ashowinfo.c
libavfilter/allfilters.c
libavfilter/version.h
libavutil/avutil.h
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Some awk versions do not treat the result of unary + on a (numeric)
string as numeric, giving wrong results when used in a boolean context
Using unary - instead is logically equivalent works as expected.
Signed-off-by: Mans Rullgard <mans@mansr.com>
This isn't too useful as a normal codec, but can be used in
voip style applications. The decoder updates the noise
generator parameters when a packet is given to it for decoding,
but if called with an empty packet, it generates more noise
according to the last parameters.
Signed-off-by: Martin Storsjö <martin@martin.st>
* qatar/master:
configure: fix tests for 2-arg math functions
doc: git-howto: Clarify comment about pushing series of commits
ivi_common: Drop unused function parameter from decode_band()
cook: Remove some silly Doxygen comments
cook: Remove senseless maybe_reformat_buffer32() function
cook: cosmetics: Better names for joint_decode() function parameters
cook: cosmetics: Better name for ccpl COOKSubpacket member
doxygen: Add av_alloc_size to list of predefined macros
doxygen: Drop some pointless entries from PREDEFINED macros list
h263: avoid memcpys over array bound in motion vector caching for obmc
Conflicts:
configure
doc/git-howto.texi
libavcodec/cook.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
* qatar/master:
configure: sanitise sparc vis check
configure: recognise more sparc variants as --cpu argument
build: Include HEADERS-yes in the HEADERS variable
pcm: change references to raw to pcm
ffv1: set the range coder state in decode_slice_header
pcmdec: change default of channels parameter to 1
Conflicts:
libavformat/pcmdec.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
* commit '0c03cc68386443f1e96ab6fb358220faf67cd5ff':
mp3: exit on parsing error in mp_decode_frame
rtmppkt: Avoid unescaped backslash in Doxygen comment
fate-lavfi: replace sed/grep/cut combos with awk
build: Plan 9 support
Conflicts:
configure
tests/lavfi-regression.sh
Merged-by: Michael Niedermayer <michaelni@gmx.at>
* commit '80521c1997a23e148edf89e11b939ab8646297ca':
build: allow targets to specify extra objects to link with executables
swscale: avoid pointless use of compound literals
libm: add fallbacks for various single-precision functions
network: use getservbyport() only if available
network: add fallbacks for INADDR_LOOPBACK and INET_ADDRSTRLEN
Include sys/time.h before sys/resource.h
Conflicts:
Makefile
configure
libavutil/libm.h
Merged-by: Michael Niedermayer <michaelni@gmx.at>
This adds support for building on Plan 9 x86-32. The compat/plan9
directory contains these items:
- replacements for the 'head' and 'printf' shell commands
- wrapper for main() to disable FPU exceptions
Larger required changes to the system are described in the
documentation.
Signed-off-by: Mans Rullgard <mans@mansr.com>
This allows targets to include special objects when linking
executables without including them in (shared) libraries.
Signed-off-by: Mans Rullgard <mans@mansr.com>
The absence of this function will only give a less informative
string back from our fallback implementation of getnameinfo().
Signed-off-by: Mans Rullgard <mans@mansr.com>
* qatar/master:
configure: Group math functions into a separate variable
avutil/mem: K&R formatting cosmetics
avutil/lzo: K&R formatting cosmetics
Conflicts:
configure
libavutil/mem.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
* commit '1cd432e167b1a80853760c89a33606e2b5f229c2':
configure: fix libcdio check
rtsp: Allow setting the reordering buffer size via an AVOption
rtsp: Vertically align a constant definition
rtp: Update the check for distinguishing between RTP and RTCP
aac: fix build with hardcoded tables
fate: dependencies for screen codec tests
riff: Move functions around to be covered by appropriate #ifdefs
Conflicts:
configure
tests/fate/screen.mak
Merged-by: Michael Niedermayer <michaelni@gmx.at>
* commit 'c0329748b04e1f175dad8c9c2ebf22a5e2dc5b72':
fate: add a dependency helper macro
Add support for building shared libraries with MSVC
avcodec: Rename avpriv_frame_rate_tab to ff_mpeg12_frame_rate_tab
gxf: Add a local copy of the relevant parts of the frame rate table
configure: Split out msvc as a separate target OS
aviobuf: Remove a senseless ifdef in avio_seek
Conflicts:
configure
libavcodec/dirac.c
libavcodec/mpeg12data.h
libavcodec/mpeg12enc.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
This requires the makedef perl script by Derek, from the
c89-to-c99 repo. That scripts produces a .def file, listing
the symbols to be exported, based on the gcc version scripts
and the built object files.
To properly load non-function symbols from DLL files, the
data symbol declarations need to have the attribute
__declspec(dllimport) when building the calling code. (On mingw,
the linker can fix this up automatically, which is why it has not
been an issue so far. If this attribute is omitted, linking
actually succeeds, but reads from the table will not produce the
desired results at runtime.)
MSVC seems to manage to link DLLs (and run properly) even if
this attribute is present while building the library itself
(which normally isn't recommended) - other object files in the
same library manage to link to the symbol (with a small warning
at link time, like "warning LNK4049: locally defined symbol
_avpriv_mpa_bitrate_tab imported" - it doesn't seem to be possible
to squelch this warning), and the definition of the tables
themselves produce a warning that can be squelched ("warning C4273:
'avpriv_mpa_bitrate_tab' : inconsistent dll linkage, see previous
definition of 'avpriv_mpa_bitrate_tab').
In this setup, mingw isn't able to link object files that refer to
data symbols with __declspec(dllimport) without those symbols
actually being linked via a DLL (linking avcodec.dll ends up with
errors like "undefined reference to `__imp__avpriv_mpa_freq_tab'").
The dllimport declspec isn't needed at all in mingw, so we simply
choose not to declare it for other compilers than MSVC that requires
it. (If ICL support later requires it, the condition can be extended
later to include both of them.)
This also implies that code that is built to link to a certain
library as a DLL can't link to the same library as a static library.
Therefore, we only allow building either static or shared but not
both at the same time. (That is, static libraries as such can be,
and actually are, built - this is used for linking the test tools to
internal symbols in the libraries - but e.g. libavformat built to
link to libavcodec as a DLL cannot link statically to libavcodec.)
Also, linking to DLLs is slightly different from linking to shared
libraries on other platforms. DLLs use a thing called import
libraries, which is basically a stub library allowing the linker
to know which symbols exist in the DLL and what name the DLL will
have at runtime.
In mingw/gcc, the import library is usually named libfoo.dll.a,
which goes next to a static library named libfoo.a. This allows
gcc to pick the dynamic one, if available, from the normal -lfoo
switches, just as it does for libfoo.a vs libfoo.so on Unix. On
MSVC however, you need to literally specify the name of the import
library instead of the static library.
Signed-off-by: Martin Storsjö <martin@martin.st>
The name mingw32 as target OS is both misleading, and very little
of the target OS specific settings actually match.
Since the target OS default is set based on uname, the default
(which on MSYS is set to mingw) is overridden by --toolchain=msvc.
Signed-off-by: Martin Storsjö <martin@martin.st>
* qatar/master:
mips64: mark hi/lo registers clobbered in MAC64/MLS64 macros
fate: list lavfi tests in a makefile
Conflicts:
configure
tests/Makefile
Merged-by: Michael Niedermayer <michaelni@gmx.at>
* commit '36ac9a16a19a365ce58cc871484c20cffe9b6401':
fate: dependencies for seek tests
fate: handle lavf test dependencies entirely in make
Conflicts:
configure
tests/Makefile
Merged-by: Michael Niedermayer <michaelni@gmx.at>