Re: glib-mkenums in glib 2



On Dec 29, 2012, at 7:20 AM, John Emmas <johne53 tiscali co uk> wrote:

> On 29 Dec 2012, at 09:55, David Nečas wrote:
> 
>> 
>> Anything ending with .in is usually processed by configure
>> (config.status) which you obviously don't have so you must replace
>> @VARIABLE@s with the corresponding values using whatever you have.  But
>> the only two variables present there are unused on MS Windows anyway –
>> MS Windows neither recognise shbangs nor is the fixed datadir code path
>> useful there.
>> 
> 
> Thanks for the suggestion David but in this case (gdbus-codegen.in) it seems to be a python script that needs to get processed.

Yes, it's a python script that needs to get processed, replacing the two items David mentioned to produce "gdbus-codegen". He' mistaken in this case, though: It's done by make, and you'll find the script in Makefile.am
> 
> Looking in makefile.am suggests that this command line would be right for my particular machine (imagine that this is all on one line) :-
> 
> python F:/+GTK-SOURCES/gnu-win32/src/glib/gio/gdbus-2.0/codegen/gdbus-codegen.in
> --interface-prefix org.
> --generate-c-code gdbus-daemon-generated
> --c-namespace _G
> F:/+GTK-SOURCES/gnu-win32/src/glib/gio/dbus-daemon.xml
> 
> However, that only seems to produce this error output:-
> 
> Traceback (most recent call last):
>   File "F:/+GTK-SOURCES/gnu-win32/src/glib/gio/gdbus-2.0/codegen/gdbus-codegen.in", line 39, in <module>
>     from codegen import codegen_main
>   File "F:\+GTK-SOURCES\gnu-win32\src\glib\gio\gdbus-2.0\codegen\codegen.py", line 26, in <module>
>     from . import config
> ValueError: Attempted relative import in non-package
> 
> So I'm currently stumped!
> 
> Like last time, it'll probably be something quite obvious that I've overlooked.

That's because gio/gdbus-2.0/codegen/config.py doesn't exist, but config.py.in does -- another file that needs to have its @variables@ substituted -- in this case @datarootdir@, @prefix@, and @VERSION@.

This one *is* done by configure, which treats it like a Makefile.in; those are all AC_SUBST values. That prolly doesn't make any sense to you, don't worry about it. @prefix@ is the root of the directory tree where glib is getting installed: /usr/local by default on a Unix/Linux box. @datarootdir@ is where various data files (man pages, translation files, etc.) go, normally prefix/share on a Unix/Linux box. @VERSION@ is the Glib version, currently 2.35.4. 

So you need to figure out how to fill in those values and create config.py from MSVS.

Regards,
John Ralls




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]