unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Andrew Schwartzmeyer <andrew@schwartzmeyer.com>
To: emacs-devel@gnu.org
Subject: Patch for build failure on OS X (under review)
Date: Mon, 5 May 2014 19:39:41 -0700	[thread overview]
Message-ID: <DA0E4F11-1242-4C3B-9E76-7463735A95E3@schwartzmeyer.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 3477 bytes --]

When building under Homebrew with the options 'brew install emacs --use-git-head --HEAD --cocoa --srgb --with-gnutls' (that is, build off master as of Mon May  5 19:31:51 PDT 2014, Cocoa build with sRGB colors, link to GnuTLS library, the following build error was encountered:

> gcc-4.8 -std=gnu99 -c  -Demacs  -I. -I. -I../lib -I./../lib   -I/usr/X11/include      -I/usr/include/libxml2          -MMD -MF deps/image.d -MP -I/usr/local/Cellar/libtasn1/3.4/include -I/usr/local/Cellar/nettle/2.7.1/include -I/usr/local/Cellar/gnutls/3.2.13/include     -g3 -O2  image.c
> image.c: In function 'png_load_body':
> image.c:5919:37: error: 'frame_background' undeclared (first use in this function)
>     fn_png_set_background (png_ptr, &frame_background,
>                                      ^
> image.c:5919:37: note: each undeclared identifier is reported only once for each function it appears in
> make[1]: *** [image.o] Error 1
> make: *** [src] Error 2
> ==> Configuration
> HOMEBREW_VERSION: 0.9.5
> HEAD: b10c09b1746cd5673bff4e40c4485cb266b1932b
> CPU: quad-core 64-bit ivybridge
> OS X: 10.9.2-x86_64
> Xcode: 5.1.1
> CLT: 5.1.0.0.1.1396320587
> X11: 2.7.5 => /opt/X11
> ==> ENV
> HOMEBREW_CC: gcc-4.8
> HOMEBREW_CXX: g++-4.8
> CMAKE_PREFIX_PATH: /usr/local
> CMAKE_INCLUDE_PATH: /usr/include/libxml2:/System/Library/Frameworks/OpenGL.framework/Versions/Current/Headers
> CMAKE_LIBRARY_PATH: /System/Library/Frameworks/OpenGL.framework/Versions/Current/Libraries
> PKG_CONFIG_PATH: /usr/local/opt/libtasn1/lib/pkgconfig:/usr/local/opt/nettle/lib/pkgconfig:/usr/local/opt/gnutls/lib/pkgconfig
> PKG_CONFIG_LIBDIR: /usr/lib/pkgconfig:/usr/local/Library/ENV/pkgconfig/10.9
> ACLOCAL_PATH: /usr/local/share/aclocal
> PATH: /usr/local/Library/ENV/4.3:/usr/local/opt/autoconf/bin:/usr/local/opt/automake/bin:/usr/local/opt/pkg-config/bin:/usr/local/opt/libtasn1/bin:/usr/local/opt/nettle/bin:/usr/local/opt/gnutls/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/opt/gcc/bin
> 
> Error: emacs HEAD did not build

Note that the exact same error happens when building with the system clang compiler.

Inspection of src/image.c revealed that in certain cases, an undefined variable reference occurred. This was due to a preprocessor #if/endif block (lines 5906 to 5917) in which the variable (png_color_16 frame_background;) was created, and a function (fn_png_set_background) after said block that needed used said variable. Here is where I am unsure: should the function be called after the block (necessitating making the variable before the block), or should the function be called inside the block? This patch does the former, as I assumed.

> diff --git a/src/image.c b/src/image.c
> index c26c0db..b4582d2 100644
> --- a/src/image.c
> +++ b/src/image.c
> @@ -5903,9 +5903,11 @@ png_load_body (struct frame *f, struct image *img, struct png_load_context *c)
>  	{
>  	  /* We use the current frame background, ignoring any default
>  	     background color set by the image.  */
> +
> +	  png_color_16 frame_background;
> +
>  #if defined (HAVE_X_WINDOWS) || defined (HAVE_NTGUI)
>  	  XColor color;
> -	  png_color_16 frame_background;
>  
>  	  color.pixel = FRAME_BACKGROUND_PIXEL (f);
>  	  x_query_color (f, &color);

I made this from a git diff; if need be, I can figure out Bazaar and send a patch in the documented format. If there’s a better way to do this, please let me know.

Cheers,

Andrew Schwartzmeyer

[-- Attachment #2: Message signed with OpenPGP using GPGMail --]
[-- Type: application/pgp-signature, Size: 842 bytes --]

             reply	other threads:[~2014-05-06  2:39 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-06  2:39 Andrew Schwartzmeyer [this message]
2014-05-06 20:06 ` Patch for build failure on OS X (under review) Alp Aker
2014-05-06 20:10   ` Alp Aker
2014-05-06 21:16     ` Paul Eggert
2014-05-07  7:14       ` Harald Hanche-Olsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=DA0E4F11-1242-4C3B-9E76-7463735A95E3@schwartzmeyer.com \
    --to=andrew@schwartzmeyer.com \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).