Index: Alpy-0.1.5/alpy.py =================================================================== --- Alpy-0.1.5.orig/alpy.py 2012-03-28 03:07:42.682184386 +0200 +++ Alpy-0.1.5/alpy.py 2012-03-28 03:08:24.794378142 +0200 @@ -32,18 +32,18 @@ if not _ALLEGRO_USE_MODULES: return __import__('_alpy') _major, _minor = sys.version_info[:2] - try: import dl + try: import DLFCN except ImportError: - msg = "Sorry, to be able to use Allegro loadable modules you need to install the 'dl' module: you can still use Alpy, but some features will not be available" + msg = "Sorry, to be able to use Allegro loadable modules you need to install the 'DLFCN' module: you can still use Alpy, but some features will not be available" print >> sys.stderr, "Warning: %s\n" % msg return __import__('_alpy') if _major > 2 or (_major == 2 and _minor >= 2): - sys.setdlopenflags(dl.RTLD_NOW|dl.RTLD_GLOBAL) + sys.setdlopenflags(DLFCN.RTLD_NOW|DLFCN.RTLD_GLOBAL) return __import__('_alpy') else: file, path, desc = imp.find_module('_alpy') try: - handle = dl.open(path, dl.RTLD_NOW|dl.RTLD_GLOBAL) + handle = DLFCN.open(path, DLFCN.RTLD_NOW|DLFCN.RTLD_GLOBAL) m = __import__('_alpy') handle.close() return m Index: Alpy-0.1.5/_alpymodule.c =================================================================== --- Alpy-0.1.5.orig/_alpymodule.c 2012-03-29 00:20:15.351117567 +0200 +++ Alpy-0.1.5/_alpymodule.c 2012-03-29 00:27:10.017151329 +0200 @@ -29,6 +29,7 @@ #include "allegro.h" #include #include +#include static const char *_utf8 = "utf8"; @@ -237,6 +238,13 @@ { int result, alpy_system = SYSTEM_AUTODETECT; + /* this is an ugly hack added for OpenWRT: seems that recursive library + dependencies won't get the treatment configured in alpy.py via + sys.setdlopenflags(), so that aleg-fbcon.so references into liballegro + are not referenced. Of course we could also go and fix liballegro to + make all modules explicitely link to liballegro themselves. */ + dlopen("liballeg.so", RTLD_NOW|RTLD_GLOBAL); + if (!alpy_allegro_installed) { alpy_allegro_installed++;