Complete.Org: Mailing Lists: Archives: freeciv-dev: January 2003:
[Freeciv-Dev] Re: (PR#2873) 1.14.0 Xaw client crash
Home

[Freeciv-Dev] Re: (PR#2873) 1.14.0 Xaw client crash

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Cc: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: (PR#2873) 1.14.0 Xaw client crash
From: "Stepan Roh via RT" <rt@xxxxxxxxxxxxxx>
Date: Thu, 23 Jan 2003 12:33:56 -0800
Reply-to: rt@xxxxxxxxxxxxxx



On Wed, 22 Jan 2003, Jason Short via RT wrote:

>
> [stepan@xxxxxxxx - Wed Jan 22 00:42:23 2003]:
>
> > OK, I found the problem:
> >
> > HAVE_LIBXAW3D is not defined which causes client/gui-xaw/pixcommp.h to
> > not
> > include Xaw3D class parts which confuses Xaw3D at runtime and crashes
> > client. The reason why it was not included lies somewhere around
> > acconfig.h/old and autogen.sh. acconfig.h mentions HAVE_LIBXAW3D while
> > config.h does not. But using autoconf suite newer than 2.13 acconfig.h
> > is
> > renamed to acconfig.old by autogen.sh and config.h.in generated by
> > autoheader does not have HAVE_LIBXAW3D in (because FC_CHECK_X_LIB is
> > not
> > recognized by autoheader - which is by the way mentioned in
> > acconfig.h)
> > and that's probably the reason why it is not set (it must be mentioned
> > in
> > config.h else it will be silently discarded). The reason why it worked
> > in
> > 1.13.0 is that configure files were generated with autoconf 2.13, but
> > in
> > 1.14.0 they are generated by autoconf 2.57.
> >
> > I have no fix for it, because I'm not an auto* guru, but someone
> > should
> > fix it as soon as possible.
> >
> > I hope it is understandable (I'm very tired).
>
> I understand why it doesn't work: as you say, HAVE_LIBXAW3D is never
> defined.  Fixing this is easy enough: we just have to define it (see
> attached patch).
>
> I don't understand why it ever worked before, though.  acconfig.h has
> '#undef HAVE_LIBXAW3D' but nowhere else in our autoconf code is this
> touched.

acconfig.h is parsed by autoconf while generating configure and its
contents are added to config.h.in. This has been made deprecated in
autoconf > 2.13.

The sad thing is that autoheader is not able to analyze calls to
FC_CHECK_X_LIB macro, which calls AC_DEFINE_UNQUOTED. This macro is the
only place where AC_DEFINE_* is called on variable and not constant. The
proper fix is to add constant AC_DEFINE to every call of FC_CHECK_X_LIB in
configure.ac (I wonder it does not crash more often, maybe HAVE_LIBXAW3D
is the only one really used, but it should be defined everywhere just to
be future-compatible).

List of all #defines (or strictly speaking #undefs) which are in
acconfig.h and are not generated by autoheader (entries not found in
configure.ac or m4/* are marked as unused - they may however be used in
source; also it looks like acconfig.h is used as template for vms and
amiga configs (hand-made of course)):

HAVE_LIBICE (unused)
HAVE_LIBSM (unused)
HAVE_LIBX11
HAVE_LIBXAW
HAVE_LIBXAW3D
HAVE_LIBXEXT
HAVE_LIBXMU
HAVE_LIBXPM
HAVE_LIBXT
HAVE_CATGETS (unused)
STRICT_WINDOWS (unused)
GENERATING_MAC (unused)
HAVE_OPENTRANSPORT (unused)
PATH_SEPARATOR (unused)
OPTION_FILE_NAME (unused)

From the list above it is obvious that only calls to FC_CHECK_X_LIB should
be altered and everything will work properly.

So I summarize my patch-vision:

- add AC_DEFINE() to all FC_CHECK_X_LIB calls in configure.ac (maybe also
in configure.in?)
- add notice to m4/x.252 (and possibly to x.213 also) that AC_DEFINE must
be called explicitly or acconfig.h must be altered (for x.213 only)

Have a nice day.

Stepan Roh




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