Index: ja2-0.12.1r6466/sgp/SGP.cc
===================================================================
--- ja2-0.12.1r6466.orig/sgp/SGP.cc	2009-07-24 09:37:53.000000000 +0100
+++ ja2-0.12.1r6466/sgp/SGP.cc	2009-07-24 09:53:01.000000000 +0100
@@ -31,6 +31,10 @@
 #include "VSurface.h"
 #include <SDL.h>
 
+#ifdef WITH_MAEMO
+#include <libosso.h>
+#endif
+
 #if defined _WIN32
 #	define WIN32_LEAN_AND_MEAN
 #	include <windows.h>
@@ -48,6 +52,9 @@
 BOOLEAN gfProgramIsRunning;
 static BOOLEAN gfGameInitialized = FALSE;
 
+#ifdef WITH_MAEMO
+static osso_context_t* context = NULL;
+#endif
 
 #if 0 // XXX TODO
 INT32 FAR PASCAL WindowProcedure(HWND hWindow, UINT16 Message, WPARAM wParam, LPARAM lParam)
@@ -124,6 +131,11 @@
 #ifdef WITH_MAEMO
 	putenv("SDL_VIDEO_X11_WMCLASS=ja2");
 #endif
+
+#ifdef WITH_MAEMO
+	context = osso_initialize ("com.nokia.ja2", "0.12.1", FALSE, NULL);
+#endif
+
 	SDL_Init(SDL_INIT_VIDEO);
 	SDL_EnableUNICODE(SDL_ENABLE);
 
@@ -180,6 +192,11 @@
 	// Shut down the different components of the SGP
 
 	// TEST
+
+#ifdef WITH_MAEMO
+	if (context) osso_deinitialize (context);
+#endif
+
 	SoundServiceStreams();
 
 	if (gfGameInitialized)
Index: ja2-0.12.1r6466/Makefile
===================================================================
--- ja2-0.12.1r6466.orig/Makefile	2009-07-24 09:37:53.000000000 +0100
+++ ja2-0.12.1r6466/Makefile	2009-07-24 09:57:53.000000000 +0100
@@ -29,6 +29,11 @@
 LDFLAGS_SDL := $(shell $(SDL_CONFIG) --libs)
 endif
 
+ifdef WITH_MAEMO
+  OSSO_CFLAGS := $(shell pkg-config --cflags libosso)
+  OSSO_LDFLAGS := $(shell pkg-config --libs libosso)
+  CFLAGS += $(OSSO_CFLAGS)
+endif
 
 CFLAGS += $(CFLAGS_SDL)
 CFLAGS += -I Build
@@ -114,6 +119,10 @@
 
 CXXFLAGS += $(CFLAGS)
 
+ifdef WITH_MAEMO
+  LDFLAGS += $(OSSO_LDFLAGS)
+endif
+
 LDFLAGS += $(LDFLAGS_SDL)
 LDFLAGS += -lm
 
