Re: [Vala] Accessing build-time config from Vala (was: Vala-list Digest, Vol 26, Issue 8)
- From: Ali Sabil <ali sabil gmail com>
- To: Andrea Bolognani <eof kiyuko org>
- Cc: vala-list gnome org
- Subject: Re: [Vala] Accessing build-time config from Vala (was: Vala-list Digest, Vol 26, Issue 8)
- Date: Wed, 6 Jan 2010 16:22:28 +0100
On Wed, Jan 6, 2010 at 3:17 PM, Andrea Bolognani <eof kiyuko org> wrote:
On Wed, Jan 06, 2010 at 10:56:32AM +0100, Frederik wrote:
golnaz nilieh wrote:
Thanks to all. I defined an empty constructor for Global, and called it in
main function. also I changed dataDir to a constant variable.
But a new question: Is there a way to pass the installation path to dataDir?
I use this macro in configure.ac:
AC_PREFIX_DEFAULT(/usr/local)
can i use it as a variable in a vala source file?
Yes, all you need is a small vapi file for your 'config.h', e.g.:
http://code.google.com/p/xnoise/source/browse/vapi/config.vapi
Use it with
--pkg config --vapidir path/to/my/vapi
and access it via
Config.DATADIR
I like this solution. Only, I can't seem to find a way to get DATADIR
defined in config.h.
Looking at xnoise, I was unable to find any obvious spot where the magic
happens. Is that done by gnome-autogen? I have a custom autogen.sh. Or am
I missing something hidden in plain sight?
You can find the explanation here:
http://www.gnu.org/software/autoconf/manual/html_node/Defining-Directories.html#Defining-Directories
--
Ali
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]