| 1 | # |
|---|
| 2 | # Hydrogen build script |
|---|
| 3 | # |
|---|
| 4 | |
|---|
| 5 | # vim: set filetype=python |
|---|
| 6 | # kate: syntax python |
|---|
| 7 | |
|---|
| 8 | import urllib |
|---|
| 9 | import os |
|---|
| 10 | import subprocess |
|---|
| 11 | import sys |
|---|
| 12 | import glob |
|---|
| 13 | |
|---|
| 14 | def printStatus( value ): |
|---|
| 15 | if value: |
|---|
| 16 | return "enabled" |
|---|
| 17 | else: |
|---|
| 18 | return "disabled" |
|---|
| 19 | |
|---|
| 20 | def recursiveDirs(root) : |
|---|
| 21 | return filter( ( lambda a : a.rfind( ".svn") == -1 ), [ a[0] for a in os.walk( root ) ] ) |
|---|
| 22 | |
|---|
| 23 | def unique( list ) : |
|---|
| 24 | return dict.fromkeys( list ).keys() |
|---|
| 25 | |
|---|
| 26 | def scanFiles(dir, accept=[ "*.cpp" ], reject=[] ) : |
|---|
| 27 | sources = [] |
|---|
| 28 | paths = recursiveDirs( dir ) |
|---|
| 29 | for path in paths: |
|---|
| 30 | for pattern in accept: |
|---|
| 31 | sources += glob.glob( path + "/" + pattern ) |
|---|
| 32 | for pattern in reject: |
|---|
| 33 | sources = filter( ( lambda a : a.rfind( pattern ) == -1 ), sources ) |
|---|
| 34 | return unique( sources ) |
|---|
| 35 | |
|---|
| 36 | def subdirsContaining( root, patterns ): |
|---|
| 37 | dirs = unique( map( os.path.dirname, scanFiles( root, patterns ) ) ) |
|---|
| 38 | dirs.sort() |
|---|
| 39 | return dirs |
|---|
| 40 | |
|---|
| 41 | |
|---|
| 42 | |
|---|
| 43 | def get_platform_flags(): |
|---|
| 44 | includes = [] |
|---|
| 45 | cppflags = [] |
|---|
| 46 | ldflags = [] |
|---|
| 47 | |
|---|
| 48 | if sys.platform == "linux2" or sys.platform == "darwin": |
|---|
| 49 | if debug: |
|---|
| 50 | cppflags += ['-Wall', '-g2', '-ggdb', '-O0'] |
|---|
| 51 | else: |
|---|
| 52 | cppflags += ['-O3', '-fomit-frame-pointer', '-funroll-loops'] |
|---|
| 53 | #cppflags += " %s" % get_optimized_flags( target_cpu ) |
|---|
| 54 | |
|---|
| 55 | if alsa: cppflags.append('-DALSA_SUPPORT') |
|---|
| 56 | if jack: cppflags.append('-DJACK_SUPPORT') |
|---|
| 57 | if lash: cppflags.append('-DLASH_SUPPORT') |
|---|
| 58 | if lrdf: cppflags.append('-DLRDF_SUPPORT') |
|---|
| 59 | if portaudio: cppflags.append('-DPORTAUDIO_SUPPORT') |
|---|
| 60 | if portmidi: cppflags.append('-DPORTMIDI_SUPPORT') |
|---|
| 61 | |
|---|
| 62 | |
|---|
| 63 | cppflags.append('-DFLAC_SUPPORT') |
|---|
| 64 | cppflags.append('-DLADSPA_SUPPORT') |
|---|
| 65 | cppflags.append('-DOSS_SUPPORT') |
|---|
| 66 | |
|---|
| 67 | |
|---|
| 68 | includes.append( '/usr/lib/lash-1.0' ) |
|---|
| 69 | |
|---|
| 70 | if libarchive: cppflags.append('-DLIBARCHIVE_SUPPORT') |
|---|
| 71 | |
|---|
| 72 | includes.append( './' ) |
|---|
| 73 | includes.append( 'gui/src/' ) |
|---|
| 74 | includes.append( '3rdparty/install/include' ) |
|---|
| 75 | |
|---|
| 76 | if sys.platform == 'linux2': |
|---|
| 77 | ldflags.append('-lasound') |
|---|
| 78 | |
|---|
| 79 | elif sys.platform == 'darwin': |
|---|
| 80 | pass |
|---|
| 81 | elif sys.platform == "win32": |
|---|
| 82 | includes.append( '3rdparty\install\include' ) |
|---|
| 83 | includes.append( 'build\pthreads\include' ) |
|---|
| 84 | includes.append( '3rdparty\libarchive\include' ) |
|---|
| 85 | includes.append( 'windows\timeFix' ) |
|---|
| 86 | else: |
|---|
| 87 | raise Exception( "Platform '%s' not supported" % sys.platform ) |
|---|
| 88 | |
|---|
| 89 | return (includes, cppflags, ldflags) |
|---|
| 90 | |
|---|
| 91 | |
|---|
| 92 | |
|---|
| 93 | def download_3rdparty_libs(): |
|---|
| 94 | print " * Downloading required 3rdparty libraries" |
|---|
| 95 | |
|---|
| 96 | curdir = os.path.abspath( os.path.curdir ) |
|---|
| 97 | |
|---|
| 98 | if sys.platform != "win32": |
|---|
| 99 | prefix = os.path.abspath( os.path.curdir ) + "/3rdparty/install" |
|---|
| 100 | else: |
|---|
| 101 | prefix = os.path.abspath( os.path.curdir ) + "\3rdparty\install" |
|---|
| 102 | |
|---|
| 103 | |
|---|
| 104 | compile_flags = "--enable-static --disable-shared" |
|---|
| 105 | |
|---|
| 106 | |
|---|
| 107 | if not os.path.exists( "3rdparty" ): |
|---|
| 108 | os.mkdir( "3rdparty" ) |
|---|
| 109 | |
|---|
| 110 | if not os.path.exists( "3rdparty/install" ): |
|---|
| 111 | os.mkdir( "3rdparty/install" ) |
|---|
| 112 | |
|---|
| 113 | if not os.path.exists( "3rdparty/install/lib" ): |
|---|
| 114 | os.mkdir( "3rdparty/install/lib" ) |
|---|
| 115 | |
|---|
| 116 | |
|---|
| 117 | |
|---|
| 118 | |
|---|
| 119 | if not os.path.exists( "3rdparty/libsndfile.tar.gz" ) and not os.path.exists("3rdparty/libsndfile.zip"): |
|---|
| 120 | if sys.platform != "win32": |
|---|
| 121 | print " * Downloading libsndfile.tar.gz" |
|---|
| 122 | urllib.urlretrieve("http://www.mega-nerd.com/libsndfile/libsndfile-1.0.17.tar.gz", "3rdparty/libsndfile.tar.gz") |
|---|
| 123 | else: |
|---|
| 124 | print " * Downloading libsndfile.zip" |
|---|
| 125 | urllib.urlretrieve("http://www.mega-nerd.com/libsndfile/libsndfile-1_0_17.zip", "3rdparty/libsndfile.zip") |
|---|
| 126 | |
|---|
| 127 | |
|---|
| 128 | if sys.platform != "win32": |
|---|
| 129 | #unix commands |
|---|
| 130 | if not os.path.exists( "3rdparty/install/lib/libsndfile.a" ): |
|---|
| 131 | Execute( "cd 3rdparty; tar xzf libsndfile.tar.gz" ) |
|---|
| 132 | Execute( "cd 3rdparty/libsndfile-1.0.17; ./configure --disable-flac --prefix=%s %s" % (prefix, compile_flags) ) |
|---|
| 133 | res = Execute( "cd 3rdparty\libsndfile-1.0.17; make -j2; make install" ) |
|---|
| 134 | if res != 0: |
|---|
| 135 | raise Exception( "Error compiling 3rdparty libraries" ) |
|---|
| 136 | else: |
|---|
| 137 | #windows |
|---|
| 138 | if not os.path.exists( "3rdparty\install\lib\libsndfile-1.dll" ): |
|---|
| 139 | Execute( "unzip 3rdparty\libsndfile.zip -d 3rdparty" ) |
|---|
| 140 | Execute( "copy 3rdparty\libsndfile-1_0_17\libsndfile-1.dll 3rdparty\install\lib") |
|---|
| 141 | Execute( "copy 3rdparty\libsndfile-1_0_17\sndfile.h 3rdparty\install\lib") |
|---|
| 142 | |
|---|
| 143 | |
|---|
| 144 | |
|---|
| 145 | |
|---|
| 146 | def get_svn_revision(): |
|---|
| 147 | p = subprocess.Popen("svnversion -n", shell=True, stdout=subprocess.PIPE) |
|---|
| 148 | return p.stdout.read() |
|---|
| 149 | |
|---|
| 150 | |
|---|
| 151 | |
|---|
| 152 | def get_hydrogen_lib(): |
|---|
| 153 | includes, cppflags, ldflags = get_platform_flags() |
|---|
| 154 | |
|---|
| 155 | includes.append( "libs/hydrogen/include" ) |
|---|
| 156 | includes.append( "/usr/include/lash-1.0") |
|---|
| 157 | |
|---|
| 158 | #location of qt4.py |
|---|
| 159 | qt4ToolLocation="." |
|---|
| 160 | |
|---|
| 161 | env = Environment(tools=['default','qt4'], toolpath=[qt4ToolLocation], ENV=os.environ, CPPPATH = includes, CPPFLAGS = cppflags, CCFLAGS = "", LINKFLAGS=ldflags ) |
|---|
| 162 | env.EnableQt4Modules( ['QtCore', 'QtGui'], debug=False) |
|---|
| 163 | env.CacheDir( "scons_cache" ) |
|---|
| 164 | |
|---|
| 165 | |
|---|
| 166 | src = scanFiles( "libs/hydrogen", ['*.cpp', '*.cc', '*.c' ], [ 'moc_'] ) |
|---|
| 167 | |
|---|
| 168 | static_lib = env.StaticLibrary(target = 'hydrogen', source = src ) |
|---|
| 169 | return static_lib |
|---|
| 170 | |
|---|
| 171 | |
|---|
| 172 | def get_hydrogen_gui( lib_hydrogen ): |
|---|
| 173 | includes, cppflags, ldflags = get_platform_flags() |
|---|
| 174 | |
|---|
| 175 | includes.append( "libs/hydrogen/include" ) |
|---|
| 176 | includes.append( "gui/src/UI" ) |
|---|
| 177 | includes.append( "/usr/include/lash-1.0") |
|---|
| 178 | |
|---|
| 179 | #location of qt4.py |
|---|
| 180 | qt4ToolLocation="." |
|---|
| 181 | |
|---|
| 182 | env = Environment(tools=['default','qt4'], toolpath=[qt4ToolLocation], ENV=os.environ, CPPPATH = includes, CPPFLAGS = cppflags, CCFLAGS = "", LINKFLAGS=ldflags ) |
|---|
| 183 | env.EnableQt4Modules( ['QtCore', 'QtGui','QtNetwork','QtXml'], debug=False) |
|---|
| 184 | env.CacheDir( "scons_cache" ) |
|---|
| 185 | |
|---|
| 186 | # rcc needs a -name flag because examples use identified resource files |
|---|
| 187 | def takebasename(file): |
|---|
| 188 | return os.path.splitext(os.path.basename(file))[0] |
|---|
| 189 | |
|---|
| 190 | |
|---|
| 191 | directory = "gui" |
|---|
| 192 | |
|---|
| 193 | resources = [ env.Qrc( qrc, QT4_QRCFLAGS = '-name ' + takebasename( qrc ) ) for qrc in scanFiles(directory, ['*.qrc'] ) ] |
|---|
| 194 | interfaces = [ env.Uic4( uic ) for uic in scanFiles(directory, ['*.ui'] ) ] |
|---|
| 195 | |
|---|
| 196 | |
|---|
| 197 | src = scanFiles( directory, ['*.cpp', '*.cc', '*.c' ], [ 'moc_'] ) |
|---|
| 198 | |
|---|
| 199 | env.Append( LIBS = lib_hydrogen ) |
|---|
| 200 | env.Append( LIBS = ["sndfile"] ) |
|---|
| 201 | |
|---|
| 202 | if lrdf: env.Append( LIBS = ["lrdf"] ) |
|---|
| 203 | if flac: env.Append( LIBS = ["FLAC","FLAC++"] ) |
|---|
| 204 | if lash: env.Append( LIBS = ["lash"]) |
|---|
| 205 | if jack: |
|---|
| 206 | env.Append( LIBS = ["jack"]) |
|---|
| 207 | env.ParseConfig('pkg-config --modversion jack', get_jack_midi_api_version) |
|---|
| 208 | if alsa: env.Append( LIBS = ["asound"]) |
|---|
| 209 | if libarchive: env.Append( LIBS = ["archive"]) |
|---|
| 210 | else: env.Append( LIBS = ["tar"]) |
|---|
| 211 | if portaudio: env.Append( LIBS = [ "portaudio" ] ) |
|---|
| 212 | if portmidi: |
|---|
| 213 | env.Append( LIBS = [ "portmidi" ] ) |
|---|
| 214 | env.Append( LIBS = [ "porttime" ] ) |
|---|
| 215 | |
|---|
| 216 | env.Append( LIBPATH = '3rdparty\libsndfile-1_0_17' ) |
|---|
| 217 | env.Append( LIBPATH = 'build\pthreads\lib' ) |
|---|
| 218 | |
|---|
| 219 | app = env.Program(target = 'hydrogen', source = src ) |
|---|
| 220 | |
|---|
| 221 | env.Alias('programs', app) |
|---|
| 222 | env.Default('programs') |
|---|
| 223 | |
|---|
| 224 | env.Alias(target="install", source=env.Install(dir= destdir + install_prefix + '/share/hydrogen/data', source="./data/i18n")) |
|---|
| 225 | env.Alias(target="install", source=env.Install(dir= destdir + install_prefix + '/share/hydrogen/data', source="./data/img")) |
|---|
| 226 | env.Alias(target="install", source=env.Install(dir= destdir + install_prefix + '/share/hydrogen/data', source="./data/drumkits")) |
|---|
| 227 | env.Alias(target="install", source=env.Install(dir= destdir + install_prefix + '/share/hydrogen/data', source="./data/demo_songs")) |
|---|
| 228 | env.Alias(target="install", source=env.Install(dir= destdir + install_prefix + '/share/hydrogen/data', source="./data/hydrogen.default.conf")) |
|---|
| 229 | env.Alias(target="install", source=env.Install(dir= destdir + install_prefix + '/share/hydrogen/data', source="./data/emptySample.wav")) |
|---|
| 230 | env.Alias(target="install", source=env.Install(dir= destdir + install_prefix + '/share/hydrogen/data', source="./data/click.wav")) |
|---|
| 231 | env.Alias(target="install", source=env.Install(dir= destdir + install_prefix + '/share/hydrogen/data', source="./data/doc")) |
|---|
| 232 | env.Alias(target="install", source=env.Install(dir= destdir + install_prefix + '/share/hydrogen/data', source="./data/DefaultSong.h2song")) |
|---|
| 233 | env.Alias(target="install", source=env.Install(dir= destdir + install_prefix + '/bin/', source="./hydrogengui")) |
|---|
| 234 | |
|---|
| 235 | return app |
|---|
| 236 | |
|---|
| 237 | |
|---|
| 238 | |
|---|
| 239 | opts = Options() |
|---|
| 240 | |
|---|
| 241 | #platform independent settings |
|---|
| 242 | opts.Add('debug', 'Set to 1 to build with debug informations', 0) |
|---|
| 243 | opts.Add('libarchive', 'Set to 1 to enable libarchive instead of libtar', 0) |
|---|
| 244 | opts.Add('prefix','Default: /usr/local',"/usr/local") |
|---|
| 245 | opts.Add('destdir','Default: none',"") |
|---|
| 246 | |
|---|
| 247 | #platform dependent settings |
|---|
| 248 | if sys.platform != "win32": |
|---|
| 249 | opts.Add('portmidi', 'Set to 1 to enable portmidi',0) |
|---|
| 250 | portmidi = int(ARGUMENTS.get('portmidi',0)) |
|---|
| 251 | |
|---|
| 252 | opts.Add('portaudio', 'Set to 1 to enable portaudio',0) |
|---|
| 253 | portaudio = int(ARGUMENTS.get('portaudio',0)) |
|---|
| 254 | |
|---|
| 255 | opts.Add('lash', 'Set to 1 to enable lash',0) |
|---|
| 256 | lash = int(ARGUMENTS.get('lash',0)) |
|---|
| 257 | |
|---|
| 258 | |
|---|
| 259 | opts.Add('alsa', 'Set to 1 to enable alsa',1) |
|---|
| 260 | alsa = int(ARGUMENTS.get('alsa',1)) |
|---|
| 261 | |
|---|
| 262 | |
|---|
| 263 | opts.Add('jack', 'Set to 1 to enable jack',1) |
|---|
| 264 | jack = int(ARGUMENTS.get('jack',1)) |
|---|
| 265 | |
|---|
| 266 | |
|---|
| 267 | opts.Add('lrdf', 'Set to 1 to enable lrdf',1) |
|---|
| 268 | lrdf = int(ARGUMENTS.get('lrdf',1)) |
|---|
| 269 | |
|---|
| 270 | |
|---|
| 271 | opts.Add('flac', 'Set to 1 to enable flac',1) |
|---|
| 272 | flac = int(ARGUMENTS.get('flac',1)) |
|---|
| 273 | |
|---|
| 274 | else: |
|---|
| 275 | #alsa, lash and jack are not available on windows |
|---|
| 276 | opts.Add('portmidi', 'Set to 1 to enable portmidi',1) |
|---|
| 277 | |
|---|
| 278 | opts.Add('portaudio', 'Set to 1 to enable portaudio',1) |
|---|
| 279 | portaudio = int(ARGUMENTS.get('portaudio',1)) |
|---|
| 280 | |
|---|
| 281 | opts.Add('lash', 'Set to 1 to enable lash',0) |
|---|
| 282 | lash = int(ARGUMENTS.get('lash',0)) |
|---|
| 283 | |
|---|
| 284 | |
|---|
| 285 | opts.Add('alsa', 'Set to 1 to enable alsa',0) |
|---|
| 286 | alsa = int(ARGUMENTS.get('alsa',0)) |
|---|
| 287 | |
|---|
| 288 | |
|---|
| 289 | opts.Add('jack', 'Set to 1 to enable jack',0) |
|---|
| 290 | jack = int(ARGUMENTS.get('jack',0)) |
|---|
| 291 | |
|---|
| 292 | opts.Add('lrdf', 'Set to 1 to enable lrdf',0) |
|---|
| 293 | lrdf = int(ARGUMENTS.get('lrdf',0)) |
|---|
| 294 | |
|---|
| 295 | opts.Add('flac', 'Set to 1 to enable flac',0) |
|---|
| 296 | flac = int(ARGUMENTS.get('flac',0)) |
|---|
| 297 | |
|---|
| 298 | # JACK MIDI version detection. |
|---|
| 299 | def get_jack_midi_api_version(xenv, pkg_ver): |
|---|
| 300 | global jack_midi |
|---|
| 301 | rv = "" |
|---|
| 302 | (major, minor, patch) = pkg_ver.rstrip().split('.') |
|---|
| 303 | major = int(major) |
|---|
| 304 | minor = int(minor) |
|---|
| 305 | patch = int(patch) |
|---|
| 306 | if major != 0: |
|---|
| 307 | return rv |
|---|
| 308 | if minor < 102: |
|---|
| 309 | return rv |
|---|
| 310 | rv = "-DJACK_MIDI_SUPPORT" |
|---|
| 311 | jack_midi = 1 |
|---|
| 312 | if (minor == 102) and (patch <= 26): |
|---|
| 313 | rv += " -DJACK_MIDI_0_102_0" |
|---|
| 314 | elif (minor < 104): |
|---|
| 315 | rv += " -DJACK_MIDI_0_102_27" |
|---|
| 316 | elif (minor == 104) and (patch == 0): |
|---|
| 317 | rv += " -DJACK_MIDI_0_102_27" |
|---|
| 318 | elif (minor >= 105): |
|---|
| 319 | rv += " -DJACK_MIDI_0_105_0" |
|---|
| 320 | xenv.MergeFlags(rv) |
|---|
| 321 | |
|---|
| 322 | debug =int(ARGUMENTS.get('debug', 0)) |
|---|
| 323 | libarchive = int(ARGUMENTS.get('libarchive', 0)) |
|---|
| 324 | |
|---|
| 325 | install_prefix = ARGUMENTS.get('prefix',"/usr/local") |
|---|
| 326 | destdir = ARGUMENTS.get('destdir',"") |
|---|
| 327 | |
|---|
| 328 | |
|---|
| 329 | #get includes ( important if you compile on non-standard envorionments) |
|---|
| 330 | includes, a , b = get_platform_flags() |
|---|
| 331 | env = Environment(options = opts, CPPPATH = includes) |
|---|
| 332 | |
|---|
| 333 | Help(opts.GenerateHelpText(env)) |
|---|
| 334 | |
|---|
| 335 | |
|---|
| 336 | platform = sys.platform |
|---|
| 337 | |
|---|
| 338 | #just download 3rd party libs if we're *not* running linux. |
|---|
| 339 | #We trust in our package managment system! |
|---|
| 340 | if platform == "darwin" or platform == "win32": |
|---|
| 341 | download_3rdparty_libs() |
|---|
| 342 | |
|---|
| 343 | |
|---|
| 344 | |
|---|
| 345 | #Check if all required libraries are installed |
|---|
| 346 | conf = Configure(env) |
|---|
| 347 | if not conf.CheckCHeader('sndfile.h'): |
|---|
| 348 | print 'libsndfile must be installed!' |
|---|
| 349 | Exit(1) |
|---|
| 350 | |
|---|
| 351 | |
|---|
| 352 | |
|---|
| 353 | # it seems that conf.CheckCHeader dislikes like the "++" in filenames |
|---|
| 354 | #if not conf.CheckCHeader('FLAC++/all.h'): |
|---|
| 355 | # print 'FLAC++ must be installed!' |
|---|
| 356 | # Exit(1) |
|---|
| 357 | |
|---|
| 358 | |
|---|
| 359 | # these libraries are optional (can be enabled/disabled, see 'scons -h') |
|---|
| 360 | |
|---|
| 361 | #alsa: (default: enabled) |
|---|
| 362 | if alsa and not conf.CheckCHeader('alsa/asoundlib.h'): |
|---|
| 363 | print 'alsa must be installed!' |
|---|
| 364 | Exit(1) |
|---|
| 365 | |
|---|
| 366 | #jack: (default: enabled) |
|---|
| 367 | if jack and not conf.CheckCHeader('jack/jack.h'): |
|---|
| 368 | print 'jack must be installed!' |
|---|
| 369 | Exit(1) |
|---|
| 370 | |
|---|
| 371 | #jack_midi: (default: enabled if jack is) |
|---|
| 372 | if jack and conf.CheckCHeader('jack/midiport.h'): |
|---|
| 373 | jack_midi = 1 |
|---|
| 374 | |
|---|
| 375 | #lash: (default: disabled) |
|---|
| 376 | if lash and not os.path.isdir("/usr/include/lash-1.0"): |
|---|
| 377 | print 'liblash must be installed!' |
|---|
| 378 | Exit(1) |
|---|
| 379 | |
|---|
| 380 | #libarchive: (default: disabled) |
|---|
| 381 | if libarchive and not conf.CheckCHeader("archive.h"): |
|---|
| 382 | print 'libarchive must be installed!' |
|---|
| 383 | Exit(1) |
|---|
| 384 | #libtar: needed if not libarchive |
|---|
| 385 | elif not libarchive and not conf.CheckCHeader("zlib.h"): |
|---|
| 386 | print 'zlib devel package must be installed!' |
|---|
| 387 | Exit(1) |
|---|
| 388 | elif not libarchive and not conf.CheckCHeader("libtar.h"): |
|---|
| 389 | print 'libtar must be installed!' |
|---|
| 390 | Exit(1) |
|---|
| 391 | |
|---|
| 392 | #lrdf: categorizing of ladspa effects |
|---|
| 393 | if lrdf and not conf.CheckCHeader('lrdf.h'): |
|---|
| 394 | print 'lrdf must be installed!' |
|---|
| 395 | Exit(1) |
|---|
| 396 | |
|---|
| 397 | #flac: support for flac samples |
|---|
| 398 | if flac and not conf.CheckCHeader('FLAC/all.h'): |
|---|
| 399 | print 'FLAC must be installed!' |
|---|
| 400 | Exit(1) |
|---|
| 401 | |
|---|
| 402 | |
|---|
| 403 | |
|---|
| 404 | print "" |
|---|
| 405 | print "=================================================================" |
|---|
| 406 | print " Hydrogen build script" |
|---|
| 407 | print "" |
|---|
| 408 | print " Revision: %s" % get_svn_revision() |
|---|
| 409 | print " Platform: %s" % platform |
|---|
| 410 | |
|---|
| 411 | if debug: |
|---|
| 412 | print " Debug build" |
|---|
| 413 | else: |
|---|
| 414 | print " Release build" |
|---|
| 415 | |
|---|
| 416 | print " Prefix: " + install_prefix |
|---|
| 417 | print " Destdir: " + destdir |
|---|
| 418 | print "=================================================================" |
|---|
| 419 | print "Feature Overview:\n" |
|---|
| 420 | |
|---|
| 421 | print " lash: " + printStatus( lash ) |
|---|
| 422 | print " alsa: " + printStatus( alsa ) |
|---|
| 423 | print " jack: " + printStatus( jack ) |
|---|
| 424 | print " jack_midi: " + printStatus( jack_midi ) |
|---|
| 425 | print "libarchive: " + printStatus( libarchive ) + (' (using libtar instead)', '')[libarchive] |
|---|
| 426 | print " portaudio: " + printStatus( portaudio ) |
|---|
| 427 | print " portmidi: " + printStatus( portmidi ) |
|---|
| 428 | |
|---|
| 429 | print "\n=================================================================" |
|---|
| 430 | print "" |
|---|
| 431 | |
|---|
| 432 | |
|---|
| 433 | # write the config.h file |
|---|
| 434 | conf = open("config.h", "w") |
|---|
| 435 | |
|---|
| 436 | conf.write( "#ifndef HYD_CONFIG_H\n" ) |
|---|
| 437 | conf.write( "#define HYD_CONFIG_H\n" ) |
|---|
| 438 | conf.write( "#include <string>\n" ) |
|---|
| 439 | conf.write( "static const std::string REVISION = \"%s\";\n" % get_svn_revision() ) |
|---|
| 440 | |
|---|
| 441 | |
|---|
| 442 | if debug: conf.write( "#define CONFIG_DEBUG\n" ) |
|---|
| 443 | if lash: conf.write( "#define LASH\n" ) |
|---|
| 444 | |
|---|
| 445 | conf.write( "#ifndef QT_BEGIN_NAMESPACE\n" ) |
|---|
| 446 | conf.write( "# define QT_BEGIN_NAMESPACE\n" ) |
|---|
| 447 | conf.write( "#endif\n" ) |
|---|
| 448 | conf.write( "#ifndef QT_END_NAMESPACE\n" ) |
|---|
| 449 | conf.write( "# define QT_END_NAMESPACE\n" ) |
|---|
| 450 | conf.write( "#endif\n" ) |
|---|
| 451 | |
|---|
| 452 | conf.write( "#define CONFIG_PREFIX \"%s\"\n" % install_prefix ) |
|---|
| 453 | conf.write( "#define DATA_PATH \"%s/share/hydrogen/data\"\n" % install_prefix ) |
|---|
| 454 | |
|---|
| 455 | conf.write( "#endif\n" ) |
|---|
| 456 | |
|---|
| 457 | conf.close() |
|---|
| 458 | |
|---|
| 459 | version = open("version.h", "w") |
|---|
| 460 | version.write( "#ifndef HYD_VERSION_H\n" ) |
|---|
| 461 | version.write( "#define HYD_VERSION_H\n" ) |
|---|
| 462 | version.write( "static const std::string VERSION = \"0.9.4-svn\" + REVISION;\n" ) |
|---|
| 463 | version.write( "#endif\n" ) |
|---|
| 464 | version.close() |
|---|
| 465 | |
|---|
| 466 | libhyd = get_hydrogen_lib() |
|---|
| 467 | app = get_hydrogen_gui( libhyd ) |
|---|