- Timestamp:
- Mar 12, 2017, 11:26:24 AM (8 years ago)
- Branches:
- sampler
- Children:
- bde49c4a
- Parents:
- 71f2e5f (diff), 67b6618 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
wscript
r71f2e5f r41b985f 48 48 49 49 def options(ctx): 50 ctx.add_option('--build-type', action = 'store', 51 default = "release", 52 choices = ('debug', 'release'), 53 dest = 'build_type', 54 help = 'whether to compile with (--build-type=release) or without (--build-type=debug) '\ 55 ' compiler opimizations [default: release]') 50 56 add_option_enable_disable(ctx, 'fftw3f', default = False, 51 57 help_str = 'compile with fftw3f instead of ooura (recommended)', … … 87 93 help_str = 'use CoreFoundation (darwin only) (auto)', 88 94 help_disable_str = 'do not use CoreFoundation framework') 89 add_option_enable_disable(ctx, 'atlas', default = None,90 help_str = 'use Atlas library ( auto)',95 add_option_enable_disable(ctx, 'atlas', default = False, 96 help_str = 'use Atlas library (no)', 91 97 help_disable_str = 'do not use Atlas library') 92 98 add_option_enable_disable(ctx, 'wavread', default = True, … … 134 140 ctx.env['DEST_OS'] = target_platform 135 141 142 if ctx.options.build_type == "debug": 143 ctx.define('DEBUG', 1) 144 else: 145 ctx.define('NDEBUG', 1) 146 136 147 if ctx.env.CC_NAME != 'msvc': 137 ctx.env.CFLAGS += ['-g', '-Wall', '-Wextra'] 148 if ctx.options.build_type == "debug": 149 # no optimization in debug mode 150 ctx.env.prepend_value('CFLAGS', ['-O0']) 151 else: 152 # default to -O2 in release mode 153 ctx.env.prepend_value('CFLAGS', ['-O2']) 154 # enable debug symbols and configure warnings 155 ctx.env.prepend_value('CFLAGS', ['-g', '-Wall', '-Wextra']) 138 156 else: 139 ctx.env.CFLAGS += ['/W4', '/MD'] 140 ctx.env.CFLAGS += ['/D_CRT_SECURE_NO_WARNINGS'] 157 # enable debug symbols 158 ctx.env.CFLAGS += ['/Z7', '/FS'] 159 ctx.env.LINKFLAGS += ['/DEBUG', '/INCREMENTAL:NO'] 160 # configure warnings 161 ctx.env.CFLAGS += ['/W4', '/D_CRT_SECURE_NO_WARNINGS'] 162 # set optimization level and runtime libs 163 if (ctx.options.build_type == "release"): 164 ctx.env.CFLAGS += ['/Ox'] 165 ctx.env.CFLAGS += ['/MD'] 166 else: 167 assert(ctx.options.build_type == "debug") 168 ctx.env.CFLAGS += ['/MDd'] 141 169 142 170 ctx.check_cc(lib='m', uselib_store='M', mandatory=False) … … 160 188 ctx.define('HAVE_SOURCE_APPLE_AUDIO', 1) 161 189 ctx.define('HAVE_SINK_APPLE_AUDIO', 1) 190 ctx.msg('Checking for AudioToolbox.framework', 'yes') 191 else: 192 ctx.msg('Checking for AudioToolbox.framework', 'no (disabled)', color = 'YELLOW') 162 193 if (ctx.options.enable_accelerate != False): 163 194 ctx.define('HAVE_ACCELERATE', 1) 164 195 ctx.env.FRAMEWORK += ['Accelerate'] 196 ctx.msg('Checking for Accelerate framework', 'yes') 197 else: 198 ctx.msg('Checking for Accelerate framework', 'no (disabled)', color = 'YELLOW') 165 199 166 200 if target_platform in [ 'ios', 'iosimulator' ]: … … 270 304 271 305 # check for libsamplerate 306 if (ctx.options.enable_double): 307 if (ctx.options.enable_samplerate): 308 ctx.fatal("Could not compile aubio in double precision mode with libsamplerate") 309 else: 310 ctx.options.enable_samplerate = False 311 ctx.msg('Checking if using samplerate', 'no (disabled in double precision mode)', 312 color = 'YELLOW') 272 313 if (ctx.options.enable_samplerate != False): 273 314 ctx.check_cfg(package = 'samplerate', atleast_version = '0.0.15', … … 330 371 # the following defines will be passed as arguments to the compiler 331 372 # instead of being written to src/config.h 373 ctx.define('HAVE_CONFIG_H', 1) 332 374 333 375 # add some defines used in examples … … 362 404 bld.env['LIB_VERSION'] = LIB_VERSION 363 405 406 # main source 407 bld.recurse('src') 408 364 409 # add sub directories 365 bld.recurse('src')366 410 if bld.env['DEST_OS'] not in ['ios', 'iosimulator', 'android']: 367 411 bld.recurse('examples') 368 412 bld.recurse('tests') 369 413 414 # pkg-config template 370 415 bld( source = 'aubio.pc.in' ) 371 416 417 # documentation 418 txt2man(bld) 419 doxygen(bld) 420 sphinx(bld) 421 422 def txt2man(bld): 372 423 # build manpages from txt files using txt2man 373 424 if bld.env['TXT2MAN']: 374 425 from waflib import TaskGen 375 426 if 'MANDIR' not in bld.env: 376 bld.env['MANDIR'] = bld.env['PREFIX'] + '/share/man' 427 bld.env['MANDIR'] = bld.env['DATAROOTDIR'] + '/man' 428 bld.env.VERSION = VERSION 377 429 rule_str = '${TXT2MAN} -t `basename ${TGT} | cut -f 1 -d . | tr a-z A-Z`' 378 430 rule_str += ' -r ${PACKAGE}\\ ${VERSION} -P ${PACKAGE}' … … 389 441 bld( source = bld.path.ant_glob('doc/*.txt') ) 390 442 443 def doxygen(bld): 391 444 # build documentation from source files using doxygen 392 445 if bld.env['DOXYGEN']: 393 446 bld( name = 'doxygen', rule = 'doxygen ${SRC} > /dev/null', 394 447 source = 'doc/web.cfg', 448 target = '../doc/web/html/index.html', 395 449 cwd = 'doc') 396 bld.install_files( '${ PREFIX}' + '/share/doc/libaubio-doc',450 bld.install_files( '${DATAROOTDIR}' + '/doc/libaubio-doc', 397 451 bld.path.ant_glob('doc/web/html/**'), 398 452 cwd = bld.path.find_dir ('doc/web'), 399 453 relative_trick = True) 400 454 455 def sphinx(bld): 401 456 # build documentation from source files using sphinx-build 457 # note: build in ../doc/_build/html, otherwise waf wont install unsigned files 402 458 if bld.env['SPHINX']: 403 bld( name = 'sphinx', rule = 'make html', 404 source = ['doc/conf.py'] + bld.path.ant_glob('doc/**.rst'), 405 cwd = 'doc') 406 bld.install_files( '${PREFIX}' + '/share/doc/libaubio-doc/sphinx', 459 bld.env.VERSION = VERSION 460 bld( name = 'sphinx', 461 rule = '${SPHINX} -b html -D release=${VERSION} -D version=${VERSION} -a -q `dirname ${SRC}` `dirname ${TGT}`', 462 source = 'doc/conf.py', 463 target = '../doc/_build/html/index.html') 464 bld.install_files( '${DATAROOTDIR}' + '/doc/libaubio-doc/sphinx', 407 465 bld.path.ant_glob('doc/_build/html/**'), 408 cwd = bld.path.find_dir 466 cwd = bld.path.find_dir('doc/_build/html'), 409 467 relative_trick = True) 468 469 # register the previous rules as build rules 470 from waflib.Build import BuildContext 471 472 class build_txt2man(BuildContext): 473 cmd = 'txt2man' 474 fun = 'txt2man' 475 476 class build_manpages(BuildContext): 477 cmd = 'manpages' 478 fun = 'txt2man' 479 480 class build_sphinx(BuildContext): 481 cmd = 'sphinx' 482 fun = 'sphinx' 483 484 class build_doxygen(BuildContext): 485 cmd = 'doxygen' 486 fun = 'doxygen' 410 487 411 488 def shutdown(bld): … … 418 495 419 496 def dist(ctx): 420 ctx.excl = ' **/.waf -1* **/*~ **/*.pyc **/*.swp **/*.swo **/*.swn **/.lock-w* **/.git*'497 ctx.excl = ' **/.waf* **/*~ **/*.pyc **/*.swp **/*.swo **/*.swn **/.lock-w* **/.git*' 421 498 ctx.excl += ' **/build/*' 422 499 ctx.excl += ' doc/_build' … … 427 504 ctx.excl += ' **.egg-info' 428 505 ctx.excl += ' **/**.zip **/**.tar.bz2' 506 ctx.excl += ' **.tar.bz2' 429 507 ctx.excl += ' **/doc/full/* **/doc/web/*' 508 ctx.excl += ' **/doc/full.cfg' 430 509 ctx.excl += ' **/python/*.db' 431 510 ctx.excl += ' **/python.old/*'
Note: See TracChangeset
for help on using the changeset viewer.