Use dlltools instead of lib.exe

Message ID 1300326977-7200-1-git-send-email-lu_zero@gentoo.org
State Committed
Commit ec10a9ab461b26b96eff7bbbb8623f42d8ee04ad
Headers show

Commit Message

Luca Barbato March 17, 2011, 1:56 a.m.
This way building ffmpeg on mingw won't require windows specific tools
---
 configure |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

Comments

Mans Rullgard March 17, 2011, 2:09 a.m. | #1
Luca Barbato <lu_zero@gentoo.org> writes:

> This way building ffmpeg on mingw won't require windows specific tools
> ---
>  configure |    4 +++-
>  1 files changed, 3 insertions(+), 1 deletions(-)
>
> diff --git a/configure b/configure
> index 4d308d2..7107187 100755
> --- a/configure
> +++ b/configure
> @@ -2417,7 +2417,7 @@ case $target_os in
>          SLIBSUF=".dll"
>          SLIBNAME_WITH_VERSION='$(SLIBPREF)$(FULLNAME)-$(LIBVERSION)$(SLIBSUF)'
>          SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(FULLNAME)-$(LIBMAJOR)$(SLIBSUF)'
> -        SLIB_EXTRA_CMD='-lib.exe /machine:$(LIBTARGET) /def:$$(@:$(SLIBSUF)=.def) /out:$(SUBDIR)$(SLIBNAME_WITH_MAJOR:$(SLIBSUF)=.lib)'
> +        SLIB_EXTRA_CMD=-'$(DLLTOOL) -m $(LIBTARGET) -d $$(@:$(SLIBSUF)=.def) -l $(SUBDIR)$(SLIBNAME_WITH_MAJOR:$(SLIBSUF)=.lib)'

Was it intentional to move the - outside the quotes?  It looks odd to me
even if the result should be the same.

>          SLIB_INSTALL_EXTRA_CMD='-install -m 644 $(SUBDIR)$(SLIBNAME_WITH_MAJOR:$(SLIBSUF)=.lib) "$(SHLIBDIR)/$(SLIBNAME:$(SLIBSUF)=.lib)"; \
>              install -m 644 $(SUBDIR)$(SLIBNAME_WITH_MAJOR:$(SLIBSUF)=.lib) "$(SHLIBDIR)/$(SLIBNAME_WITH_MAJOR:$(SLIBSUF)=.lib)"; \
>              install -d "$(LIBDIR)"; \
> @@ -2425,6 +2425,7 @@ case $target_os in
>          SLIB_UNINSTALL_EXTRA_CMD='rm -f "$(SHLIBDIR)/$(SLIBNAME:$(SLIBSUF)=.lib)"'
>          SHFLAGS='-shared -Wl,--output-def,$$(@:$(SLIBSUF)=.def) -Wl,--out-implib,$(SUBDIR)lib$(SLIBNAME:$(SLIBSUF)=.dll.a) -Wl,--enable-runtime-pseudo-reloc -Wl,--enable-auto-image-base'
>          objformat="win32"
> +        dlltool="${cross_prefix}dlltool"
>          enable dos_paths
>          check_cflags -fno-common
>          check_cpp_condition _mingw.h "defined (__MINGW64_VERSION_MAJOR) || (__MINGW32_MAJOR_VERSION > 3) \
> @@ -3234,6 +3235,7 @@ CPPFLAGS=$CPPFLAGS
>  CFLAGS=$CFLAGS
>  ASFLAGS=$ASFLAGS
>  CC_O=$CC_O
> +DLLTOOL=$dlltool
>  LDFLAGS=$LDFLAGS
>  FFSERVERLDFLAGS=$FFSERVERLDFLAGS
>  SHFLAGS=$SHFLAGS
> -- 
> 1.7.4.1

Looks OK otherwise, without verifying the command line syntax of dlltool.

Would there be a point to setting $dlltool the same way as the other
build tools?
Luca Barbato March 17, 2011, 2:18 a.m. | #2
On 03/17/2011 03:09 AM, Måns Rullgård wrote:
> Luca Barbato <lu_zero@gentoo.org> writes:
> 
>> This way building ffmpeg on mingw won't require windows specific tools
>> ---
>>  configure |    4 +++-
>>  1 files changed, 3 insertions(+), 1 deletions(-)
>>
>> diff --git a/configure b/configure
>> index 4d308d2..7107187 100755
>> --- a/configure
>> +++ b/configure
>> @@ -2417,7 +2417,7 @@ case $target_os in
>>          SLIBSUF=".dll"
>>          SLIBNAME_WITH_VERSION='$(SLIBPREF)$(FULLNAME)-$(LIBVERSION)$(SLIBSUF)'
>>          SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(FULLNAME)-$(LIBMAJOR)$(SLIBSUF)'
>> -        SLIB_EXTRA_CMD='-lib.exe /machine:$(LIBTARGET) /def:$$(@:$(SLIBSUF)=.def) /out:$(SUBDIR)$(SLIBNAME_WITH_MAJOR:$(SLIBSUF)=.lib)'
>> +        SLIB_EXTRA_CMD=-'$(DLLTOOL) -m $(LIBTARGET) -d $$(@:$(SLIBSUF)=.def) -l $(SUBDIR)$(SLIBNAME_WITH_MAJOR:$(SLIBSUF)=.lib)'
> 
> Was it intentional to move the - outside the quotes?  It looks odd to me
> even if the result should be the same.

I could drop the - since dlltool should be always present.

>>          SLIB_INSTALL_EXTRA_CMD='-install -m 644 $(SUBDIR)$(SLIBNAME_WITH_MAJOR:$(SLIBSUF)=.lib) "$(SHLIBDIR)/$(SLIBNAME:$(SLIBSUF)=.lib)"; \
>>              install -m 644 $(SUBDIR)$(SLIBNAME_WITH_MAJOR:$(SLIBSUF)=.lib) "$(SHLIBDIR)/$(SLIBNAME_WITH_MAJOR:$(SLIBSUF)=.lib)"; \
>>              install -d "$(LIBDIR)"; \
>> @@ -2425,6 +2425,7 @@ case $target_os in
>>          SLIB_UNINSTALL_EXTRA_CMD='rm -f "$(SHLIBDIR)/$(SLIBNAME:$(SLIBSUF)=.lib)"'
>>          SHFLAGS='-shared -Wl,--output-def,$$(@:$(SLIBSUF)=.def) -Wl,--out-implib,$(SUBDIR)lib$(SLIBNAME:$(SLIBSUF)=.dll.a) -Wl,--enable-runtime-pseudo-reloc -Wl,--enable-auto-image-base'
>>          objformat="win32"
>> +        dlltool="${cross_prefix}dlltool"
>>          enable dos_paths
>>          check_cflags -fno-common
>>          check_cpp_condition _mingw.h "defined (__MINGW64_VERSION_MAJOR) || (__MINGW32_MAJOR_VERSION > 3) \
>> @@ -3234,6 +3235,7 @@ CPPFLAGS=$CPPFLAGS
>>  CFLAGS=$CFLAGS
>>  ASFLAGS=$ASFLAGS
>>  CC_O=$CC_O
>> +DLLTOOL=$dlltool
>>  LDFLAGS=$LDFLAGS
>>  FFSERVERLDFLAGS=$FFSERVERLDFLAGS
>>  SHFLAGS=$SHFLAGS
>> -- 
>> 1.7.4.1
> 
> Looks OK otherwise, without verifying the command line syntax of dlltool.
> 
> Would there be a point to setting $dlltool the same way as the other
> build tools?

Not sure right now would be wonderful if more people tests it since I'm
not 100% sure dlltool works as replacement of lib.exe

Anybody with windows could please try as well?

lu

PS: I'd consider providing the .def file just in case.

Patch

diff --git a/configure b/configure
index 4d308d2..7107187 100755
--- a/configure
+++ b/configure
@@ -2417,7 +2417,7 @@  case $target_os in
         SLIBSUF=".dll"
         SLIBNAME_WITH_VERSION='$(SLIBPREF)$(FULLNAME)-$(LIBVERSION)$(SLIBSUF)'
         SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(FULLNAME)-$(LIBMAJOR)$(SLIBSUF)'
-        SLIB_EXTRA_CMD='-lib.exe /machine:$(LIBTARGET) /def:$$(@:$(SLIBSUF)=.def) /out:$(SUBDIR)$(SLIBNAME_WITH_MAJOR:$(SLIBSUF)=.lib)'
+        SLIB_EXTRA_CMD=-'$(DLLTOOL) -m $(LIBTARGET) -d $$(@:$(SLIBSUF)=.def) -l $(SUBDIR)$(SLIBNAME_WITH_MAJOR:$(SLIBSUF)=.lib)'
         SLIB_INSTALL_EXTRA_CMD='-install -m 644 $(SUBDIR)$(SLIBNAME_WITH_MAJOR:$(SLIBSUF)=.lib) "$(SHLIBDIR)/$(SLIBNAME:$(SLIBSUF)=.lib)"; \
             install -m 644 $(SUBDIR)$(SLIBNAME_WITH_MAJOR:$(SLIBSUF)=.lib) "$(SHLIBDIR)/$(SLIBNAME_WITH_MAJOR:$(SLIBSUF)=.lib)"; \
             install -d "$(LIBDIR)"; \
@@ -2425,6 +2425,7 @@  case $target_os in
         SLIB_UNINSTALL_EXTRA_CMD='rm -f "$(SHLIBDIR)/$(SLIBNAME:$(SLIBSUF)=.lib)"'
         SHFLAGS='-shared -Wl,--output-def,$$(@:$(SLIBSUF)=.def) -Wl,--out-implib,$(SUBDIR)lib$(SLIBNAME:$(SLIBSUF)=.dll.a) -Wl,--enable-runtime-pseudo-reloc -Wl,--enable-auto-image-base'
         objformat="win32"
+        dlltool="${cross_prefix}dlltool"
         enable dos_paths
         check_cflags -fno-common
         check_cpp_condition _mingw.h "defined (__MINGW64_VERSION_MAJOR) || (__MINGW32_MAJOR_VERSION > 3) \
@@ -3234,6 +3235,7 @@  CPPFLAGS=$CPPFLAGS
 CFLAGS=$CFLAGS
 ASFLAGS=$ASFLAGS
 CC_O=$CC_O
+DLLTOOL=$dlltool
 LDFLAGS=$LDFLAGS
 FFSERVERLDFLAGS=$FFSERVERLDFLAGS
 SHFLAGS=$SHFLAGS