Changes in wscript [54dd945:22dd9dc]
Legend:
- Unmodified
- Added
- Removed
-
wscript
r54dd945 r22dd9dc 31 31 out = 'build' 32 32 33 def add_option_enable_disable(ctx, name, default = None, help_str = None, help_disable_str = None): 34 if help_str == None: 35 help_str = 'enable ' + name + ' support' 36 if help_disable_str == None: 37 help_disable_str = 'do not ' + help_str 38 ctx.add_option('--enable-' + name, action = 'store_true', default = default, 39 dest = 'enable_' + name, 40 help = help_str) 41 ctx.add_option('--disable-' + name, action = 'store_false', 42 #default = default, 43 dest = 'enable_' + name, 44 help = help_disable_str ) 45 33 46 def options(ctx): 34 ctx.add_option('--enable-double', action='store_true', default=False, 35 help='compile aubio in double precision mode') 36 ctx.add_option('--enable-fftw3f', action='store_true', default=False, 37 help='compile with fftw3f instead of ooura (recommended)') 38 ctx.add_option('--enable-fftw3', action='store_true', default=False, 39 help='compile with fftw3 instead of ooura (recommended in double precision)') 40 ctx.add_option('--enable-complex', action='store_true', default=False, 41 help='compile with C99 complex') 42 ctx.add_option('--enable-jack', action='store_true', default=None, 43 help='compile with jack support') 44 ctx.add_option('--enable-lash', action='store_true', default=None, 45 help='compile with lash support') 46 ctx.add_option('--enable-sndfile', action='store_true', default=None, 47 help='compile with libsndfile support') 48 ctx.add_option('--enable-samplerate', action='store_true', default=None, 49 help='compile with libsamplerate support') 47 add_option_enable_disable(ctx, 'double', default = False, 48 help_str = 'compile aubio in double precision mode') 49 add_option_enable_disable(ctx, 'fftw3f', default = False, 50 help_str = 'compile with fftw3f instead of ooura (recommended)', help_disable_str = 'do not compile with fftw3f') 51 add_option_enable_disable(ctx, 'fftw3', default = False, 52 help_str = 'compile with fftw3 instead of ooura', help_disable_str = 'do not compile with fftw3') 53 add_option_enable_disable(ctx, 'complex', default = False, 54 help_str ='compile with C99 complex', help_disable_str = 'do not use C99 complex (default)' ) 55 add_option_enable_disable(ctx, 'jack', default = None, 56 help_str = 'compile with jack (auto)', help_disable_str = 'disable jack support') 57 add_option_enable_disable(ctx, 'lash', default = None, 58 help_str = 'compile with LASH (auto)', help_disable_str = 'disable LASH' ) 59 add_option_enable_disable(ctx, 'sndfile', default = None, 60 help_str = 'compile with sndfile (auto)', help_disable_str = 'disable sndfile') 61 add_option_enable_disable(ctx, 'samplerate', default = None, 62 help_str = 'compile with samplerate (auto)', help_disable_str = 'disable samplerate') 63 50 64 ctx.add_option('--with-target-platform', type='string', 51 65 help='set target platform for cross-compilation', dest='target_platform') 52 66 ctx.load('compiler_c') 53 67 ctx.load('waf_unit_test') 68 ctx.load('gnu_dirs') 54 69 55 70 def configure(ctx): … … 57 72 ctx.load('compiler_c') 58 73 ctx.load('waf_unit_test') 74 ctx.load('gnu_dirs') 59 75 ctx.env.CFLAGS += ['-g', '-Wall', '-Wextra'] 60 76 … … 73 89 ctx.define('HAVE_ACCELERATE', 1) 74 90 75 if Options.platform == 'ios':91 if Options.platform in [ 'ios', 'iosimulator' ]: 76 92 ctx.env.CC = 'clang' 77 93 ctx.env.LD = 'clang' 78 94 ctx.env.LINK_CC = 'clang' 79 SDKVER="6.1" 80 DEVROOT="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer" 81 SDKROOT="%(DEVROOT)s/SDKs/iPhoneOS%(SDKVER)s.sdk" % locals() 95 ctx.define('HAVE_ACCELERATE', 1) 96 ctx.define('TARGET_OS_IPHONE', 1) 82 97 ctx.env.FRAMEWORK = ['CoreFoundation', 'AudioToolbox', 'Accelerate'] 83 ctx.define('HAVE_ACCELERATE', 1) 84 ctx.env.CFLAGS += [ '-miphoneos-version-min=6.1', '-arch', 'armv7', 85 '--sysroot=%s' % SDKROOT] 86 ctx.env.LINKFLAGS += ['-std=c99', '-arch', 'armv7', '--sysroot=%s' % 87 SDKROOT] 98 SDKVER="7.0" 99 MINSDKVER="6.1" 100 if Options.platform == 'ios': 101 DEVROOT="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer" 102 SDKROOT="%(DEVROOT)s/SDKs/iPhoneOS%(SDKVER)s.sdk" % locals() 103 ctx.env.CFLAGS += [ '-arch', 'armv7' ] 104 ctx.env.CFLAGS += [ '-arch', 'armv7s' ] 105 ctx.env.LINKFLAGS += ['-arch', 'armv7'] 106 ctx.env.LINKFLAGS += ['-arch', 'armv7s'] 107 else: 108 DEVROOT="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer" 109 SDKROOT="%(DEVROOT)s/SDKs/iPhoneSimulator%(SDKVER)s.sdk" % locals() 110 ctx.env.CFLAGS += [ '-arch', 'i386' ] 111 ctx.env.LINKFLAGS += ['-arch', 'i386'] 112 ctx.env.CFLAGS += [ '-miphoneos-version-min=' + MINSDKVER ] 113 ctx.env.CFLAGS += [ '--sysroot=%s' % SDKROOT] 114 ctx.env.CFLAGS += ['-std=c99'] 115 ctx.env.LINKFLAGS += ['-std=c99'] 116 ctx.env.LINKFLAGS += ['--sysroot=%s' % SDKROOT] 88 117 89 118 # check for required headers … … 139 168 args = '--cflags --libs', mandatory = False) 140 169 ctx.define('HAVE_FFTW3', 1) 170 171 # fftw disabled, use ooura 172 if 'HAVE_FFTW3F' in ctx.env.define_key: 173 ctx.msg('Checking for FFT implementation', 'fftw3f') 174 elif 'HAVE_FFTW3' in ctx.env.define_key: 175 ctx.msg('Checking for FFT implementation', 'fftw3') 176 elif 'HAVE_ACCELERATE' in ctx.env.define_key: 177 ctx.msg('Checking for FFT implementation', 'vDSP') 141 178 else: 142 # fftw disabled, use ooura 143 if 'HAVE_ACCELERATE' in ctx.env.define_key: 144 ctx.msg('Checking for FFT implementation', 'vDSP') 145 else: 146 ctx.msg('Checking for FFT implementation', 'ooura') 147 pass 179 ctx.msg('Checking for FFT implementation', 'ooura') 148 180 149 181 if (Options.options.enable_jack != False): … … 175 207 bld.recurse('src') 176 208 from waflib import Options 177 if Options.platform != 'ios':209 if Options.platform not in ['ios', 'iosimulator']: 178 210 bld.recurse('examples') 179 211 bld.recurse('tests') 180 212 181 213 """ 182 # create the aubio.pc file for pkg-config183 if ctx.env['TARGET_PLATFORM'] == 'linux':184 aubiopc = ctx.new_task_gen('subst')185 aubiopc.source = 'aubio.pc.in'186 aubiopc.target = 'aubio.pc'187 aubiopc.install_path = '${PREFIX}/lib/pkgconfig'188 189 # build manpages from sgml files190 if ctx.env['DOCBOOKTOMAN']:191 import TaskGen192 TaskGen.declare_chain(193 name = 'docbooktoman',194 rule = '${DOCBOOKTOMAN} ${SRC} > ${TGT}',195 ext_in = '.sgml',196 ext_out = '.1',197 reentrant = 0,198 )199 manpages = ctx.new_task_gen(name = 'docbooktoman',200 source=ctx.path.ant_glob('doc/*.sgml'))201 ctx.install_files('${MANDIR}/man1', ctx.path.ant_glob('doc/*.1'))202 203 214 # install woodblock sound 204 215 bld.install_files('${PREFIX}/share/sounds/aubio/', … … 206 217 """ 207 218 219 bld( source = 'aubio.pc.in' ) 220 221 # build manpages from sgml files 222 if bld.env['DOCBOOKTOMAN']: 223 from waflib import TaskGen 224 if 'MANDIR' not in bld.env: 225 bld.env['MANDIR'] = bld.env['PREFIX'] + '/share/man' 226 TaskGen.declare_chain( 227 name = 'docbooktoman', 228 rule = '${DOCBOOKTOMAN} ${SRC} > ${TGT}', 229 ext_in = '.sgml', 230 ext_out = '.1', 231 reentrant = False, 232 install_path = '${MANDIR}/man1', 233 ) 234 bld( source = bld.path.ant_glob('doc/*.sgml') ) 235 236 """ 237 bld(rule = 'doxygen ${SRC}', source = 'web.cfg') #, target = 'doc/web/index.html') 238 """ 239 240 208 241 def shutdown(bld): 209 242 from waflib import Options, Logs 210 if Options.platform == 'ios':243 if Options.platform in ['ios', 'iosimulator']: 211 244 msg ='aubio built for ios, contact the author for a commercial license' 212 245 Logs.pprint('RED', msg) 213 246 msg =' Paul Brossier <piem@aubio.org>' 214 247 Logs.pprint('RED', msg) 248 249 250 def dist(ctx): 251 ctx.excl = ' **/.waf-1* **/*~ **/*.pyc **/*.swp **/.lock-w* **/.git*' 252 ctx.excl += ' **/build/*' 253 ctx.excl += ' **/python/gen **/python/build **/python/dist' 254 ctx.excl += ' **/**.zip **/**.tar.bz2' 255 ctx.excl += ' **/doc/full/*' 256 ctx.excl += ' **/python/*.db' 257 ctx.excl += ' **/python.old/*'
Note: See TracChangeset
for help on using the changeset viewer.