| 1 | # Wedge definition for re2c.
|
| 2 | #
|
| 3 | # Loaded by deps/wedge.sh.
|
| 4 |
|
| 5 | set -o nounset
|
| 6 | set -o pipefail
|
| 7 | set -o errexit
|
| 8 |
|
| 9 | # sourced
|
| 10 | WEDGE_NAME='re2c'
|
| 11 | WEDGE_VERSION='4.3.1'
|
| 12 | WEDGE_IS_ABSOLUTE=1 # TODO: consider relaxing
|
| 13 |
|
| 14 | wedge-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 |
|
| 45 | wedge-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 |
|
| 62 | wedge-smoke-test() {
|
| 63 | local install_dir=$1
|
| 64 |
|
| 65 | $install_dir/bin/re2c --version
|
| 66 | }
|
| 67 |
|
| 68 |
|
| 69 | #
|
| 70 | # Unused
|
| 71 | #
|
| 72 |
|
| 73 | strip-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 | }
|