unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Chong Yidong <cyd@stupidchicken.com>
Cc: emacs-devel@gnu.org
Subject: Build --without-x broken
Date: Sun, 08 Jun 2008 11:39:40 +0300	[thread overview]
Message-ID: <uzlpwl3qr.fsf@gnu.org> (raw)

Today's CVS cannot be build --without-x, it fails thusly:

  gcc -c -D_BSD_SOURCE   -Demacs -DHAVE_CONFIG_H  -I. -I/home/e/eliz/emacs.cvs/emacs/src -D_BSD_SOURCE    -g -O2 -Wno-pointer-sign  xmenu.c
  xmenu.c: In function 'Fx_popup_menu':
  xmenu.c:409: error: 'unuse_menu_items' undeclared (first use in this function)
  xmenu.c:409: error: (Each undeclared identifier is reported only once
  xmenu.c:409: error: for each function it appears in.)
  xmenu.c:431: error: 'menu_items_n_panes' undeclared (first use in this function)
  xmenu.c:432: error: 'menu_items' undeclared (first use in this function)
  xmenu.c:432: error: invalid type argument of '->'
  xmenu.c:432: error: 'MENU_ITEMS_PANE_NAME' undeclared (first use in this function)
  xmenu.c:464: error: invalid type argument of '->'
  make[1]: *** [xmenu.o] Error 1
  make[1]: Leaving directory `/srv/data/home/e/eliz/emacs.cvs/emacs/src'
  make: *** [src] Error 2

This happens because of the latest changes intended to move
platform-independent portions of C-level menu support to a separate
file menu.c.  (In the archives, I found only a single email message
that suggests such a change, and no discussions.  Did I overlook
something?)

Unfortunately, in their current form, the modified files have quite a
few problems.  For starters, they seem to assume that menus are only
supported under HAVE_X_WINDOWS.  For example, src/Makefile.in only
compiles menu.c on that condition:

  #ifdef HAVE_X_WINDOWS
  MENU_OBJ = menu.o
  #endif

and the menu definitions moved from xmenu.c to keyboard.h are also
conditioned on HAVE_X_WINDOWS.  The right symbol is HAVE_MENUS,
because even platforms without HAVE_X_WINDOWS (--without-x build
included) support menus.  There are other problems as well, for
example with the semantics of HAVE_NTGUI.

However, simply replacing HAVE_X_WINDOWS with HAVE_MENUS will break
other platforms, since some of them, like the Mac and MS-Windows,
define HAVE_MENUS, but have their own, slightly different definitions
for menu support macros, which apparently weren't yet incorporated
into menu.c.

Which brings me to the question: Yidong, is this still work in
progress, or are you done, and consider it to be the job of the
non-GNU platform maintainers to do whatever is necessary to get their
platforms in line with these changes?  Since neither
macmenu.c/w32menu.c nor src/makefile.w32-in were modified along the
same lines as xmenu.c and src/Makefile.in, it sounds like this work is
not yet done, but then why was it committed without any word of
warning?

If you don't intend to work on other platforms, please at least get
the --without-x case right.

In general, such cross-platform changes should be discussed first, and
maybe the patches posted here for review before committing them.  Such
changes are notoriously hard to get right, because of the myriad of
subtle considerations and platform-specific knowledge that hardly any
single person can get a hold on.  Discussing this before committing
would avoid most, if not all, of these pitfalls.




                 reply	other threads:[~2008-06-08  8:39 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=uzlpwl3qr.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=cyd@stupidchicken.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).