aboutsummaryrefslogtreecommitdiffstats
path: root/testing/emscripten/embuilder-omit-provided.patch
blob: 5bdcc26f82060b244ddaa4e1a95eab60c7a50a9b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
Remove task for building native_optimizer and binaryen. It's not needed,
because we ship this binary as a package. Also we don't build
emscripten-fastcomp with X86 target, so it can't be used to build this native
binary.

--- a/embuilder.py
+++ b/embuilder.py
@@ -33,8 +33,6 @@
         libcxx_noexcept
         libcxxabi
         gl
-        native_optimizer
-        binaryen
         bullet
         freetype
         libpng
@@ -48,14 +46,10 @@
 
 Issuing 'embuilder.py build ALL' causes each task to be built.
 
-It is also possible to build native_optimizer manually by using CMake. To
-do that, run
+Do not use this tool to build native_optimizer manually - it's already
+installed and configured on Alpine Linux.
 
-   1. cd $EMSCRIPTEN/tools/optimizer
-   2. cmake . -DCMAKE_BUILD_TYPE=Release
-   3. make (or mingw32-make/vcbuild/msbuild on Windows)
-
-and set up the location to the native optimizer in ~/.emscripten
+If you need binaryen, install it with apk: apk add binaryen.
 
 '''
   sys.exit(0)
@@ -88,12 +82,6 @@
       skip_tasks = {'libc-mt', 'dlmalloc_threadsafe', 'pthreads'}
       print('Skipping building of %s, because WebAssembly does not support pthreads.' % ', '.join(skip_tasks))
       tasks = [x for x in tasks if x not in skip_tasks]
-    if os.environ.get('EMSCRIPTEN_NATIVE_OPTIMIZER'):
-      print 'Skipping building of native-optimizer since environment variable EMSCRIPTEN_NATIVE_OPTIMIZER is present and set to point to a prebuilt native optimizer path.'
-    elif hasattr(shared, 'EMSCRIPTEN_NATIVE_OPTIMIZER'):
-      print 'Skipping building of native-optimizer since .emscripten config file has set EMSCRIPTEN_NATIVE_OPTIMIZER to point to a prebuilt native optimizer path.'
-    else:
-      tasks += ['native_optimizer']
   for what in tasks:
     shared.logging.info('building and verifying ' + what)
     if what in ('libc', 'dlmalloc'):
@@ -146,9 +134,7 @@
         }
       ''', ['gl.bc'])
     elif what == 'native_optimizer':
-      build('''
-        int main() {}
-      ''', ['optimizer.2.exe'], ['-O2'])
+      shared.logging.warning('native_optimizer is already installed: /usr/bin/emoptimizer. Skipping build.')
     elif what == 'wasm_compiler_rt':
       if shared.get_llvm_target() == shared.WASM_TARGET:
         build('''
@@ -177,7 +163,7 @@
     elif what == 'sdl2-ttf':
       build_port('sdl2-ttf', 'libsdl2_ttf.bc', ['-s', 'USE_SDL=2', '-s', 'USE_SDL_TTF=2', '-s', 'USE_FREETYPE=1'])
     elif what == 'binaryen':
-      build_port('binaryen', None, ['-s', 'BINARYEN=1'])
+      shared.logging.warning('Run "apk add binaryen" to install binaryen. Skipping build.')
     else:
       shared.logging.error('unfamiliar build target: ' + what)
       sys.exit(1)