MIRROR: javascript for ๐Ÿœ's, a tiny runtime with big ambitions
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

add libant build scripts

+589
+4
libant/.gitignore
··· 1 + /.cache 2 + /build 3 + /vendor 4 + /dist
+9
libant/build.sh
··· 1 + #!/bin/bash 2 + set -e 3 + 4 + SCRIPTS_DIR="$(cd "$(dirname "$0")/scripts" && pwd)" 5 + 6 + "$SCRIPTS_DIR/setup.sh" 7 + "$SCRIPTS_DIR/deps.sh" 8 + "$SCRIPTS_DIR/compile.sh" "$@" 9 + "$SCRIPTS_DIR/bundle.sh"
+283
libant/meson.build
··· 1 + project('libant', 'c', default_options: [ 2 + 'optimization=2', 3 + 'c_std=gnu23', 4 + 'default_library=static', 5 + 'b_lto=false', 6 + 'strip=true' 7 + ], subproject_dir: 'vendor') 8 + 9 + use_lto = get_option('lto') 10 + cmake = import('cmake') 11 + src_root = meson.project_source_root() / '..' 12 + 13 + module_files = run_command('sh', '-c', 14 + 'ls ' + src_root / 'src' / 'modules' / '*.c', 15 + check: true 16 + ).stdout().strip().split() 17 + 18 + lib_sources = files( 19 + '../src/utils.c', 20 + '../src/ant.c', 21 + '../src/gc.c', 22 + '../src/repl.c', 23 + '../src/runtime.c', 24 + '../src/snapshot.c', 25 + '../src/esm/remote.c', 26 + ) + files(module_files) 27 + 28 + tls_lib = get_option('tls_library') 29 + cc = meson.get_compiler('c') 30 + 31 + if tls_lib == 'openssl' 32 + openssl_dep = dependency('openssl', required: true, static: true) 33 + mbedtls_dep = [] 34 + else 35 + openssl_dep = dependency('', required: false) 36 + mbedtls_dep = [ 37 + dependency('mbedtls', required: true, static: true), 38 + dependency('mbedx509', required: true, static: true), 39 + dependency('mbedcrypto', required: true, static: true), 40 + ] 41 + endif 42 + libsodium_dep = dependency('libsodium', required: true, static: true) 43 + 44 + if host_machine.system() == 'windows' 45 + uuid_dep = cc.find_library('rpcrt4', required: true) 46 + elif host_machine.system() == 'darwin' 47 + uuid_dep = dependency('uuid', required: true) 48 + security_dep = dependency('appleframeworks', modules: ['Security', 'CoreFoundation'], required: true) 49 + else 50 + uuid_dep = dependency('uuid', required: true, static: true) 51 + endif 52 + 53 + llhttp = dependency('llhttp', static: true, required: false) 54 + if not llhttp.found() 55 + llhttp = dependency('llhttp', method: 'cmake', modules: ['llhttp::llhttp_static'], required: true) 56 + endif 57 + 58 + libuv_sub = subproject('libuv', default_options: [ 59 + 'build_tests=false', 60 + 'build_benchmarks=false' 61 + ]) 62 + libuv_dep = libuv_sub.get_variable('libuv_dep') 63 + 64 + tlsuv_opts = cmake.subproject_options() 65 + bdwgc_opts = cmake.subproject_options() 66 + 67 + cmake_prefix = get_option('deps_prefix_cmake') 68 + tlsuv_cmake_defines = { 69 + 'BUILD_TESTING': 'OFF', 70 + 'TLSUV_TLSLIB': tls_lib, 71 + 'MBEDTLS_DIR': cmake_prefix, 72 + } 73 + tlsuv_opts.add_cmake_defines(tlsuv_cmake_defines) 74 + 75 + bdwgc_opts.add_cmake_defines({ 76 + 'BUILD_SHARED_LIBS': 'OFF', 77 + 'enable_cplusplus': 'OFF', 78 + }) 79 + 80 + tlsuv_compile_args = [ 81 + '-Wno-unused-function', 82 + '-Wno-unused-variable', 83 + '-Wno-bitwise-op-parentheses', 84 + '-Wno-sometimes-uninitialized', 85 + '-I' + meson.project_source_root() / 'subprojects' / 'libuv-v1.51.0' / 'include' 86 + ] 87 + if cmake_prefix != '' 88 + tlsuv_compile_args += ['-I' + cmake_prefix / 'include'] 89 + endif 90 + tlsuv_opts.append_compile_args('c', tlsuv_compile_args) 91 + 92 + bdwgc_gc_args = ['-DGC_NO_THREAD_REDIRECTS', '-DGC_THREADS'] 93 + if host_machine.system() == 'linux' 94 + bdwgc_gc_args += ['-DNO_GETCONTEXT'] 95 + endif 96 + bdwgc_opts.append_compile_args('c', bdwgc_gc_args) 97 + 98 + tlsuv_dep = cmake.subproject('tlsuv', options: tlsuv_opts).dependency('tlsuv') 99 + bdwgc_dep = cmake.subproject('bdwgc', options: bdwgc_opts).dependency('gc') 100 + 101 + pcre2_dep = subproject('pcre2').get_variable('libpcre2_8') 102 + uthash_dep = subproject('uthash').get_variable('uthash_dep') 103 + yyjson_dep = subproject('yyjson').get_variable('yyjson_dep') 104 + uuidv7_dep = subproject('uuidv7').get_variable('uuidv7_dep') 105 + argtable3_dep = subproject('argtable3').get_variable('argtable3_dep') 106 + minicoro_dep = subproject('minicoro').get_variable('minicoro_dep') 107 + 108 + zlib_dep = subproject('zlib-ng', 109 + default_options: ['b_lto=false'] 110 + ).get_variable('zlib_ng_dep') 111 + 112 + libffi_dep = subproject('libffi', default_options: [ 113 + 'warning_level=0', 114 + 'tests=false' 115 + ]).get_variable('ffi_dep') 116 + 117 + cargo = find_program('cargo', required: true) 118 + cp = find_program('cp', required: true) 119 + 120 + oxc_lib_name = 'liboxc.a' 121 + oxc_output_name = 'liboxc.a' 122 + 123 + if host_machine.system() == 'windows' 124 + rust_target = 'x86_64-pc-windows-gnu' 125 + oxc_release_dir = meson.project_build_root() / 'oxc-target' / rust_target / 'release' 126 + rust_target_arg = ' --target ' + rust_target 127 + else 128 + oxc_release_dir = meson.project_build_root() / 'oxc-target' / 'release' 129 + rust_target_arg = '' 130 + endif 131 + 132 + oxc_lib = custom_target( 133 + 'oxc_strip', 134 + output: oxc_output_name, 135 + command: [ 136 + 'sh', '-c', 137 + cargo.full_path() + ' build --release' + rust_target_arg + ' ' + 138 + '--manifest-path ' + meson.project_source_root() / '..' / 'src' / 'strip' / 'Cargo.toml' + ' ' + 139 + '--target-dir ' + meson.project_build_root() / 'oxc-target' + 140 + ' && ' + cp.full_path() + ' ' + oxc_release_dir / oxc_lib_name + ' @OUTPUT@' 141 + ], 142 + build_by_default: true 143 + ) 144 + 145 + oxc_dep = declare_dependency(link_with: oxc_lib) 146 + 147 + git_hash = run_command('git', 'rev-parse', '--short', 'HEAD', check: false).stdout().strip() 148 + if git_hash == '' 149 + git_hash = 'unknown' 150 + endif 151 + 152 + timestamp_opt = get_option('build_timestamp') 153 + if timestamp_opt == '' 154 + timestamp = run_command('date', '+%s', check: true).stdout().strip() 155 + else 156 + timestamp = timestamp_opt 157 + endif 158 + 159 + version_conf = configuration_data() 160 + version_conf.set('ANT_VERSION', '0.3.13.' + timestamp + '-g' + git_hash) 161 + version_conf.set('ANT_BUILD_TIMESTAMP', timestamp) 162 + 163 + cmd_cc = meson.get_compiler('c') 164 + target_triple = run_command(cmd_cc.cmd_array(), '-dumpmachine', check: true).stdout().strip() 165 + 166 + triple_parts = target_triple.split('-') 167 + if triple_parts.length() == 4 and triple_parts[1] != 'unknown' and triple_parts[1] != 'pc' and triple_parts[1] != 'apple' 168 + target_triple = triple_parts[0] + '-unknown-' + triple_parts[2] + '-' + triple_parts[3] 169 + endif 170 + 171 + version_conf.set('ANT_GIT_HASH', git_hash) 172 + if tls_lib == 'mbedtls' 173 + version_conf.set('ANT_TARGET_TRIPLE', target_triple + '-mbedtls') 174 + else 175 + version_conf.set('ANT_TARGET_TRIPLE', target_triple) 176 + endif 177 + 178 + config_h = configure_file( 179 + input: '../include/config.h.in', 180 + output: 'config.h', 181 + configuration: version_conf 182 + ) 183 + 184 + include = include_directories('../include') 185 + build_include = include_directories('.') 186 + strip_include = include_directories('../src/strip') 187 + 188 + add_project_arguments( 189 + '-D NO_EXECUTE_PERMISSION', 190 + '-Wno-unused-function', 191 + '-Wno-deprecated-declarations', 192 + language: 'c') 193 + 194 + if host_machine.system() == 'linux' 195 + add_project_arguments('-fno-pie', language: 'c') 196 + add_project_link_arguments('-no-pie', language: 'c') 197 + endif 198 + 199 + node = find_program('node', required: true) 200 + 201 + core_files = run_command('sh', '-c', 202 + 'find ' + meson.project_source_root() / '..' / 'src' / 'core' + ' -name "*.js" ! -name "index.js" | sort', 203 + check: true 204 + ).stdout().strip().split() 205 + 206 + snapshot_h = custom_target( 207 + 'snapshot', 208 + input: ['../src/core/index.ts'] + files(core_files), 209 + output: 'snapshot_data.h', 210 + command: [ 211 + node, 212 + meson.project_source_root() / '..' / 'src' / 'tools' / 'gen_snapshot.js', 213 + '@INPUT0@', 214 + '@OUTPUT@', 215 + 'VERSION=' + version_conf.get('ANT_VERSION'), 216 + 'GIT_HASH=' + version_conf.get('ANT_GIT_HASH'), 217 + 'BUILD_TIMESTAMP=' + version_conf.get('ANT_BUILD_TIMESTAMP'), 218 + 'TARGET=' + version_conf.get('ANT_TARGET_TRIPLE'), 219 + 'MBEDTLS=' + (tls_lib == 'mbedtls').to_string(), 220 + 'HOST=' + host_machine.system() 221 + ], 222 + build_by_default: true 223 + ) 224 + 225 + ant_deps = [ 226 + libffi_dep, bdwgc_dep, uuid_dep, 227 + llhttp, pcre2_dep, libuv_dep, 228 + argtable3_dep, tlsuv_dep, libsodium_dep, 229 + yyjson_dep, minicoro_dep, uuidv7_dep, 230 + openssl_dep, zlib_dep, uthash_dep, 231 + ] + mbedtls_dep 232 + 233 + if host_machine.system() == 'darwin' 234 + ant_deps += [security_dep] 235 + endif 236 + 237 + libant_core = static_library( 238 + 'ant_core', 239 + lib_sources + [snapshot_h], 240 + include_directories: [include, build_include, strip_include], 241 + dependencies: ant_deps + [oxc_dep], 242 + ) 243 + 244 + if use_lto 245 + libant_core_lto = static_library( 246 + 'ant_core_lto', 247 + lib_sources + [snapshot_h], 248 + include_directories: [include, build_include, strip_include], 249 + dependencies: ant_deps + [oxc_dep], 250 + c_args: ['-flto'], 251 + ) 252 + endif 253 + 254 + pkg = import('pkgconfig') 255 + 256 + if host_machine.system() == 'darwin' 257 + pkg_libs = ['-framework Security', '-framework CoreFoundation', '-lpthread'] 258 + elif host_machine.system() == 'linux' 259 + pkg_libs = ['-lpthread', '-ldl', '-lm'] 260 + elif host_machine.system() == 'windows' 261 + pkg_libs = ['-lws2_32', '-lrpcrt4', '-lsecur32', '-lntdll', '-lcrypt32', '-luserenv'] 262 + else 263 + pkg_libs = ['-lpthread'] 264 + endif 265 + 266 + pkg.generate( 267 + name: 'libant', 268 + description: 'Ant JavaScript Engine - Embeddable JS runtime', 269 + version: version_conf.get('ANT_VERSION'), 270 + extra_cflags: ['-I${includedir}/ant'], 271 + libraries: ['-L${libdir}', '-lant'] + pkg_libs 272 + ) 273 + 274 + gen_header = custom_target( 275 + 'ant_header', 276 + input: [config_h], 277 + output: 'libant.h', 278 + command: [ 279 + 'bash', meson.project_source_root() / 'scripts' / 'header.sh', 280 + '@INPUT0@', '@OUTPUT@' 281 + ], 282 + build_by_default: true 283 + )
+4
libant/meson_options.txt
··· 1 + option('build_timestamp', type: 'string', value: '', description: 'build timestamp (defaults to current time if empty)') 2 + option('tls_library', type: 'combo', choices: ['openssl', 'mbedtls'], value: 'openssl', description: 'TLS library to use') 3 + option('deps_prefix_cmake', type: 'string', value: '', description: 'prefix path for finding dependencies in cmake subprojects') 4 + option('lto', type: 'boolean', value: true, description: 'also build LTO version (libant-lto.a)')
+67
libant/scripts/bundle.sh
··· 1 + #!/bin/bash 2 + set -e 3 + 4 + . "$(dirname "$0")/common.sh" 5 + 6 + DIST_DIR="$SCRIPT_DIR/dist" 7 + mkdir -p "$DIST_DIR" 8 + 9 + bundle_lib() { 10 + NAME="$1" 11 + EXCLUDE="$2" 12 + OUTPUT="$BUILD_DIR/$NAME" 13 + 14 + echo "Bundling $NAME..." 15 + 16 + TMPDIR=$(mktemp -d) 17 + 18 + LIBS=$(find "$BUILD_DIR" -name '*.a' \ 19 + ! -name 'libant.a' \ 20 + ! -name 'libant-lto.a' \ 21 + ! -path '*/oxc-target/release/deps/*' \ 22 + ! -path '*/.external/*' \ 23 + 2>/dev/null | grep -v "$EXCLUDE" | sort -u) 24 + 25 + cd "$TMPDIR" 26 + for lib in $LIBS; do 27 + libname=$(basename "$lib" .a) 28 + mkdir -p "$libname" 29 + (cd "$libname" && llvm-ar x "$lib" 2>/dev/null || ar x "$lib") 30 + done 31 + 32 + find . -name '*.o' > objects.txt 33 + 34 + if [ ! -s objects.txt ]; then 35 + echo "No objects found, skipping $NAME" 36 + rm -rf "$TMPDIR" 37 + cd "$SCRIPT_DIR" 38 + return 39 + fi 40 + 41 + if command -v llvm-ar >/dev/null 2>&1; then 42 + llvm-ar rcs "$OUTPUT" $(cat objects.txt) 43 + else 44 + ar rcs "$OUTPUT" $(cat objects.txt) 45 + fi 46 + 47 + rm -rf "$TMPDIR" 48 + cd "$SCRIPT_DIR" 49 + 50 + cp "$OUTPUT" "$DIST_DIR/" 51 + echo "Created: $DIST_DIR/$NAME ($(du -h "$OUTPUT" | cut -f1))" 52 + } 53 + 54 + bundle_lib "libant.a" "_lto" 55 + 56 + if [ -f "$BUILD_DIR/libant_core_lto.a" ]; then 57 + bundle_lib "libant-lto.a" "libant_core.a" 58 + fi 59 + 60 + if [ -f "$BUILD_DIR/libant.h" ]; then 61 + cp "$BUILD_DIR/libant.h" "$DIST_DIR/ant.h" 62 + echo "Created: $DIST_DIR/ant.h" 63 + fi 64 + 65 + echo "" 66 + echo "Done! Distribution files in $DIST_DIR:" 67 + ls -lh "$DIST_DIR"/ 2>/dev/null || echo "No files found"
+8
libant/scripts/common.sh
··· 1 + #!/bin/bash 2 + 3 + SCRIPT_DIR="$(cd "$(dirname "$0")/.." && pwd)" 4 + ROOT_DIR="$(cd "$SCRIPT_DIR/.." && pwd)" 5 + DEPS_DIR="$SCRIPT_DIR/build/deps" 6 + BUILD_DIR="$SCRIPT_DIR/build" 7 + CACHE_DIR="$SCRIPT_DIR/build/.external" 8 + NCPU=$(sysctl -n hw.ncpu 2>/dev/null || nproc 2>/dev/null || echo 4)
+11
libant/scripts/compile.sh
··· 1 + #!/bin/bash 2 + set -e 3 + 4 + . "$(dirname "$0")/common.sh" 5 + 6 + cd "$SCRIPT_DIR" 7 + 8 + export PKG_CONFIG_PATH="$DEPS_DIR/lib/pkgconfig:$PKG_CONFIG_PATH" 9 + 10 + meson setup build --prefer-static -Dtls_library=mbedtls -Ddeps_prefix_cmake="$DEPS_DIR" "$@" 11 + meson compile -C build
+76
libant/scripts/deps.sh
··· 1 + #!/bin/bash 2 + set -e 3 + 4 + . "$(dirname "$0")/common.sh" 5 + 6 + build_deps() { 7 + if [ -f "$DEPS_DIR/lib/libllhttp.a" ] && \ 8 + [ -f "$DEPS_DIR/lib/libz.a" ] && \ 9 + [ -f "$DEPS_DIR/lib/libmbedtls.a" ] && \ 10 + [ -f "$DEPS_DIR/lib/libsodium.a" ]; then 11 + echo "Dependencies already built, skipping..." 12 + return 13 + fi 14 + 15 + echo "Building dependencies..." 16 + mkdir -p "$DEPS_DIR" "$CACHE_DIR" 17 + 18 + if [ ! -f "$DEPS_DIR/lib/libllhttp.a" ]; then 19 + echo "Building llhttp..." 20 + rm -rf "$CACHE_DIR/llhttp" 21 + git clone --depth 1 --branch release/v9.3.0 https://github.com/nodejs/llhttp.git "$CACHE_DIR/llhttp" 22 + cd "$CACHE_DIR/llhttp" 23 + cmake -B build \ 24 + -DCMAKE_INSTALL_PREFIX="$DEPS_DIR" \ 25 + -DBUILD_SHARED_LIBS=OFF \ 26 + -DBUILD_STATIC_LIBS=ON \ 27 + -DCMAKE_BUILD_TYPE=Release 28 + cmake --build build -j$NCPU 29 + cmake --install build 30 + fi 31 + 32 + if [ ! -f "$DEPS_DIR/lib/libz.a" ]; then 33 + echo "Building zlib..." 34 + rm -rf "$CACHE_DIR/zlib" 35 + git clone --depth 1 --branch v1.3.1 https://github.com/madler/zlib.git "$CACHE_DIR/zlib" 36 + cd "$CACHE_DIR/zlib" 37 + cmake -B build \ 38 + -DCMAKE_INSTALL_PREFIX="$DEPS_DIR" \ 39 + -DBUILD_SHARED_LIBS=OFF \ 40 + -DCMAKE_BUILD_TYPE=Release 41 + cmake --build build -j$NCPU 42 + cmake --install build 43 + rm -f "$DEPS_DIR/lib/libz.so"* "$DEPS_DIR/lib/libz.dylib"* 2>/dev/null || true 44 + fi 45 + 46 + if [ ! -f "$DEPS_DIR/lib/libmbedtls.a" ]; then 47 + echo "Building mbedTLS..." 48 + rm -rf "$CACHE_DIR/mbedtls" 49 + git clone --depth 1 --branch mbedtls-3.6.5 --recurse-submodules https://github.com/Mbed-TLS/mbedtls.git "$CACHE_DIR/mbedtls" 50 + cd "$CACHE_DIR/mbedtls" 51 + cmake -B build \ 52 + -DCMAKE_INSTALL_PREFIX="$DEPS_DIR" \ 53 + -DENABLE_PROGRAMS=OFF \ 54 + -DENABLE_TESTING=OFF \ 55 + -DCMAKE_BUILD_TYPE=Release \ 56 + -DUSE_STATIC_MBEDTLS_LIBRARY=ON \ 57 + -DUSE_SHARED_MBEDTLS_LIBRARY=OFF 58 + cmake --build build -j$NCPU 59 + cmake --install build 60 + fi 61 + 62 + if [ ! -f "$DEPS_DIR/lib/libsodium.a" ]; then 63 + echo "Building libsodium..." 64 + rm -rf "$CACHE_DIR/libsodium" 65 + git clone --depth 1 --branch 1.0.20-RELEASE https://github.com/jedisct1/libsodium.git "$CACHE_DIR/libsodium" 66 + cd "$CACHE_DIR/libsodium" 67 + ./autogen.sh 68 + ./configure --prefix="$DEPS_DIR" --disable-shared --enable-static 69 + make -j$NCPU 70 + make install 71 + fi 72 + 73 + echo "Dependencies built in $DEPS_DIR" 74 + } 75 + 76 + build_deps
+114
libant/scripts/header.sh
··· 1 + #!/bin/bash 2 + set -e 3 + 4 + . "$(dirname "$0")/common.sh" 5 + 6 + CONFIG_H="$1" 7 + OUTPUT="$2" 8 + INCLUDE_DIR="$ROOT_DIR/include" 9 + 10 + if [ -z "$CONFIG_H" ] || [ -z "$OUTPUT" ]; then 11 + echo "Usage: $0 <config.h> <output.h>" 12 + exit 1 13 + fi 14 + 15 + VENDOR_DIR="$SCRIPT_DIR/vendor" 16 + 17 + HEADERS=( 18 + "config.h:$CONFIG_H" 19 + "compat.h:$INCLUDE_DIR/compat.h" 20 + "ant.h:$INCLUDE_DIR/ant.h" 21 + "utils.h:$INCLUDE_DIR/utils.h" 22 + "gc_version.h:$VENDOR_DIR/gc-8.2.10/include/gc_version.h" 23 + "gc_config_macros.h:$VENDOR_DIR/gc-8.2.10/include/gc_config_macros.h" 24 + "gc.h:$VENDOR_DIR/gc-8.2.10/include/gc.h" 25 + "minicoro.h:$VENDOR_DIR/minicoro/minicoro.h" 26 + "arena.h:$INCLUDE_DIR/arena.h" 27 + "runtime.h:$INCLUDE_DIR/runtime.h" 28 + "esm/remote.h:$INCLUDE_DIR/esm/remote.h" 29 + ) 30 + 31 + for f in "$INCLUDE_DIR"/modules/*.h; do 32 + name="modules/$(basename "$f")" 33 + HEADERS+=("$name:$f") 34 + done 35 + 36 + cat > "$OUTPUT" << 'EOF' 37 + /* 38 + * Ant JavaScript Engine 39 + * https://github.com/themackabu/ant 40 + * 41 + * The MIT License (MIT) 42 + * 43 + * Copyright (c) 2026 theMackabu (me@themackabu.dev) 44 + * 45 + * Permission is hereby granted, free of charge, to any person obtaining a copy 46 + * of this software and associated documentation files (the "Software"), to deal 47 + * in the Software without restriction, including without limitation the rights 48 + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 49 + * copies of the Software, and to permit persons to whom the Software is 50 + * furnished to do so, subject to the following conditions: 51 + * 52 + * The above copyright notice and this permission notice shall be included in all 53 + * copies or substantial portions of the Software. 54 + * 55 + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 56 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 57 + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 58 + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 59 + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 60 + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 61 + * SOFTWARE. 62 + * 63 + * --- 64 + * 65 + * This is an auto-generated amalgamated header containing all public APIs. 66 + * Link with libant.a and required system libraries: 67 + * macOS: -framework Security -framework CoreFoundation -lpthread 68 + * Linux: -lpthread -ldl -lm 69 + * Windows: -lws2_32 -lrpcrt4 -lsecur32 -lntdll -lcrypt32 -luserenv 70 + */ 71 + #ifndef LIBANT_H 72 + #define LIBANT_H 73 + 74 + EOF 75 + 76 + for entry in "${HEADERS[@]}"; do 77 + name="${entry%%:*}" 78 + path="${entry##*:}" 79 + 80 + if [ ! -f "$path" ]; then 81 + echo "Warning: $path not found, skipping" >&2 82 + continue 83 + fi 84 + 85 + echo "/* === $name === */" >> "$OUTPUT" 86 + 87 + while IFS= read -r line || [ -n "$line" ]; do 88 + if [[ "$line" =~ ^[[:space:]]*#[[:space:]]*pragma[[:space:]]+once ]]; then 89 + continue 90 + fi 91 + 92 + if [[ "$line" =~ ^[[:space:]]*#[[:space:]]*include[[:space:]]+\"(config\.h|compat\.h|ant\.h|utils\.h|arena\.h|runtime\.h|internal\.h)\" ]]; then 93 + continue 94 + fi 95 + if [[ "$line" =~ ^[[:space:]]*#[[:space:]]*include[[:space:]]+\"esm/ ]]; then 96 + continue 97 + fi 98 + if [[ "$line" =~ ^[[:space:]]*#[[:space:]]*include[[:space:]]+\"modules/ ]]; then 99 + continue 100 + fi 101 + 102 + if [[ "$line" =~ ^[[:space:]]*#[[:space:]]*include[[:space:]]+\<config\.h\> ]]; then 103 + continue 104 + fi 105 + 106 + echo "$line" >> "$OUTPUT" 107 + done < "$path" 108 + 109 + echo "" >> "$OUTPUT" 110 + done 111 + 112 + echo "#endif /* LIBANT_H */" >> "$OUTPUT" 113 + 114 + echo "Generated $OUTPUT"
+13
libant/scripts/setup.sh
··· 1 + #!/bin/bash 2 + set -e 3 + 4 + . "$(dirname "$0")/common.sh" 5 + 6 + cd "$ROOT_DIR" 7 + meson subprojects download 8 + 9 + if [ ! -d "$SCRIPT_DIR/vendor" ]; then 10 + cp -r "$ROOT_DIR/vendor" "$SCRIPT_DIR/vendor" 11 + fi 12 + 13 + mkdir -p "$BUILD_DIR"