Martin Storsjö <[email protected]> writes:

> diff --git a/configure b/configure
> index b30d69b..b70b1ec 100755
> --- a/configure
> +++ b/configure
> @@ -2794,6 +2794,20 @@ case $target_os in
>          add_cppflags -U__STRICT_ANSI__
>          ;;
>      win32|win64)
> +        # Link to the import library instead of the normal static library for
> +        # shared libs.
> +        enabled shared && LD_LIB='%.lib'
> +        shlibdir_default="$bindir_default"
> +        SLIBPREF=""
> +        SLIBSUF=".dll"
> +        
> SLIBNAME_WITH_VERSION='$(SLIBPREF)$(FULLNAME)-$(LIBVERSION)$(SLIBSUF)'
> +        SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(FULLNAME)-$(LIBMAJOR)$(SLIBSUF)'
> +        SLIB_CREATE_DEF_CMD='makedef $(SUBDIR)lib$(NAME).ver $(OBJS) > 
> $$(@:$(SLIBSUF)=.def)'
> +        SLIB_INSTALL_NAME='$(SLIBNAME_WITH_MAJOR)'
> +        SLIB_INSTALL_LINKS=
> +        SLIB_INSTALL_EXTRA_SHLIB='$(SLIBNAME:$(SLIBSUF)=.lib)'
> +        SLIB_INSTALL_EXTRA_LIB='$(SLIBNAME_WITH_MAJOR:$(SLIBSUF)=.def)'
> +        SHFLAGS='-dll -def:$$(@:$(SLIBSUF)=.def) 
> -implib:$(SUBDIR)$(SLIBNAME:$(SLIBSUF)=.lib)'
>          objformat="win32"
>          ranlib=:
>          enable dos_paths

This is looking reasonable.

> @@ -2930,6 +2944,9 @@ build the shared libraries as well. To only build the 
> shared libraries specify
>  EOF
>      exit 1;
>  fi
> +if enabled_all msvc static shared; then
> +    die "Cannot build shared and static libraries at the same time with 
> MSVC."
> +fi

Another idea is to simply disable static if shared is enabled.  That way
users can simply configure --enable-shared and save some pointless typing.

> +#if CONFIG_SHARED && defined(_WIN32) && !defined(COMPILING_avcodec)
> +#define avcodec_exportdata __declspec(dllimport)
> +#else
> +#define avcodec_exportdata
> +#endif

I want to think about this some more.

> diff --git a/library.mak b/library.mak
> index b365935..56a4586 100644
> --- a/library.mak
> +++ b/library.mak
> @@ -33,6 +33,7 @@ install-libs-$(CONFIG_STATIC): install-lib$(NAME)-static
>  install-libs-$(CONFIG_SHARED): install-lib$(NAME)-shared
>
>  define RULES
> +$(OBJS): CPPFLAGS += -DCOMPILING_$(NAME)=1
>  $(EXAMPLES) $(TOOLS): THISLIB = $(FULLNAME:%=$(LD_LIB))
>  $(TESTPROGS):         THISLIB = $(SUBDIR)$(LIBNAME)

This could use a blank line.

-- 
Måns Rullgård
[email protected]
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to