aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Almer <jamrial@gmail.com>2017-11-11 11:40:06 -0300
committerJames Almer <jamrial@gmail.com>2017-11-11 13:15:42 -0300
commit98a9b1f0de0b05e5b48cd938ee63498107975973 (patch)
tree2277a70fefb507e22f0b6abd6ebd22f0ed4271df
parentc14f8125a8930ed6b2d4fc138273ee9dc17c05f6 (diff)
parentaccb06120c13a4ead442464d96f2fa318fa07a4e (diff)
downloadffmpeg-98a9b1f0de0b05e5b48cd938ee63498107975973.tar.gz
Merge commit 'accb06120c13a4ead442464d96f2fa318fa07a4e'
* commit 'accb06120c13a4ead442464d96f2fa318fa07a4e': configure: Use dllexport/dllimport for data symbols across DLLs with mingw Merged-by: James Almer <jamrial@gmail.com>
-rwxr-xr-xconfigure20
-rw-r--r--libavcodec/internal.h2
-rw-r--r--libavutil/internal.h2
3 files changed, 12 insertions, 12 deletions
diff --git a/configure b/configure
index 50443c0401..f9a27b5019 100755
--- a/configure
+++ b/configure
@@ -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
diff --git a/libavcodec/internal.h b/libavcodec/internal.h
index 522032b108..d47ce0e93d 100644
--- a/libavcodec/internal.h
+++ b/libavcodec/internal.h
@@ -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
diff --git a/libavutil/internal.h b/libavutil/internal.h
index c4bf1466ef..fef5089097 100644
--- a/libavutil/internal.h
+++ b/libavutil/internal.h
@@ -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