Commit 98a9b1f0 authored by James Almer's avatar James Almer

Merge commit 'accb0612'

* commit 'accb0612':
  configure: Use dllexport/dllimport for data symbols across DLLs with mingw
Merged-by: 's avatarJames Almer <jamrial@gmail.com>
parents c14f8125 accb0612
......@@ -5038,6 +5038,10 @@ case $target_os in
if enabled x86_64; then
LIBTARGET="i386:x86-64"
fi
if enabled shared; then
# Cannot build both shared and static libs when using dllexport.
disable static
fi
enabled shared && ! enabled small && check_cmd $windres --version && enable gnu_windres
enabled x86_32 && check_ldflags -Wl,--large-address-aware
shlibdir_default="$bindir_default"
......@@ -5045,21 +5049,15 @@ case $target_os in
SLIBSUF=".dll"
SLIBNAME_WITH_VERSION='$(SLIBPREF)$(FULLNAME)-$(LIBVERSION)$(SLIBSUF)'
SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(FULLNAME)-$(LIBMAJOR)$(SLIBSUF)'
dlltool="${cross_prefix}dlltool"
if check_cmd lib.exe -list; then
SLIB_EXTRA_CMD=-'sed -e "s/ @[^ ]*//" $$(@:$(SLIBSUF)=.orig.def) > $$(@:$(SLIBSUF)=.def); lib.exe -nologo -machine:$(LIBTARGET) -def:$$(@:$(SLIBSUF)=.def) -out:$(SUBDIR)$(SLIBNAME:$(SLIBSUF)=.lib)'
if enabled x86_64; then
LIBTARGET=x64
fi
elif check_cmd $dlltool --version; then
SLIB_EXTRA_CMD=-'sed -e "s/ @[^ ]*//" $$(@:$(SLIBSUF)=.orig.def) > $$(@:$(SLIBSUF)=.def); $(DLLTOOL) -m $(LIBTARGET) -d $$(@:$(SLIBSUF)=.def) -l $(SUBDIR)$(SLIBNAME:$(SLIBSUF)=.lib) -D $(SLIBNAME_WITH_MAJOR)'
fi
SLIB_EXTRA_CMD=-'$(DLLTOOL) -m $(LIBTARGET) -d $$(@:$(SLIBSUF)=.def) -l $(SUBDIR)$(SLIBNAME:$(SLIBSUF)=.lib) -D $(SLIBNAME_WITH_MAJOR)'
SLIB_INSTALL_NAME='$(SLIBNAME_WITH_MAJOR)'
SLIB_INSTALL_LINKS=
SLIB_INSTALL_EXTRA_SHLIB='$(SLIBNAME:$(SLIBSUF)=.lib)'
SLIB_INSTALL_EXTRA_LIB='lib$(SLIBNAME:$(SLIBSUF)=.dll.a) $(SLIBNAME_WITH_MAJOR:$(SLIBSUF)=.def)'
SHFLAGS='-shared -Wl,--output-def,$$(@:$(SLIBSUF)=.orig.def) -Wl,--out-implib,$(SUBDIR)lib$(SLIBNAME:$(SLIBSUF)=.dll.a) -Wl,--enable-runtime-pseudo-reloc -Wl,--disable-auto-image-base'
SLIB_CREATE_DEF_CMD='ARCH="$(ARCH)" AR="$(AR_CMD)" NM="$(NM_CMD)" $(SRC_PATH)/compat/windows/makedef $(SUBDIR)lib$(NAME).ver $(OBJS) > $$(@:$(SLIBSUF)=.def)'
SHFLAGS='-shared -Wl,--out-implib,$(SUBDIR)lib$(SLIBNAME:$(SLIBSUF)=.dll.a) -Wl,--disable-auto-image-base $$(@:$(SLIBSUF)=.def)'
enabled x86_64 && objformat="win64" || objformat="win32"
dlltool="${cross_prefix}dlltool"
ranlib=:
enable dos_paths
check_ldflags -Wl,--nxcompat,--dynamicbase
......@@ -6931,6 +6929,8 @@ DEPX86ASMFLAGS=\$(X86ASMFLAGS)
AR=$ar
ARFLAGS=$arflags
AR_O=$ar_o
AR_CMD=$ar
NM_CMD=$nm
RANLIB=$ranlib
STRIP=$strip
STRIPTYPE=$striptype
......
......@@ -414,7 +414,7 @@ int ff_alloc_a53_sei(const AVFrame *frame, size_t prefix_len,
*/
int64_t ff_guess_coded_bitrate(AVCodecContext *avctx);
#if defined(_MSC_VER) && CONFIG_SHARED
#if defined(_WIN32) && CONFIG_SHARED
#ifdef BUILDING_avcodec
# define av_export_avcodec __declspec(dllexport)
#else
......
......@@ -63,7 +63,7 @@
#endif
#endif
#if defined(_MSC_VER) && CONFIG_SHARED
#if defined(_WIN32) && CONFIG_SHARED
#ifdef BUILDING_avutil
# define av_export_avutil __declspec(dllexport)
#else
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment