emacs-devel
[Top][All Lists]
Advanced

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

Build --without-x broken


From: Eli Zaretskii
Subject: Build --without-x broken
Date: Sun, 08 Jun 2008 11:39:40 +0300

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 via email to

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