[1/3] mingw: Install the .def file, too

Message ID 1310021290-77683-1-git-send-email-martin@martin.st
State Superseded
Headers show

Commit Message

Martin Storsjö July 7, 2011, 6:48 a.m.
The .def file is useful for creating import libraries that
work better with MSVC than the ones created by dlltool.

The .def files are installed into the lib directory - there
doesn't seem to be any common practice for where these are
installed.
---
Would the bin directory be a better choice, since the DLLs
themselves are installed there?

 configure |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

Comments

Diego Biurrun July 7, 2011, 7:24 a.m. | #1
On Thu, Jul 07, 2011 at 09:48:08AM +0300, Martin Storsjö wrote:
> The .def file is useful for creating import libraries that
> work better with MSVC than the ones created by dlltool.
> 
> The .def files are installed into the lib directory - there
> doesn't seem to be any common practice for where these are
> installed.
> ---
> Would the bin directory be a better choice, since the DLLs
> themselves are installed there?

Where do other projects install the .def files?  What does autotools do?

> --- a/configure
> +++ b/configure
> @@ -2423,7 +2423,8 @@ case $target_os in
>          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)"; \
> -            install -m 644 $(SUBDIR)lib$(SLIBNAME:$(SLIBSUF)=.dll.a) "$(LIBDIR)/lib$(SLIBNAME:$(SLIBSUF)=.dll.a)"'
> +            install -m 644 $(SUBDIR)lib$(SLIBNAME:$(SLIBSUF)=.dll.a) "$(LIBDIR)/lib$(SLIBNAME:$(SLIBSUF)=.dll.a)"; \
> +            install $(SUBDIR)$(SLIBNAME_WITH_MAJOR:$(SLIBSUF)=.def) "$(LIBDIR)/$(SLIBNAME_WITH_MAJOR:$(SLIBSUF)=.def)"'

You are missing the permissions.

Diego
Martin Storsjö July 7, 2011, 7:33 a.m. | #2
On Thu, 7 Jul 2011, Diego Biurrun wrote:

> On Thu, Jul 07, 2011 at 09:48:08AM +0300, Martin Storsjö wrote:
> > The .def file is useful for creating import libraries that
> > work better with MSVC than the ones created by dlltool.
> > 
> > The .def files are installed into the lib directory - there
> > doesn't seem to be any common practice for where these are
> > installed.
> > ---
> > Would the bin directory be a better choice, since the DLLs
> > themselves are installed there?
> 
> Where do other projects install the .def files?  What does autotools do?

Autotools don't install the .def file. The zlib official binary package 
ships it in lib.

> > --- a/configure
> > +++ b/configure
> > @@ -2423,7 +2423,8 @@ case $target_os in
> >          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)"; \
> > -            install -m 644 $(SUBDIR)lib$(SLIBNAME:$(SLIBSUF)=.dll.a) "$(LIBDIR)/lib$(SLIBNAME:$(SLIBSUF)=.dll.a)"'
> > +            install -m 644 $(SUBDIR)lib$(SLIBNAME:$(SLIBSUF)=.dll.a) "$(LIBDIR)/lib$(SLIBNAME:$(SLIBSUF)=.dll.a)"; \
> > +            install $(SUBDIR)$(SLIBNAME_WITH_MAJOR:$(SLIBSUF)=.def) "$(LIBDIR)/$(SLIBNAME_WITH_MAJOR:$(SLIBSUF)=.def)"'
> 
> You are missing the permissions.

Fixed locally.

// Martin

Patch

diff --git a/configure b/configure
index e77340f..0508508 100755
--- a/configure
+++ b/configure
@@ -2423,7 +2423,8 @@  case $target_os in
         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)"; \
-            install -m 644 $(SUBDIR)lib$(SLIBNAME:$(SLIBSUF)=.dll.a) "$(LIBDIR)/lib$(SLIBNAME:$(SLIBSUF)=.dll.a)"'
+            install -m 644 $(SUBDIR)lib$(SLIBNAME:$(SLIBSUF)=.dll.a) "$(LIBDIR)/lib$(SLIBNAME:$(SLIBSUF)=.dll.a)"; \
+            install $(SUBDIR)$(SLIBNAME_WITH_MAJOR:$(SLIBSUF)=.def) "$(LIBDIR)/$(SLIBNAME_WITH_MAJOR:$(SLIBSUF)=.def)"'
         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"