This commit is contained in:
parent
b7fc4d901f
commit
8f02394e60
30
.gitea/workflows/dropshell-build.yaml
Normal file
30
.gitea/workflows/dropshell-build.yaml
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
name: dropshell-build
|
||||||
|
run-name: Build test and publish dropshell-build
|
||||||
|
|
||||||
|
on: [push]
|
||||||
|
|
||||||
|
defaults:
|
||||||
|
run:
|
||||||
|
shell: bash
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
- name: Login to Gitea
|
||||||
|
uses: docker/login-action@v3
|
||||||
|
with:
|
||||||
|
registry: gitea.jde.nz
|
||||||
|
username: DoesntMatter
|
||||||
|
password: ${{ secrets.DOCKER_PUSH_TOKEN }}
|
||||||
|
- name: Build
|
||||||
|
run: |
|
||||||
|
./build.sh
|
||||||
|
- name: Test
|
||||||
|
run: |
|
||||||
|
./test.sh
|
||||||
|
- name: Publish
|
||||||
|
run: |
|
||||||
|
SOS_WRITE_TOKEN=${{ secrets.SOS_WRITE_TOKEN }} ./publish.sh
|
54
.gitignore
vendored
Normal file
54
.gitignore
vendored
Normal file
@ -0,0 +1,54 @@
|
|||||||
|
# Build directories
|
||||||
|
build/
|
||||||
|
**/build/
|
||||||
|
**/cmake-build-*/
|
||||||
|
output/
|
||||||
|
**/openssl-*/
|
||||||
|
|
||||||
|
|
||||||
|
# Compiled Object files
|
||||||
|
*.slo
|
||||||
|
*.lo
|
||||||
|
*.o
|
||||||
|
*.obj
|
||||||
|
|
||||||
|
# Precompiled Headers
|
||||||
|
*.gch
|
||||||
|
*.pch
|
||||||
|
|
||||||
|
# Compiled Dynamic libraries
|
||||||
|
*.so
|
||||||
|
*.dylib
|
||||||
|
*.dll
|
||||||
|
|
||||||
|
# Compiled Static libraries
|
||||||
|
*.lai
|
||||||
|
*.la
|
||||||
|
*.a
|
||||||
|
*.lib
|
||||||
|
|
||||||
|
# Executables
|
||||||
|
*.exe
|
||||||
|
*.out
|
||||||
|
*.app
|
||||||
|
|
||||||
|
# CMake
|
||||||
|
CMakeCache.txt
|
||||||
|
CMakeFiles/
|
||||||
|
cmake_install.cmake
|
||||||
|
install_manifest.txt
|
||||||
|
compile_commands.json
|
||||||
|
CTestTestfile.cmake
|
||||||
|
|
||||||
|
# IDE - VSCode
|
||||||
|
|
||||||
|
# IDE - CLion
|
||||||
|
.idea/
|
||||||
|
*.iml
|
||||||
|
*.iws
|
||||||
|
*.ipr
|
||||||
|
|
||||||
|
# macOS
|
||||||
|
.DS_Store
|
||||||
|
.AppleDouble
|
||||||
|
.LSOverride
|
20
Dockerfile
Normal file
20
Dockerfile
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
FROM debian:latest
|
||||||
|
|
||||||
|
RUN apt-get update && apt-get install -y \
|
||||||
|
build-essential \
|
||||||
|
cmake \
|
||||||
|
git \
|
||||||
|
nlohmann-json3-dev wget curl cmake ninja-build mold build-essential nodejs npm jq ccache \
|
||||||
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
#RUN curl -fsSL https://get.docker.com | sh
|
||||||
|
|
||||||
|
COPY --chmod=0755 ./src/* /usr/local/bin/
|
||||||
|
|
||||||
|
RUN /usr/local/bin/install_dropshell_build_requirements
|
||||||
|
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
CMD ["dropshell-build","/app"]
|
||||||
|
|
||||||
|
|
8
build.sh
Executable file
8
build.sh
Executable file
@ -0,0 +1,8 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
|
||||||
|
|
||||||
|
docker build -t gitea.jde.nz/public/dropshell-build:test -f "${SCRIPT_DIR}/Dockerfile" "${SCRIPT_DIR}"
|
||||||
|
|
32
publish.sh
Executable file
32
publish.sh
Executable file
@ -0,0 +1,32 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
|
||||||
|
|
||||||
|
# download the sos binary
|
||||||
|
SOS="${SCRIPT_DIR}/temp/sos"
|
||||||
|
mkdir -p "${SCRIPT_DIR}/temp"
|
||||||
|
|
||||||
|
curl -L -o "${SOS}" https://getbin.xyz/sos/sos
|
||||||
|
chmod +x "${SOS}"
|
||||||
|
|
||||||
|
|
||||||
|
# upload the dropshell-build script
|
||||||
|
"${SOS}" upload "getbin.xyz" "dropshell-build" "${SCRIPT_DIR}/src/dropshell-build"
|
||||||
|
|
||||||
|
# upload the install requirements script
|
||||||
|
"${SOS}" upload "getbin.xyz" "dropshell-build-install-requirements" "${SCRIPT_DIR}/src/install_dropshell_build_requirements"
|
||||||
|
|
||||||
|
|
||||||
|
# tag and push the dropshell-build image
|
||||||
|
echo "Tagging and pushing the dropshell-build image"
|
||||||
|
|
||||||
|
docker tag gitea.jde.nz/public/dropshell-build:test gitea.jde.nz/public/dropshell-build:latest
|
||||||
|
|
||||||
|
docker push gitea.jde.nz/public/dropshell-build:latest
|
||||||
|
|
||||||
|
|
||||||
|
# clean up
|
||||||
|
rm -rf "${SCRIPT_DIR}/temp"
|
||||||
|
echo "Done"
|
268
src/dropshell-build
Executable file
268
src/dropshell-build
Executable file
@ -0,0 +1,268 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
# SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
|
||||||
|
|
||||||
|
ARCHS=(
|
||||||
|
"x86_64"
|
||||||
|
"aarch64"
|
||||||
|
)
|
||||||
|
|
||||||
|
HOSTARCH=$(uname -m)
|
||||||
|
|
||||||
|
SOURCE_DIR=""
|
||||||
|
BUILD_DIR=""
|
||||||
|
OUTPUT_DIR=""
|
||||||
|
EXECUTABLE_NAME=""
|
||||||
|
|
||||||
|
# set flags from command line
|
||||||
|
RELEASE=0
|
||||||
|
MULTIBUILD=0
|
||||||
|
|
||||||
|
|
||||||
|
function help() {
|
||||||
|
echo "Usage: $0 [options]"
|
||||||
|
echo "Options:"
|
||||||
|
echo " version Show version information and exit"
|
||||||
|
echo " "
|
||||||
|
echo " <directory> Build the project using cmake in <directory>"
|
||||||
|
echo " -r, --release Build release version"
|
||||||
|
echo " -m, --multi Build for multiple architectures"
|
||||||
|
}
|
||||||
|
|
||||||
|
function version() {
|
||||||
|
echo "2025.0531.0942"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
# ----------------------------------------------------------------------------------------------------------
|
||||||
|
# BUILD
|
||||||
|
# ----------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
CMAKE_FILE="CMakeLists.txt"
|
||||||
|
|
||||||
|
function get_executable_name() {
|
||||||
|
local var_value=""
|
||||||
|
local CMAKEFILEPATH="${1:-}"
|
||||||
|
[ -n "${CMAKEFILEPATH:-}" ] || die "No CMake file path given!"
|
||||||
|
CMAKEFILEPATH="$CMAKEFILEPATH/${CMAKE_FILE}"
|
||||||
|
[ -f "${CMAKEFILEPATH}" ] || die "${CMAKE_FILE} not found in ${CMAKEFILEPATH}"
|
||||||
|
|
||||||
|
echo "Getting executable name from ${CMAKEFILEPATH}"
|
||||||
|
|
||||||
|
while IFS= read -r line; do
|
||||||
|
# Look for set(PROJECT_EXE_NAME ipdemo)
|
||||||
|
if [[ "$line" =~ set\(PROJECT_EXE_NAME[[:space:]]+([a-zA-Z0-9_-]+)\) ]]; then
|
||||||
|
var_value=$(echo "$line" | sed -E 's/.*set\(PROJECT_EXE_NAME[[:space:]]+([a-zA-Z0-9_-]+)\).*/\1/')
|
||||||
|
fi
|
||||||
|
# Look for add_executable(${PROJECT_EXE_NAME}
|
||||||
|
if [[ "$line" =~ add_executable\([[:space:]]*\$\{PROJECT_EXE_NAME\}[[:space:]] ]]; then
|
||||||
|
echo "Found executable name: $var_value"
|
||||||
|
EXECUTABLE_NAME="$var_value"
|
||||||
|
fi
|
||||||
|
done < "${CMAKEFILEPATH}"
|
||||||
|
|
||||||
|
[[ -n "$EXECUTABLE_NAME" ]] || die "Executable name not found."
|
||||||
|
echo "Executable name: $EXECUTABLE_NAME"
|
||||||
|
}
|
||||||
|
|
||||||
|
function build_arch() {
|
||||||
|
local ARCH="$1"
|
||||||
|
local CMAKE_DIR="$2"
|
||||||
|
|
||||||
|
local BUILD_DIR="${CMAKE_DIR}/build"
|
||||||
|
local OUTPUT_DIR="${CMAKE_DIR}/output"
|
||||||
|
|
||||||
|
local PREVDIR="$PWD"
|
||||||
|
local JOBS;
|
||||||
|
JOBS=$(nproc) # Set JOBS to the number of available CPU cores
|
||||||
|
cd "${CMAKE_DIR}" || exit 1
|
||||||
|
|
||||||
|
local ARCH_BUILD_DIR=${BUILD_DIR}/${ARCH}
|
||||||
|
mkdir -p "${ARCH_BUILD_DIR}"
|
||||||
|
|
||||||
|
echo "Building for ${ARCH} in ${ARCH_BUILD_DIR}, from ${SOURCE_DIR}"
|
||||||
|
|
||||||
|
if [ ! -f "${HOME}/.musl-cross/${ARCH}-linux-musl-cross/bin/${ARCH}-linux-musl-g++" ]; then
|
||||||
|
echo "Musl cross toolchain not found for ${ARCH}."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
CMAKE_BUILD_TYPE="Release"
|
||||||
|
if [ "$RELEASE" -eq 0 ]; then
|
||||||
|
CMAKE_BUILD_TYPE="Debug"
|
||||||
|
fi
|
||||||
|
|
||||||
|
export CC="${HOME}/.musl-cross/${ARCH}-linux-musl-cross/bin/${ARCH}-linux-musl-gcc"
|
||||||
|
export CXX="${HOME}/.musl-cross/${ARCH}-linux-musl-cross/bin/${ARCH}-linux-musl-g++"
|
||||||
|
export SYSROOT="${HOME}/.musl-cross/${ARCH}-linux-musl-cross/${ARCH}-linux-musl/sysroot"
|
||||||
|
export OPENSSL_ROOT_DIR="${SYSROOT}/usr"
|
||||||
|
export CFLAGS="--sysroot=$SYSROOT"
|
||||||
|
export CXXFLAGS="--sysroot=$SYSROOT"
|
||||||
|
export LDFLAGS="--sysroot=$SYSROOT"
|
||||||
|
export MAKEFLAGS="-j${JOBS}"
|
||||||
|
|
||||||
|
cmake -B "${ARCH_BUILD_DIR}" -G Ninja \
|
||||||
|
-DCMAKE_BUILD_TYPE="${CMAKE_BUILD_TYPE}" \
|
||||||
|
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
|
||||||
|
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
|
||||||
|
-DCMAKE_LINKER=mold \
|
||||||
|
-DCMAKE_C_COMPILER_TARGET="${ARCH}-linux-musl" \
|
||||||
|
-DCMAKE_CXX_COMPILER_TARGET="${ARCH}-linux-musl" \
|
||||||
|
-DCMAKE_C_FLAGS="${CFLAGS}" \
|
||||||
|
-DCMAKE_CXX_FLAGS="${CXXFLAGS}" \
|
||||||
|
-DCMAKE_FIND_ROOT_PATH="${SYSROOT}" \
|
||||||
|
-DCMAKE_SYSROOT="${SYSROOT}"
|
||||||
|
cd "${ARCH_BUILD_DIR}" || exit 1
|
||||||
|
ninja -k0 -j"${JOBS}"
|
||||||
|
|
||||||
|
if [ "$RELEASE" -eq 1 ]; then
|
||||||
|
upx "${ARCH_BUILD_DIR}/${EXECUTABLE_NAME}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ ! -d "${OUTPUT_DIR}" ]; then
|
||||||
|
mkdir -p "${OUTPUT_DIR}"
|
||||||
|
fi
|
||||||
|
cp "${ARCH_BUILD_DIR}/${EXECUTABLE_NAME}" "${OUTPUT_DIR}/${EXECUTABLE_NAME}.${ARCH}"
|
||||||
|
|
||||||
|
cd "${PREVDIR}" || exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
function build() {
|
||||||
|
echo "Building project in directory $1"
|
||||||
|
if [ ! -d "$1" ]; then
|
||||||
|
echo "Directory $1 does not exist"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
local CMAKE_DIR="$1"
|
||||||
|
|
||||||
|
if [ ! -f "${CMAKEFILEPATH}" ]; then
|
||||||
|
echo "${CMAKEFILEPATH} not found"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# if have the -m option, then build for multiple architectures
|
||||||
|
if [ $MULTIBUILD -eq 1 ]; then
|
||||||
|
for arch in "${ARCHS[@]}"; do
|
||||||
|
build_arch "$arch"
|
||||||
|
done
|
||||||
|
else
|
||||||
|
build_arch "$HOSTARCH" "$CMAKE_DIR"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
function buildspawn() {
|
||||||
|
local CMAKE_DIR="${1:-}"
|
||||||
|
[ -n "${CMAKE_DIR:-}" ] || die "No CMake Directory given!"
|
||||||
|
[ -d "$CMAKE_DIR" ] || die "CMake Directory doesn't exist: $CMAKE_DIR"
|
||||||
|
|
||||||
|
# make canonical
|
||||||
|
CMAKE_DIR=$(realpath "$CMAKE_DIR")
|
||||||
|
|
||||||
|
get_executable_name "$CMAKE_DIR"
|
||||||
|
|
||||||
|
FLAGS=""
|
||||||
|
[ $MULTIBUILD -eq 0 ] || FLAGS="$FLAGS -m"
|
||||||
|
[ $RELEASE -eq 0 ] || FLAGS="$FLAGS -r"
|
||||||
|
|
||||||
|
BUILD_VERSION_FILE="$HOME/.config/dropshell-build/version"
|
||||||
|
if [ ! -f "$BUILD_VERSION_FILE" ]; then
|
||||||
|
# check if docker is installed
|
||||||
|
if ! command -v docker &> /dev/null; then
|
||||||
|
echo "Neither dropshell-build nor docker appears to be available. Please install one of them."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
echo "Using Docker Buildchain."
|
||||||
|
TAG="latest"
|
||||||
|
if [ -n "${DROPSHELL_BUILD_TAG-}" ]; then
|
||||||
|
TAG="$DROPSHELL_BUILD_TAG"
|
||||||
|
fi
|
||||||
|
echo "Using Docker Buildchain with tag: $TAG"
|
||||||
|
|
||||||
|
|
||||||
|
# Check if we're running in Gitea Actions
|
||||||
|
if [ -n "${JOB_CONTAINER_NAME:-}" ] && [ -n "${GITHUB_WORKSPACE:-}" ]; then
|
||||||
|
echo "--------------------------------"
|
||||||
|
echo "Running in Gitea Actions - using --volumes-from"
|
||||||
|
echo "--------------------------------"
|
||||||
|
|
||||||
|
echo "ls -la using --volumes-from"
|
||||||
|
echo "GITHUB_WORKSPACE: ${GITHUB_WORKSPACE}"
|
||||||
|
echo "CMAKE_DIR: ${CMAKE_DIR}"
|
||||||
|
echo "PWD: ${PWD}"
|
||||||
|
echo "JOB_CONTAINER_NAME: ${JOB_CONTAINER_NAME}"
|
||||||
|
|
||||||
|
docker run --rm \
|
||||||
|
--volumes-from="${JOB_CONTAINER_NAME}" \
|
||||||
|
"gitea.jde.nz/public/dropshell-build:${TAG}" \
|
||||||
|
bash -c "rm -rf /app && \
|
||||||
|
ln -s ${CMAKE_DIR} /app && \
|
||||||
|
dropshell-build $FLAGS /app"
|
||||||
|
else
|
||||||
|
echo "Running locally"
|
||||||
|
docker run --rm \
|
||||||
|
-u "$(id -u)":"$(id -g)" \
|
||||||
|
-v "$CMAKE_DIR":/app \
|
||||||
|
"gitea.jde.nz/public/dropshell-build:${TAG}" \
|
||||||
|
bash -c "dropshell-build $FLAGS /app"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo "Using local native buildchain"
|
||||||
|
# shellcheck disable=SC2086
|
||||||
|
build $FLAGS $CMAKE_DIR
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
# ----------------------------------------------------------------------------------------------------------
|
||||||
|
# MAIN
|
||||||
|
# ----------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
function main() {
|
||||||
|
while getopts "rm" opt; do
|
||||||
|
case $opt in
|
||||||
|
r)
|
||||||
|
RELEASE=1
|
||||||
|
;;
|
||||||
|
m)
|
||||||
|
MULTIBUILD=1
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
help
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
|
# Shift the processed options out of the argument list
|
||||||
|
shift $((OPTIND-1))
|
||||||
|
|
||||||
|
# check we have at least one argument
|
||||||
|
if [ $# -eq 0 ]; then
|
||||||
|
help
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
# get command argument, now that the flags are set
|
||||||
|
CMD="$1"
|
||||||
|
|
||||||
|
if [ -z "$CMD" ]; then
|
||||||
|
help
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
case "$CMD" in
|
||||||
|
version)
|
||||||
|
version
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
buildspawn "$1"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
|
main "$@"
|
348
src/install_dropshell_build_requirements
Executable file
348
src/install_dropshell_build_requirements
Executable file
@ -0,0 +1,348 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
|
||||||
|
|
||||||
|
# If the user is not root, use sudo
|
||||||
|
SUDOCMD=""
|
||||||
|
[ "$EUID" -eq 0 ] || SUDOCMD="sudo"
|
||||||
|
|
||||||
|
# If the user is not root, use the home directory of the user who ran the script
|
||||||
|
USER_HOME="$HOME"
|
||||||
|
if [ -n "${SUDO_USER:-}" ] && [ "$SUDO_USER" != "root" ]; then
|
||||||
|
USER_HOME=$(eval echo "~${SUDO_USER}")
|
||||||
|
fi
|
||||||
|
|
||||||
|
# test sudo is working or we're root (return non-zero if not root!)
|
||||||
|
if ! ${SUDOCMD:-} true; then
|
||||||
|
echo "Error: This script must be run as root or with sudo privileges." >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
_die() {
|
||||||
|
echo -e "Error: $1" >&2
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
# Colors for output
|
||||||
|
RED='\033[0;31m'
|
||||||
|
GREEN='\033[0;32m'
|
||||||
|
YELLOW='\033[1;33m'
|
||||||
|
NC='\033[0m' # No Color
|
||||||
|
|
||||||
|
# Function to print status messages
|
||||||
|
print_status() {
|
||||||
|
echo -e "${GREEN}[*] $1${NC}"
|
||||||
|
}
|
||||||
|
|
||||||
|
print_error() {
|
||||||
|
echo -e "${RED}[!] $1${NC}"
|
||||||
|
}
|
||||||
|
|
||||||
|
print_warning() {
|
||||||
|
echo -e "${YELLOW}[!] $1${NC}"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#----------------------------------------------------------------------------------------------------------
|
||||||
|
# Headers on Host (Native)
|
||||||
|
#----------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
# Function to check if a package is installed
|
||||||
|
is_package_installed() {
|
||||||
|
if [ "$OS" = "Alpine Linux" ]; then
|
||||||
|
apk info | grep -q "^$1$"
|
||||||
|
else
|
||||||
|
dpkg -l "$1"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
function install_packages() {
|
||||||
|
local PACKAGES
|
||||||
|
local HAVE_UPDATED=0
|
||||||
|
|
||||||
|
# Detect distribution
|
||||||
|
if [ -f /etc/os-release ]; then
|
||||||
|
. /etc/os-release
|
||||||
|
OS=$NAME
|
||||||
|
VER=$VERSION_ID
|
||||||
|
else
|
||||||
|
print_error "Could not detect distribution"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
print_status "Detected OS: $OS $VER"
|
||||||
|
|
||||||
|
# Define packages based on distribution
|
||||||
|
case $OS in
|
||||||
|
"Ubuntu"|"Debian GNU/Linux")
|
||||||
|
# Common packages for both Ubuntu and Debian
|
||||||
|
# cmake make g++ build-essential upx musl-tools wget tar ccache ninja-build mold
|
||||||
|
PACKAGES="build-essential cmake git wget tar curl ninja-build mold nodejs npm perl jq ccache"
|
||||||
|
INSTALLCMD="apt-get install -y"
|
||||||
|
UPDATECMD="apt-get update"
|
||||||
|
;;
|
||||||
|
"Alpine Linux")
|
||||||
|
PACKAGES="build-base cmake git wget tar curl ninja mold nodejs npm linux-headers perl jq ccache"
|
||||||
|
INSTALLCMD="apk add --no-cache"
|
||||||
|
UPDATECMD="apk update"
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
print_error "Unsupported distribution: $OS"
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
# Install missing packages
|
||||||
|
print_status "Checking and installing required packages..."
|
||||||
|
for pkg in $PACKAGES; do
|
||||||
|
if ! is_package_installed "$pkg"; then
|
||||||
|
print_status "Installing $pkg..."
|
||||||
|
|
||||||
|
# Update package lists
|
||||||
|
if [ "$HAVE_UPDATED" -eq 0 ]; then
|
||||||
|
print_status "Updating package lists..."
|
||||||
|
${SUDOCMD:-} bash -c "${UPDATECMD}"
|
||||||
|
HAVE_UPDATED=1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if ! bash -c "${SUDOCMD:-} ${INSTALLCMD} $pkg"; then
|
||||||
|
print_error "Failed to install $pkg"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
print_status "$pkg is already installed"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function install_headers() {
|
||||||
|
# put libassert headers on the host.
|
||||||
|
echo "Checking for libassert headers"
|
||||||
|
if [ ! -f "/usr/local/lib/libassert.a" ]; then
|
||||||
|
echo "libassert not found, installing..."
|
||||||
|
git clone https://github.com/jeremy-rifkin/libassert.git
|
||||||
|
#git checkout v2.1.5
|
||||||
|
mkdir libassert/build
|
||||||
|
cd "libassert/build" || exit 1
|
||||||
|
cmake .. -DCMAKE_BUILD_TYPE=Release
|
||||||
|
make -j
|
||||||
|
${SUDOCMD:-} make install
|
||||||
|
cd ../..
|
||||||
|
rm -rf libassert
|
||||||
|
else
|
||||||
|
echo "libassert headers already installed"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#----------------------------------------------------------------------------------------------------------
|
||||||
|
# OpenSSL for musl cross toolchains
|
||||||
|
#----------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
function install_openssl_musl() {
|
||||||
|
OPENSSL_VERSION=3.5.0
|
||||||
|
|
||||||
|
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||||
|
BUILD_DIR="${SCRIPT_DIR}/build"
|
||||||
|
MUSL_CROSS_DIR="$HOME/.musl-cross"
|
||||||
|
mkdir -p "$BUILD_DIR"
|
||||||
|
# Helper: compare versions (returns 0 if $1 >= $2)
|
||||||
|
version_ge() {
|
||||||
|
[ "$1" = "$2" ] && return 0
|
||||||
|
[ "$(printf '%s\n' "$1" "$2" | sort -V | head -n1)" = "$2" ]
|
||||||
|
}
|
||||||
|
|
||||||
|
# Find all installed musl cross toolchains
|
||||||
|
TOOLCHAINS=()
|
||||||
|
for tc in "$MUSL_CROSS_DIR"/*-linux-musl-cross; do
|
||||||
|
[ -d "$tc" ] || continue
|
||||||
|
arch=$(basename "$tc" | sed 's/-linux-musl-cross//')
|
||||||
|
TOOLCHAINS+=("$arch")
|
||||||
|
done
|
||||||
|
|
||||||
|
if [ ${#TOOLCHAINS[@]} -eq 0 ]; then
|
||||||
|
echo "No musl cross toolchains found in $MUSL_CROSS_DIR. Exiting."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Found musl cross toolchains: ${TOOLCHAINS[*]}"
|
||||||
|
|
||||||
|
for ARCH in "${TOOLCHAINS[@]}"; do
|
||||||
|
echo "==============================="
|
||||||
|
echo "Checking OpenSSL for $ARCH..."
|
||||||
|
echo "==============================="
|
||||||
|
if [ "$ARCH" = "x86_64" ]; then
|
||||||
|
MUSL_PREFIX="$MUSL_CROSS_DIR/x86_64-linux-musl-cross"
|
||||||
|
OPENSSL_TARGET=linux-x86_64
|
||||||
|
elif [ "$ARCH" = "aarch64" ]; then
|
||||||
|
MUSL_PREFIX="$MUSL_CROSS_DIR/aarch64-linux-musl-cross"
|
||||||
|
OPENSSL_TARGET=linux-aarch64
|
||||||
|
else
|
||||||
|
# Try to guess OpenSSL target for other musl toolchains
|
||||||
|
OPENSSL_TARGET="linux-$ARCH"
|
||||||
|
MUSL_PREFIX="$MUSL_CROSS_DIR/${ARCH}-linux-musl-cross"
|
||||||
|
fi
|
||||||
|
SYSROOT="$MUSL_PREFIX/${ARCH}-linux-musl/sysroot"
|
||||||
|
CC="$MUSL_PREFIX/bin/${ARCH}-linux-musl-gcc"
|
||||||
|
AR="$MUSL_PREFIX/bin/${ARCH}-linux-musl-ar"
|
||||||
|
RANLIB="$MUSL_PREFIX/bin/${ARCH}-linux-musl-ranlib"
|
||||||
|
|
||||||
|
DEST_PATH="$SYSROOT/usr/lib/libssl.a"
|
||||||
|
if [ -f "$DEST_PATH" ]; then
|
||||||
|
echo "OpenSSL $ARCH is already installed"
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
|
||||||
|
SKIP_BUILD=0
|
||||||
|
if [ -f "$SYSROOT/usr/lib/libssl.a" ]; then
|
||||||
|
# Try to extract version from opensslv.h
|
||||||
|
OPENSSLV_H="$SYSROOT/usr/include/openssl/opensslv.h"
|
||||||
|
if [ -f "$OPENSSLV_H" ]; then
|
||||||
|
INSTALLED_VERSION=$(grep '# *define *OPENSSL_VERSION_TEXT' "$OPENSSLV_H" | sed -E 's/.*OpenSSL ([0-9.]+)[^ ]*.*/\1/')
|
||||||
|
if [ -n "$INSTALLED_VERSION" ]; then
|
||||||
|
echo "Found installed OpenSSL version: $INSTALLED_VERSION"
|
||||||
|
if version_ge "$INSTALLED_VERSION" "$OPENSSL_VERSION"; then
|
||||||
|
echo "OpenSSL $INSTALLED_VERSION is up-to-date (>= $OPENSSL_VERSION), skipping build for $ARCH."
|
||||||
|
SKIP_BUILD=1
|
||||||
|
else
|
||||||
|
echo "OpenSSL $INSTALLED_VERSION is older than $OPENSSL_VERSION, will rebuild."
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo "Could not determine installed OpenSSL version, will rebuild."
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo "No opensslv.h found, will rebuild."
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo "No libssl.a found, will rebuild."
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$SKIP_BUILD" -eq 1 ]; then
|
||||||
|
echo "Skipping build for $ARCH."
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
|
||||||
|
cd "$BUILD_DIR"
|
||||||
|
if [ ! -d "openssl-${OPENSSL_VERSION}" ]; then
|
||||||
|
if [ ! -f "openssl-${OPENSSL_VERSION}.tar.gz" ]; then
|
||||||
|
wget "https://www.openssl.org/source/openssl-${OPENSSL_VERSION}.tar.gz"
|
||||||
|
fi
|
||||||
|
tar xf "openssl-${OPENSSL_VERSION}.tar.gz"
|
||||||
|
fi
|
||||||
|
cd "openssl-${OPENSSL_VERSION}"
|
||||||
|
|
||||||
|
echo "----------------------------------------------"
|
||||||
|
echo "Configuring for $ARCH with sysroot $SYSROOT..."
|
||||||
|
CC="$CC" AR="$AR" RANLIB="$RANLIB" ./Configure "$OPENSSL_TARGET" no-shared --prefix="$SYSROOT/usr"
|
||||||
|
echo "Building..."
|
||||||
|
make -j"$(nproc)"
|
||||||
|
echo "Installing to $SYSROOT/usr ..."
|
||||||
|
make install_sw
|
||||||
|
cd "$BUILD_DIR"
|
||||||
|
echo "Done for $ARCH."
|
||||||
|
echo
|
||||||
|
# Remove build dir for next arch to avoid cross contamination
|
||||||
|
rm -rf "openssl-${OPENSSL_VERSION}"
|
||||||
|
tar xf "openssl-${OPENSSL_VERSION}.tar.gz"
|
||||||
|
done
|
||||||
|
|
||||||
|
echo "OpenSSL built and installed for all detected musl toolchains."
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# ----------------------------------------------------------------------------------------------------------
|
||||||
|
# MUSL CROSS COMPILERS
|
||||||
|
# ----------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
function check_path() {
|
||||||
|
local BASHRC="${USER_HOME}/.bashrc"
|
||||||
|
local TOOLCHAIN="$1"
|
||||||
|
local MUSL_PATH="$INSTALL_DIR/$TOOLCHAIN/bin"
|
||||||
|
if ! echo "$PATH" | grep -q "$MUSL_PATH"; then
|
||||||
|
echo "Adding $MUSL_PATH to PATH in $BASHRC"
|
||||||
|
PATH_LINE="export PATH=\"$MUSL_PATH:\$PATH\""
|
||||||
|
if ! grep -Fxq "$PATH_LINE" "$BASHRC"; then
|
||||||
|
echo "" >> "$BASHRC"
|
||||||
|
echo "# Add musl cross compilers to PATH for dropshell" >> "$BASHRC"
|
||||||
|
echo "$PATH_LINE" >> "$BASHRC"
|
||||||
|
|
||||||
|
echo "Added musl cross compilers to $BASHRC"
|
||||||
|
echo "You should run 'source ~/.bashrc' to update your PATH"
|
||||||
|
else
|
||||||
|
echo "You should run 'source ~/.bashrc' to update your PATH"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
function install_musl_cross() {
|
||||||
|
local TOOLCHAIN="$1"
|
||||||
|
local MUSL_CC_URL="https://getbin.xyz"
|
||||||
|
if [ ! -d "$INSTALL_DIR/$TOOLCHAIN" ]; then
|
||||||
|
echo "Downloading $TOOLCHAIN musl cross toolchain..."
|
||||||
|
wget -nc -O "$TMPDIR/$TOOLCHAIN.tgz" "$MUSL_CC_URL/$TOOLCHAIN.tgz:latest"
|
||||||
|
tar -C "$INSTALL_DIR" -xvf "$TMPDIR/$TOOLCHAIN.tgz"
|
||||||
|
else
|
||||||
|
echo "$TOOLCHAIN musl cross toolchain already installed"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
function install_musl() {
|
||||||
|
echo "Installing musl toolchain"
|
||||||
|
|
||||||
|
# Set install directory
|
||||||
|
INSTALL_DIR="$USER_HOME/.musl-cross"
|
||||||
|
mkdir -p "$INSTALL_DIR"
|
||||||
|
|
||||||
|
TMPDIR=$(mktemp -d)
|
||||||
|
trap 'rm -rf "$TMPDIR"' EXIT
|
||||||
|
|
||||||
|
TOOLCHAIN_LIST=(
|
||||||
|
"aarch64-linux-musl-cross"
|
||||||
|
"x86_64-linux-musl-cross"
|
||||||
|
)
|
||||||
|
|
||||||
|
for TOOLCHAIN in "${TOOLCHAIN_LIST[@]}"; do
|
||||||
|
install_musl_cross "$TOOLCHAIN"
|
||||||
|
check_path "$TOOLCHAIN"
|
||||||
|
done
|
||||||
|
|
||||||
|
# Clean up
|
||||||
|
rm -rf "$TMPDIR"
|
||||||
|
}
|
||||||
|
|
||||||
|
function output_version() {
|
||||||
|
local VERSIONDATE
|
||||||
|
local CONFIG_DIR="$USER_HOME/.config/dropshell-build/"
|
||||||
|
mkdir -p "$CONFIG_DIR"
|
||||||
|
VERSIONDATE="$(date +%Y.%m%d.%H%M)"
|
||||||
|
echo "$VERSIONDATE" > "$CONFIG_DIR/version" || echo "Error: Failed to write version file to $CONFIG_DIR/version"
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#----------------------------------------------------------------------------------------------------------
|
||||||
|
# Main
|
||||||
|
#----------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
function main() {
|
||||||
|
|
||||||
|
install_packages
|
||||||
|
|
||||||
|
install_headers
|
||||||
|
|
||||||
|
install_musl
|
||||||
|
|
||||||
|
install_openssl_musl
|
||||||
|
|
||||||
|
output_version
|
||||||
|
|
||||||
|
echo "Done"
|
||||||
|
}
|
||||||
|
|
||||||
|
main "$@"
|
15
test.sh
Executable file
15
test.sh
Executable file
@ -0,0 +1,15 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
|
||||||
|
|
||||||
|
echo "Testing dropshell-build"
|
||||||
|
|
||||||
|
DROPSHELL_BUILD_TAG="test" "${SCRIPT_DIR}/src/dropshell-build" "${SCRIPT_DIR}/test"
|
||||||
|
|
||||||
|
"${SCRIPT_DIR}/test/output/ipdemo.x86_64"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
4
test/.ccache/0/CACHEDIR.TAG
Normal file
4
test/.ccache/0/CACHEDIR.TAG
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
Signature: 8a477f597d28d172789f06886806bc55
|
||||||
|
# This file is a cache directory tag created by ccache.
|
||||||
|
# For information about cache directory tags, see:
|
||||||
|
# http://www.brynosaurus.com/cachedir/
|
82
test/.ccache/0/a/stats
Normal file
82
test/.ccache/0/a/stats
Normal file
@ -0,0 +1,82 @@
|
|||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
3
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
3
|
||||||
|
3
|
||||||
|
0
|
||||||
|
6
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
6
|
||||||
|
0
|
||||||
|
3
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
BIN
test/.ccache/0/c/aaicapo17sbvoqmjgn2cmlcheirsr2eM
Normal file
BIN
test/.ccache/0/c/aaicapo17sbvoqmjgn2cmlcheirsr2eM
Normal file
Binary file not shown.
82
test/.ccache/0/c/stats
Normal file
82
test/.ccache/0/c/stats
Normal file
@ -0,0 +1,82 @@
|
|||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
1
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
82
test/.ccache/0/stats
Normal file
82
test/.ccache/0/stats
Normal file
@ -0,0 +1,82 @@
|
|||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
1
|
||||||
|
16
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
1
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
16
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
82
test/.ccache/1/1/stats
Normal file
82
test/.ccache/1/1/stats
Normal file
@ -0,0 +1,82 @@
|
|||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
3
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
82
test/.ccache/1/2/stats
Normal file
82
test/.ccache/1/2/stats
Normal file
@ -0,0 +1,82 @@
|
|||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
1
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
82
test/.ccache/1/e/stats
Normal file
82
test/.ccache/1/e/stats
Normal file
@ -0,0 +1,82 @@
|
|||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
1
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
1
|
||||||
|
1
|
||||||
|
0
|
||||||
|
2
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
2
|
||||||
|
0
|
||||||
|
1
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
82
test/.ccache/2/5/stats
Normal file
82
test/.ccache/2/5/stats
Normal file
@ -0,0 +1,82 @@
|
|||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
1
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
4
test/.ccache/2/CACHEDIR.TAG
Normal file
4
test/.ccache/2/CACHEDIR.TAG
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
Signature: 8a477f597d28d172789f06886806bc55
|
||||||
|
# This file is a cache directory tag created by ccache.
|
||||||
|
# For information about cache directory tags, see:
|
||||||
|
# http://www.brynosaurus.com/cachedir/
|
82
test/.ccache/2/d/stats
Normal file
82
test/.ccache/2/d/stats
Normal file
@ -0,0 +1,82 @@
|
|||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
1
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
1
|
||||||
|
1
|
||||||
|
0
|
||||||
|
2
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
2
|
||||||
|
0
|
||||||
|
1
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
BIN
test/.ccache/2/e/9dc3onnqn8rat9gvebfkmhom2hm37teR
Normal file
BIN
test/.ccache/2/e/9dc3onnqn8rat9gvebfkmhom2hm37teR
Normal file
Binary file not shown.
82
test/.ccache/2/stats
Normal file
82
test/.ccache/2/stats
Normal file
@ -0,0 +1,82 @@
|
|||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
1
|
||||||
|
4
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
1
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
4
|
||||||
|
0
|
||||||
|
0
|
82
test/.ccache/3/4/stats
Normal file
82
test/.ccache/3/4/stats
Normal file
@ -0,0 +1,82 @@
|
|||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
1
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
82
test/.ccache/3/7/stats
Normal file
82
test/.ccache/3/7/stats
Normal file
@ -0,0 +1,82 @@
|
|||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
1
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
1
|
||||||
|
1
|
||||||
|
0
|
||||||
|
2
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
2
|
||||||
|
0
|
||||||
|
1
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
82
test/.ccache/3/e/stats
Normal file
82
test/.ccache/3/e/stats
Normal file
@ -0,0 +1,82 @@
|
|||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
1
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
BIN
test/.ccache/4/0/38skoanmcjl0asrltg5foudrhoa98l6R
Normal file
BIN
test/.ccache/4/0/38skoanmcjl0asrltg5foudrhoa98l6R
Normal file
Binary file not shown.
4
test/.ccache/4/CACHEDIR.TAG
Normal file
4
test/.ccache/4/CACHEDIR.TAG
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
Signature: 8a477f597d28d172789f06886806bc55
|
||||||
|
# This file is a cache directory tag created by ccache.
|
||||||
|
# For information about cache directory tags, see:
|
||||||
|
# http://www.brynosaurus.com/cachedir/
|
BIN
test/.ccache/4/b/e63vp6nheqb9ljsvvflf2rprmqrdtmuR
Normal file
BIN
test/.ccache/4/b/e63vp6nheqb9ljsvvflf2rprmqrdtmuR
Normal file
Binary file not shown.
82
test/.ccache/4/stats
Normal file
82
test/.ccache/4/stats
Normal file
@ -0,0 +1,82 @@
|
|||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
2
|
||||||
|
472
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
1
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
1
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
236
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
236
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
BIN
test/.ccache/6/1/99hro0kcqvitm08ph1qp23lc096dpjgM
Normal file
BIN
test/.ccache/6/1/99hro0kcqvitm08ph1qp23lc096dpjgM
Normal file
Binary file not shown.
4
test/.ccache/6/CACHEDIR.TAG
Normal file
4
test/.ccache/6/CACHEDIR.TAG
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
Signature: 8a477f597d28d172789f06886806bc55
|
||||||
|
# This file is a cache directory tag created by ccache.
|
||||||
|
# For information about cache directory tags, see:
|
||||||
|
# http://www.brynosaurus.com/cachedir/
|
BIN
test/.ccache/6/c/cfpg24omtabmcf0551a884a2i1480imR
Normal file
BIN
test/.ccache/6/c/cfpg24omtabmcf0551a884a2i1480imR
Normal file
Binary file not shown.
82
test/.ccache/6/stats
Normal file
82
test/.ccache/6/stats
Normal file
@ -0,0 +1,82 @@
|
|||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
2
|
||||||
|
8
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
1
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
1
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
4
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
4
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
4
test/.ccache/9/CACHEDIR.TAG
Normal file
4
test/.ccache/9/CACHEDIR.TAG
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
Signature: 8a477f597d28d172789f06886806bc55
|
||||||
|
# This file is a cache directory tag created by ccache.
|
||||||
|
# For information about cache directory tags, see:
|
||||||
|
# http://www.brynosaurus.com/cachedir/
|
BIN
test/.ccache/9/a/fd2897kchp5ong36tqk6obhs3al8grgM
Normal file
BIN
test/.ccache/9/a/fd2897kchp5ong36tqk6obhs3al8grgM
Normal file
Binary file not shown.
82
test/.ccache/9/stats
Normal file
82
test/.ccache/9/stats
Normal file
@ -0,0 +1,82 @@
|
|||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
1
|
||||||
|
16
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
1
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
16
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
BIN
test/.ccache/a/2/802tu8tqcjankp7asf9phvduq5nid82M
Normal file
BIN
test/.ccache/a/2/802tu8tqcjankp7asf9phvduq5nid82M
Normal file
Binary file not shown.
BIN
test/.ccache/a/9/49to0fu7pau2cla8merd8b3g64qh2noM
Normal file
BIN
test/.ccache/a/9/49to0fu7pau2cla8merd8b3g64qh2noM
Normal file
Binary file not shown.
4
test/.ccache/a/CACHEDIR.TAG
Normal file
4
test/.ccache/a/CACHEDIR.TAG
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
Signature: 8a477f597d28d172789f06886806bc55
|
||||||
|
# This file is a cache directory tag created by ccache.
|
||||||
|
# For information about cache directory tags, see:
|
||||||
|
# http://www.brynosaurus.com/cachedir/
|
82
test/.ccache/a/stats
Normal file
82
test/.ccache/a/stats
Normal file
@ -0,0 +1,82 @@
|
|||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
2
|
||||||
|
20
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
1
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
1
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
4
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
16
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
BIN
test/.ccache/b/1/80mp1h8inh43vbck35d22ai3d9s5e94R
Normal file
BIN
test/.ccache/b/1/80mp1h8inh43vbck35d22ai3d9s5e94R
Normal file
Binary file not shown.
4
test/.ccache/b/CACHEDIR.TAG
Normal file
4
test/.ccache/b/CACHEDIR.TAG
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
Signature: 8a477f597d28d172789f06886806bc55
|
||||||
|
# This file is a cache directory tag created by ccache.
|
||||||
|
# For information about cache directory tags, see:
|
||||||
|
# http://www.brynosaurus.com/cachedir/
|
82
test/.ccache/b/stats
Normal file
82
test/.ccache/b/stats
Normal file
@ -0,0 +1,82 @@
|
|||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
1
|
||||||
|
236
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
1
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
236
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
BIN
test/.ccache/c/0/3a34k150ga9nserg9pef8uij1gdvajeM
Normal file
BIN
test/.ccache/c/0/3a34k150ga9nserg9pef8uij1gdvajeM
Normal file
Binary file not shown.
4
test/.ccache/c/CACHEDIR.TAG
Normal file
4
test/.ccache/c/CACHEDIR.TAG
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
Signature: 8a477f597d28d172789f06886806bc55
|
||||||
|
# This file is a cache directory tag created by ccache.
|
||||||
|
# For information about cache directory tags, see:
|
||||||
|
# http://www.brynosaurus.com/cachedir/
|
82
test/.ccache/c/stats
Normal file
82
test/.ccache/c/stats
Normal file
@ -0,0 +1,82 @@
|
|||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
1
|
||||||
|
16
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
1
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
16
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
BIN
test/.ccache/f/4/8dp5jdv5s35vp9ugponj5s5qe8v4b9qR
Normal file
BIN
test/.ccache/f/4/8dp5jdv5s35vp9ugponj5s5qe8v4b9qR
Normal file
Binary file not shown.
4
test/.ccache/f/CACHEDIR.TAG
Normal file
4
test/.ccache/f/CACHEDIR.TAG
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
Signature: 8a477f597d28d172789f06886806bc55
|
||||||
|
# This file is a cache directory tag created by ccache.
|
||||||
|
# For information about cache directory tags, see:
|
||||||
|
# http://www.brynosaurus.com/cachedir/
|
82
test/.ccache/f/stats
Normal file
82
test/.ccache/f/stats
Normal file
@ -0,0 +1,82 @@
|
|||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
1
|
||||||
|
236
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
1
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
236
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
||||||
|
0
|
0
test/.ccache/tmp/.cleaned
Normal file
0
test/.ccache/tmp/.cleaned
Normal file
BIN
test/.ccache/tmp/inode-cache-64.v2
Normal file
BIN
test/.ccache/tmp/inode-cache-64.v2
Normal file
Binary file not shown.
103
test/CMakeLists.txt
Normal file
103
test/CMakeLists.txt
Normal file
@ -0,0 +1,103 @@
|
|||||||
|
cmake_minimum_required(VERSION 3.10)
|
||||||
|
set(PROJECT_EXE_NAME ipdemo)
|
||||||
|
project(${PROJECT_EXE_NAME} VERSION 1.0.0 LANGUAGES CXX)
|
||||||
|
|
||||||
|
# Force static linking globally
|
||||||
|
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static")
|
||||||
|
set(CMAKE_FIND_LIBRARY_SUFFIXES ".a")
|
||||||
|
set(BUILD_SHARED_LIBS OFF CACHE BOOL "Build shared libraries" FORCE)
|
||||||
|
set(CMAKE_POSITION_INDEPENDENT_CODE OFF)
|
||||||
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -static")
|
||||||
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static")
|
||||||
|
set(ZLIB_USE_STATIC_LIBS "ON")
|
||||||
|
|
||||||
|
set(CMAKE_CXX_STANDARD 23)
|
||||||
|
set(CMAKE_C_STANDARD 23)
|
||||||
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||||
|
|
||||||
|
# Set default build type to Release if not specified
|
||||||
|
if(NOT CMAKE_BUILD_TYPE)
|
||||||
|
set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Choose the type of build (Debug or Release)" FORCE)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# Configure build-specific compiler flags
|
||||||
|
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -g")
|
||||||
|
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3 -DNDEBUG")
|
||||||
|
|
||||||
|
# Configure version information
|
||||||
|
string(TIMESTAMP CURRENT_YEAR "%Y")
|
||||||
|
string(TIMESTAMP CURRENT_MONTH "%m")
|
||||||
|
string(TIMESTAMP CURRENT_DAY "%d")
|
||||||
|
string(TIMESTAMP CURRENT_HOUR "%H")
|
||||||
|
string(TIMESTAMP CURRENT_MINUTE "%M")
|
||||||
|
set(PROJECT_VERSION "${CURRENT_YEAR}.${CURRENT_MONTH}${CURRENT_DAY}.${CURRENT_HOUR}${CURRENT_MINUTE}")
|
||||||
|
string(TIMESTAMP RELEASE_DATE "%Y-%m-%d")
|
||||||
|
|
||||||
|
# Configure version.hpp file
|
||||||
|
configure_file(
|
||||||
|
"${CMAKE_CURRENT_SOURCE_DIR}/src/version.hpp.in"
|
||||||
|
"${CMAKE_CURRENT_BINARY_DIR}/src/autogen/version.hpp"
|
||||||
|
@ONLY
|
||||||
|
)
|
||||||
|
|
||||||
|
# Set CMAKE_MODULE_PATH to include our custom find modules
|
||||||
|
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
|
||||||
|
|
||||||
|
# Auto-detect source files
|
||||||
|
file(GLOB_RECURSE SOURCES "src/*.cpp")
|
||||||
|
file(GLOB_RECURSE HEADERS "src/*.hpp")
|
||||||
|
|
||||||
|
# Add custom target to run cmake_prebuild.sh at the start of the build process
|
||||||
|
add_custom_target(run_prebuild_script ALL
|
||||||
|
COMMAND ${CMAKE_COMMAND} -E echo "Running cmake_prebuild.sh..."
|
||||||
|
COMMAND ${CMAKE_COMMAND} -E env bash ${CMAKE_CURRENT_SOURCE_DIR}/cmake_prebuild.sh
|
||||||
|
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
||||||
|
)
|
||||||
|
|
||||||
|
# Add executable
|
||||||
|
add_executable(${PROJECT_EXE_NAME} ${SOURCES})
|
||||||
|
add_dependencies(${PROJECT_EXE_NAME} run_prebuild_script)
|
||||||
|
|
||||||
|
# Set include directories
|
||||||
|
# build dir goes first so that we can use the generated version.hpp
|
||||||
|
target_include_directories(${PROJECT_EXE_NAME} PRIVATE
|
||||||
|
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/src/autogen>
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/src
|
||||||
|
)
|
||||||
|
|
||||||
|
# Configure libassert
|
||||||
|
include(FetchContent)
|
||||||
|
FetchContent_Declare(
|
||||||
|
libassert
|
||||||
|
GIT_REPOSITORY https://github.com/jeremy-rifkin/libassert.git
|
||||||
|
GIT_TAG v2.1.5
|
||||||
|
)
|
||||||
|
FetchContent_MakeAvailable(libassert)
|
||||||
|
|
||||||
|
# Add cpptrace
|
||||||
|
FetchContent_Declare(
|
||||||
|
cpptrace
|
||||||
|
GIT_REPOSITORY https://github.com/jeremy-rifkin/cpptrace.git
|
||||||
|
GIT_TAG v0.8.3
|
||||||
|
)
|
||||||
|
FetchContent_MakeAvailable(cpptrace)
|
||||||
|
|
||||||
|
# Add nlohmann/json
|
||||||
|
FetchContent_Declare(
|
||||||
|
nlohmann_json
|
||||||
|
GIT_REPOSITORY https://github.com/nlohmann/json.git
|
||||||
|
GIT_TAG v3.11.3
|
||||||
|
)
|
||||||
|
FetchContent_MakeAvailable(nlohmann_json)
|
||||||
|
|
||||||
|
# Link libraries
|
||||||
|
target_link_libraries(${PROJECT_EXE_NAME} PRIVATE
|
||||||
|
libassert::assert
|
||||||
|
cpptrace::cpptrace
|
||||||
|
nlohmann_json::nlohmann_json
|
||||||
|
)
|
||||||
|
|
||||||
|
# Set static linking flags
|
||||||
|
set_target_properties(${PROJECT_EXE_NAME} PROPERTIES
|
||||||
|
LINK_FLAGS "-static"
|
||||||
|
)
|
3
test/cmake_prebuild.sh
Executable file
3
test/cmake_prebuild.sh
Executable file
@ -0,0 +1,3 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
echo "cmake_prebuild.sh complete."
|
21
test/src/autogen/version.hpp
Normal file
21
test/src/autogen/version.hpp
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
/*
|
||||||
|
|
||||||
|
version.hpp is automatically generated by the build system, from version.hpp.in.
|
||||||
|
|
||||||
|
DO NOT EDIT VERSION.HPP!
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <string>
|
||||||
|
|
||||||
|
namespace dropshell {
|
||||||
|
|
||||||
|
// Version information
|
||||||
|
const std::string VERSION = "@PROJECT_VERSION@";
|
||||||
|
const std::string RELEASE_DATE = "@RELEASE_DATE@";
|
||||||
|
const std::string AUTHOR = "j842";
|
||||||
|
const std::string LICENSE = "MIT";
|
||||||
|
|
||||||
|
} // namespace dropshell
|
10509
test/src/httplib.hpp
Normal file
10509
test/src/httplib.hpp
Normal file
File diff suppressed because it is too large
Load Diff
26
test/src/main.cpp
Normal file
26
test/src/main.cpp
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
#include <iostream>
|
||||||
|
|
||||||
|
#include <nlohmann/json.hpp>
|
||||||
|
#include <libassert/assert.hpp>
|
||||||
|
|
||||||
|
#include "httplib.hpp"
|
||||||
|
#include "version.hpp"
|
||||||
|
|
||||||
|
int main() {
|
||||||
|
std::cout << "Retrieving IP address..." << std::endl;
|
||||||
|
|
||||||
|
httplib::Client cli("http://ipinfo.io");
|
||||||
|
auto res = cli.Get("/ip");
|
||||||
|
|
||||||
|
ASSERT(res->status == 200, "Failed to get IP");
|
||||||
|
|
||||||
|
nlohmann::json j;
|
||||||
|
j["ip"] = res->body;
|
||||||
|
j["status"] = res->status;
|
||||||
|
|
||||||
|
std::cout << j.dump(4) << std::endl;
|
||||||
|
|
||||||
|
std::cout << "Done" << std::endl;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
21
test/src/version.hpp.in
Normal file
21
test/src/version.hpp.in
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
/*
|
||||||
|
|
||||||
|
version.hpp is automatically generated by the build system, from version.hpp.in.
|
||||||
|
|
||||||
|
DO NOT EDIT VERSION.HPP!
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <string>
|
||||||
|
|
||||||
|
namespace dropshell {
|
||||||
|
|
||||||
|
// Version information
|
||||||
|
const std::string VERSION = "@PROJECT_VERSION@";
|
||||||
|
const std::string RELEASE_DATE = "@RELEASE_DATE@";
|
||||||
|
const std::string AUTHOR = "j842";
|
||||||
|
const std::string LICENSE = "MIT";
|
||||||
|
|
||||||
|
} // namespace dropshell
|
Loading…
x
Reference in New Issue
Block a user