Hi
Am Dienstag, 23. August 2005 00.57 schrieb Pedro Lopez-Cabanillas:
> About the compiling test. I could build Rosegarden with scons, and it went
> smooth, including installation. Except that there is no support for LIRC in
> the build system (there are sources, but no way to configure HAVE_LIRC).
I can confirm that. In /scons_admin/kde.py the LIRC part has been removed
between revision 1.3 and 1.4 after having been added with 1.3:
http://cvs.sourceforge.net/viewcvs.py/rosegarden/rosegarden/scons_admin/kde.py?r1=1.3&r2=1.4
The attached patch adds it again. I know that it's some bricolage, but I don't
know a better place to put it in for now. It was once proposed to put it into
sound.py as the other configurable options live there, but on the other hand
it's intended for the SConscript for the kde-app in ./gui, not in ./sound.
Regards
Toni
Index: rosegarden/scons_admin/kde.py
===================================================================
RCS file: /cvsroot/rosegarden/rosegarden/scons_admin/kde.py,v
retrieving revision 1.4
diff -u -d -r1.4 kde.py
--- rosegarden/scons_admin/kde.py 17 Aug 2005 18:31:10 -0000 1.4
+++ rosegarden/scons_admin/kde.py 26 Aug 2005 10:30:25 -0000
@@ -265,7 +265,7 @@
p('BOLD','* qtincludes ','qt includes path (/usr/include/qt on debian, ..)')
p('BOLD','* kdelibs ','kde libraries path, for linking the programs')
p('BOLD','* qtlibs ','qt libraries path, for linking the program')
-
+ p('BOLD','* nolirc ','disable LIRC')
p('BOLD','* scons configure libdir=/usr/local/lib qtincludes=/usr/include/qt\n')
return
@@ -305,6 +305,10 @@
('KDEXDG', ''), ('KDEXDGDIR', ''), ('KDEMENU', ''),
('KDEMIME', ''), ('KDEICONS', ''), ('KDESERV', ''),
('KDESERVTYPES', ''), ('KDEAPPS', ''),
+
+ ( 'OPTLIB_CCFLAGS', 'optional libraries compilation flags' ),
+ ( 'OPTLIB_LDFLAGS', 'optional libraries link flags' ),
+ ( 'LIRC_SOURCES', 'compile in LIRC sources' ),
)
opts.Update(env)
@@ -321,12 +325,41 @@
# reconfigure when things are missing
if not env['HELP'] and (env['_CONFIGURE'] or not env.has_key('QTDIR') or not env.has_key('KDEDIR')):
detect_kde(env)
+
+ # Configure stuff for optional libraries
+ conf = env.Configure()
+
+ if env.has_key('OPTLIB_CCFLAGS'):
+ env.__delitem__('OPTLIB_CCFLAGS')
+ if env.has_key('OPTLIB_LDFLAGS'):
+ env.__delitem__('OPTLIB_LDFLAGS')
+
+ if 'nolirc' in env['ARGS']:
+ print "-> LIRC support disabled by user"
+ haveLirc = 0
+ else:
+ haveLirc = conf.CheckLibWithHeader('lirc_client', 'lirc/lirc_client.h', 'C', 'int lirc_init();')
+
+ env = conf.Finish()
+
+ if haveLirc:
+ env.Append(LIRC_SOURCES = 1)
+ env.Append(OPTLIB_CCFLAGS = '-DHAVE_LIRC')
+ env.AppendUnique(OPTLIB_LDFLAGS = '-llirc_client')
+
opts.Save(cachefile, env)
## set default variables, one can override them in sconscript files
env.Append(CXXFLAGS = ['-I'+env['KDEINCLUDEPATH'], '-I'+env['QTINCLUDEPATH'] ],
LIBPATH = [env['KDELIBPATH'], env['QTLIBPATH'] ])
+ # optional libraries
+ if env.has_key('OPTLIB_CCFLAGS'):
+ env.AppendUnique(CCFLAGS = env['OPTLIB_CCFLAGS'] )
+ env.AppendUnique(CXXFLAGS = env['OPTLIB_CCFLAGS'] )
+ if env.has_key('OPTLIB_LDFLAGS'):
+ env.AppendUnique(LINKFLAGS = env['OPTLIB_LDFLAGS'] )
+
env['QT_AUTOSCAN'] = 1
env['QT_DEBUG'] = 0