emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Acquiring dependencies for Windows builds


From: Eli Zaretskii
Subject: Re: Acquiring dependencies for Windows builds
Date: Tue, 08 Mar 2022 18:48:06 +0200

> From: "H. Dieter Wilhelm" <dieter@duenenhof-wilhelm.de>
> Cc: arash@gnu.org,  corwin@bru.st,  emacs-devel@gnu.org,
>   phillip.lord@russet.org.uk
> Date: Tue, 08 Mar 2022 16:52:52 +0100
> 
> >> Luckily zlib1.dll contains also "lib". :-)
> >
> > You are relying on luck too much: look in your Windows/system32
> > directory, and you will see there quite a few system DLLs that match
> > "lib".  My suggestion is to have an explicit list of system DLLs that
> > should be filtered out.
> 
> I understand, thanks.  I'll grab all DLL filenames of the
> Windows/system32 folder and filter them out.  Or how would you build or
> hard-code such a filter list?

I'd maintain a hand-crafted list.  There aren't so many system DLLs
you will see in the dependencies.

> >> In the following I'm using copy-file. But I'm wondering why the argument
> >> OK-IF-ALREADY-EXISTS can't be used to skip a copy process if the file
> >> exists?
> >
> > I'm not sure I understand,
> 
> Would it make sense to you to have the (additonal) capability for
> copy-file to do nothing if the target file already exists?
> 
> At the moment I can 1) trigger an error, 2) overwrite an existing file
> and 3) ask for confirmation either to overwrite or to have an error.  So
> 3) is actually only an - annoying - way to have 1) or 2), there's no way
> to leave an existing file alone without an error.

I think this is answered by the below:

> > If you find libtiff-5.dll, you should not overwrite it with
> > libtiff3.dll, even if the latter exists.
> 
> I see, I'll just copy the available, leftmost DLLs.

Yes.

> > Also, I don't see that you ignore DLLs that don't match the version
> > with which Emacs was compiled.  E.g., this part of
> > dynamic-library-alist:
> >
> >        (if (>= libgif-version 50100)
> >        ;; Yes, giflib 5.0 uses 6 as the major version of the API,
> >        ;; and giflib 5.1 uses 7, thus "libgif-7.dll" and
> >        ;; "libgif-6.dll" below (giflib 4.x used 5 as the major API
> >        ;; version).  giflib5.dll is from the lua-files project,
> >        ;; and gif.dll is from luapower.
> >        '(gif "libgif-7.dll")
> >      (if (>= libgif-version 50000)
> >          '(gif "libgif-6.dll" "giflib5.dll" "gif.dll")
> >      '(gif "libgif-5.dll" "giflib4.dll" "libungif4.dll" "libungif.dll")))
> 
> Please tell me where I can find above definition of
> dynamic-library-alist?  Mine (Emacs-27.2) just says:
> 
>   dynamic-library-alist is a variable defined in ‘C source code’.
> 
>   ((harfbuzz "libharfbuzz-0.dll")
>    (gdiplus "gdiplus.dll")
>    (shlwapi "shlwapi.dll")
>    (xpm "libxpm.dll" "xpm4.dll" "libXpm-nox4.dll")
>    (png "libpng16.dll" "libpng16-16.dll")
>    (tiff "libtiff-5.dll" "libtiff3.dll" "libtiff.dll")
>    (jpeg "libjpeg-8.dll")
>    (gif "libgif-7.dll")
>    (svg "librsvg-2-2.dll")
>    (webp "libwebp-7.dll" "libwebp.dll")
>    (sqlite3 "libsqlite3-0.dll")
>    (gdk-pixbuf "libgdk_pixbuf-2.0-0.dll")
>    (glib "libglib-2.0-0.dll")
>    (gio "libgio-2.0-0.dll")
>    (gobject "libgobject-2.0-0.dll")
>    (gnutls "libgnutls-30.dll")
>    (libxml2 "libxml2-2.dll" "libxml2.dll")
>    (zlib "zlib1.dll" "libz-1.dll")
>    (lcms2 "liblcms2-2.dll")
>    (json "libjansson-4.dll")
>    (gccjit "libgccjit-0.dll"))

I guess you took this from a running Emacs?  The original is in
w32-win.el, and that's where I took the fragment I've shown.

If you intend to collect the dependencies by running the same Emacs
binary as the one you will be packaging, then using the list from the
running Emacs will solve you the versions problem, because Emacs
filters it to have the DLLs it needs.

> > means that Emacs compiled against giflib 5.1 and later should not try
> > to use libgif-6.dll or libgif-5.dll, it should only use libgif-7.dll.
> > We do this when a newer version is binary incompatible with an older
> > one, so you cannot just choose whichever DLL you have, you must use
> > the one that is binary-compatible with Emacs.
> 
> I'm struggling to understand that, I thought ./configure would sort out
> what is necessary and available on my system?

Not configure, but Emacs itself when it starts up.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]