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
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
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
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.
Additional Item Attachment:
File name: client-and-xaw-client-need-libm.patch Size:1 KB
Reply to this item at:
Message sent via/by Gna!
Freeciv-dev mailing list