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
Best regards,
Frederik
_______________________________________________
Vala-list mailing list
Vala...@gnome.org
http://mail.gnome.org/mailman/listinfo/vala-list
If you define dataDir as constant you don't need the constructor and
you don't need to call it.
> 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?
>
I already posted a message about that in this mailing list, but it
seems like you are subscribing to a mail digest, it will take a while
before you get it.
> 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?
--
Andrea Bolognani <e...@kiyuko.org>
Resistance is futile, you will be garbage collected.
You can find the explanation here:
http://www.gnu.org/software/autoconf/manual/html_node/Defining-Directories.html#Defining-Directories
--
Ali