Changeset 5b194f0


Ignore:
Timestamp:
Oct 1, 2017, 3:27:07 AM (2 years ago)
Author:
Paul Brossier <piem@piem.org>
Branches:
feature/autosink, feature/constantq, feature/pitchshift, feature/pydocstrings, feature/timestretch, master
Children:
16c12a1, 2a4ce6d
Parents:
2f02d51 (diff), 873646d (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.
Message:

Merge branch 'PR/simplify_emscripten'

Files:
4 edited

Legend:

Unmodified
Added
Removed
  • .appveyor.yml

    r2f02d51 r5b194f0  
    88    # pre-installed python version, see:
    99    # http://www.appveyor.com/docs/installed-software#python
    10     - PYTHON: "C:\\Python27"
     10    - PYTHONDIR: "C:\\Python27"
    1111      PYTHON_VERSION: "2.7.x"
    1212      PYTHON_ARCH: "32"
    1313
    14     - PYTHON: "C:\\Python27-x64"
     14    - PYTHONDIR: "C:\\Python27-x64"
    1515      PYTHON_VERSION: "2.7.x"
    1616      PYTHON_ARCH: "64"
    1717
    18     - PYTHON: "C:\\Python34"
     18    - PYTHONDIR: "C:\\Python34"
    1919      PYTHON_VERSION: "3.4.x"
    2020      PYTHON_ARCH: "32"
    2121
    22     - PYTHON: "C:\\Python34-x64"
     22    - PYTHONDIR: "C:\\Python34-x64"
    2323      PYTHON_VERSION: "3.4.x"
    2424      PYTHON_ARCH: "64"
    2525
    26     - PYTHON: "C:\\Python35"
     26    - PYTHONDIR: "C:\\Python35"
    2727      PYTHON_VERSION: "3.5.x"
    2828      PYTHON_ARCH: "32"
    2929
    30     - PYTHON: "C:\\Python35-x64"
     30    - PYTHONDIR: "C:\\Python35-x64"
    3131      PYTHON_VERSION: "3.5.x"
    3232      PYTHON_ARCH: "64"
     
    4040
    4141  # Check that we have the expected version and architecture for Python
    42   - "%PYTHON%\\python.exe --version"
    43   - "%PYTHON%\\python.exe -c \"import struct; print(struct.calcsize('P') * 8)\""
     42  - "%PYTHONDIR%\\python.exe --version"
     43  - "%PYTHONDIR%\\python.exe -c \"import struct; print(struct.calcsize('P') * 8)\""
    4444
    4545  # We need wheel installed to build wheels
    46   - "%PYTHON%\\python.exe -m pip install wheel"
     46  - "%PYTHONDIR%\\python.exe -m pip install wheel"
    4747
    48   - "SET PATH=%PATH_EXTRAS%;%PYTHON%;%PYTHON%\\Scripts;%PATH%"
     48  - "SET PATH=%PATH_EXTRAS%;%PYTHONDIR%;%PYTHONDIR%\\Scripts;%PATH%"
    4949
    5050  - "pip install --disable-pip-version-check --user --upgrade pip"
     
    5252
    5353before_build:
    54   - curl -fsS -o waf https://waf.io/waf-1.8.22
    55   - curl -fsS -o waf.bat https://raw.githubusercontent.com/waf-project/waf/master/utils/waf.bat
     54  - "bash scripts/get_waf.sh"
    5655
    5756build_script:
     
    6362  - "nose2 --verbose"
    6463  # clean up
    65   - waf distclean
     64  - "python waf distclean"
    6665  # build libaubio
    67   - waf configure build --verbose
     66  - python waf configure build --verbose --msvc_version="msvc 14.0"
    6867  # build python module using libaubio dll
    6968  - "python setup.py build"
  • scripts/build_emscripten

    r2f02d51 r5b194f0  
    1 #! /bin/sh
     1#! /bin/bash
    22
    33function checkprog() {
     
    1010
    1111# clean
    12 emmake ./waf distclean
     12./waf distclean
    1313
    1414# configure
    15 emconfigure ./waf configure --prefix=$EMSCRIPTEN/system/local/ --with-target-platform emscripten
     15emconfigure ./waf configure --with-target-platform emscripten $*
    1616
    1717# build
    18 emmake ./waf --testcmd="node %s"
    19 
    20 # intall
    21 #emmake ./waf install
     18emmake ./waf build
  • scripts/get_waf.sh

    r2f02d51 r5b194f0  
    1 #! /bin/sh
     1#! /bin/bash
    22
    33set -e
    44set -x
    55
    6 WAFURL=https://waf.io/waf-2.0.1
     6WAFVERSION=2.0.1
     7WAFTARBALL=waf-$WAFVERSION.tar.bz2
     8WAFURL=https://waf.io/$WAFTARBALL
    79
    8 ( which wget > /dev/null && wget -qO waf $WAFURL ) || ( which curl > /dev/null && curl $WAFURL > waf )
     10WAFBUILDDIR=`mktemp -d`
    911
    10 chmod +x waf
     12function cleanup () {
     13  rm -rf $WAFBUILDDIR
     14}
     15
     16trap cleanup SIGINT SIGTERM
     17
     18function buildwaf () {
     19  pushd $WAFBUILDDIR
     20
     21  ( which wget > /dev/null && wget -qO $WAFTARBALL $WAFURL ) || ( which curl > /dev/null && curl $WAFURL > $WAFTARBALL )
     22
     23  tar xf $WAFTARBALL
     24  pushd waf-$WAFVERSION
     25  NOCLIMB=1 python waf-light --tools=c_emscripten,syms $*
     26
     27  popd
     28  popd
     29
     30  cp -prv $WAFBUILDDIR/waf-$WAFVERSION/waf $PWD
     31
     32  chmod +x waf
     33}
     34
     35buildwaf
     36
     37cleanup
  • wscript

    r2f02d51 r5b194f0  
    103103
    104104def configure(ctx):
    105     from waflib import Options
    106     ctx.load('compiler_c')
    107     ctx.load('waf_unit_test')
    108     ctx.load('gnu_dirs')
    109 
    110105    target_platform = sys.platform
    111106    if ctx.options.target_platform:
    112107        target_platform = ctx.options.target_platform
    113108
     109    from waflib import Options
    114110
    115111    if target_platform=='emscripten':
    116         # need to force spaces between flag -o and path
    117         # inspired from :
    118         # https://github.com/waf-project/waf/blob/master/waflib/extras/c_emscripten.py (#1885)
    119         # (OSX /emscripten 1.37.9)
    120         ctx.env.CC_TGT_F            = ['-c', '-o', '']
    121         ctx.env.CCLNK_TGT_F         = ['-o', '']
     112        ctx.load('c_emscripten')
     113    else:
     114        ctx.load('compiler_c')
     115
     116    ctx.load('waf_unit_test')
     117    ctx.load('gnu_dirs')
     118
    122119    # check for common headers
    123120    ctx.check(header_name='stdlib.h')
     
    152149    else:
    153150        # enable debug symbols
    154         ctx.env.CFLAGS += ['/Z7', '/FS']
     151        ctx.env.CFLAGS += ['/Z7']
     152        # /FS flag available in msvc >= 12 (2013)
     153        if 'MSVC_VERSION' in ctx.env and ctx.env.MSVC_VERSION >= 12:
     154            ctx.env.CFLAGS += ['/FS']
    155155        ctx.env.LINKFLAGS += ['/DEBUG', '/INCREMENTAL:NO']
    156156        # configure warnings
     
    227227
    228228    if target_platform == 'emscripten':
    229         import os.path
    230         ctx.env.CFLAGS += [ '-I' + os.path.join(os.environ['EMSCRIPTEN'], 'system', 'include') ]
    231        
    232229        if ctx.options.build_type == "debug":
    233230            ctx.env.cshlib_PATTERN = '%s.js'
     
    250247        from python.lib.gen_external import get_c_declarations, get_cpp_objects_from_c_declarations, get_all_func_names_from_lib, generate_lib_from_c_declarations
    251248        c_decls = get_c_declarations(usedouble=False)  # emscripten can't use double
    252         objects = get_cpp_objects_from_c_declarations(c_decls)
     249        objects = list(get_cpp_objects_from_c_declarations(c_decls))
    253250        # ensure that aubio structs are exported
    254251        objects += ['fvec_t', 'cvec_t', 'fmat_t']
     
    447444    # add sub directories
    448445    if bld.env['DEST_OS'] not in ['ios', 'iosimulator', 'android']:
     446        if bld.env['DEST_OS']=='emscripten' and not bld.options.testcmd:
     447            bld.options.testcmd = 'node %s'
    449448        bld.recurse('examples')
    450449        bld.recurse('tests')
Note: See TracChangeset for help on using the changeset viewer.