File: build.sh

package info (click to toggle)
uncrustify 0.68.1%2Bdfsg1-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 18,000 kB
  • sloc: cpp: 56,567; ansic: 19,840; cs: 3,097; python: 2,717; objc: 1,650; java: 510; sh: 390; awk: 150; perl: 63; makefile: 7
file content (33 lines) | stat: -rwxr-xr-x 2,059 bytes parent folder | download | duplicates (3)
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
#!/bin/sh
# script to build without cmake,
# manually generate header files usually created by CMake,
# past those inside Uncrustifys 'src' dir
# run this script in the 'emscripten' dir

sh_dir="$(dirname "$(readlink -f "$0")")"
outTmp="temp.bak"
out="libUncrustify.js"

#https://github.com/kripken/emscripten/blob/master/src/settings.js

em++ -O3                                                                       \
    ${COMMENT# initialy increase memory for big input files }                  \
    -s TOTAL_MEMORY=67108864                                                   \
    ${COMMENT# let the memory grow dynamically if even more is needed  }       \
    -s ALLOW_MEMORY_GROWTH=1                                                   \
    -s VERBOSE=1                                                               \
    -s MODULARIZE=1                                                            \
    -s EXPORT_NAME="'libUncrustify'"                                           \
    -s ERROR_ON_UNDEFINED_SYMBOLS=1                                            \
    -s ALLOW_MEMORY_GROWTH=1                                                   \
    -s "EXTRA_EXPORTED_RUNTIME_METHODS=['UTF8ToString', 'stringToUTF8', 'lengthBytesUTF8', 'writeAsciiToMemory']" \
    --bind                                                                     \
    --pre-js prefix_module.js                                                  \
    --post-js postfix_module.js                                                \
    ${COMMENT# TODO: handle async ajax load to enable this }                   \
    --memory-init-file 0                                                       \
    -o $out                                                                    \
    ../src/*.cpp                                                               \
&& cat "./prefix_file" "$out" "./postfix_file" > "$outTmp"                     \
&& mv "$outTmp" "$out"                                                         \
&& ./test/run_tests.py "$sh_dir/libUncrustify.js" "$sh_dir/test"