[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Problems with data files
From: |
Ralf Wildenhues |
Subject: |
Re: Problems with data files |
Date: |
Mon, 26 May 2008 20:07:08 +0200 |
User-agent: |
Mutt/1.5.17+20080114 (2008-01-14) |
Hello Ganesh,
* Ganesh Kundapur wrote on Mon, May 26, 2008 at 10:43:50AM CEST:
> My directory structure is
> Game
> - Makefile.am
> - src
> - Makefile.am
> - inc
> - data
> <some files>
> - audio
> - Makefile.am
>
> Toplevel Makefile.am contains
> datadir = /usr/share/game/data
Note that this setting here has several problems:
- It will not propagate from toplevel Makefile.am to other Makefiles.
In order to override a variable globally, do something like
AC_SUBST([datadir], [$value])
in configure.ac.
- Actually, datadir is predefined by Autoconf, and while you can
override it, it is not such a good idea, because then the output of
./configure --help
will not tell the truth, for example. You could set gamedir in
configure.ac, for example, and use that in the Makefile.am files.
- Your setting is absolute, instead of relative to, say, ${prefix}.
No installation directory should be passed in absolute, because your
users may want to (and have good reason to!) override it. For example,
I may want to use "--prefix=$HOME/local" and expect all files to be
installed below my home directory, because that's where I have write
privileges.
A better setting would be "'${datarootdir}'", which, incidentally, is
the default set by Autoconf.
"make distcheck" ensures that you do not define absolute directories.
- I wonder whether you should not touch the setting at all, and instead
just teach your users to
./configure --datadir=/usr/share/game/data
which will most likely do the right thing. (Use --datarootdir if you
want docdir, infodir, localedir, and mandir to be adjusted as well.)
Please see
<http://www.gnu.org/software/automake/manual/html_node/Standard-Directory-Variables.html>
<http://www.gnu.org/software/autoconf/manual/standards/Directory-Variables.html>
and references therein for more information on this.
> When i configure, Makefile will be created under src, data directories but
> not under data/audio directory. Makefile wont be created even if i put a
> entry under SUBDIRS
That's likely because you haven't listed that Makefile as
AC_CONFIG_FILES in configure.ac.
> in toplevel Makefile.am as
> game/Makefile.am
> ---------------------------
> datadir = /usr/share/game/data
>
> SUBDIR = src \
> data \
> data/audio
>
> and when i run make, i'm getting the fallowing errors due to absence of the
> Makefile under data/audio directory
This is likely just a followup error of above.
Hope that helps.
Cheers,
Ralf