OILS / deps / source.medo / re2c / WEDGE View on Github | oils.pub

80 lines, 58 significant
1# Wedge definition for re2c.
2#
3# Loaded by deps/wedge.sh.
4
5set -o nounset
6set -o pipefail
7set -o errexit
8
9# sourced
10WEDGE_NAME='re2c'
11WEDGE_VERSION='4.3.1'
12WEDGE_IS_ABSOLUTE=1 # TODO: consider relaxing
13
14wedge-make() {
15 local src_dir=$1
16 local build_dir=$2
17 local install_dir=$3
18
19 pushd $build_dir
20
21 $src_dir/configure --help
22 echo
23
24 # Disable everything except C and Rust: https://re2c.org/build/build.html
25 time $src_dir/configure \
26 --prefix=$install_dir \
27 --enable-dlang=no \
28 --enable-golang=no \
29 --enable-haskell=no \
30 --enable-java=no \
31 --enable-js=no \
32 --enable-ocaml=no \
33 --enable-python=no \
34 --enable-swift=no \
35 --enable-vlang=no \
36 --enable-zig=no
37
38 echo
39
40 time make
41
42 popd
43}
44
45wedge-install() {
46 local build_dir=$1
47
48 pushd $build_dir
49
50 # install-strip is a GNU thing! It discards symbols.
51
52 # TODO: copy them from the original binary in $BUILD_DIR
53 # objcopy --add-debug-link, etc.
54 #
55 # /wedge/oilshell.org/symbols could be a separate thing.
56
57 time make install-strip
58
59 popd
60}
61
62wedge-smoke-test() {
63 local install_dir=$1
64
65 $install_dir/bin/re2c --version
66}
67
68
69#
70# Unused
71#
72
73strip-bin() {
74 ### UNUSED
75
76 # Makes a big difference -- stripped binary is 674K, while unstriped is 12.5
77 # MB!
78
79 strip -o $INSTALL_DIR/bin/re2c.stripped $INSTALL_DIR/bin/re2c
80}