Complete.Org: Mailing Lists: Archives: freeciv-dev: September 2006:
[Freeciv-Dev] autoconf destroys use of $datadir
Home

[Freeciv-Dev] autoconf destroys use of $datadir

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Freeciv-Dev <freeciv-dev@xxxxxxxxxxx>
Subject: [Freeciv-Dev] autoconf destroys use of $datadir
From: Jason Dorje Short <jdorje@xxxxxxxxx>
Date: Sat, 02 Sep 2006 21:01:45 -0400

In new versions of autoconf (as present in debian unstable for months now)

  $datadir is set to "${datarootdir}" (not expanded)
  $datarootdir is set to "${prefix}" (not expanded)
  $prefix is set to "NONE"

This is, simply, absurdly obnoxious. In the first place you can never actually use $datadir. You have to use an auto-expander like FC_EXPAND_DIR or AC_GGZ_UNQUOTEDPATH. Further, FC_EXPAND_DIR only expands once and thus needs to be fixed. Finally, since no prefix is set by default you have to set one manually before you can use this.

And not only that, but this affects all previous versions of freeciv as well. I cannot even compile Freeciv 2.0 anymore because of this misfeature.

Supposedly the way these are intended to be used is in cflags, rather than in config.h. The attached patch changes this, and seems to work (for 2.1).

-jason
Index: configure.ac
===================================================================
--- configure.ac        (revision 12296)
+++ configure.ac        (working copy)
@@ -597,10 +597,11 @@
 FC_EXPAND_DIR(FREECIV_DATADIR, "$datadir/freeciv")
 
 if test x"$MINGW32" = xyes; then
-  AC_DEFINE_UNQUOTED(DEFAULT_DATA_PATH, ".;data;~/.freeciv;$FREECIV_DATADIR", 
[Mingw32-specific path])
+  DEFAULT_DATA_PATH=".;data;~/.freeciv;$datadir/freeciv"
 else
-  AC_DEFINE_UNQUOTED(DEFAULT_DATA_PATH, ".:data:~/.freeciv:$FREECIV_DATADIR", 
[Freeciv data path])
+  DEFAULT_DATA_PATH=".:data:~/.freeciv:$datadir/freeciv"
 fi
+CPPFLAGS="$CPPFLAGS -DDEFAULT_DATA_PATH=\\\"$DEFAULT_DATA_PATH\\\""
 
 dnl This has to be last library
 if test -n "$WITH_EFENCE"; then

[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] autoconf destroys use of $datadir, Jason Dorje Short <=