Compiling freeciv, use of config.h

You can get help here if Freeciv doesn't start on your computer, or if you keep getting fatal errors while playing etc.
Post Reply
sc0ttj
Posts: 10
Joined: Wed Dec 09, 2020 3:56 pm

Compiling freeciv, use of config.h

Post by sc0ttj »

Hi all,

This is my first post, sorry if it's off topic, in the wrong place, or too outdated to be answered.

But I'm having problems compiling older versions of Freeciv, on Linux (a distro based on Ubuntu Focal x64).

I am trying to compile some older versions which use the Xaw client.

Each version I have tried to compile needs a config.h file to build properly - before I even get past other, manual
patches and changes.

I managed to get a config.h generated from somewhere, while building version 1.14.2...

In order to build any later versions (R2_1_11 from svn, and a 2.2.0 tar.bz2 release) I have had to manually add the
config.h from 1.14.2, and to manually add/remove various variables to then get past onto the next errors (out of
scope/topic for this post).

So.. My question is simply this:

How do I generate the proper config.h that is needed for each version, so I don't have to copy one over from an
older Freeciv and hack it to death?


Here is (generally) how I am compiling them:

Code: Select all

./autogen.sh
export LDFLAGS="-lm -lz" 
./configure --with-xaw --enable-client=xaw --debug=yes --disable-nls
make CFLAGS="-Wall" -j3
...note I can see from the output of running ./configure that the config.h file is created at some point, but not left
in the filesystem after it finishes.. And I do have a config.in in each version, from which I guess the config.h is
generated...

Thanks
cazfi
Elite
Posts: 3077
Joined: Tue Jan 29, 2013 6:54 pm

Re: Compiling freeciv, use of config.h

Post by cazfi »

Configure headers are indeed generated by configure. Note that its name was changed from "config.h" to "fc_config.h" at some version (don't remember exactly when), and in latest versions it lives in gen_headers/ subdirectory.
I have no idea why it would not be present in the filesystem after configure finishes (succesfully). Maybe config.log can tell you something?
Your configure line seems to have mysterious "--debug=yes" - you probably mean "--enable-debug"
cazfi
Elite
Posts: 3077
Joined: Tue Jan 29, 2013 6:54 pm

Re: Compiling freeciv, use of config.h

Post by cazfi »

sc0ttj wrote:on Linux (a distro based on Ubuntu Focal x64).
I tested on 64bit Focal virtual machine.
sc0ttj wrote:In order to build any later versions (R2_1_11 from svn, and a 2.2.0 tar.bz2 release)
Downloaded freeciv-2.2.0.tar.bz2.
Run just configure for it (autogen.sh part is already handled in a tarball). Left out --enable-debug as "-Werror" flag brought in by it is likely to cause compile with a modern compiler to fail (instead of just warning) in many ways in such an ancient codebase. Assuming nls works, so not giving --disable-nls either.

Code: Select all

./configure --enable-client=xaw
That went through just fine and config.h is there.

Build with make eventually fails to something that seems like libpng incompatibility.
sc0ttj
Posts: 10
Joined: Wed Dec 09, 2020 3:56 pm

Re: Compiling freeciv, use of config.h

Post by sc0ttj »

Hmm OK thanks..

there must be something weird on the distro I'm using, as I definitely can't find a config.h once
the configure script is done...

I'll look into the logs and maybe hack the configure script if needed..

Thanks.

EDIT:

As a side note for anyone else building old Freecivs, and relevant to the above replies:

I did indeed comment out something in server/generators/ which was a tile PNG check of some kind, and the
build worked without it (after I manually added a config.h, etc)...
cazfi
Elite
Posts: 3077
Joined: Tue Jan 29, 2013 6:54 pm

Re: Compiling freeciv, use of config.h

Post by cazfi »

cazfi wrote:Build with make eventually fails to something that seems like libpng incompatibility.
There's no such problem with 2.2.7 (last bugfix release of the freeciv-2.2). There rarely is point in using anything but the latest (least buggy) release from a series.
sc0ttj
Posts: 10
Joined: Wed Dec 09, 2020 3:56 pm

Re: Compiling freeciv, use of config.h

Post by sc0ttj »

Ooh OK thanks.. I'll take a look..

Basically I'm looking to compile the latest "proper" Xaw client version, and customise some rulesets, units etc from there..

Ideally, I'd like the latest, greatest version with (in order of importance):

- the old Xaw client
- AI diplomacy
- building/improvement effects that actually works (1.14.2 had them in rulesets, but not implemented :( )
- AI nations desired government that actually works (does it in latest? did it ever?)
- AI nations desired tech/techgoals that actually works
- tech and units only allowed for certain nations
- tech and units only allowed for certain gov types
- specific buildings/wonders required in a city before certain units can be built (so bldg_req for units, not only tech_req)
- Images for tech and wonders (was it ever implemented in Xaw client?)


...I'm thinking around 2.2.x might be the latest I wanna go?
cazfi
Elite
Posts: 3077
Joined: Tue Jan 29, 2013 6:54 pm

Re: Compiling freeciv, use of config.h

Post by cazfi »

Xaw-client is present in freeciv-2.6. It has been dropped from freeciv-3.0.
sc0ttj
Posts: 10
Joined: Wed Dec 09, 2020 3:56 pm

Re: Compiling freeciv, use of config.h

Post by sc0ttj »

Aha .. OK thanks
Post Reply