GTK+ development with SunStudio 12
Greetings,
I'm currently in the process of learning GTK+ programming. For this task I wanted to use SunStudio 12 but I found the configuration of the projects for GTK+ development very annoying (adding many include directories and libraries for every configuration).
Therefore I developed a small tool using python which extracts the necessary information from the output of pkg-config and adds it to the configuration of the SunStudio project.
If someone is interested in using this tool he can find it here: http://home.arcor.de/jsiebert/
Feedback is very welcome! Hope you enjoy using the tool!
Best regards,
Jens Siebert
# 5
Ok, your tool doesn't work for me. :(
Tried it "as is" on my Gentoo Linux system, and it looked like the required xml library isn't installed:
[code]
Traceback (most recent call last):
File "./ss12-gtk-project.py_200706241644", line 6, in ?
from lxml import etree as ElementTree
ImportError: No module named lxml
[/code]
So, as there was a package called "lxml" available, installed that and tried again. Still no luck:
[code]
Traceback (most recent call last):
File "./ss12-gtk-project.py_200706241644", line 7, in ?
from xml.etree.ElementTree import Element
ImportError: No module named etree.ElementTree
[/code]
Looking at http://effbot.org/zone/element-index.htm, it gave some hints, so modified the import declaration at the top of your script to:
[code]
import os
import sys
import getopt
from lxml.etree import Element, ElementTree
[/code]
This seemed to let the script run:
[code]
$ ./ss12-gtk-project.py
Usage: ss12-gtk-project.py -d <SS12-project-directory> -p <project-name> -P <package>
$
[/code]
But after that, I can't get it to recognise the project directory or arguments in a useful way:
[code]
$ ./ss12-gtk-project.py -d /home/jc/SunStudioProjects -p flame-edit -P glib-2.0
Error: Given project-dir or project-name doesn't exist!
$ ls -la /home/jc/SunStudioProjects
total 12
drwxr-xr-x3 jc users 4096 Jun 24 15:53 .
drwx 114 jc users 4096 Jun 24 16:52 ..
drwxr-xr-x 10 jc users 4096 Jun 24 16:24 flame-edit
$ ls -la /home/jc/SunStudioProjects/flame-edit/
total 704
drwxr-xr-x 10 jc users4096 Jun 24 16:24 .
drwxr-xr-x 3 jc users4096 Jun 24 15:53 ..
-rw-r--r-- 1 jc users 78355 Jun 24 16:24 .make.state.Debug
-rw-r--r-- 1 jc users37 Apr 19 2006 AUTHORS
drwxr-xr-x 2 jc users4096 Jun 24 15:56 CVS
-rw-r--r-- 1 jc users 26425 Jul 30 2006 LICENSE.TXT
-rw-r--r-- 1 jc users2269 Jun 24 15:56 Makefile
-rw-r--r-- 1 jc users4310 Feb 25 19:51 NOTES.TXT
-rw-r--r-- 1 jc users 130188 Jun 24 13:03 backend.c
-rw-r--r-- 1 jc users3528 Sep 12 2006 backend.h
drwxr-xr-x 3 jc users4096 Jun 24 16:15 build
-rw-r--r-- 1 jc users 28154 Jun 24 11:06 callbacks.c
-rw-r--r-- 1 jc users3513 Jul 9 2006 callbacks.h
drwxr-xr-x 3 jc users4096 Jun 24 15:53 config
-rw-r--r-- 1 jc users2502 Dec 31 11:19 configure.in
drwxr-xr-x 3 jc users4096 Jun 24 16:22 dist
-rw-r--r-- 1 jc users5188 Jan 5 17:46 externs.h
-rw-r--r-- 1 jc users 69011 Jan 5 19:31 flame-edit.c
-rw-r--r-- 1 jc users9375 Dec 31 11:19 flame-types.h
drwxr-xr-x 4 jc users4096 Jun 24 15:53 fonts
-rw-r--r-- 1 jc users 256963 Jun 24 13:56 gui-functions.c
-rw-r--r-- 1 jc users4714 Jul 4 2006 gui-functions.h
drwxr-xr-x 5 jc users4096 Jun 24 15:53 images
drwxr-xr-x 3 jc users4096 Jun 24 16:53 nbproject
-rw-r--r-- 1 jc users3344 Dec 30 23:03 old_Makefile
-rw-r--r-- 1 jc users766 Jul 30 2006 old_Makefile.config.in
drwxr-xr-x 3 jc users4096 Jun 24 15:53 sounds
$
[/code]
Any ideas?
# 7
Hi Justin,
> Ok, your tool doesn't work for me. :(
>
Well... Some feedback at least ;-)
[...]
> Looking at http://effbot.org/zone/element-index.htm,
> it gave some hints, so modified the import
> declaration at the top of your script to:
>
> [code]
> import os
> import sys
> import getopt
> from lxml.etree import Element, ElementTree
> [/code]
>
D'oh! Ok, fixed that...
I've uploaded a new version of the script. Could you please test this version with your installation?
>
> But after that, I can't get it to recognise the
> project directory or arguments in a useful way:
>
> [code]
> $ ./ss12-gtk-project.py -d /home/jc/SunStudioProjects
> -p flame-edit -P glib-2.0
> Error: Given project-dir or project-name doesn't
> exist!
Could you check if there is a file named "configurations.xml" in the nbproject sub-directory of the project directory (e.g. /home/jc/SunStudioProjects/flame-edit/nbproject/configurations.xml)?
I suspect that is has been renamed to "configurations.bak" in a previous attempt to run the script.
Just rename configurations.bak to configurations.xml...
Thanks for your feedback and suggestions!
Best regards,
Jens