* bug#15531: Emacs configure fails with gif 5.0
@ 2013-10-05 15:27 Barry Fishman
2013-10-05 18:26 ` Eli Zaretskii
2013-10-10 0:40 ` Glenn Morris
0 siblings, 2 replies; 4+ messages in thread
From: Barry Fishman @ 2013-10-05 15:27 UTC (permalink / raw)
To: 15531
[-- Attachment #1: Type: text/plain, Size: 610 bytes --]
Package: emacs
Version: 24.3.50
The configure script fails to recognize the gif_lib.h header file for
gif 5.0 and so prints an error that git support can not be found.
The gif_lib.h header file has been reorganized for gif 5.0. There is no
longer a EGifPutExtensionLast function. However there is a new
GifMakeMapObject I used in my patch. A better way would probably be to
look at the new GIFLIB_MAJOR define now in gif_lib.h.
I have included a patch, but I do not have many OS/platforms that I
can check. I am far from understanding autoconfig, but my attempt at a
fix (git patch) is included below:
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: configure and image.c patches --]
[-- Type: text/x-diff, Size: 2200 bytes --]
diff --git a/configure.ac b/configure.ac
index 53426b6..0f05d8e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3109,8 +3109,9 @@ elif test "${HAVE_X11}" = "yes" && test "${with_gif}" != "no" \
|| test "${HAVE_W32}" = "yes"; then
AC_CHECK_HEADER(gif_lib.h,
# EGifPutExtensionLast only exists from version libungif-4.1.0b1.
-# Earlier versions can crash Emacs.
- [AC_CHECK_LIB(gif, EGifPutExtensionLast, HAVE_GIF=yes, HAVE_GIF=maybe)])
+# Earlier versions can crash Emacs, but version 5.0 removes EGifPutExtensionLast.
+ [AC_CHECK_LIB(gif, GifMakeMapObject, HAVE_GIF=yes,
+ [AC_CHECK_LIB(gif, EGifPutExtensionLast, HAVE_GIF=yes, HAVE_GIF=maybe)])])
if test "$HAVE_GIF" = yes; then
LIBGIF=-lgif
diff --git a/src/image.c b/src/image.c
index e429830..c414f5b 100644
--- a/src/image.c
+++ b/src/image.c
@@ -7219,14 +7219,22 @@ gif_image_p (Lisp_Object object)
#endif /* HAVE_NTGUI */
+#ifndef GIFLIB_MAJOR
+#define GIFLIB_MAJOR 0
+#endif
#ifdef WINDOWSNT
/* GIF library details. */
DEF_IMGLIB_FN (int, DGifCloseFile, (GifFileType *));
DEF_IMGLIB_FN (int, DGifSlurp, (GifFileType *));
+#if GIFLIB_MAJOR < 5
DEF_IMGLIB_FN (GifFileType *, DGifOpen, (void *, InputFunc));
DEF_IMGLIB_FN (GifFileType *, DGifOpenFileName, (const char *));
+#else
+DEF_IMGLIB_FN (GifFileType *, DGifOpen, (void *, InputFunc, int *));
+DEF_IMGLIB_FN (GifFileType *, DGifOpenFileName, (const char *, int *));
+#endif
static bool
init_gif_functions (void)
@@ -7316,7 +7324,11 @@ gif_load (struct frame *f, struct image *img)
}
/* Open the GIF file. */
+#if GIFLIB_MAJOR < 5
gif = fn_DGifOpenFileName (SSDATA (file));
+#else
+ gif = fn_DGifOpenFileName (SSDATA (file), NULL);
+#endif
if (gif == NULL)
{
image_error ("Cannot open `%s'", file, Qnil);
@@ -7337,7 +7349,11 @@ gif_load (struct frame *f, struct image *img)
memsrc.len = SBYTES (specified_data);
memsrc.index = 0;
+#if GIFLIB_MAJOR < 5
gif = fn_DGifOpen (&memsrc, gif_read_from_memory);
+#else
+ gif = fn_DGifOpen (&memsrc, gif_read_from_memory, NULL);
+#endif
if (!gif)
{
image_error ("Cannot open memory source `%s'", img->spec, Qnil);
[-- Attachment #3: Type: text/plain, Size: 19 bytes --]
--
Barry Fishman
^ permalink raw reply related [flat|nested] 4+ messages in thread
* bug#15531: Emacs configure fails with gif 5.0
2013-10-05 15:27 bug#15531: Emacs configure fails with gif 5.0 Barry Fishman
@ 2013-10-05 18:26 ` Eli Zaretskii
2013-10-05 19:19 ` Barry Fishman
2013-10-10 0:40 ` Glenn Morris
1 sibling, 1 reply; 4+ messages in thread
From: Eli Zaretskii @ 2013-10-05 18:26 UTC (permalink / raw)
To: Barry Fishman; +Cc: 15531
> From: Barry Fishman <barry_fishman@acm.org>
> Date: Sat, 05 Oct 2013 11:27:53 -0400
>
> The configure script fails to recognize the gif_lib.h header file for
> gif 5.0 and so prints an error that git support can not be found.
>
> The gif_lib.h header file has been reorganized for gif 5.0. There is no
> longer a EGifPutExtensionLast function. However there is a new
> GifMakeMapObject I used in my patch. A better way would probably be to
> look at the new GIFLIB_MAJOR define now in gif_lib.h.
>
> I have included a patch, but I do not have many OS/platforms that I
> can check. I am far from understanding autoconfig, but my attempt at a
> fix (git patch) is included below:
Thanks.
For the record, this is not enough for Windows, because we must
prevent Emacs compiled with libungif 5.0 or newer to dynamically load
an older shared library, or vice versa.
Btw, where can one find this new version? I can only find versions
4.x or older.
^ permalink raw reply [flat|nested] 4+ messages in thread
* bug#15531: Emacs configure fails with gif 5.0
2013-10-05 18:26 ` Eli Zaretskii
@ 2013-10-05 19:19 ` Barry Fishman
0 siblings, 0 replies; 4+ messages in thread
From: Barry Fishman @ 2013-10-05 19:19 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: 15531
On 2013-10-05 14:26:06 EDT, Eli Zaretskii wrote:
> For the record, this is not enough for Windows, because we must
> prevent Emacs compiled with libungif 5.0 or newer to dynamically load
> an older shared library, or vice versa.
>
> Btw, where can one find this new version? I can only find versions
> 4.x or older.
I use Arch GNU/Linux which defaults to using giflib 5.0.4. They point
back to http://sourceforge.net/projects/giflib/. It has the download
for 5.0.5 listed under the "Recent Releases" heading. Its also
tagged in its git repository.
--
Barry Fishman
^ permalink raw reply [flat|nested] 4+ messages in thread
* bug#15531: Emacs configure fails with gif 5.0
2013-10-05 15:27 bug#15531: Emacs configure fails with gif 5.0 Barry Fishman
2013-10-05 18:26 ` Eli Zaretskii
@ 2013-10-10 0:40 ` Glenn Morris
1 sibling, 0 replies; 4+ messages in thread
From: Glenn Morris @ 2013-10-10 0:40 UTC (permalink / raw)
To: 15531-done
Version: 24.4
Thank you; applied.
We'll need a copyright assignment to accept any more code from you.
If you think you might contribute more in future, let me know off-list,
and I can send you a form to get started.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2013-10-10 0:40 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-05 15:27 bug#15531: Emacs configure fails with gif 5.0 Barry Fishman
2013-10-05 18:26 ` Eli Zaretskii
2013-10-05 19:19 ` Barry Fishman
2013-10-10 0:40 ` Glenn Morris
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.