inz.fi

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit 2902f7e6ca31071f8731a3f3f4cba119ee30f92a
parent dfb5d90036276af103c9d261be7d5d2cd1a39910
Author: Santtu Lakkala <inz@inz.fi>
Date:   Sun, 21 Oct 2007 09:55:50 +0000

Leetle hildon-1/chinook migration things

Diffstat:
Aposts/leetle-hildon-1chinook-migration-things.md | 58++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 58 insertions(+), 0 deletions(-)

diff --git a/posts/leetle-hildon-1chinook-migration-things.md b/posts/leetle-hildon-1chinook-migration-things.md @@ -0,0 +1,57 @@ +# Leetle hildon-1/chinook migration things + + Most of "my" applications are now chinook ready, at least in the svn. However, I prefer to keep them compatible with mistral and bora, so I need to do little quirks. Let's investigate osso-xterm's modifications for example. + + What was previously known as hildon-libs, is now hildon-1, so we need to tell configure.ac about this. Before the change, I had: + +<div class="p"> + <pre> +PKG_CHECK_MODULES(HILDON, hildon-libs >= 0.12.0) +AC_SUBST(HILDON_CFLAGS) +AC_SUBST(HILDON_LIBS) + </pre> +</div> + + Now, as we need to also check for hildon-1, and due to the fact that we need to know it in source as the include paths have changed, it goes like this: + +<div class="p"> + <pre> +PKG_CHECK_MODULES(HILDON, hildon-1 >= 0.9.9, \ + AC_DEFINE(HILDON, 1, [Version of hildon libraries]), \ + [AC_DEFINE(HILDON, 0, [Version of hildon libraries]) \ + PKG_CHECK_MODULES(HILDON_LIBS, hildon-libs >= 0.12.0)]) +AC_SUBST(HILDON_CFLAGS) +AC_SUBST(HILDON_LIBS) + </pre> +</div> + + In code, I do the following: + +<div class="p"> + <pre> +#ifdef HAVE_CONFIG_H +# include <config.h> +#endif +#if HILDON == 1 +# include <hildon/hildon-window.h> +#else +# include <hildon-widgets/hildon-window.h> +#endif + </pre> +</div> + + There are also some real changes, but with this I get to compile stuff and get warnings/errors for the other stuff that has changed. Those I've, again, separated with #if HILDON == 1. + + For projects that don't use autotools, I use this kind of stuff: + +<div class="p"> + <pre> +mh_shot_tool_CFLAGS += $(shell if pkg-config hildon-1 --exists; then \ + pkg-config hildon-1 --cflags; echo -DHILDON=1; \ + elif pkg-config hildon-libs --exists; then \ + pkg-config hildon-libs --cflags; echo -DHILDON=0; \ + else pkg-config gtk+-2.0 --cflags; fi) + </pre> +</div> + + **Edit:** thanks to Loïc for pointing out, the AC_SUBSTs aren't actually needed, PKG_CHECK_MODULES already does that. You may omit them and it will still work. +\ No newline at end of file