+#
+# Check for wiimote dependencies
+
+if env['WIIMOTE']:
+ wiimoteConf = env.Configure ( )
+ if not wiimoteConf.CheckHeader('cwiid.h'):
+ print 'WIIMOTE configured but you are missing libcwiid!'
+ sys.exit(1)
+ if not wiimoteConf.CheckHeader('bluetooth/bluetooth.h'):
+ print 'WIIMOTE configured but you are missing the libbluetooth headers which you need to compile wiimote support!'
+ sys.exit(1)
+ wiimoteConf.Finish()
+
+
+#
+# Check for FLAC
+
+libraries['flac'] = LibraryInfo ()
+prep_libcheck(env, libraries['flac'])
+libraries['flac'].Append(CPPPATH="/usr/local/include", LIBPATH="/usr/local/lib")
+
+#
+# june 1st 2007: look for a function that is in FLAC 1.1.2 and not in later versions
+# since the version of libsndfile we have internally does not support
+# the new API that libFLAC has adopted
+#
+
+conf = Configure (libraries['flac'])
+if conf.CheckLib ('FLAC', 'FLAC__seekable_stream_decoder_init', language='CXX'):
+ conf.env.Append(CCFLAGS='-DHAVE_FLAC')
+ use_flac = True
+else:
+ use_flac = False
+
+libraries['flac'] = conf.Finish ()
+
+# or if that fails...
+#libraries['flac'] = LibraryInfo (LIBS='FLAC')
+