From 598a141bf45e4fd9609215917d5d1a4b93f2f81f Mon Sep 17 00:00:00 2001 From: theMackabu Date: Tue, 20 Jan 2026 22:13:48 -0800 Subject: [PATCH] add libant build scripts --- libant/.gitignore | 4 + libant/build.sh | 9 ++ libant/meson.build | 283 ++++++++++++++++++++++++++++++++++++++ libant/meson_options.txt | 4 + libant/scripts/bundle.sh | 67 +++++++++ libant/scripts/common.sh | 8 ++ libant/scripts/compile.sh | 11 ++ libant/scripts/deps.sh | 76 ++++++++++ libant/scripts/header.sh | 114 +++++++++++++++ libant/scripts/setup.sh | 13 ++ 10 files changed, 589 insertions(+) create mode 100644 libant/.gitignore create mode 100755 libant/build.sh create mode 100644 libant/meson.build create mode 100644 libant/meson_options.txt create mode 100755 libant/scripts/bundle.sh create mode 100755 libant/scripts/common.sh create mode 100755 libant/scripts/compile.sh create mode 100755 libant/scripts/deps.sh create mode 100755 libant/scripts/header.sh create mode 100755 libant/scripts/setup.sh diff --git a/libant/.gitignore b/libant/.gitignore new file mode 100644 index 0000000..2b99c9e --- /dev/null +++ b/libant/.gitignore @@ -0,0 +1,4 @@ +/.cache +/build +/vendor +/dist \ No newline at end of file diff --git a/libant/build.sh b/libant/build.sh new file mode 100755 index 0000000..623b02d --- /dev/null +++ b/libant/build.sh @@ -0,0 +1,9 @@ +#!/bin/bash +set -e + +SCRIPTS_DIR="$(cd "$(dirname "$0")/scripts" && pwd)" + +"$SCRIPTS_DIR/setup.sh" +"$SCRIPTS_DIR/deps.sh" +"$SCRIPTS_DIR/compile.sh" "$@" +"$SCRIPTS_DIR/bundle.sh" diff --git a/libant/meson.build b/libant/meson.build new file mode 100644 index 0000000..698aa84 --- /dev/null +++ b/libant/meson.build @@ -0,0 +1,283 @@ +project('libant', 'c', default_options: [ + 'optimization=2', + 'c_std=gnu23', + 'default_library=static', + 'b_lto=false', + 'strip=true' +], subproject_dir: 'vendor') + +use_lto = get_option('lto') +cmake = import('cmake') +src_root = meson.project_source_root() / '..' + +module_files = run_command('sh', '-c', + 'ls ' + src_root / 'src' / 'modules' / '*.c', + check: true +).stdout().strip().split() + +lib_sources = files( + '../src/utils.c', + '../src/ant.c', + '../src/gc.c', + '../src/repl.c', + '../src/runtime.c', + '../src/snapshot.c', + '../src/esm/remote.c', +) + files(module_files) + +tls_lib = get_option('tls_library') +cc = meson.get_compiler('c') + +if tls_lib == 'openssl' + openssl_dep = dependency('openssl', required: true, static: true) + mbedtls_dep = [] +else + openssl_dep = dependency('', required: false) + mbedtls_dep = [ + dependency('mbedtls', required: true, static: true), + dependency('mbedx509', required: true, static: true), + dependency('mbedcrypto', required: true, static: true), + ] +endif +libsodium_dep = dependency('libsodium', required: true, static: true) + +if host_machine.system() == 'windows' + uuid_dep = cc.find_library('rpcrt4', required: true) +elif host_machine.system() == 'darwin' + uuid_dep = dependency('uuid', required: true) + security_dep = dependency('appleframeworks', modules: ['Security', 'CoreFoundation'], required: true) +else + uuid_dep = dependency('uuid', required: true, static: true) +endif + +llhttp = dependency('llhttp', static: true, required: false) +if not llhttp.found() + llhttp = dependency('llhttp', method: 'cmake', modules: ['llhttp::llhttp_static'], required: true) +endif + +libuv_sub = subproject('libuv', default_options: [ + 'build_tests=false', + 'build_benchmarks=false' +]) +libuv_dep = libuv_sub.get_variable('libuv_dep') + +tlsuv_opts = cmake.subproject_options() +bdwgc_opts = cmake.subproject_options() + +cmake_prefix = get_option('deps_prefix_cmake') +tlsuv_cmake_defines = { + 'BUILD_TESTING': 'OFF', + 'TLSUV_TLSLIB': tls_lib, + 'MBEDTLS_DIR': cmake_prefix, +} +tlsuv_opts.add_cmake_defines(tlsuv_cmake_defines) + +bdwgc_opts.add_cmake_defines({ + 'BUILD_SHARED_LIBS': 'OFF', + 'enable_cplusplus': 'OFF', +}) + +tlsuv_compile_args = [ + '-Wno-unused-function', + '-Wno-unused-variable', + '-Wno-bitwise-op-parentheses', + '-Wno-sometimes-uninitialized', + '-I' + meson.project_source_root() / 'subprojects' / 'libuv-v1.51.0' / 'include' +] +if cmake_prefix != '' + tlsuv_compile_args += ['-I' + cmake_prefix / 'include'] +endif +tlsuv_opts.append_compile_args('c', tlsuv_compile_args) + +bdwgc_gc_args = ['-DGC_NO_THREAD_REDIRECTS', '-DGC_THREADS'] +if host_machine.system() == 'linux' + bdwgc_gc_args += ['-DNO_GETCONTEXT'] +endif +bdwgc_opts.append_compile_args('c', bdwgc_gc_args) + +tlsuv_dep = cmake.subproject('tlsuv', options: tlsuv_opts).dependency('tlsuv') +bdwgc_dep = cmake.subproject('bdwgc', options: bdwgc_opts).dependency('gc') + +pcre2_dep = subproject('pcre2').get_variable('libpcre2_8') +uthash_dep = subproject('uthash').get_variable('uthash_dep') +yyjson_dep = subproject('yyjson').get_variable('yyjson_dep') +uuidv7_dep = subproject('uuidv7').get_variable('uuidv7_dep') +argtable3_dep = subproject('argtable3').get_variable('argtable3_dep') +minicoro_dep = subproject('minicoro').get_variable('minicoro_dep') + +zlib_dep = subproject('zlib-ng', + default_options: ['b_lto=false'] +).get_variable('zlib_ng_dep') + +libffi_dep = subproject('libffi', default_options: [ + 'warning_level=0', + 'tests=false' +]).get_variable('ffi_dep') + +cargo = find_program('cargo', required: true) +cp = find_program('cp', required: true) + +oxc_lib_name = 'liboxc.a' +oxc_output_name = 'liboxc.a' + +if host_machine.system() == 'windows' + rust_target = 'x86_64-pc-windows-gnu' + oxc_release_dir = meson.project_build_root() / 'oxc-target' / rust_target / 'release' + rust_target_arg = ' --target ' + rust_target +else + oxc_release_dir = meson.project_build_root() / 'oxc-target' / 'release' + rust_target_arg = '' +endif + +oxc_lib = custom_target( + 'oxc_strip', + output: oxc_output_name, + command: [ + 'sh', '-c', + cargo.full_path() + ' build --release' + rust_target_arg + ' ' + + '--manifest-path ' + meson.project_source_root() / '..' / 'src' / 'strip' / 'Cargo.toml' + ' ' + + '--target-dir ' + meson.project_build_root() / 'oxc-target' + + ' && ' + cp.full_path() + ' ' + oxc_release_dir / oxc_lib_name + ' @OUTPUT@' + ], + build_by_default: true +) + +oxc_dep = declare_dependency(link_with: oxc_lib) + +git_hash = run_command('git', 'rev-parse', '--short', 'HEAD', check: false).stdout().strip() +if git_hash == '' + git_hash = 'unknown' +endif + +timestamp_opt = get_option('build_timestamp') +if timestamp_opt == '' + timestamp = run_command('date', '+%s', check: true).stdout().strip() +else + timestamp = timestamp_opt +endif + +version_conf = configuration_data() +version_conf.set('ANT_VERSION', '0.3.13.' + timestamp + '-g' + git_hash) +version_conf.set('ANT_BUILD_TIMESTAMP', timestamp) + +cmd_cc = meson.get_compiler('c') +target_triple = run_command(cmd_cc.cmd_array(), '-dumpmachine', check: true).stdout().strip() + +triple_parts = target_triple.split('-') +if triple_parts.length() == 4 and triple_parts[1] != 'unknown' and triple_parts[1] != 'pc' and triple_parts[1] != 'apple' + target_triple = triple_parts[0] + '-unknown-' + triple_parts[2] + '-' + triple_parts[3] +endif + +version_conf.set('ANT_GIT_HASH', git_hash) +if tls_lib == 'mbedtls' + version_conf.set('ANT_TARGET_TRIPLE', target_triple + '-mbedtls') +else + version_conf.set('ANT_TARGET_TRIPLE', target_triple) +endif + +config_h = configure_file( + input: '../include/config.h.in', + output: 'config.h', + configuration: version_conf +) + +include = include_directories('../include') +build_include = include_directories('.') +strip_include = include_directories('../src/strip') + +add_project_arguments( + '-D NO_EXECUTE_PERMISSION', + '-Wno-unused-function', + '-Wno-deprecated-declarations', +language: 'c') + +if host_machine.system() == 'linux' + add_project_arguments('-fno-pie', language: 'c') + add_project_link_arguments('-no-pie', language: 'c') +endif + +node = find_program('node', required: true) + +core_files = run_command('sh', '-c', + 'find ' + meson.project_source_root() / '..' / 'src' / 'core' + ' -name "*.js" ! -name "index.js" | sort', + check: true +).stdout().strip().split() + +snapshot_h = custom_target( + 'snapshot', + input: ['../src/core/index.ts'] + files(core_files), + output: 'snapshot_data.h', + command: [ + node, + meson.project_source_root() / '..' / 'src' / 'tools' / 'gen_snapshot.js', + '@INPUT0@', + '@OUTPUT@', + 'VERSION=' + version_conf.get('ANT_VERSION'), + 'GIT_HASH=' + version_conf.get('ANT_GIT_HASH'), + 'BUILD_TIMESTAMP=' + version_conf.get('ANT_BUILD_TIMESTAMP'), + 'TARGET=' + version_conf.get('ANT_TARGET_TRIPLE'), + 'MBEDTLS=' + (tls_lib == 'mbedtls').to_string(), + 'HOST=' + host_machine.system() + ], + build_by_default: true +) + +ant_deps = [ + libffi_dep, bdwgc_dep, uuid_dep, + llhttp, pcre2_dep, libuv_dep, + argtable3_dep, tlsuv_dep, libsodium_dep, + yyjson_dep, minicoro_dep, uuidv7_dep, + openssl_dep, zlib_dep, uthash_dep, +] + mbedtls_dep + +if host_machine.system() == 'darwin' + ant_deps += [security_dep] +endif + +libant_core = static_library( + 'ant_core', + lib_sources + [snapshot_h], + include_directories: [include, build_include, strip_include], + dependencies: ant_deps + [oxc_dep], +) + +if use_lto + libant_core_lto = static_library( + 'ant_core_lto', + lib_sources + [snapshot_h], + include_directories: [include, build_include, strip_include], + dependencies: ant_deps + [oxc_dep], + c_args: ['-flto'], + ) +endif + +pkg = import('pkgconfig') + +if host_machine.system() == 'darwin' + pkg_libs = ['-framework Security', '-framework CoreFoundation', '-lpthread'] +elif host_machine.system() == 'linux' + pkg_libs = ['-lpthread', '-ldl', '-lm'] +elif host_machine.system() == 'windows' + pkg_libs = ['-lws2_32', '-lrpcrt4', '-lsecur32', '-lntdll', '-lcrypt32', '-luserenv'] +else + pkg_libs = ['-lpthread'] +endif + +pkg.generate( + name: 'libant', + description: 'Ant JavaScript Engine - Embeddable JS runtime', + version: version_conf.get('ANT_VERSION'), + extra_cflags: ['-I${includedir}/ant'], + libraries: ['-L${libdir}', '-lant'] + pkg_libs +) + +gen_header = custom_target( + 'ant_header', + input: [config_h], + output: 'libant.h', + command: [ + 'bash', meson.project_source_root() / 'scripts' / 'header.sh', + '@INPUT0@', '@OUTPUT@' + ], + build_by_default: true +) \ No newline at end of file diff --git a/libant/meson_options.txt b/libant/meson_options.txt new file mode 100644 index 0000000..da52a30 --- /dev/null +++ b/libant/meson_options.txt @@ -0,0 +1,4 @@ +option('build_timestamp', type: 'string', value: '', description: 'build timestamp (defaults to current time if empty)') +option('tls_library', type: 'combo', choices: ['openssl', 'mbedtls'], value: 'openssl', description: 'TLS library to use') +option('deps_prefix_cmake', type: 'string', value: '', description: 'prefix path for finding dependencies in cmake subprojects') +option('lto', type: 'boolean', value: true, description: 'also build LTO version (libant-lto.a)') diff --git a/libant/scripts/bundle.sh b/libant/scripts/bundle.sh new file mode 100755 index 0000000..c497337 --- /dev/null +++ b/libant/scripts/bundle.sh @@ -0,0 +1,67 @@ +#!/bin/bash +set -e + +. "$(dirname "$0")/common.sh" + +DIST_DIR="$SCRIPT_DIR/dist" +mkdir -p "$DIST_DIR" + +bundle_lib() { + NAME="$1" + EXCLUDE="$2" + OUTPUT="$BUILD_DIR/$NAME" + + echo "Bundling $NAME..." + + TMPDIR=$(mktemp -d) + + LIBS=$(find "$BUILD_DIR" -name '*.a' \ + ! -name 'libant.a' \ + ! -name 'libant-lto.a' \ + ! -path '*/oxc-target/release/deps/*' \ + ! -path '*/.external/*' \ + 2>/dev/null | grep -v "$EXCLUDE" | sort -u) + + cd "$TMPDIR" + for lib in $LIBS; do + libname=$(basename "$lib" .a) + mkdir -p "$libname" + (cd "$libname" && llvm-ar x "$lib" 2>/dev/null || ar x "$lib") + done + + find . -name '*.o' > objects.txt + + if [ ! -s objects.txt ]; then + echo "No objects found, skipping $NAME" + rm -rf "$TMPDIR" + cd "$SCRIPT_DIR" + return + fi + + if command -v llvm-ar >/dev/null 2>&1; then + llvm-ar rcs "$OUTPUT" $(cat objects.txt) + else + ar rcs "$OUTPUT" $(cat objects.txt) + fi + + rm -rf "$TMPDIR" + cd "$SCRIPT_DIR" + + cp "$OUTPUT" "$DIST_DIR/" + echo "Created: $DIST_DIR/$NAME ($(du -h "$OUTPUT" | cut -f1))" +} + +bundle_lib "libant.a" "_lto" + +if [ -f "$BUILD_DIR/libant_core_lto.a" ]; then + bundle_lib "libant-lto.a" "libant_core.a" +fi + +if [ -f "$BUILD_DIR/libant.h" ]; then + cp "$BUILD_DIR/libant.h" "$DIST_DIR/ant.h" + echo "Created: $DIST_DIR/ant.h" +fi + +echo "" +echo "Done! Distribution files in $DIST_DIR:" +ls -lh "$DIST_DIR"/ 2>/dev/null || echo "No files found" diff --git a/libant/scripts/common.sh b/libant/scripts/common.sh new file mode 100755 index 0000000..44ba9f2 --- /dev/null +++ b/libant/scripts/common.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +SCRIPT_DIR="$(cd "$(dirname "$0")/.." && pwd)" +ROOT_DIR="$(cd "$SCRIPT_DIR/.." && pwd)" +DEPS_DIR="$SCRIPT_DIR/build/deps" +BUILD_DIR="$SCRIPT_DIR/build" +CACHE_DIR="$SCRIPT_DIR/build/.external" +NCPU=$(sysctl -n hw.ncpu 2>/dev/null || nproc 2>/dev/null || echo 4) diff --git a/libant/scripts/compile.sh b/libant/scripts/compile.sh new file mode 100755 index 0000000..2904f71 --- /dev/null +++ b/libant/scripts/compile.sh @@ -0,0 +1,11 @@ +#!/bin/bash +set -e + +. "$(dirname "$0")/common.sh" + +cd "$SCRIPT_DIR" + +export PKG_CONFIG_PATH="$DEPS_DIR/lib/pkgconfig:$PKG_CONFIG_PATH" + +meson setup build --prefer-static -Dtls_library=mbedtls -Ddeps_prefix_cmake="$DEPS_DIR" "$@" +meson compile -C build diff --git a/libant/scripts/deps.sh b/libant/scripts/deps.sh new file mode 100755 index 0000000..c8dccba --- /dev/null +++ b/libant/scripts/deps.sh @@ -0,0 +1,76 @@ +#!/bin/bash +set -e + +. "$(dirname "$0")/common.sh" + +build_deps() { + if [ -f "$DEPS_DIR/lib/libllhttp.a" ] && \ + [ -f "$DEPS_DIR/lib/libz.a" ] && \ + [ -f "$DEPS_DIR/lib/libmbedtls.a" ] && \ + [ -f "$DEPS_DIR/lib/libsodium.a" ]; then + echo "Dependencies already built, skipping..." + return + fi + + echo "Building dependencies..." + mkdir -p "$DEPS_DIR" "$CACHE_DIR" + + if [ ! -f "$DEPS_DIR/lib/libllhttp.a" ]; then + echo "Building llhttp..." + rm -rf "$CACHE_DIR/llhttp" + git clone --depth 1 --branch release/v9.3.0 https://github.com/nodejs/llhttp.git "$CACHE_DIR/llhttp" + cd "$CACHE_DIR/llhttp" + cmake -B build \ + -DCMAKE_INSTALL_PREFIX="$DEPS_DIR" \ + -DBUILD_SHARED_LIBS=OFF \ + -DBUILD_STATIC_LIBS=ON \ + -DCMAKE_BUILD_TYPE=Release + cmake --build build -j$NCPU + cmake --install build + fi + + if [ ! -f "$DEPS_DIR/lib/libz.a" ]; then + echo "Building zlib..." + rm -rf "$CACHE_DIR/zlib" + git clone --depth 1 --branch v1.3.1 https://github.com/madler/zlib.git "$CACHE_DIR/zlib" + cd "$CACHE_DIR/zlib" + cmake -B build \ + -DCMAKE_INSTALL_PREFIX="$DEPS_DIR" \ + -DBUILD_SHARED_LIBS=OFF \ + -DCMAKE_BUILD_TYPE=Release + cmake --build build -j$NCPU + cmake --install build + rm -f "$DEPS_DIR/lib/libz.so"* "$DEPS_DIR/lib/libz.dylib"* 2>/dev/null || true + fi + + if [ ! -f "$DEPS_DIR/lib/libmbedtls.a" ]; then + echo "Building mbedTLS..." + rm -rf "$CACHE_DIR/mbedtls" + git clone --depth 1 --branch mbedtls-3.6.5 --recurse-submodules https://github.com/Mbed-TLS/mbedtls.git "$CACHE_DIR/mbedtls" + cd "$CACHE_DIR/mbedtls" + cmake -B build \ + -DCMAKE_INSTALL_PREFIX="$DEPS_DIR" \ + -DENABLE_PROGRAMS=OFF \ + -DENABLE_TESTING=OFF \ + -DCMAKE_BUILD_TYPE=Release \ + -DUSE_STATIC_MBEDTLS_LIBRARY=ON \ + -DUSE_SHARED_MBEDTLS_LIBRARY=OFF + cmake --build build -j$NCPU + cmake --install build + fi + + if [ ! -f "$DEPS_DIR/lib/libsodium.a" ]; then + echo "Building libsodium..." + rm -rf "$CACHE_DIR/libsodium" + git clone --depth 1 --branch 1.0.20-RELEASE https://github.com/jedisct1/libsodium.git "$CACHE_DIR/libsodium" + cd "$CACHE_DIR/libsodium" + ./autogen.sh + ./configure --prefix="$DEPS_DIR" --disable-shared --enable-static + make -j$NCPU + make install + fi + + echo "Dependencies built in $DEPS_DIR" +} + +build_deps diff --git a/libant/scripts/header.sh b/libant/scripts/header.sh new file mode 100755 index 0000000..d4b300d --- /dev/null +++ b/libant/scripts/header.sh @@ -0,0 +1,114 @@ +#!/bin/bash +set -e + +. "$(dirname "$0")/common.sh" + +CONFIG_H="$1" +OUTPUT="$2" +INCLUDE_DIR="$ROOT_DIR/include" + +if [ -z "$CONFIG_H" ] || [ -z "$OUTPUT" ]; then + echo "Usage: $0 " + exit 1 +fi + +VENDOR_DIR="$SCRIPT_DIR/vendor" + +HEADERS=( + "config.h:$CONFIG_H" + "compat.h:$INCLUDE_DIR/compat.h" + "ant.h:$INCLUDE_DIR/ant.h" + "utils.h:$INCLUDE_DIR/utils.h" + "gc_version.h:$VENDOR_DIR/gc-8.2.10/include/gc_version.h" + "gc_config_macros.h:$VENDOR_DIR/gc-8.2.10/include/gc_config_macros.h" + "gc.h:$VENDOR_DIR/gc-8.2.10/include/gc.h" + "minicoro.h:$VENDOR_DIR/minicoro/minicoro.h" + "arena.h:$INCLUDE_DIR/arena.h" + "runtime.h:$INCLUDE_DIR/runtime.h" + "esm/remote.h:$INCLUDE_DIR/esm/remote.h" +) + +for f in "$INCLUDE_DIR"/modules/*.h; do + name="modules/$(basename "$f")" + HEADERS+=("$name:$f") +done + +cat > "$OUTPUT" << 'EOF' +/* + * Ant JavaScript Engine + * https://github.com/themackabu/ant + * + * The MIT License (MIT) + * + * Copyright (c) 2026 theMackabu (me@themackabu.dev) + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * --- + * + * This is an auto-generated amalgamated header containing all public APIs. + * Link with libant.a and required system libraries: + * macOS: -framework Security -framework CoreFoundation -lpthread + * Linux: -lpthread -ldl -lm + * Windows: -lws2_32 -lrpcrt4 -lsecur32 -lntdll -lcrypt32 -luserenv + */ +#ifndef LIBANT_H +#define LIBANT_H + +EOF + +for entry in "${HEADERS[@]}"; do + name="${entry%%:*}" + path="${entry##*:}" + + if [ ! -f "$path" ]; then + echo "Warning: $path not found, skipping" >&2 + continue + fi + + echo "/* === $name === */" >> "$OUTPUT" + + while IFS= read -r line || [ -n "$line" ]; do + if [[ "$line" =~ ^[[:space:]]*#[[:space:]]*pragma[[:space:]]+once ]]; then + continue + fi + + if [[ "$line" =~ ^[[:space:]]*#[[:space:]]*include[[:space:]]+\"(config\.h|compat\.h|ant\.h|utils\.h|arena\.h|runtime\.h|internal\.h)\" ]]; then + continue + fi + if [[ "$line" =~ ^[[:space:]]*#[[:space:]]*include[[:space:]]+\"esm/ ]]; then + continue + fi + if [[ "$line" =~ ^[[:space:]]*#[[:space:]]*include[[:space:]]+\"modules/ ]]; then + continue + fi + + if [[ "$line" =~ ^[[:space:]]*#[[:space:]]*include[[:space:]]+\ ]]; then + continue + fi + + echo "$line" >> "$OUTPUT" + done < "$path" + + echo "" >> "$OUTPUT" +done + +echo "#endif /* LIBANT_H */" >> "$OUTPUT" + +echo "Generated $OUTPUT" diff --git a/libant/scripts/setup.sh b/libant/scripts/setup.sh new file mode 100755 index 0000000..8e51f08 --- /dev/null +++ b/libant/scripts/setup.sh @@ -0,0 +1,13 @@ +#!/bin/bash +set -e + +. "$(dirname "$0")/common.sh" + +cd "$ROOT_DIR" +meson subprojects download + +if [ ! -d "$SCRIPT_DIR/vendor" ]; then + cp -r "$ROOT_DIR/vendor" "$SCRIPT_DIR/vendor" +fi + +mkdir -p "$BUILD_DIR" -- 2.51.2