Follow-up Comment #5, bug #15400 (project freeciv):

This bug is related to 15973 <http://gna.org/bugs/index.php?15973>, which
handles the particular case of libfreeciv.  This patch handles the other
cases, which are the common client code and the convenience library
libgui-xaw.

What this patch does is described below, together with arguments as to why
each thing is the right thing to do.  I checked to make sure all the errors
in the report are addressed, but I have not actually tested a build using
gold.

1.  Unconditonally add -lm to the autoconf variable CLIENT_LIBS

The way the build system is currently structured, the CLIENT_LIBS variable
appears to be the right place to put library requirements of the common
client code.  In particular, client_main.c uses the math library, so each
client must be linked against it.

2.  Remove the 'pow' function checks and unconditionally add -lm to SERVER
LIBS

It seems like an entirely speculative benefit to check for libm.  If someone
has an example of a real system with a functioning build kit and no libm, we
can revisit this.  But for now, to keep things simple and consistent, -lm is
unconditionally added to both CLIENT_LIBS and SERVER_LIBS.

3.  Add -lm to the LIBADD for the libgui-xaw convenience library

We must be sure to link each library to its dependencies, even if we think
the final executable will be linked with those dependencies anyway.

4.  Add an explicit include of math.h in one of the xaw implementation files

It's not a good idea to rely on a chain of header inclusions.  Each file that
uses the math library should include math.h directly.

JKL

(file #9096)
    _______________________________________________________

Additional Item Attachment:

File name: client-and-xaw-client-need-libm.patch Size:1 KB


    _______________________________________________________

Reply to this item at:

  <http://gna.org/bugs/?15400>

_______________________________________________
  Message sent via/by Gna!
  http://gna.org/


_______________________________________________
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev

Reply via email to