Fandom

Freeciv

Comments0

Ifdef survey

Phlox September 16, 2012 User blog:Phlox

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.

Root directory CONFIGURE file has lots of interesting flags that are largely unused.

  • CLIENT_GUI_SDL_TRUE
  • CLIENT_GUI_GTK_2_0_TRUE


Aside from DEBUG and one time/ low frequency tags, these are the flags of note:

  • HAVE_CONFIG_H
  • WIN32_NATIVE
  • IPV6_SUPPORT
  • GGZ_CLIENT
  • AUDIO_SDL
  • GGZ_GTK
  • SMALL_SCREEN
  • UNDER_CE

Lots of fiddly ones about Lang, Net, sys

Curious ones

  • DONE_BY_create_city_virtual

Example how the flag gets to the code

utility\timing.c has a number of code fragments protected with #ifdef HAVE_FTIME. timing.c gets them from included file config.h config.h is generated by automake utilities. The control file is Configure. in the root directory.

Configure. has a line:

#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1

This is part of a loop that evaluates a dozen properties and assigns a HAVE_[propertyName] flag value to it. Above this code you will see a more straightforward

#define HAVE_VSNPRINTF 1

The configure appears at the beginning to be a generated file, and large gaps of whitespace suggest that it is, but the string values in config.h don't appear anywhere else, so this is where you are supposed to put your flags in.

Not especially intuitive for an initiate, but there I go again.

Oh you have got to be kidding me

No, no no it is not so simple that you peons should be trusted with passing a flag... No with AUTOHELL we are much too too virtualized for something so simple minded and easy to use. We are going to make it so you have to learn a whole new language with lots and lots of files in hidey holes where we oh so clever people have hidden code. So the rest of us can spend 2 hours just to insert one fricking flag so we can ifdef check it.

All for what purpose? So makes will work on all platforms? Name me one platform where this POS automake runs straight out of the box.

Brother.

Continuation of VSNPRINTF =

Right the place where that VSNPRINTF code came was this file: m4/vsnprintf.m4 which has:

  AC_DEFINE(HAVE_WORKING_VSNPRINTF, 1,

BUT BUT- you complain- it doesn't say HAVE_VSNPRINTF, so this is not it. Well No, because they don't just copy this confdefs.h file.... They AWK it. So they are renaming crud to god knows what. You know, if you really really wanted to make your trail imperceptible you would "Tidy" things up. The way to Hell is paved with good regex expressions.

Ok, you know what you have to type and where? m4/sdl-client.m4 What we need to do is an ACDEFINE... oh brother. Anyway,

AC_DEFINE(CLIENT_GUI_SDL, 1, [We are building an SDL client.])

That's another 2 hours of my life I will never have back just to set one fricking flag. Oh- and the Autogen takes like 10 minutes just to generate my line in config.h which now reads:

#define CLIENT_GUI_SDL 1
AUTOHELL poem

This is the farmer sowing his corn
That kept the cock that crowed in the morn
That waked the priest all shaven and shorn
That married the man all tattered and torn
That kissed the maiden all forlorn
That milked the cow with the crumpled horn
That tossed the dog that worried the cat
That killed the rat that ate the malt

That lay in the house that Jack built

Also on Fandom

Random Wiki